|
@@ -200,6 +200,8 @@ public class TmstruckLoadResultServiceImpl implements ITmstruckLoadResultService
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public int addXS2LoadResult(Map<String, Object> map) throws Exception {
|
|
|
TmstruckLoadResult tmstruckLoadResult = new TmstruckLoadResult();
|
|
|
+ BigDecimal orderId=null;
|
|
|
+ int i=0;
|
|
|
//通过运输订单号查询订单类型
|
|
|
String orderNumber = (String) map.get("orderNumber");
|
|
|
//通过订单号查询订单类型 及总实绩Id
|
|
@@ -207,24 +209,31 @@ public class TmstruckLoadResultServiceImpl implements ITmstruckLoadResultService
|
|
|
String capacityNumber = (String) mesMap.get("capacityNumber");
|
|
|
int orderType = DataChange.dataToBigDecimal(mesMap.get("orderType")).intValue();
|
|
|
BigDecimal resultTotalId = DataChange.dataToBigDecimal(mesMap.get("totalId"));
|
|
|
+ orderId = DataChange.dataToBigDecimal(mesMap.get("orderId"));
|
|
|
//装货时查询是否含有净重
|
|
|
Integer netWeight = tmstruckUnloadResultMapper.getNetWeightByTotalId(resultTotalId);
|
|
|
if(orderType == 11 || orderType == 15 || orderType == 16){
|
|
|
- int sqe = DataChange.dataToBigDecimal(mesMap.get("Sqe")).intValue();
|
|
|
- sqe = sqe + 1;
|
|
|
- map.put("resultId",tmstruckLoadResultMapper.selectMaxId());
|
|
|
- map.put("Sqe",sqe);//查询路段顺序号+1
|
|
|
- map.put("resultTotalId", resultTotalId);
|
|
|
- int i =tmstruckLoadResultMapper.insertSelective(generateLoad(map));
|
|
|
- //更新路段顺序号
|
|
|
- mesMap.put("orderLineSequence",sqe);
|
|
|
- utilsService.updateOrderLineSqeByOrderNumber(mesMap);
|
|
|
- //推送消息到websocket
|
|
|
- utilsService.pushMesToWebsocket(capacityNumber, "装货");
|
|
|
- BigDecimal orderId = DataChange.dataToBigDecimal(mesMap.get("orderId"));
|
|
|
+ //判断是否有装货实绩
|
|
|
+ BigDecimal resultId = tmstruckLoadResultMapper.getResultId(resultTotalId);
|
|
|
+ if (resultId==null) {
|
|
|
+ int sqe = DataChange.dataToBigDecimal(mesMap.get("Sqe")).intValue();
|
|
|
+ sqe = sqe + 1;
|
|
|
+ map.put("resultId", tmstruckLoadResultMapper.selectMaxId());
|
|
|
+ map.put("Sqe", sqe);//查询路段顺序号+1
|
|
|
+ map.put("resultTotalId", resultTotalId);
|
|
|
+ i = tmstruckLoadResultMapper.insertSelective(generateLoad(map));
|
|
|
+ //更新路段顺序号
|
|
|
+ mesMap.put("orderLineSequence", sqe);
|
|
|
+ utilsService.updateOrderLineSqeByOrderNumber(mesMap);
|
|
|
+ //推送消息到websocket
|
|
|
+ utilsService.pushMesToWebsocket(capacityNumber, "装货");
|
|
|
+ }else {
|
|
|
+ //已装货的实绩
|
|
|
+ map.put("resultId",resultId);
|
|
|
+ }
|
|
|
int i1 = addCapacityRemark(map);
|
|
|
- if(i1 == -5){
|
|
|
- return -5;
|
|
|
+ if (i1==-5){
|
|
|
+ return -5;
|
|
|
}
|
|
|
//根据运输订单查找需求备注
|
|
|
Map<String,Object> remarkMap=tmstruckTimeTaskResultMapper.selectInwardDueTimeByOrderId(orderId);
|
|
@@ -278,7 +287,6 @@ public class TmstruckLoadResultServiceImpl implements ITmstruckLoadResultService
|
|
|
if(personnelId != null){
|
|
|
tmstruckLoadResult.setLoaderId(new BigDecimal(personnelId));
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
// 更新装货点
|
|
|
tmstruckLoadResult.setLoadingId(DataChange.dataToBigDecimal(map.get("warehouseId")));
|
|
@@ -303,7 +311,6 @@ public class TmstruckLoadResultServiceImpl implements ITmstruckLoadResultService
|
|
|
//推送消息到websocket
|
|
|
utilsService.pushMesToWebsocket(capacityNumber, "装货");
|
|
|
//map.put("orderTypee",orderType);
|
|
|
-
|
|
|
if (map.get("warehouseId")==null){
|
|
|
map.put("warehouseName",null);
|
|
|
}else {
|
|
@@ -311,7 +318,7 @@ public class TmstruckLoadResultServiceImpl implements ITmstruckLoadResultService
|
|
|
String warehouseName = utilsMapper.queryWarehouseName(DataChange.dataToBigDecimal(map.get("warehouseId")));
|
|
|
map.put("warehouseName",warehouseName);
|
|
|
}
|
|
|
- int i = tmstruckMeasureCommissionService.addMeasureCommissionForLoding(map);
|
|
|
+// int i = tmstruckMeasureCommissionService.addMeasureCommissionForLoding(map);
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
@@ -457,10 +464,10 @@ public class TmstruckLoadResultServiceImpl implements ITmstruckLoadResultService
|
|
|
public int addCapacityRemark(Map<String, Object> map) {
|
|
|
int i=0;
|
|
|
TmstruckLoadResult tmstruckLoadResult=new TmstruckLoadResult();
|
|
|
- String capacityName = utilsMapper.getCapacityNameBySsoId((String) map.get("personnelSsoId") );
|
|
|
+ String capacityName = utilsMapper.getCapacityNameBySsoId((String) map.get("personnelSsoId"));
|
|
|
if (capacityName!=null) {
|
|
|
- //通过车牌去寻找装货实绩,减少多次装货
|
|
|
- map.put("capacityName", capacityName);
|
|
|
+ map.put("capacityName",capacityName);
|
|
|
+ //判断装机是否重复扫码
|
|
|
BigDecimal loadResultId = utilsMapper.getLoadResultId(map);
|
|
|
if (loadResultId == null) {
|
|
|
tmstruckLoadResult.setResultId(DataChange.dataToBigDecimal(map.get("resultId")));
|