|
@@ -89,7 +89,6 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
|
|
|
*/
|
|
|
public int addMaoMeasureCommission(Map<String, Object> map){
|
|
|
int i = 0;
|
|
|
- addMeasureCommission(map); // 添加计毛委托
|
|
|
//发送数据给计量系统 必要数据 orderTypee:订单类型 resultTotalId: 总实绩Id orderId
|
|
|
int orderType = DataChange.dataToBigDecimal(map.get("orderTypee")).intValue();
|
|
|
if(orderType == 10){
|
|
@@ -119,7 +118,6 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
|
|
|
*/
|
|
|
public int addXSMeasureCommission(Map<String, Object> map){
|
|
|
int i = 0;
|
|
|
- addMeasureCommission(map); // 添加计毛委托
|
|
|
//发送数据给计量系统 必要数据 orderTypee:订单类型 resultTotalId: 总实绩Id orderId
|
|
|
//获取当前订单是属于哪个厂区订单
|
|
|
Integer shipperId = tmstruckMeasureCommissionMapper.getShipperIdByOrderId(DataChange.dataToBigDecimal(map.get("orderId")));
|
|
@@ -188,7 +186,6 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
|
|
|
i = sendDXMeasureCommissionMes(map);//如果有两条没有净重的实绩则需要给达兴发委托 否则给达钢发委托
|
|
|
}
|
|
|
}
|
|
|
- addMeasureCommission(map); // 添加计毛委托
|
|
|
return i;
|
|
|
}
|
|
|
|
|
@@ -323,10 +320,12 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
|
|
|
measureCommission.put("isInsert",true);
|
|
|
measureCommission.put("deliveryMethod", "磅重交货");
|
|
|
measureCommission.put("packagesNum", 0);
|
|
|
-
|
|
|
}
|
|
|
+ if(measureCommission != null)
|
|
|
+ map.put("materialId", measureCommission.get("materialId"));
|
|
|
+ addMeasureCommission(map); // 添加计量委托
|
|
|
+ System.out.println(measureCommission);
|
|
|
/*访问接口发送数据*/
|
|
|
- System.out.println(measureCommission == null ? "没有查询出委托" : measureCommission);
|
|
|
return 1;
|
|
|
// return sendMesToMeasure(measureCommission);
|
|
|
|
|
@@ -412,6 +411,9 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
+ if(measureCommission != null)
|
|
|
+ map.put("materialId", measureCommission.get("item"));
|
|
|
+ addMeasureCommission(map); // 添加计量委托
|
|
|
/*访问接口发送数据*/
|
|
|
return sendMesToDXMeasure(measureCommission);
|
|
|
}
|
|
@@ -479,13 +481,36 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
|
|
|
|
|
|
//发送计量委托
|
|
|
@Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Transactional
|
|
|
public int sendMeasureCommssion(Map<String, Object> map){
|
|
|
+ if(map.get("deletedCommission") != null){
|
|
|
+ //在计量实绩中查询是否有计量数据,如果有则代表已经计量过了不允许撤回
|
|
|
+ List<Integer> commission = tmstruckMeasureCommissionMapper.checkoutWeightCommission(map);
|
|
|
+ if(commission.size() != 0){
|
|
|
+ return 2;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //查询最后发送委托的物资
|
|
|
+ Integer alreadySentMaterialId = tmstruckMeasureCommissionMapper.getAlreadySentMaterialId(map);
|
|
|
+ if(alreadySentMaterialId != null){
|
|
|
+ map.put("checkMaterialId", alreadySentMaterialId);
|
|
|
+ //判断当前订单是否有已经发送过委托 但是还未计量完成的物资
|
|
|
+ Map<String, Object> checkoutMesMap = tmstruckMeasureCommissionMapper.checkoutWeightCommission2(map);
|
|
|
+ if(checkoutMesMap == null){ // 为空则是这个物资还没有计量
|
|
|
+ return 4;
|
|
|
+ }else {
|
|
|
+ //如果不为空, 判断是否有净重 如果有净重则是计量完成 否则 没有
|
|
|
+ if(checkoutMesMap.get("resultNetWeight") == null){
|
|
|
+ return 4;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
int i=0;
|
|
|
//获取订单类型
|
|
|
BigDecimal orderId = DataChange.dataToBigDecimal(map.get("orderId"));
|
|
|
- BigDecimal orderType = utilsMapper.getOrderTypeByOrderId(orderId);
|
|
|
- map.put("orderTypee", orderType);
|
|
|
+ map.putAll(utilsMapper.getOrderMesByOrderId(orderId));
|
|
|
+ BigDecimal orderType = DataChange.dataToBigDecimal(map.get("orderTypee"));
|
|
|
//根据运输订单id查找运输订单号
|
|
|
switch (orderType.intValue()){
|
|
|
case 1: //查询未装车实绩
|
|
@@ -521,6 +546,13 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
|
|
|
case 18:
|
|
|
i+=addMaoMeasureCommission(map);
|
|
|
}
|
|
|
+ if(i == 1){
|
|
|
+ //发送委托成功后修改订单物资表
|
|
|
+ tmstruckMeasureCommissionMapper.updateOmsTruckMaterial(map);
|
|
|
+ if(map.get("deletedCommission") != null){
|
|
|
+ i = 3;
|
|
|
+ }
|
|
|
+ }
|
|
|
return i;
|
|
|
}
|
|
|
|