|
|
@@ -264,28 +264,29 @@ public class ResumptionServiceImpl implements ResumptionService {
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
- List<ResumptionNFCVo> orgNFCs = resumptionMapper.selectNFCOfOrg(resumption.getId(), resumption.getOrgId());
|
|
|
+ List<ResumptionNFCVo> orgAllNFCs = resumptionMapper.selectNFCOfOrg(resumption.getId(), resumption.getOrgId());
|
|
|
+ final Set<Long> usedNFCID = new HashSet<>();
|
|
|
if (!isExist) {
|
|
|
//未保存过时,根据NFC-点位-区域的关系,将绑定到点位的履职内容拆解到各个区域。
|
|
|
List<ResumptionPlanVo> supplementItems = new ArrayList<>();
|
|
|
|
|
|
for (ResumptionPlanVo resumptionPlanVo : resumptionPlanVos) {
|
|
|
-
|
|
|
if (ObjectUtil.isNotNull(resumptionPlanVo.getCheckId()) && ObjectUtil.isNull(resumptionPlanVo.getAreaId())) {
|
|
|
|
|
|
- /*Map<Long, List<ResumptionNFCVo>> areaGroup = orgNFCs.stream()
|
|
|
+ /*Map<Long, List<ResumptionNFCVo>> areaGroup = orgAllNFCs.stream()
|
|
|
.filter(n -> ObjectUtil.equal(n.getCheckId(), resumptionPlanVo.getCheckId()))
|
|
|
.collect(Collectors.groupingBy(n -> n.getAreaId()));
|
|
|
*/
|
|
|
- Map<Long,List<ResumptionNFCVo>> areaGroup = new HashMap<>();
|
|
|
+ Map<Long, List<ResumptionNFCVo>> areaGroup = new HashMap<>();
|
|
|
List<ResumptionNFCVo> vos = new ArrayList<>();
|
|
|
- for (ResumptionNFCVo nfcVo : orgNFCs) {
|
|
|
- if(nfcVo.getCheckId().equals(resumptionPlanVo.getCheckId())){
|
|
|
+ for (ResumptionNFCVo nfcVo : orgAllNFCs) {
|
|
|
+ if (nfcVo.getCheckId().equals(resumptionPlanVo.getCheckId())) {
|
|
|
nfcVo.setPointScan(resumptionPlanVo.getPointScan());
|
|
|
vos.add(nfcVo);
|
|
|
+ usedNFCID.add(nfcVo.getNfcId());
|
|
|
}
|
|
|
}
|
|
|
- areaGroup= vos.stream().collect(Collectors.groupingBy(n -> n.getAreaId()));
|
|
|
+ areaGroup = vos.stream().collect(Collectors.groupingBy(n -> n.getAreaId()));
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(areaGroup)) {
|
|
|
@@ -303,9 +304,10 @@ public class ResumptionServiceImpl implements ResumptionService {
|
|
|
});
|
|
|
}
|
|
|
} else {
|
|
|
- for (ResumptionNFCVo nfcVo : orgNFCs) {
|
|
|
- if(nfcVo.getAreaId().equals(resumptionPlanVo.getAreaId())){
|
|
|
+ for (ResumptionNFCVo nfcVo : orgAllNFCs) {
|
|
|
+ if (nfcVo.getAreaId().equals(resumptionPlanVo.getAreaId())) {
|
|
|
nfcVo.setPointScan(resumptionPlanVo.getPointScan());
|
|
|
+ usedNFCID.add(nfcVo.getNfcId());
|
|
|
}
|
|
|
}
|
|
|
//如果是绑定到区域的,直接使用
|
|
|
@@ -314,14 +316,14 @@ public class ResumptionServiceImpl implements ResumptionService {
|
|
|
}
|
|
|
|
|
|
resumptionPlanVos = supplementItems;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//反馈给前端,只需要保存后的数据
|
|
|
- if(resumption.getStatus() == 3){
|
|
|
+ if (resumption.getStatus() == 3) {
|
|
|
//如果已经提交
|
|
|
- orgNFCs = orgNFCs.stream().filter(n -> n.getStatus() == 1).collect(Collectors.toList());
|
|
|
+ usedNFCID.addAll(orgAllNFCs.stream().filter(n -> n.getStatus() == 1).map(n -> n.getNfcId()).collect(Collectors.toSet()));
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
+ orgAllNFCs = orgAllNFCs.stream().filter(n -> usedNFCID.contains(n.getNfcId())).collect(Collectors.toList());
|
|
|
|
|
|
Integer yesPointNum = 0;
|
|
|
Integer noPointNum = 0;
|
|
|
@@ -349,7 +351,7 @@ public class ResumptionServiceImpl implements ResumptionService {
|
|
|
if (ObjectUtil.isNull(areaVo)) {
|
|
|
areaVo = new AreaResumptionVo();
|
|
|
areaVo.setAreaId(vo.getAreaId());
|
|
|
- areaVo.setAreaName(ObjectUtil.isNull(vo.getAreaName())?"其它":vo.getAreaName());
|
|
|
+ areaVo.setAreaName(ObjectUtil.isNull(vo.getAreaName()) ? "其它" : vo.getAreaName());
|
|
|
map.put(areaVo.getAreaId(), areaVo);
|
|
|
}
|
|
|
|
|
|
@@ -383,7 +385,7 @@ public class ResumptionServiceImpl implements ResumptionService {
|
|
|
if (itCom == null) {
|
|
|
itCom = new HashMap<>();
|
|
|
itCom.put("total", 1);
|
|
|
- if (pointVo.getDataStatus() == 1 ) {
|
|
|
+ if (pointVo.getDataStatus() == 1) {
|
|
|
itCom.put("yes", 0);
|
|
|
} else {
|
|
|
itCom.put("yes", 1);
|
|
|
@@ -424,7 +426,7 @@ public class ResumptionServiceImpl implements ResumptionService {
|
|
|
AreaResumptionVo vo = entry.getValue();
|
|
|
Long areaId = entry.getKey();
|
|
|
//获取每个区域下的nfc
|
|
|
- List<ResumptionNFCVo> resumptionNFCVos = orgNFCs.stream().filter(n -> ObjectUtil.equal(n.getAreaId(), areaId)).collect(Collectors.toList());
|
|
|
+ List<ResumptionNFCVo> resumptionNFCVos = orgAllNFCs.stream().filter(n -> ObjectUtil.equal(n.getAreaId(), areaId)).collect(Collectors.toList());
|
|
|
/*resumptionMapper.selectResumptionNFC(resumption.getId(), areaId, resumption.getOrgId());*/
|
|
|
|
|
|
for (ResumptionNFCVo resumptionNFCVo : resumptionNFCVos) {
|