|
@@ -85,19 +85,19 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
|
|
|
int i = 0;
|
|
|
addMeasureCommission(map); // 添加计毛委托
|
|
|
//发送数据给计量系统 必要数据 orderTypee:订单类型 resultTotalId: 总实绩Id orderId
|
|
|
- //获取当前订单是属于哪个厂区订单
|
|
|
- Integer receiveId = 0 ;
|
|
|
- if(DataChange.dataToBigDecimal(map.get("orderTypee")).intValue() == 10){
|
|
|
- receiveId = tmstruckMeasureCommissionMapper.getReceiveIdByRequirementOrderId(DataChange.dataToBigDecimal(map.get("orderId")));
|
|
|
- }else{
|
|
|
- //查询采购订单中的组织
|
|
|
- receiveId = tmstruckMeasureCommissionMapper.getReceiveIdByOrderId(DataChange.dataToBigDecimal(map.get("orderId")));
|
|
|
- }
|
|
|
- if(receiveId == 1){
|
|
|
+ int orderType = DataChange.dataToBigDecimal(map.get("orderTypee")).intValue();
|
|
|
+ if(orderType == 10){
|
|
|
+ //获取当前订单是属于哪个厂区订单
|
|
|
+ Integer receiveId = tmstruckMeasureCommissionMapper.getReceiveIdByRequirementOrderId(DataChange.dataToBigDecimal(map.get("orderId")));
|
|
|
+ if(receiveId == 1){
|
|
|
+ i += sendMeasureCommissionMes(map); //发送委托给达州钢铁
|
|
|
+ }else if(receiveId == 2) {
|
|
|
+ i += sendDXMeasureCommissionMes(map); //发送委托给达兴能源
|
|
|
+ }
|
|
|
+ }else if(orderType == 6 || orderType == 5){
|
|
|
//发送委托给达州钢铁
|
|
|
i += sendMeasureCommissionMes(map);
|
|
|
- }
|
|
|
- if(receiveId == 2) {
|
|
|
+ }else if(orderType == 18 || orderType == 7) {
|
|
|
//发送委托给达兴能源
|
|
|
i += sendDXMeasureCommissionMes(map);
|
|
|
}
|
|
@@ -213,7 +213,7 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 查询计量委托并向计量系统发送数据 调用他们接口
|
|
|
+ * 查询计量委托并向计量系统发送数据 调用他们接口 (老厂区)
|
|
|
* 1:销售订单;2:焦炭发运计划;3:水渣发运计划;4:内转到异地库;5:采购辅料订单;6:采购老区燃料订单;
|
|
|
* 7:采购新区燃料订单;8:采购进口矿(万州-厂内);9:采购内转(达州-厂内);10:采购内转(老区-厂内); 11:厂内内转
|
|
|
* @param map orderTypee 订单类型 type 计皮0还是计毛1类型 orderId 订单ID
|
|
@@ -221,8 +221,8 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
|
|
|
public int sendMeasureCommissionMes(Map<String, Object> map){
|
|
|
Map<String, Object> measureCommission = null;
|
|
|
//查询计量委托
|
|
|
- BigDecimal orderType = DataChange.dataToBigDecimal(map.get("orderTypee"));
|
|
|
- switch (orderType.intValue()){
|
|
|
+ Integer orderType = DataChange.dataToBigDecimal(map.get("orderTypee")).intValue();
|
|
|
+ switch (orderType){
|
|
|
case 1:
|
|
|
break;
|
|
|
case 2:
|
|
@@ -238,9 +238,13 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
|
|
|
case 6:
|
|
|
case 7:
|
|
|
case 8:
|
|
|
- case 9:
|
|
|
+// case 9:
|
|
|
measureCommission = tmstruckMeasureCommissionMapper.purchaseMeasure(map);
|
|
|
- measureCommission.put("isRelationEAS", false);
|
|
|
+ if(orderType == 6){
|
|
|
+ measureCommission.put("isRelationEAS", false);
|
|
|
+ }else {
|
|
|
+ measureCommission.put("isRelationEAS", true);
|
|
|
+ }
|
|
|
measureCommission.put("flowTo", "进厂");
|
|
|
measureCommission.put("isDel", false);
|
|
|
measureCommission.put("isInsert", true);
|
|
@@ -398,6 +402,8 @@ public class TmstruckMeasureCommissionServiceImpl implements ITmstruckMeasureCom
|
|
|
if(success){
|
|
|
return 1;
|
|
|
}
|
|
|
+ }else{
|
|
|
+ System.out.println("委托发送失败:" + jsonData);
|
|
|
}
|
|
|
return 0;
|
|
|
}
|