|
@@ -5,13 +5,21 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import net.lab1024.sa.admin.common.PostRequestUtil;
|
|
import net.lab1024.sa.admin.common.PostRequestUtil;
|
|
|
|
+import net.lab1024.sa.admin.module.gm.audit.domain.from.AddAuditFrom;
|
|
import net.lab1024.sa.admin.module.gm.common.dao.CommonDao;
|
|
import net.lab1024.sa.admin.module.gm.common.dao.CommonDao;
|
|
|
|
+import net.lab1024.sa.admin.module.gm.common.domain.Vo.AppearanceVo;
|
|
import net.lab1024.sa.admin.module.gm.common.domain.Vo.FileVo;
|
|
import net.lab1024.sa.admin.module.gm.common.domain.Vo.FileVo;
|
|
import net.lab1024.sa.admin.module.gm.common.domain.Vo.PartsSapVo;
|
|
import net.lab1024.sa.admin.module.gm.common.domain.Vo.PartsSapVo;
|
|
import net.lab1024.sa.admin.module.gm.common.domain.Vo.PastureVo;
|
|
import net.lab1024.sa.admin.module.gm.common.domain.Vo.PastureVo;
|
|
import net.lab1024.sa.admin.module.gm.eq.dao.EquipmentDao;
|
|
import net.lab1024.sa.admin.module.gm.eq.dao.EquipmentDao;
|
|
|
|
+import net.lab1024.sa.admin.module.gm.eq.domain.EquipmentInfo;
|
|
import net.lab1024.sa.admin.module.gm.eq.domain.EquipmentTplnrInfo;
|
|
import net.lab1024.sa.admin.module.gm.eq.domain.EquipmentTplnrInfo;
|
|
import net.lab1024.sa.admin.module.gm.eq.domain.from.EquipmentTplnrFrom;
|
|
import net.lab1024.sa.admin.module.gm.eq.domain.from.EquipmentTplnrFrom;
|
|
|
|
+import net.lab1024.sa.admin.module.gm.eq.service.EquipmentService;
|
|
|
|
+import net.lab1024.sa.admin.module.gm.inspection.domain.from.BigInspectionFrom;
|
|
|
|
+import net.lab1024.sa.admin.module.gm.inspection.domain.from.InspectionFrom;
|
|
|
|
+import net.lab1024.sa.admin.module.gm.inspection.domain.vo.BigInspectionVo;
|
|
|
|
+import net.lab1024.sa.admin.module.gm.inspection.service.InspectionService;
|
|
import net.lab1024.sa.admin.module.gm.maintain.domain.vo.MaintainDetailsVo;
|
|
import net.lab1024.sa.admin.module.gm.maintain.domain.vo.MaintainDetailsVo;
|
|
import net.lab1024.sa.admin.module.gm.maintain.domain.vo.MaintainQueryVo;
|
|
import net.lab1024.sa.admin.module.gm.maintain.domain.vo.MaintainQueryVo;
|
|
import net.lab1024.sa.admin.module.gm.maintain.domain.vo.OutsourceVo;
|
|
import net.lab1024.sa.admin.module.gm.maintain.domain.vo.OutsourceVo;
|
|
@@ -24,6 +32,7 @@ import net.lab1024.sa.admin.module.gm.repair.dao.RepairDao;
|
|
import net.lab1024.sa.admin.module.gm.repair.domain.vo.RepirVo;
|
|
import net.lab1024.sa.admin.module.gm.repair.domain.vo.RepirVo;
|
|
import net.lab1024.sa.admin.module.gm.repair.service.RepairService;
|
|
import net.lab1024.sa.admin.module.gm.repair.service.RepairService;
|
|
import net.lab1024.sa.common.common.domain.EquipmentAddResponse;
|
|
import net.lab1024.sa.common.common.domain.EquipmentAddResponse;
|
|
|
|
+import net.lab1024.sa.common.common.domain.ResponseDTO;
|
|
import net.lab1024.sa.common.common.util.SmartPageUtil;
|
|
import net.lab1024.sa.common.common.util.SmartPageUtil;
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -48,15 +57,24 @@ public class CommonService {
|
|
private PartapplyService partapplyService;
|
|
private PartapplyService partapplyService;
|
|
@Autowired
|
|
@Autowired
|
|
private MalfunctionService malfunctionService;
|
|
private MalfunctionService malfunctionService;
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private InspectionService inspectionService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private AppearanceService appearanceService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private EquipmentService equipmentService;
|
|
|
|
|
|
public String autoCreatCode(String pastureId, String codeType) {
|
|
public String autoCreatCode(String pastureId, String codeType) {
|
|
String code = commonDao.autoCreatCode(pastureId, codeType);
|
|
String code = commonDao.autoCreatCode(pastureId, codeType);
|
|
return code;
|
|
return code;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public String getPastureEquipmentZG(String pastureId) {
|
|
|
|
+ String code = commonDao.getPastureEquipmentZG(pastureId);
|
|
|
|
+ return code;
|
|
|
|
+ }
|
|
|
|
|
|
- public EquipmentAddResponse addSapBXPush(String QMNUM,String loginName) throws Exception {
|
|
|
|
|
|
+ public EquipmentAddResponse addSapBXPush(String QMNUM, String loginName) throws Exception {
|
|
|
|
|
|
try {
|
|
try {
|
|
Map<String, Object> getReq = new HashMap();
|
|
Map<String, Object> getReq = new HashMap();
|
|
@@ -69,7 +87,7 @@ public class CommonService {
|
|
getReq.put("Header", header);
|
|
getReq.put("Header", header);
|
|
JSONObject json = new JSONObject(getReq);
|
|
JSONObject json = new JSONObject(getReq);
|
|
System.out.println(json.toString());
|
|
System.out.println(json.toString());
|
|
- String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/FNS", "application/json", json.toString());
|
|
|
|
|
|
+ String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/FNS", "application/json", json.toString());
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
|
|
Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
|
|
List<RepirVo> parseArray = JSON.parseArray(JSON.toJSONString(map.get("Item")), RepirVo.class);
|
|
List<RepirVo> parseArray = JSON.parseArray(JSON.toJSONString(map.get("Item")), RepirVo.class);
|
|
@@ -117,7 +135,7 @@ public class CommonService {
|
|
|
|
|
|
JSONObject jsonWx = new JSONObject(req);
|
|
JSONObject jsonWx = new JSONObject(req);
|
|
System.out.println(jsonWx.toString());
|
|
System.out.println(jsonWx.toString());
|
|
- String responseWxStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDERCHG", "application/json", jsonWx.toString());
|
|
|
|
|
|
+ String responseWxStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDERCHG", "application/json", jsonWx.toString());
|
|
String AUFNR = "";
|
|
String AUFNR = "";
|
|
ObjectMapper objectWxMapper = new ObjectMapper();
|
|
ObjectMapper objectWxMapper = new ObjectMapper();
|
|
Map<String, Object> mapWx = objectWxMapper.readValue(responseWxStr, Map.class);
|
|
Map<String, Object> mapWx = objectWxMapper.readValue(responseWxStr, Map.class);
|
|
@@ -146,7 +164,7 @@ public class CommonService {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
- public EquipmentAddResponse editSapBXPush(String wxCode, String outSource, int isoutSource, String priceUnit, String status) throws Exception {
|
|
|
|
|
|
+ public EquipmentAddResponse editSapBXPush(String wxCode, String outSource, int isoutSource, String priceUnit, String status, String loginName) throws Exception {
|
|
try {
|
|
try {
|
|
Map<String, Object> req = new HashMap<>();
|
|
Map<String, Object> req = new HashMap<>();
|
|
Map<String, Object> sapReq = new HashMap<>();
|
|
Map<String, Object> sapReq = new HashMap<>();
|
|
@@ -167,12 +185,13 @@ public class CommonService {
|
|
sapReq.put("PRIOK", maintain.getPRIOK());
|
|
sapReq.put("PRIOK", maintain.getPRIOK());
|
|
sapReq.put("ILART", "003");
|
|
sapReq.put("ILART", "003");
|
|
sapReq.put("QMNUM", maintain.getSapCode());
|
|
sapReq.put("QMNUM", maintain.getSapCode());
|
|
-
|
|
|
|
|
|
+ sapReq.put("BNAME", loginName);
|
|
// if (!status.equals("P10")) {
|
|
// if (!status.equals("P10")) {
|
|
sapReq.put("ZZOR_INF_STA", status);
|
|
sapReq.put("ZZOR_INF_STA", status);
|
|
|
|
+ String eqLoginName= commonDao.getPastureEquipmentZG(maintain.getPastureId());
|
|
// }
|
|
// }
|
|
if (status.equals("P20")) {
|
|
if (status.equals("P20")) {
|
|
- List<MalfunctionDatabaseVo> malfunctionList = malfunctionService.getMalfunction(wxCode);
|
|
|
|
|
|
+ List<MalfunctionDatabaseVo> malfunctionList = malfunctionService.getMalfunction(wxCode);
|
|
for (MalfunctionDatabaseVo malfunctionDatabaseVo : malfunctionList) {
|
|
for (MalfunctionDatabaseVo malfunctionDatabaseVo : malfunctionList) {
|
|
System.out.println(malfunctionDatabaseVo);
|
|
System.out.println(malfunctionDatabaseVo);
|
|
sapReq.put("URGRP", malfunctionDatabaseVo.getReasonCodegruppe());
|
|
sapReq.put("URGRP", malfunctionDatabaseVo.getReasonCodegruppe());
|
|
@@ -202,7 +221,7 @@ public class CommonService {
|
|
getReq.put("Header", header);
|
|
getReq.put("Header", header);
|
|
JSONObject json = new JSONObject(getReq);
|
|
JSONObject json = new JSONObject(getReq);
|
|
|
|
|
|
- String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
|
|
|
|
|
|
+ String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
|
|
Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
|
|
List<MaintainQueryVo> parseArray = JSON.parseArray(JSON.toJSONString(map.get("Item")), MaintainQueryVo.class);
|
|
List<MaintainQueryVo> parseArray = JSON.parseArray(JSON.toJSONString(map.get("Item")), MaintainQueryVo.class);
|
|
@@ -280,6 +299,7 @@ public class CommonService {
|
|
sapReq1.put("STEUS", "PM01");
|
|
sapReq1.put("STEUS", "PM01");
|
|
} else {
|
|
} else {
|
|
sapReq1.put("STEUS", "PM02");
|
|
sapReq1.put("STEUS", "PM02");
|
|
|
|
+ sapReq.put("BNAME", eqLoginName);
|
|
}
|
|
}
|
|
// sapReq1.put("APLZL", 10);
|
|
// sapReq1.put("APLZL", 10);
|
|
itemList1.add(sapReq1);
|
|
itemList1.add(sapReq1);
|
|
@@ -289,26 +309,41 @@ public class CommonService {
|
|
query.setPageNum(1);
|
|
query.setPageNum(1);
|
|
query.setPageSize(10000);
|
|
query.setPageSize(10000);
|
|
Page pageParam = SmartPageUtil.convert2PageQuery(query);
|
|
Page pageParam = SmartPageUtil.convert2PageQuery(query);
|
|
- List<PartapplyVo> partapplyList = partapplyService.getPartapplyList(pageParam, "", wxCode, "1");
|
|
|
|
|
|
+ List<PartapplyVo> partapplyList = partapplyService.getPartapplyList(pageParam, "", wxCode, "");
|
|
List<Map<String, Object>> itemList2 = new ArrayList<>();
|
|
List<Map<String, Object>> itemList2 = new ArrayList<>();
|
|
|
|
|
|
|
|
+ List<Integer> partapplyId = new ArrayList<>();
|
|
if (!partapplyList.equals(null)) {
|
|
if (!partapplyList.equals(null)) {
|
|
|
|
+ int i = 0;
|
|
for (PartapplyVo partapplyVo : partapplyList) {
|
|
for (PartapplyVo partapplyVo : partapplyList) {
|
|
|
|
+ i++;
|
|
|
|
+ if (partapplyVo.getStatus() == 0) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if (partapplyVo.getSapStatus() == 1) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
Map<String, Object> sapReq2 = new HashMap<>();
|
|
Map<String, Object> sapReq2 = new HashMap<>();
|
|
// sapReq.put("ILART", "004");
|
|
// sapReq.put("ILART", "004");
|
|
sapReq2.put("AUFNR", maintain.getAUFNR());
|
|
sapReq2.put("AUFNR", maintain.getAUFNR());
|
|
sapReq2.put("LGORT", partapplyVo.getLgort());
|
|
sapReq2.put("LGORT", partapplyVo.getLgort());
|
|
- if (Item2 != null) {
|
|
|
|
- for (net.lab1024.sa.admin.module.gm.maintain.domain.vo.PartapplyVo vo : Item2) {
|
|
|
|
- if (partapplyVo.getSort() * 10 == Integer.parseInt(vo.getPOSNR())) {
|
|
|
|
- sapReq2.put("AUFPL", vo.getAUFPL());
|
|
|
|
- sapReq2.put("VORNR", vo.getVORNR());
|
|
|
|
- sapReq2.put("RSNUM", vo.getRSNUM());
|
|
|
|
- sapReq2.put("POSNR", vo.getPOSNR());
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// boolean exist = false;
|
|
|
|
+// if (Item2 != null) {
|
|
|
|
+// for (net.lab1024.sa.admin.module.gm.maintain.domain.vo.PartapplyVo vo : Item2) {
|
|
|
|
+// if (vo.getPOSNR().equals("00" + (i * 10))) {
|
|
|
|
+// sapReq2.put("AUFPL", vo.getAUFPL());
|
|
|
|
+// sapReq2.put("VORNR", vo.getVORNR());
|
|
|
|
+// sapReq2.put("RSNUM", vo.getRSNUM());
|
|
|
|
+// sapReq2.put("POSNR", vo.getPOSNR());
|
|
|
|
+// exist = true;
|
|
|
|
+// break;
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// if (exist) {
|
|
|
|
+// continue;
|
|
|
|
+// }
|
|
|
|
+
|
|
sapReq2.put("LTXA1", "维修工单");
|
|
sapReq2.put("LTXA1", "维修工单");
|
|
sapReq2.put("MATNR", partapplyVo.getPartCode());
|
|
sapReq2.put("MATNR", partapplyVo.getPartCode());
|
|
sapReq2.put("MAKTX", partapplyVo.getPartName());
|
|
sapReq2.put("MAKTX", partapplyVo.getPartName());
|
|
@@ -321,7 +356,9 @@ public class CommonService {
|
|
sapReq2.put("BDTER", bdter);
|
|
sapReq2.put("BDTER", bdter);
|
|
sapReq2.put("MEINS", partapplyVo.getUnit());
|
|
sapReq2.put("MEINS", partapplyVo.getUnit());
|
|
sapReq2.put("APLZL", partapplyVo.getSort());
|
|
sapReq2.put("APLZL", partapplyVo.getSort());
|
|
-// sapReq2.put("POSNR", partapplyVo.getSort() * 10);
|
|
|
|
|
|
+ sapReq2.put("POSNR", "00" + (i * 10));
|
|
|
|
+ partapplyId.add(partapplyVo.getId());
|
|
|
|
+ sapReq.put("BNAME", eqLoginName);
|
|
itemList2.add(sapReq2);
|
|
itemList2.add(sapReq2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -331,7 +368,7 @@ public class CommonService {
|
|
req.put("Item", sapReq);
|
|
req.put("Item", sapReq);
|
|
JSONObject jsonWx = new JSONObject(req);
|
|
JSONObject jsonWx = new JSONObject(req);
|
|
System.out.println(jsonWx.toString());
|
|
System.out.println(jsonWx.toString());
|
|
- String responseWxStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDERCHG", "application/json", jsonWx.toString());
|
|
|
|
|
|
+ String responseWxStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDERCHG", "application/json", jsonWx.toString());
|
|
System.out.println(responseWxStr);
|
|
System.out.println(responseWxStr);
|
|
ObjectMapper objectWxMapper = new ObjectMapper();
|
|
ObjectMapper objectWxMapper = new ObjectMapper();
|
|
Map<String, Object> mapWx = objectWxMapper.readValue(responseWxStr, Map.class);
|
|
Map<String, Object> mapWx = objectWxMapper.readValue(responseWxStr, Map.class);
|
|
@@ -342,6 +379,10 @@ public class CommonService {
|
|
res.setCode("500");
|
|
res.setCode("500");
|
|
res.setMsg(stringObjectMap.get("SYNRESULT").toString());
|
|
res.setMsg(stringObjectMap.get("SYNRESULT").toString());
|
|
return res;
|
|
return res;
|
|
|
|
+ }else {
|
|
|
|
+ for (Integer id : partapplyId) {
|
|
|
|
+ partapplyService.EditPartapplySapStauts(id);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -375,8 +416,8 @@ public class CommonService {
|
|
return commonDao.getPasture(companycode);
|
|
return commonDao.getPasture(companycode);
|
|
}
|
|
}
|
|
|
|
|
|
- public List<PastureVo> getPastureList() {
|
|
|
|
- return commonDao.getPastureList();
|
|
|
|
|
|
+ public List<PastureVo> getPastureList(String pastureName) {
|
|
|
|
+ return commonDao.getPastureList(pastureName);
|
|
}
|
|
}
|
|
|
|
|
|
public PastureVo getPastureById(int id) {
|
|
public PastureVo getPastureById(int id) {
|
|
@@ -397,7 +438,7 @@ public class CommonService {
|
|
req.put("Header", header);
|
|
req.put("Header", header);
|
|
JSONObject json = new JSONObject(req);
|
|
JSONObject json = new JSONObject(req);
|
|
System.out.println(json.toString());
|
|
System.out.println(json.toString());
|
|
- String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
|
|
|
|
|
|
+ String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
|
|
|
|
|
|
System.out.println(responseStr);
|
|
System.out.println(responseStr);
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
@@ -442,27 +483,44 @@ public class CommonService {
|
|
query.setPageNum(1);
|
|
query.setPageNum(1);
|
|
query.setPageSize(10000);
|
|
query.setPageSize(10000);
|
|
Page pageParam = SmartPageUtil.convert2PageQuery(query);
|
|
Page pageParam = SmartPageUtil.convert2PageQuery(query);
|
|
- List<PartapplyVo> partapplyList = partapplyService.getPartapplyList(pageParam, "", byCode, "1");
|
|
|
|
|
|
+ List<PartapplyVo> partapplyList = partapplyService.getPartapplyList(pageParam, "", byCode, "");
|
|
List<Map<String, Object>> itemList2 = new ArrayList<>();
|
|
List<Map<String, Object>> itemList2 = new ArrayList<>();
|
|
|
|
|
|
- if (partapplyList != null) {
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ List<Integer> partapplyId = new ArrayList<>();
|
|
|
|
+ String eqLoginName = "";
|
|
|
|
+ if (!partapplyList.equals(null)) {
|
|
|
|
+ int i = 0;
|
|
for (PartapplyVo partapplyVo : partapplyList) {
|
|
for (PartapplyVo partapplyVo : partapplyList) {
|
|
|
|
+ i++;
|
|
|
|
+ if (i == 0){
|
|
|
|
+ eqLoginName = commonDao.getPastureEquipmentZG(partapplyVo.getPastureId());
|
|
|
|
+ }
|
|
|
|
+ if (partapplyVo.getStatus() == 0) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if (partapplyVo.getSapStatus() == 1) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
Map<String, Object> sapReq2 = new HashMap<>();
|
|
Map<String, Object> sapReq2 = new HashMap<>();
|
|
// sapReq.put("ILART", "004");
|
|
// sapReq.put("ILART", "004");
|
|
sapReq2.put("AUFNR", maintain.getAUFNR());
|
|
sapReq2.put("AUFNR", maintain.getAUFNR());
|
|
- if (maintain.getItem2() != null) {
|
|
|
|
- for (net.lab1024.sa.admin.module.gm.maintain.domain.vo.PartapplyVo vo : maintain.getItem2()) {
|
|
|
|
- if (partapplyVo.getSort() * 10 == Integer.parseInt(vo.getPOSNR())) {
|
|
|
|
- sapReq2.put("AUFPL", vo.getAUFPL());
|
|
|
|
- sapReq2.put("VORNR", vo.getVORNR());
|
|
|
|
- sapReq2.put("RSNUM", vo.getRSNUM());
|
|
|
|
- sapReq2.put("POSNR", vo.getPOSNR());
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// System.out.println(sapReq2);
|
|
|
|
+// boolean exist = false;
|
|
|
|
+// if (maintain.getItem2() != null) {
|
|
|
|
+// for (net.lab1024.sa.admin.module.gm.maintain.domain.vo.PartapplyVo vo : maintain.getItem2()) {
|
|
|
|
+// if (vo.getPOSNR().equals("00" + (i * 10))) {
|
|
|
|
+// sapReq2.put("AUFPL", vo.getAUFPL());
|
|
|
|
+// sapReq2.put("VORNR", vo.getVORNR());
|
|
|
|
+// sapReq2.put("RSNUM", vo.getRSNUM());
|
|
|
|
+// sapReq2.put("POSNR", vo.getPOSNR());
|
|
|
|
+// exist = true;
|
|
|
|
+// break;
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// if (exist) {
|
|
|
|
+// continue;
|
|
|
|
+// }
|
|
|
|
|
|
sapReq2.put("LTXA1", "保养工单");
|
|
sapReq2.put("LTXA1", "保养工单");
|
|
sapReq2.put("MATNR", partapplyVo.getPartCode());
|
|
sapReq2.put("MATNR", partapplyVo.getPartCode());
|
|
@@ -477,8 +535,12 @@ public class CommonService {
|
|
sapReq2.put("BDTER", bdter);
|
|
sapReq2.put("BDTER", bdter);
|
|
sapReq2.put("MEINS", partapplyVo.getUnit());
|
|
sapReq2.put("MEINS", partapplyVo.getUnit());
|
|
sapReq2.put("APLZL", partapplyVo.getSort());
|
|
sapReq2.put("APLZL", partapplyVo.getSort());
|
|
- sapReq2.put("POSNR", partapplyVo.getSort() * 10);
|
|
|
|
|
|
+ sapReq2.put("POSNR", "00" + (i * 10));
|
|
|
|
+ System.out.println(sapReq2);
|
|
|
|
+ partapplyId.add(partapplyVo.getId());
|
|
|
|
+ sapReq.put("BNAME", eqLoginName);
|
|
itemList2.add(sapReq2);
|
|
itemList2.add(sapReq2);
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -502,7 +564,7 @@ public class CommonService {
|
|
JSONObject jsonWx = new JSONObject(req);
|
|
JSONObject jsonWx = new JSONObject(req);
|
|
System.out.println(jsonWx.toString());
|
|
System.out.println(jsonWx.toString());
|
|
|
|
|
|
- String responseWxStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDERCHG", "application/json", jsonWx.toString());
|
|
|
|
|
|
+ String responseWxStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDERCHG", "application/json", jsonWx.toString());
|
|
System.out.println(responseWxStr);
|
|
System.out.println(responseWxStr);
|
|
ObjectMapper objectWxMapper = new ObjectMapper();
|
|
ObjectMapper objectWxMapper = new ObjectMapper();
|
|
Map<String, Object> mapWx = objectWxMapper.readValue(responseWxStr, Map.class);
|
|
Map<String, Object> mapWx = objectWxMapper.readValue(responseWxStr, Map.class);
|
|
@@ -513,6 +575,10 @@ public class CommonService {
|
|
res.setCode("500");
|
|
res.setCode("500");
|
|
res.setMsg(stringObjectMap.get("SYNRESULT").toString());
|
|
res.setMsg(stringObjectMap.get("SYNRESULT").toString());
|
|
return res;
|
|
return res;
|
|
|
|
+ }else{
|
|
|
|
+ for (Integer id : partapplyId) {
|
|
|
|
+ partapplyService.EditPartapplySapStauts(id);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -528,14 +594,15 @@ public class CommonService {
|
|
}
|
|
}
|
|
|
|
|
|
public void SyncParts() throws Exception {
|
|
public void SyncParts() throws Exception {
|
|
- List<PastureVo> pastureList = commonDao.getPastureList();
|
|
|
|
|
|
+
|
|
|
|
+ List<PastureVo> pastureList = commonDao.getPastureList("");
|
|
for (PastureVo pastureVo : pastureList) {
|
|
for (PastureVo pastureVo : pastureList) {
|
|
System.out.println(pastureVo);
|
|
System.out.println(pastureVo);
|
|
Map<String, Object> req = new HashMap();
|
|
Map<String, Object> req = new HashMap();
|
|
req.put("WERKS", pastureVo.getCompanycode());
|
|
req.put("WERKS", pastureVo.getCompanycode());
|
|
JSONObject json = new JSONObject(req);
|
|
JSONObject json = new JSONObject(req);
|
|
|
|
|
|
- String responseStr = PostRequestUtil.SendPost("http://10.249.124.21:50000/RESTAdapter/BC_ZK/MATERIALMASTER", "application/json", json.toString());
|
|
|
|
|
|
+ String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_ZK/MATERIALMASTER", "application/json", json.toString());
|
|
|
|
|
|
try {
|
|
try {
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
@@ -552,6 +619,132 @@ public class CommonService {
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public ResponseDTO SyncBigInspection(int pastureId) throws Exception {
|
|
|
|
+ PastureVo pasture = getPastureById(pastureId);
|
|
|
|
+
|
|
|
|
+ Map<String, Object> req = new HashMap();
|
|
|
|
+ Map itemReq = new HashMap();
|
|
|
|
+ itemReq.put("IWERK", pasture.getCompanycode());
|
|
|
|
+ itemReq.put("AUART", "ZP02");
|
|
|
|
+
|
|
|
|
+ req.put("Item", itemReq);
|
|
|
|
+ Map header = new HashMap();
|
|
|
|
+ header.put("SRC_SYSTEM", "APP");
|
|
|
|
+ header.put("DEST_SYSTEM", "SAP");
|
|
|
|
+ req.put("Header", header);
|
|
|
|
+ JSONObject json = new JSONObject(req);
|
|
|
|
+ System.out.println(json.toString());
|
|
|
|
+ String responseStr = PostRequestUtil.SendPost("http://10.249.123.21:50000/RESTAdapter/BC_PMAPP/REPAIRORDER", "application/json", json.toString());
|
|
|
|
+
|
|
|
|
+ System.out.println(responseStr);
|
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
|
+ Map<String, Object> map = objectMapper.readValue(responseStr, Map.class);
|
|
|
|
+ List<MaintainQueryVo> parseArray = JSON.parseArray(JSON.toJSONString(map.get("Item")), MaintainQueryVo.class);
|
|
|
|
+ if (parseArray != null) {
|
|
|
|
+ List<String> sapCodeList = new ArrayList<>();
|
|
|
|
+ for (MaintainQueryVo maintainQueryVo : parseArray) {
|
|
|
|
+ sapCodeList.add(maintainQueryVo.getAUFNR());
|
|
|
|
+ }
|
|
|
|
+ String sapCode = String.join(",", sapCodeList);
|
|
|
|
+ List<BigInspectionVo> bigInspectionList = inspectionService.getBigInspectionBySapCode(sapCode);
|
|
|
|
+ for (MaintainQueryVo maintainQueryVo : parseArray) {
|
|
|
|
+ boolean exist = false;
|
|
|
|
+ for (BigInspectionVo bigInspectionVo : bigInspectionList) {
|
|
|
|
+ if (maintainQueryVo.getAUFNR().equals(bigInspectionVo.getSapCode())) {
|
|
|
|
+ exist = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!exist) {
|
|
|
|
+ System.out.println(maintainQueryVo.getAUFNR());
|
|
|
|
+ BigInspectionFrom bigInspectionIn = new BigInspectionFrom();
|
|
|
|
+ AddAuditFrom addAuditFrom = new AddAuditFrom();
|
|
|
|
+ bigInspectionIn.setPastureId(pastureId);
|
|
|
|
+ System.out.println(maintainQueryVo.getEQUNR());
|
|
|
|
+ EquipmentInfo eqInfo = equipmentService.getEquipmenDetailsByEqCode(maintainQueryVo.getEQUNR());
|
|
|
|
+
|
|
|
|
+ if (eqInfo == null) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+// if (planType == 0) {
|
|
|
|
+// String xjCode = autoCreatCode(String.valueOf(pasture.getId()), "WH");
|
|
|
|
+// bigInspectionIn.setInspectionCode(xjCode);
|
|
|
|
+ bigInspectionIn.setPlanType(1);
|
|
|
|
+// addAuditFrom.setCode(xjCode);
|
|
|
|
+ addAuditFrom.setAuditType(3);
|
|
|
|
+ if (eqInfo.getOneupkeep() == null) {
|
|
|
|
+ eqInfo.setOneupkeep("");
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if (eqInfo.getTwoupkeep() == null) {
|
|
|
|
+ eqInfo.setTwoupkeep("");
|
|
|
|
+ }
|
|
|
|
+ if (eqInfo.getOneupkeep().equals("") || eqInfo.getTwoupkeep().equals("")) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ bigInspectionIn.setUpkeepPerson(eqInfo.getOneupkeep().toString() + "," + eqInfo.getTwoupkeep().toString());
|
|
|
|
+
|
|
|
|
+ bigInspectionIn.setEqCode(maintainQueryVo.getEQUNR());
|
|
|
|
+ bigInspectionIn.setPlantime(maintainQueryVo.getERDAT());
|
|
|
|
+ bigInspectionIn.setSapCode(maintainQueryVo.getAUFNR());
|
|
|
|
+ bigInspectionIn.setRemark(maintainQueryVo.getKTEXT());
|
|
|
|
+
|
|
|
|
+ addAuditFrom.setSapCode(maintainQueryVo.getAUFNR());
|
|
|
|
+ addAuditFrom.setPastureId(pastureId);
|
|
|
|
+
|
|
|
|
+ if (eqInfo.getOneduty() == null) {
|
|
|
|
+ eqInfo.setOneduty("");
|
|
|
|
+ }
|
|
|
|
+ if (eqInfo.getTwoduty() == null) {
|
|
|
|
+ eqInfo.setTwoduty("");
|
|
|
|
+ }
|
|
|
|
+ bigInspectionIn.setOnePerson(eqInfo.getOneduty().toString());
|
|
|
|
+ bigInspectionIn.setOnePerson(eqInfo.getTwoduty().toString());
|
|
|
|
+
|
|
|
|
+ addAuditFrom.setProcessed(1);
|
|
|
|
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ Date date = new Date(System.currentTimeMillis());
|
|
|
|
+ addAuditFrom.setDate(formatter.format(date));
|
|
|
|
+
|
|
|
|
+ List<AppearanceVo> appearanceList = appearanceService.getAppearanceAllList(maintainQueryVo.getPLNNR(), maintainQueryVo.getPLNAL());
|
|
|
|
+ List<InspectionFrom> inspectionFromList = new ArrayList<>();
|
|
|
|
+ if (maintainQueryVo.getItem1() != null) {
|
|
|
|
+ for (OutsourceVo taskDetails : maintainQueryVo.getItem1()) {
|
|
|
|
+// for (AppearanceVo appearanceVo : appearanceList) {
|
|
|
|
+ String sapCode1 = maintainQueryVo.getPLNNR() + maintainQueryVo.getPLNAL() + taskDetails.getVORNR();
|
|
|
|
+ if (sapCode1.equals(maintainQueryVo.getPLNNR() + maintainQueryVo.getPLNAL() + taskDetails.getVORNR())) {
|
|
|
|
+ InspectionFrom inspectionFrom = new InspectionFrom();
|
|
|
|
+ inspectionFrom.setInspectionCode(bigInspectionIn.getInspectionCode());
|
|
|
|
+ inspectionFrom.setPLNNR(maintainQueryVo.getPLNNR());
|
|
|
|
+ inspectionFrom.setPLNAL(maintainQueryVo.getPLNAL());
|
|
|
|
+ inspectionFrom.setVORNR(taskDetails.getVORNR());
|
|
|
|
+ inspectionFrom.setContent(maintainQueryVo.getKTEXT());
|
|
|
|
+ inspectionFromList.add(inspectionFrom);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ addAuditFrom.setEqCode(bigInspectionIn.getEqCode());
|
|
|
|
+ String xjCode = autoCreatCode(String.valueOf(pasture.getId()), "WH");
|
|
|
|
+ bigInspectionIn.setInspectionCode(xjCode);
|
|
|
|
+ bigInspectionIn.setPlanType(1);
|
|
|
|
+ addAuditFrom.setCode(xjCode);
|
|
|
|
+ inspectionService.addBigInspection(bigInspectionIn, addAuditFrom, inspectionFromList);
|
|
|
|
+ EquipmentAddResponse res1 = editSapBYPush(bigInspectionIn.getInspectionCode(), addAuditFrom.getSapCode(), "P10");
|
|
|
|
+ if (res1 != null) {
|
|
|
|
+ ResponseDTO res = ResponseDTO.ok();
|
|
|
|
+ res = ResponseDTO.ok(false);
|
|
|
|
+ res.setCode(500);
|
|
|
|
+ res.setMsg(res1.getMsg());
|
|
|
|
+ return res;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|