|
@@ -74,6 +74,8 @@ public class AmsSaleOrderController extends BaseRESTfulController {
|
|
|
@Autowired
|
|
|
JoinFeign joinFeign;
|
|
|
@Autowired
|
|
|
+ EASDeleteUtil easDeleteUtil;
|
|
|
+ @Autowired
|
|
|
EASCapacityTestUtil easCapacityTestUtil;
|
|
|
private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
@@ -695,24 +697,27 @@ public class AmsSaleOrderController extends BaseRESTfulController {
|
|
|
|
|
|
@ApiModelProperty(value = "钢材派单")
|
|
|
@PostMapping("/dispatchSteelOrder")
|
|
|
- public RESTfulResult dispatchSteelOrder(@RequestBody List<Map<String,Object>> mapList) {
|
|
|
+ public RESTfulResult dispatchSteelOrder(@RequestBody List<Map<String,Object>> mapList) throws Exception {
|
|
|
int result = amsSaleOrderService.dispatchSteelOrder(mapList);
|
|
|
if (result == 0) {
|
|
|
return failed("匹配不到车牌号!");
|
|
|
}
|
|
|
else {
|
|
|
-// for (Map<String, Object> map : mapList) {
|
|
|
-// // 调用EAS接口将车牌号传给金蝶
|
|
|
-// BigDecimal saleOrderMaterialId = (BigDecimal) map.get("saleOrderMaterialId");
|
|
|
-// Map<String,Object> input = joinFeign.findCarNumberByOrderId(saleOrderMaterialId);
|
|
|
-// Map<String, Object> totalMap = easCapacityTestUtil.getTotalMap();
|
|
|
-// totalMap.put("input",input);
|
|
|
-// System.out.println(totalMap);
|
|
|
-// String json = JSONUtils.toJSONString(totalMap);
|
|
|
-// System.out.println(json);
|
|
|
-// Map<String,Object> s = joinFeign.pushCarNumberToEas(totalMap);
|
|
|
-// System.out.println(s);
|
|
|
-// }
|
|
|
+ for (Map<String, Object> map : mapList) {
|
|
|
+ // 调用EAS接口将车牌号传给金蝶
|
|
|
+ BigDecimal saleOrderMaterialId = new BigDecimal((Integer) map.get("saleOrderMaterialId")) ;
|
|
|
+ Map<String,Object> input = joinFeign.findCarNumberByOrderId(saleOrderMaterialId);
|
|
|
+ Map<String, Object> totalMap = easCapacityTestUtil.getTotalMap();
|
|
|
+ totalMap.put("input",input);
|
|
|
+ System.out.println(totalMap);
|
|
|
+ String json = JSONUtils.toJSONString(totalMap);
|
|
|
+ System.out.println(json);
|
|
|
+ Map<String,Object> s = joinFeign.pushCarNumberToEas(totalMap);
|
|
|
+ if (s == null || s.size() == 0) {
|
|
|
+ throw new Exception("登录金蝶失败");
|
|
|
+ }
|
|
|
+ System.out.println(s);
|
|
|
+ }
|
|
|
return success(result);
|
|
|
}
|
|
|
}
|
|
@@ -956,21 +961,25 @@ public class AmsSaleOrderController extends BaseRESTfulController {
|
|
|
int result = amsSaleOrderService.updateCarAddress(mapValue);
|
|
|
// 如果返回结果为0,则认定是关闭了车辆
|
|
|
if (result == 0) {
|
|
|
- // 调用修改接口同步修改金蝶数据
|
|
|
- BigDecimal saleOrderId = DataChange.dataToBigDecimal(mapValue.get("saleOrderId"));
|
|
|
- // 调用金蝶接口,将销售订单推送到金蝶系统
|
|
|
- Map<String, Object> input = joinFeign.getSaleOrder(saleOrderId);
|
|
|
- Map<String, Object> head = (Map<String, Object>) input.get("head");
|
|
|
- head.put("status","update");
|
|
|
- // 获得金蝶接口配置
|
|
|
- Map<String, Object> totalMap = easUtil.getTotalMap();
|
|
|
- // 组装报文
|
|
|
- totalMap.put("input",input);
|
|
|
- System.out.println(totalMap);
|
|
|
- String json = JSONUtils.toJSONString(totalMap);
|
|
|
- System.out.println(json);
|
|
|
- Map<String,Object> s = joinFeign.pushSaleOrderToEas(totalMap);
|
|
|
- System.out.println(s);
|
|
|
+ BigDecimal saleOrderMaterialId = DataChange.dataToBigDecimal(mapValue.get("saleOrderMaterialId"));
|
|
|
+ List<Map<String,Object>> saleMaterialIdList = amsSaleOrderService.getSaleMaterialId(saleOrderMaterialId);
|
|
|
+ String wholeOrder = "0";
|
|
|
+ String status = "close";
|
|
|
+ String reason = "收货地址修改超过片区范围";
|
|
|
+ // 循环调用关闭金蝶分录接口
|
|
|
+ for (Map<String, Object> head : saleMaterialIdList) {
|
|
|
+ head.put("wholeOrder",wholeOrder);
|
|
|
+ head.put("status",status);
|
|
|
+ head.put("reason",reason);
|
|
|
+ Map<String,Object> input = new HashMap<>();
|
|
|
+ input.put("head",head);
|
|
|
+ Map<String, Object> totalMap = easDeleteUtil.getTotalMap();
|
|
|
+ totalMap.put("input",input);
|
|
|
+ String json = JSONUtils.toJSONString(totalMap);
|
|
|
+ System.out.println(json);
|
|
|
+ Map<String, Object> resultMap = joinFeign.deleteSaleOrderToEas(totalMap);
|
|
|
+ System.out.println(resultMap);
|
|
|
+ }
|
|
|
}
|
|
|
return success(result);
|
|
|
}
|
|
@@ -1126,6 +1135,21 @@ public class AmsSaleOrderController extends BaseRESTfulController {
|
|
|
@PostMapping("/updateCapacityNumberInFactory")
|
|
|
public RESTfulResult updateCapacityNumberInFactory(@RequestBody Map<String,Object> mapValue) {
|
|
|
int result = amsSaleOrderService.updateCapacityNumberInFactory(mapValue);
|
|
|
- return success(result);
|
|
|
+ if (result == 0) {
|
|
|
+ return failed("已装货车辆不允许修改车牌");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ // 调用EAS接口将车牌号传给金蝶
|
|
|
+ BigDecimal saleOrderMaterialId = new BigDecimal((Integer) mapValue.get("saleOrderMaterialId"));
|
|
|
+ Map<String, Object> input = joinFeign.findCarNumberByOrderId(saleOrderMaterialId);
|
|
|
+ Map<String, Object> totalMap = easCapacityTestUtil.getTotalMap();
|
|
|
+ totalMap.put("input", input);
|
|
|
+ System.out.println(totalMap);
|
|
|
+ String json = JSONUtils.toJSONString(totalMap);
|
|
|
+ System.out.println(json);
|
|
|
+ Map<String, Object> s = joinFeign.pushCarNumberToEas(totalMap);
|
|
|
+ System.out.println(s);
|
|
|
+ return success(result);
|
|
|
+ }
|
|
|
}
|
|
|
}
|