|
|
|
|
@ -3,7 +3,6 @@ package cokr.xit.fims.crdn.service.bean;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.math.BigInteger;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.Comparator;
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@ -27,6 +26,7 @@ import cokr.xit.fims.crdn.dao.CrdnTeamMapper;
|
|
|
|
|
import cokr.xit.fims.crdn.receive.eqpmnt.SingleFileParser;
|
|
|
|
|
import cokr.xit.fims.crdn.service.CrdnService;
|
|
|
|
|
import cokr.xit.fims.crdn.service.ImportService;
|
|
|
|
|
import cokr.xit.fims.eqplc.dao.EqplcMapper;
|
|
|
|
|
import cokr.xit.fims.mngt.service.bean.TaskProcessor;
|
|
|
|
|
import cokr.xit.foundation.component.AbstractServiceBean;
|
|
|
|
|
import cokr.xit.foundation.data.DataObject;
|
|
|
|
|
@ -56,6 +56,8 @@ public class ImportServiceBean extends AbstractServiceBean implements ImportServ
|
|
|
|
|
protected UserMapper userMapper;
|
|
|
|
|
@Resource(name = "crdnTeamMapper")
|
|
|
|
|
private CrdnTeamMapper crdnTeamMapper;
|
|
|
|
|
@Resource(name="eqplcMapper")
|
|
|
|
|
private EqplcMapper eqplcMapper;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int createCrdns(List<String> interfaceSequences) {
|
|
|
|
|
@ -112,7 +114,10 @@ public class ImportServiceBean extends AbstractServiceBean implements ImportServ
|
|
|
|
|
setCrdnPlc(divided);
|
|
|
|
|
|
|
|
|
|
List<DataObject> invalidPlace = divided.stream()
|
|
|
|
|
.filter(info -> "invalid".equals(info.get("status")))
|
|
|
|
|
.filter(info -> {
|
|
|
|
|
DataObject metaInfo = (DataObject)info.get("metaInfo");
|
|
|
|
|
return "invalidPlace".equals(metaInfo.get("status"));
|
|
|
|
|
})
|
|
|
|
|
.toList();
|
|
|
|
|
divided.removeAll(invalidPlace); // 잘못된 단속장소 제외
|
|
|
|
|
resp.set("invalidPlace", invalidPlace.size());
|
|
|
|
|
@ -328,27 +333,26 @@ public class ImportServiceBean extends AbstractServiceBean implements ImportServ
|
|
|
|
|
.toList();
|
|
|
|
|
if (metaInfoList.isEmpty()) return;
|
|
|
|
|
|
|
|
|
|
List<DataObject> eqpPlcList = Collections.emptyList(); // TODO: EquipmentPlace 완료되면 교체할 것
|
|
|
|
|
if (eqpPlcList.isEmpty()) return;
|
|
|
|
|
|
|
|
|
|
//키 = 장비코드-장소이름
|
|
|
|
|
Map<String, DataObject> eqpPlcMap = eqpPlcList.stream().collect(Collectors.toMap(
|
|
|
|
|
Map<String, DataObject> eqpPlcMap = eqplcMapper.selectList(null).stream().collect(Collectors.toMap(
|
|
|
|
|
info -> info.get("EQP_CD") + "-" + info.get("PLC_NM"),
|
|
|
|
|
info -> info
|
|
|
|
|
));
|
|
|
|
|
if (eqpPlcMap.isEmpty()) return;
|
|
|
|
|
|
|
|
|
|
for (DataObject metaInfo: metaInfoList) {
|
|
|
|
|
String key = metaInfo.get("EQPMNT_CD") + "-" + metaInfo.get("CRDN_PLC");
|
|
|
|
|
DataObject eqpPlc = eqpPlcMap.get(key);
|
|
|
|
|
if (eqpPlc == null) {
|
|
|
|
|
metaInfo.set("status", "invalid");
|
|
|
|
|
log().debug("invalid place name: {}", key);
|
|
|
|
|
metaInfo.set("status", "invalidPlace");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
metaInfo
|
|
|
|
|
.set("CRDN_STDG_NM", eqpPlc.get("STDG_NM"))
|
|
|
|
|
.set("CRDN_ROAD_NM", eqpPlcMap.get("ROAD_NM"))
|
|
|
|
|
.set("CRDN_PLC", eqpPlcMap.get("PLC"));
|
|
|
|
|
.set("CRDN_ROAD_NM", eqpPlc.get("ROAD_NM"))
|
|
|
|
|
.set("CRDN_PLC", eqpPlc.get("PLC"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|