|
@@ -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);
|
|
|
}
|
|
|
-
|
|
|
+ checkMeasureCommission += tmstruckMeasureCommissionService.addXSMeasureCommission(map);
|
|
|
break;
|
|
|
case 2:
|
|
|
case 3:
|
|
@@ -201,7 +205,7 @@ public class TmstruckEnfactoryResultServiceImpl implements ITmstruckEnfactoryRes
|
|
|
|
|
|
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;
|