|
@@ -142,7 +142,7 @@ public class TmstruckEnfactoryResultServiceImpl implements ITmstruckEnfactoryRes
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public int enFactoryResultByPDA(Map<String, Object> map){
|
|
|
+ public int enFactoryResultByPDA(Map<String, Object> map) throws Exception {
|
|
|
int i = 0;
|
|
|
//通过运输订单号查询订单类型
|
|
|
String orderNumber = (String) map.get("orderNumber");
|
|
@@ -152,16 +152,20 @@ public class TmstruckEnfactoryResultServiceImpl implements ITmstruckEnfactoryRes
|
|
|
i += updateEnFactoryResultByPDA(map); //添加进厂实绩
|
|
|
//修改路段顺序号
|
|
|
i += utilsService.updateOrderLineSequence(map);
|
|
|
+ //判断委托是否发送成功
|
|
|
+ int checkMeasureCommission = 0;
|
|
|
switch (orderType.intValue()){
|
|
|
case 1:
|
|
|
case 4:
|
|
|
//查询未装车实绩
|
|
|
List<Map<String, Object>> mapList = rulesService.judgeLastMaterial(DataChange.dataToBigDecimal(map.get("orderId")));
|
|
|
if(mapList.size() == 1){
|
|
|
- //如果是单拼 不需要走计算 直接走钢材的汽车衡
|
|
|
+ //如果是单拼 不需要走计算 直接走钢材的汽车衡(钢材)
|
|
|
Map<String, Object> mesMap = new HashMap<>();
|
|
|
mesMap.put("materialId",mapList.get(0).get("materialId"));
|
|
|
+ map.put("materialId", mapList.get(0).get("materialId"));
|
|
|
mesMap.put("nature", 1);
|
|
|
+ mesMap.put("orderId", map.get("orderId"));
|
|
|
//计算计皮汽车衡
|
|
|
int tarePlaceId = rulesService.calculateWeighbridge(mesMap);
|
|
|
mesMap.put("tarePlaceId", tarePlaceId);
|
|
@@ -181,7 +185,7 @@ public class TmstruckEnfactoryResultServiceImpl implements ITmstruckEnfactoryRes
|
|
|
//更新汽车衡
|
|
|
i += tmstruckWeightResultService.updateWeightResult(calculateMap);
|
|
|
}
|
|
|
-// i += tmstruckMeasureCommissionService.addPiMeasureCommission(map); //添加计皮委托
|
|
|
+ checkMeasureCommission += tmstruckMeasureCommissionService.addXSMeasureCommission(map); //添加计皮委托
|
|
|
break;
|
|
|
case 2:
|
|
|
case 3:
|
|
@@ -201,7 +205,7 @@ public class TmstruckEnfactoryResultServiceImpl implements ITmstruckEnfactoryRes
|
|
|
//通过物资ID查询物资Id
|
|
|
List<Integer> materialIdList = utilsMapper.getMaterialIdByOrderId(DataChange.dataToBigDecimal(map.get("orderId")));
|
|
|
map.put("materialId", materialIdList.get(0));
|
|
|
- i += tmstruckMeasureCommissionService.addMaoMeasureCommission(map); //添加计毛委托 并发送计毛委托
|
|
|
+ checkMeasureCommission += tmstruckMeasureCommissionService.addMaoMeasureCommission(map); //添加计毛委托 并发送计毛委托
|
|
|
break;
|
|
|
case 10: // 采购内转(老区-厂内) 没有进厂
|
|
|
break;
|
|
@@ -215,7 +219,10 @@ public class TmstruckEnfactoryResultServiceImpl implements ITmstruckEnfactoryRes
|
|
|
map.put("materialId", materialIdByOrderId.get(0));
|
|
|
//默认收货单位为新厂区
|
|
|
|
|
|
- i += tmstruckMeasureCommissionService.addLXMeasureCommission(map);
|
|
|
+ checkMeasureCommission += tmstruckMeasureCommissionService.addLXMeasureCommission(map);
|
|
|
+ }
|
|
|
+ if(checkMeasureCommission == 0){
|
|
|
+ throw new Exception("委托发送失败");
|
|
|
}
|
|
|
utilsService.pushMesToWebsocket((String) map.get("capacityNumber"), "车辆进厂");
|
|
|
return i;
|