|
@@ -2,6 +2,7 @@ package com.steerinfo.dil.service.impl;
|
|
|
|
|
|
import com.steerinfo.dil.feign.BmsTruckFeign;
|
|
|
import com.steerinfo.dil.feign.OmsFeign;
|
|
|
+import com.steerinfo.dil.feign.TmstruckFeign;
|
|
|
import com.steerinfo.dil.mapper.TmstrainWeightResultMapper;
|
|
|
import com.steerinfo.dil.mapper.TmstruckReceiptResultMapper;
|
|
|
import com.steerinfo.dil.mapper.UtilsMapper;
|
|
@@ -51,6 +52,9 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
@Autowired
|
|
|
OmsFeign omsFeign;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ TmstruckFeign tmstruckFeign;
|
|
|
+
|
|
|
@Autowired
|
|
|
TmstruckReceiptResultMapper tmstruckReceiptResultMapper;
|
|
|
|
|
@@ -59,7 +63,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
|
|
|
|
|
|
//属于采购订单的订单类型(先计毛后计皮)
|
|
|
- final private List<Integer> judgeOrderTypeList = Arrays.asList(5, 6, 7, 8, 9, 12, 14,15, 17, 18);
|
|
|
+ final private List<Integer> judgeOrderTypeList = Arrays.asList(5, 6, 7, 8, 9, 12, 15, 17, 18);
|
|
|
|
|
|
//老厂区需要给金蝶回传的数据订单类型
|
|
|
// final private List<Integer> judgeToKDTypeList = Arrays.asList(6, 17);
|
|
@@ -128,7 +132,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
if(oneMap == null){
|
|
|
return map.get("orderNumber") + "系统无此订单";
|
|
|
}
|
|
|
- Integer orderType= DataChange.dataToBigDecimal(oneMap.get("orderType")).intValue();
|
|
|
+ int orderType= DataChange.dataToBigDecimal(oneMap.get("orderType")).intValue();
|
|
|
if(orderType == 11){
|
|
|
return insertWeightResultBy11(map, oneMap);
|
|
|
}
|
|
@@ -162,6 +166,10 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
}
|
|
|
}
|
|
|
tmstruckWeightResultMapper.updateByPrimaryKeySelective(tmstruckWeightResult);
|
|
|
+ //如果订单类型是零星订单 需要查询一下是否还有未计量物资
|
|
|
+ if(orderType == 12 || orderType == 13){
|
|
|
+ dealWithLxOrder(map, stringObjectMap);
|
|
|
+ }
|
|
|
//推送数据
|
|
|
utilsService.pushMesToWebsocket((String) stringObjectMap.get("capacityNumber"), "计量");
|
|
|
return map.get("orderNumber") + "成功";
|
|
@@ -177,7 +185,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
public TmstruckWeightResult generateWeightResult(Map<String, Object> map) throws Exception {
|
|
|
TmstruckWeightResult tmstruckWeightResult = new TmstruckWeightResult();
|
|
|
tmstruckWeightResult.setId(DataChange.dataToBigDecimal(map.get("weightTaskResultId")));
|
|
|
- Integer orderType = DataChange.dataToBigDecimal(map.get("orderTypee")).intValue();
|
|
|
+ int orderType = DataChange.dataToBigDecimal(map.get("orderTypee")).intValue();
|
|
|
//磅单号
|
|
|
tmstruckWeightResult.setResultPoundNo((String) map.get("resultPoundNo"));
|
|
|
String resultCrossWeightTime = (String) map.get("resultCrossWeightTime");
|
|
@@ -204,7 +212,7 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else if(orderType == 10 || orderType == 20){
|
|
|
+ else if(orderType == 10 || orderType == 20 || orderType == 14){
|
|
|
//查询还有几条没有净重的实绩
|
|
|
Integer resultNum = tmstruckWeightResultMapper.selectNoNetWeightResult((String) map.get("orderNumber"));
|
|
|
if(resultNum == 2){
|
|
@@ -448,6 +456,38 @@ public class TmstruckWeightResultServiceImpl implements ITmstruckWeightResultSer
|
|
|
return map.get("orderNumber") + "成功";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 处理零星订单多拼方法
|
|
|
+ * @Author TXF
|
|
|
+ * @Date 2022/3/15 18:37
|
|
|
+ * @param map
|
|
|
+ * @param stringObjectMap
|
|
|
+ * @return
|
|
|
+ **/
|
|
|
+ public void dealWithLxOrder(Map<String, Object> map, Map<String, Object> stringObjectMap){
|
|
|
+ if(map.get("resultNetWeight") != null){
|
|
|
+ String resultNetWeight = String.valueOf(map.get("resultNetWeight"));
|
|
|
+ if(! ("".equals(resultNetWeight) || "null".equals(resultNetWeight))){
|
|
|
+ //查询是否还有物资如果为空则为已经计量完成
|
|
|
+ Integer materialId = utilsMapper.getNextMaterialId(DataChange.dataToBigDecimal(stringObjectMap.get("orderId")));
|
|
|
+ if(materialId != null){
|
|
|
+ stringObjectMap.put("materialId", materialId);
|
|
|
+ stringObjectMap.put("asd", 1);
|
|
|
+ Map<String, Object> returnMap = null;
|
|
|
+ try {
|
|
|
+ returnMap = tmstruckFeign.sendMeasureCommission(stringObjectMap);
|
|
|
+ String code = (String) returnMap.get("code");
|
|
|
+ if(!"200".equals(code)){
|
|
|
+ System.out.println(returnMap.get("data"));
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ System.out.println(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 添加火车计量实绩
|
|
|
* @param map
|