Commit 28c4a254 authored by 姬鋆屾's avatar 姬鋆屾
parents 063f625a 90b70ac8
......@@ -155,11 +155,11 @@ public class CheckWindowPerformEntity extends CheckWindowPerformVo {
this.sumScore = BigDecimal.ZERO;
this.submitDate = new Date();
this.manageCheckPerson = "";
this.manageCheckTime = new Date();
this.manageCheckTime = null;
this.manageCheckDesc = "";
this.manageCheckResult = "";
this.leaderCheckPerson = "";
this.leaderCheckTime = new Date();
this.leaderCheckTime = null;
this.leaderCheckDesc = "";
this.leaderCheckResult = "";
this.checkStatus = 1;
......
package com.mortals.xhx.module.window.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.RespData;
......@@ -15,10 +16,7 @@ import com.mortals.xhx.module.window.model.WindowOwnerDetailEntity;
import com.mortals.xhx.module.window.service.WindowOwnerDetailService;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -38,21 +36,18 @@ public class WindowOwnerDetailServiceImpl extends AbstractCRUDServiceImpl<Window
@Override
public List<WindowPdu> subWindowPduList(WindowPdu pdu) {
List<WindowPdu> subList = new ArrayList<>();
List<WindowOwnerDetailEntity> ownerDetail = this.getAllList();
if(!CollectionUtils.isEmpty(ownerDetail)){
Long[] windows = ownerDetail.stream().map(WindowOwnerDetailEntity::getWindowId).toArray(Long[]::new);
pdu.setIdNotList(Arrays.asList(windows));
if(pdu.getSiteId()==null){
pdu.setSiteId(1l); //默认只查宜宾市民中心
}
pdu.setSize(-1);
Rest<RespData<List<WindowPdu>>> respDataRest = windowFeign.list(pdu);
log.info(JSONObject.toJSONString(respDataRest));
if (respDataRest.getCode() == YesNoEnum.YES.getValue()) {
List<WindowOwnerDetailEntity> ownerDetail = this.getAllList();
if(!CollectionUtils.isEmpty(ownerDetail)){
Map<Long,List<WindowOwnerDetailEntity>> windowMap = ownerDetail.stream().collect(Collectors.groupingBy(WindowOwnerDetailEntity::getWindowId));
List<WindowPdu> allWindow = respDataRest.getData().getData();
for(WindowPdu item:allWindow){
if(!windowMap.containsKey(item.getId())){
subList.add(item);
}
}
subList = respDataRest.getData().getData();
}
}
return subList;
......
package com.mortals.xhx.module.window.service.impl;
import com.mortals.xhx.common.code.FillStatusEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import com.mortals.xhx.module.check.model.CheckWindowPerformQuery;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformQuery;
import com.mortals.xhx.module.check.service.CheckWindowPerformService;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformDetailEntity;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformDetailQuery;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformEntity;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
......@@ -7,6 +20,11 @@ import com.mortals.xhx.module.window.dao.WindowPerformDao;
import com.mortals.xhx.module.window.model.WindowPerformEntity;
import com.mortals.xhx.module.window.service.WindowPerformService;
import lombok.extern.slf4j.Slf4j;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* WindowPerformService
* 大厅窗口信息 service实现
......@@ -18,4 +36,42 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerformDao, WindowPerformEntity, Long> implements WindowPerformService {
@Autowired
private CheckWindowPerformService checkWindowPerformService;
@Override
protected void saveAfter(WindowPerformEntity entity, Context context) throws AppException {
if(entity.getFillStatus()== FillStatusEnum.提交.getValue()){
saveToCheck(entity);
}
super.saveAfter(entity, context);
}
@Override
protected void updateAfter(WindowPerformEntity entity, Context context) throws AppException {
if(entity.getFillStatus()== FillStatusEnum.提交.getValue()){
saveToCheck(entity);
}
super.updateAfter(entity, context);
}
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
List<CheckWindowPerformEntity> performEntitys = checkWindowPerformService.find(new CheckWindowPerformQuery().recordIdList(Arrays.asList(ids)));
checkWindowPerformService.removeList(performEntitys,context);
super.removeAfter(ids, context, result);
}
private void saveToCheck(WindowPerformEntity entity){
CheckWindowPerformEntity perform = new CheckWindowPerformEntity();
perform.initAttrValue();
BeanUtils.copyProperties(entity, perform, BeanUtil.getNullPropertyNames(entity));
perform.setId(null);
perform.setRecordId(entity.getId());
perform.setFromName("市政务服务大厅窗口考核登记表");
perform.setSubmitDate(entity.getFillDate());
perform.setUpdateTime(null);
perform.setUpdateUserId(null);
checkWindowPerformService.save(perform);
}
}
\ No newline at end of file
package com.mortals.xhx.module.window.service.impl;
import com.mortals.xhx.common.code.FillStatusEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import com.mortals.xhx.module.check.model.CheckWindowPerformQuery;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformQuery;
import com.mortals.xhx.module.check.service.CheckWindowPerformService;
import com.mortals.xhx.module.check.service.CheckWindowWorkmanPerformService;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformDetailEntity;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformDetailQuery;
import com.mortals.xhx.module.window.service.WindowWorkmanPerformDetailService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
......@@ -30,6 +39,8 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
@Autowired
private WindowWorkmanPerformDetailService windowWorkmanPerformDetailService;
@Autowired
private CheckWindowWorkmanPerformService checkWindowWorkmanPerformService;
@Override
......@@ -42,6 +53,9 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
});
windowWorkmanPerformDetailService.save(entity.getWorkmanPerformDetailList());
}
if(entity.getFillStatus()== FillStatusEnum.提交.getValue()){
saveToCheck(entity);
}
super.saveAfter(entity, context);
}
......@@ -59,6 +73,9 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
});
windowWorkmanPerformDetailService.save(entity.getWorkmanPerformDetailList());
}
if(entity.getFillStatus()== FillStatusEnum.提交.getValue()){
saveToCheck(entity);
}
super.updateAfter(entity, context);
}
......@@ -66,6 +83,21 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
List<WindowWorkmanPerformDetailEntity> detailEntities = windowWorkmanPerformDetailService.find(new WindowWorkmanPerformDetailQuery().performIdList(Arrays.asList(ids)));
windowWorkmanPerformDetailService.removeList(detailEntities, context);
List<CheckWindowWorkmanPerformEntity> performEntitys = checkWindowWorkmanPerformService.find(new CheckWindowWorkmanPerformQuery().recordIdList(Arrays.asList(ids)));
checkWindowWorkmanPerformService.removeList(performEntitys,context);
super.removeAfter(ids, context, result);
}
private void saveToCheck(WindowWorkmanPerformEntity entity){
CheckWindowWorkmanPerformEntity perform = new CheckWindowWorkmanPerformEntity();
perform.initAttrValue();
BeanUtils.copyProperties(entity, perform, BeanUtil.getNullPropertyNames(entity));
perform.setId(null);
perform.setRecordId(entity.getId());
perform.setFromName("市政务服务大厅窗口工作人员考核汇总表");
perform.setSubmitDate(entity.getFillDate());
perform.setUpdateTime(null);
perform.setUpdateUserId(null);
checkWindowWorkmanPerformService.save(perform);
}
}
\ No newline at end of file
......@@ -3,6 +3,8 @@ package com.mortals.xhx.common.pdu.window;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
import java.util.List;
@Data
public class WindowPdu extends BaseEntityLong {
/**
......@@ -87,4 +89,7 @@ public class WindowPdu extends BaseEntityLong {
*/
private String hallName;
/** 序号,主键,自增长排除列表 */
private List<Long> idNotList;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment