|
@@ -2,6 +2,7 @@ package com.steerinfo.dil.controller;
|
|
|
|
|
|
import com.steerinfo.dil.feign.ESFeign;
|
|
|
import com.steerinfo.dil.mapper.CommonSeq;
|
|
|
+import com.steerinfo.dil.mapper.WmspInboundScanResultMapper;
|
|
|
import com.steerinfo.dil.model.WmspOutboundResult;
|
|
|
import com.steerinfo.dil.model.WmspOutboundScanResult;
|
|
|
import com.steerinfo.dil.service.IWmspOutboundResultService;
|
|
@@ -21,10 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
|
* WmspOutboundResult RESTful接口:
|
|
@@ -46,6 +44,8 @@ public class WmspOutboundResultController extends BaseRESTfulController {
|
|
|
@Autowired
|
|
|
WmspOutboundResultServiceImpl wmspOutboundResultService;
|
|
|
@Autowired
|
|
|
+ WmspInboundScanResultMapper wmspInboundScanResultMapper;
|
|
|
+ @Autowired
|
|
|
CommonSeq commonSeq;
|
|
|
@Autowired
|
|
|
ESFeign esFeign;
|
|
@@ -150,87 +150,89 @@ public class WmspOutboundResultController extends BaseRESTfulController {
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
map.put("orderId",orderId);
|
|
|
map.put("materialId",materialId);
|
|
|
- int orderNum = wmspOutboundResultService.ExistWmspOutboundResult(map);
|
|
|
|
|
|
Map<String, Object> outBoundDetailedInfo=null;
|
|
|
- if(orderNum == 0){
|
|
|
-
|
|
|
- WmspOutboundResult wmspOutboundResult = new WmspOutboundResult();
|
|
|
-
|
|
|
- int seq_wmspoutboundresult = commonSeq.getSeqNumber("seq__WMSP_OUTBOUND_RESULT");
|
|
|
-
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
-
|
|
|
- String resultNumber = "XSCK" + sdf.format(new Date());
|
|
|
- if(seq_wmspoutboundresult < 10){
|
|
|
- resultNumber += "0000000" + seq_wmspoutboundresult;
|
|
|
- }else if(seq_wmspoutboundresult < 100){
|
|
|
- resultNumber += "000000" + seq_wmspoutboundresult;
|
|
|
- }else if(seq_wmspoutboundresult < 1000){
|
|
|
- resultNumber += "00000" + seq_wmspoutboundresult;
|
|
|
- }else if(seq_wmspoutboundresult < 10000){
|
|
|
- resultNumber += "0000" + seq_wmspoutboundresult;
|
|
|
- }else if(seq_wmspoutboundresult < 100000){
|
|
|
- resultNumber += "000" + seq_wmspoutboundresult;
|
|
|
- }else if(seq_wmspoutboundresult < 1000000){
|
|
|
- resultNumber += "00" + seq_wmspoutboundresult;
|
|
|
- }else if(seq_wmspoutboundresult < 10000000){
|
|
|
- resultNumber += "0" + seq_wmspoutboundresult;
|
|
|
- }else{
|
|
|
- resultNumber += seq_wmspoutboundresult;
|
|
|
- }
|
|
|
-
|
|
|
- BigDecimal orderType = (BigDecimal) order.get("orderType");
|
|
|
-
|
|
|
- * orderType : 1 为普通出库
|
|
|
- * orderType : 4 为调拨出库
|
|
|
- * */
|
|
|
- String resultOutboundType = "普通出库";
|
|
|
- if(orderType.intValue() == 4){
|
|
|
- resultOutboundType = "调拨出库";
|
|
|
- }
|
|
|
-
|
|
|
- wmspOutboundResult.setResultId(new BigDecimal(seq_wmspoutboundresult));
|
|
|
-
|
|
|
- wmspOutboundResult.setResultNumber(resultNumber);
|
|
|
-
|
|
|
- wmspOutboundResult.setBillLadingId(orderId);
|
|
|
-
|
|
|
- wmspOutboundResult.setResultOutboundType(resultOutboundType);
|
|
|
-
|
|
|
- wmspOutboundResult.setResultStatus(new BigDecimal(0));
|
|
|
-
|
|
|
- wmspOutboundResult.setInsertUsername("admin");
|
|
|
- wmspOutboundResult.setInsertTime(new Date());
|
|
|
- wmspOutboundResult.setUpdateUsername("admin");
|
|
|
- wmspOutboundResult.setUpdateTime(new Date());
|
|
|
- wmspOutboundResult.setInsertUpdateRemark("无");
|
|
|
- wmspOutboundResult.setDeleted(new BigDecimal(0));
|
|
|
-
|
|
|
- wmspOutboundResult.setMaterialId(materialId);
|
|
|
- Integer res = wmspOutboundResultService.insertSelective(wmspOutboundResult);
|
|
|
- if(res == 1){
|
|
|
+ if ("".equals(wmspOutboundResultService.ExistWmspOutboundResult(map))){
|
|
|
+ int orderNum = wmspOutboundResultService.ExistWmspOutboundResult(map);
|
|
|
+ if(orderNum == 0){
|
|
|
+
|
|
|
+ WmspOutboundResult wmspOutboundResult = new WmspOutboundResult();
|
|
|
+
|
|
|
+ int seq_wmspoutboundresult = commonSeq.getSeqNumber("seq__WMSP_OUTBOUND_RESULT");
|
|
|
+
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
+
|
|
|
+ String resultNumber = "XSCK" + sdf.format(new Date());
|
|
|
+ if(seq_wmspoutboundresult < 10){
|
|
|
+ resultNumber += "0000000" + seq_wmspoutboundresult;
|
|
|
+ }else if(seq_wmspoutboundresult < 100){
|
|
|
+ resultNumber += "000000" + seq_wmspoutboundresult;
|
|
|
+ }else if(seq_wmspoutboundresult < 1000){
|
|
|
+ resultNumber += "00000" + seq_wmspoutboundresult;
|
|
|
+ }else if(seq_wmspoutboundresult < 10000){
|
|
|
+ resultNumber += "0000" + seq_wmspoutboundresult;
|
|
|
+ }else if(seq_wmspoutboundresult < 100000){
|
|
|
+ resultNumber += "000" + seq_wmspoutboundresult;
|
|
|
+ }else if(seq_wmspoutboundresult < 1000000){
|
|
|
+ resultNumber += "00" + seq_wmspoutboundresult;
|
|
|
+ }else if(seq_wmspoutboundresult < 10000000){
|
|
|
+ resultNumber += "0" + seq_wmspoutboundresult;
|
|
|
+ }else{
|
|
|
+ resultNumber += seq_wmspoutboundresult;
|
|
|
+ }
|
|
|
+
|
|
|
+ BigDecimal orderType = (BigDecimal) order.get("orderType");
|
|
|
+
|
|
|
+ * orderType : 1 为普通出库
|
|
|
+ * orderType : 4 为调拨出库
|
|
|
+ * */
|
|
|
+ String resultOutboundType = "普通出库";
|
|
|
+ if(orderType.intValue() == 4){
|
|
|
+ resultOutboundType = "调拨出库";
|
|
|
+ }
|
|
|
+
|
|
|
+ wmspOutboundResult.setResultId(new BigDecimal(seq_wmspoutboundresult));
|
|
|
+
|
|
|
+ wmspOutboundResult.setResultNumber(resultNumber);
|
|
|
+
|
|
|
+ wmspOutboundResult.setBillLadingId(orderId);
|
|
|
+
|
|
|
+ wmspOutboundResult.setResultOutboundType(resultOutboundType);
|
|
|
+
|
|
|
+ wmspOutboundResult.setResultStatus(new BigDecimal(0));
|
|
|
+
|
|
|
+ wmspOutboundResult.setInsertUsername("admin");
|
|
|
+ wmspOutboundResult.setInsertTime(new Date());
|
|
|
+ wmspOutboundResult.setUpdateUsername("admin");
|
|
|
+ wmspOutboundResult.setUpdateTime(new Date());
|
|
|
+ wmspOutboundResult.setInsertUpdateRemark("无");
|
|
|
+ wmspOutboundResult.setDeleted(new BigDecimal(0));
|
|
|
+
|
|
|
+ wmspOutboundResult.setMaterialId(materialId);
|
|
|
+ Integer res = wmspOutboundResultService.insertSelective(wmspOutboundResult);
|
|
|
+ if(res == 1){
|
|
|
|
|
|
+
|
|
|
+ outBoundDetailedInfo = wmspOutboundResultService.getOutBoundDetailedInfo(orderId);
|
|
|
+ outBoundDetailedInfo.put("orderNumber",orderNumber);
|
|
|
+
|
|
|
+ outBoundDetailedInfo.put("materialCode",materialCode);
|
|
|
+ outBoundDetailedInfo.put("materialName",materialName);
|
|
|
+ outBoundDetailedInfo.put("materialSpecification",materialSpecification);
|
|
|
+ outBoundDetailedInfo.put("materialModel",materialModel);
|
|
|
+ outBoundDetailedInfo.put("materialTheoreticalWeight",materialTheoreticalWeight);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
|
|
|
outBoundDetailedInfo = wmspOutboundResultService.getOutBoundDetailedInfo(orderId);
|
|
|
outBoundDetailedInfo.put("orderNumber",orderNumber);
|
|
|
-
|
|
|
+
|
|
|
outBoundDetailedInfo.put("materialCode",materialCode);
|
|
|
outBoundDetailedInfo.put("materialName",materialName);
|
|
|
outBoundDetailedInfo.put("materialSpecification",materialSpecification);
|
|
|
outBoundDetailedInfo.put("materialModel",materialModel);
|
|
|
outBoundDetailedInfo.put("materialTheoreticalWeight",materialTheoreticalWeight);
|
|
|
}
|
|
|
- }else{
|
|
|
-
|
|
|
- outBoundDetailedInfo = wmspOutboundResultService.getOutBoundDetailedInfo(orderId);
|
|
|
- outBoundDetailedInfo.put("orderNumber",orderNumber);
|
|
|
-
|
|
|
- outBoundDetailedInfo.put("materialCode",materialCode);
|
|
|
- outBoundDetailedInfo.put("materialName",materialName);
|
|
|
- outBoundDetailedInfo.put("materialSpecification",materialSpecification);
|
|
|
- outBoundDetailedInfo.put("materialModel",materialModel);
|
|
|
- outBoundDetailedInfo.put("materialTheoreticalWeight",materialTheoreticalWeight);
|
|
|
}
|
|
|
return outBoundDetailedInfo;
|
|
|
}
|
|
@@ -286,11 +288,6 @@ public class WmspOutboundResultController extends BaseRESTfulController {
|
|
|
|
|
|
BigDecimal personnelId = wmspOutboundResultService.getPersonnelIdByJobnumber(personnelJobNumber);
|
|
|
|
|
|
- int EqualMaterialsNumber = wmspOutboundResultService.EqualMaterialsNumber(resultId);
|
|
|
- if(EqualMaterialsNumber==1){
|
|
|
-
|
|
|
- return failed("装货数量已够");
|
|
|
- }else {
|
|
|
|
|
|
|
|
|
String[] split = resultMaterial.split("-");
|
|
@@ -308,6 +305,11 @@ public class WmspOutboundResultController extends BaseRESTfulController {
|
|
|
int seq_wmspOutboundScanResult = commonSeq.getSeqNumber("seq__WMSP_OUTBOUND_SCAN_RESULT");
|
|
|
|
|
|
wmspOutboundScanResult.setResultId(new BigDecimal(seq_wmspOutboundScanResult));
|
|
|
+
|
|
|
+ List<Map<String, Object>> list= wmspInboundScanResultMapper.getInboundResultIdByMaterial(subResultMaterial);
|
|
|
+
|
|
|
+ Map<String ,Object> map1 = list.get(0);
|
|
|
+ wmspOutboundScanResult.setInboundResultId((BigDecimal) map1.get("inboundResultId"));
|
|
|
|
|
|
wmspOutboundScanResult.setOutboundResultId(resultId);
|
|
|
|
|
@@ -325,8 +327,15 @@ public class WmspOutboundResultController extends BaseRESTfulController {
|
|
|
wmspOutboundScanResult.setUpdateTime(new Date());
|
|
|
wmspOutboundScanResult.setInsertUpdateRemark("无");
|
|
|
if(SteelMaterialId.intValue()==OutboundMaterialId.intValue()){
|
|
|
-
|
|
|
- wmspOutboundScanResult.setResultCheck(new BigDecimal(0));
|
|
|
+ int EqualMaterialsNumber = wmspOutboundResultService.EqualMaterialsNumber(resultId);
|
|
|
+ if(EqualMaterialsNumber==1){
|
|
|
+
|
|
|
+ wmspOutboundScanResult.setResultCheck(new BigDecimal(1));
|
|
|
+ }else {
|
|
|
+
|
|
|
+ wmspOutboundScanResult.setResultCheck(new BigDecimal(0));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
wmspOutboundResultService.scanResultInsert(wmspOutboundScanResult);
|
|
|
}else {
|
|
@@ -346,7 +355,9 @@ public class WmspOutboundResultController extends BaseRESTfulController {
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> scanAuditSuccessInfo = wmspOutboundResultService.scanAuditSuccessInfo(resultId);
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
for (Map<String, Object> stringObjectMap : scanAuditSuccessInfo) {
|
|
|
String resultMaterial1 = (String) stringObjectMap.get("resultMaterial");
|
|
|
|
|
@@ -381,7 +392,7 @@ public class WmspOutboundResultController extends BaseRESTfulController {
|
|
|
stringObjectMap.putAll(theSameOutboundInfo);
|
|
|
}
|
|
|
return success(scanAuditSuccessInfo);
|
|
|
- }
|
|
|
+
|
|
|
}else{
|
|
|
|
|
|
|