|
|
@@ -89,11 +89,10 @@ public class TMSController extends BaseRESTfulController {
|
|
|
|
|
|
@ApiOperation(value = "修改车辆实绩")
|
|
|
@ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
|
|
|
- @PutMapping(value = "/comprehensiveresultsupadete/{id}")
|
|
|
+ @PostMapping(value = "/comprehensiveresultsupadete")
|
|
|
@LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"计算公式"})
|
|
|
- public Map<String, Object> comprehensiveresultsUpdate(@PathVariable BigDecimal id, @RequestBody(required = false) Map<String, Object> map) {
|
|
|
- map.put("updateUsername", map.get("userName").toString());
|
|
|
- return tmsFeign.updateAmsSalaryContrac(id, map);
|
|
|
+ public Map<String, Object> comprehensiveresultsUpdate(@RequestBody(required = false) Map<String, Object> map) {
|
|
|
+ return tmsFeign.updateAmsSalaryContrac(map);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "派发运输订单")
|
|
|
@@ -107,11 +106,21 @@ public class TMSController extends BaseRESTfulController {
|
|
|
@ApiOperation(value = "批量派发运输订单")
|
|
|
@ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
|
|
|
@PostMapping(value = "/batchDispatch")
|
|
|
+ @RequestLimit(seconds = 100)
|
|
|
@LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"运输订单"})
|
|
|
public Map<String, Object> batchDispatch(@RequestBody(required = false) Map<String, Object> map) {
|
|
|
return tmsFeign.batchDispatch(map);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "批量派发运输订单")
|
|
|
+ @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
|
|
|
+ @PostMapping(value = "/batchDispatchSc")
|
|
|
+ @RequestLimit(seconds = 100)
|
|
|
+ @LogAround(foreignKeys = {"transOrderId"}, foreignKeyTypes = {"运输订单"})
|
|
|
+ public Map<String, Object> batchDispatchSc(@RequestBody(required = false) Map<String, Object> map) {
|
|
|
+ return tmsFeign.batchDispatchSc(map);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "修改运输订单")
|
|
|
@ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
|
|
|
@PostMapping(value = "/updateTransOrder")
|
|
|
@@ -535,6 +544,10 @@ public class TMSController extends BaseRESTfulController {
|
|
|
if(!weightTime.equals(item.get("计量日期").toString())){
|
|
|
throw new Exception("同一个Excel只允许一批车辆,请检查计量日期!");
|
|
|
}
|
|
|
+ //更新重量
|
|
|
+ BigDecimal weight = DataChange.dataToBigDecimal(map.get("weight"));
|
|
|
+ weight = weight.add(DataChange.dataToBigDecimal(item.get("净重")));
|
|
|
+ map.put("weight", weight);
|
|
|
} else {
|
|
|
throw new Exception("同一个Excel文件中只允许有一个通知单号!");
|
|
|
}
|
|
|
@@ -542,6 +555,7 @@ public class TMSController extends BaseRESTfulController {
|
|
|
//不存在,新增
|
|
|
map.put("requirementNumber", requirementNumber);
|
|
|
map.put("weightTime",item.get("计量日期").toString());
|
|
|
+ map.put("weight",DataChange.dataToBigDecimal(item.get("净重")));
|
|
|
}
|
|
|
//车牌号去重
|
|
|
capacitySet.add(item.get("车号").toString());
|
|
|
@@ -557,8 +571,14 @@ public class TMSController extends BaseRESTfulController {
|
|
|
List<Map<String,Object>> orderList = universalMapper.findTrainWeight(map);
|
|
|
if (orderList.size() <= 0) {
|
|
|
throw new Exception("未查询到装车信息,请先上传装车作业!");
|
|
|
+ } else if(orderList.size() != universalMapper.countTransOrder(orderList.get(0))){
|
|
|
+ throw new Exception("计量信息与装车信息数量不一致,请重新上传!");
|
|
|
+ } else if(orderList.get(0).get("unloadResultId")!=null){
|
|
|
+ throw new Exception("车皮已卸车,不允许再上传计量!");
|
|
|
}
|
|
|
map.put("orderList",orderList);
|
|
|
+ map.put("transPlanId",orderList.get(0).get("transPlanId"));
|
|
|
+ map.put("materialId",orderList.get(0).get("materialId"));
|
|
|
//新增TMS
|
|
|
return tmsFeign.purchaseTrainWeight(map);
|
|
|
}
|
|
|
@@ -627,8 +647,21 @@ public class TMSController extends BaseRESTfulController {
|
|
|
List<Map<String,Object>> orderList = universalMapper.findTrainUnload(map);
|
|
|
if (orderList.size() <= 0) {
|
|
|
throw new Exception("未查询到装车信息,请先上传装车作业!");
|
|
|
+ } else if(orderList.size() != universalMapper.countTransOrder(orderList.get(0))){
|
|
|
+ throw new Exception("卸货信息与装车信息数量不一致,请重新上传!");
|
|
|
+ }
|
|
|
+ //获取原本重量之和
|
|
|
+ BigDecimal weightOld = BigDecimal.ZERO;
|
|
|
+ for(Map<String,Object> item : orderList){
|
|
|
+ weightOld = weightOld.add(DataChange.dataToBigDecimal(item.get("unloadWeightOld")));
|
|
|
}
|
|
|
+ map.put("weightOld",weightOld);
|
|
|
+ map.put("diff",DataChange.dataToBigDecimal(map.get("weight").toString()).subtract(weightOld));
|
|
|
map.put("orderList",orderList);
|
|
|
+ map.put("requirementSerialNumber",orderList.get(0).get("requirementSerialNumber"));
|
|
|
+ map.put("transPlanId",orderList.get(0).get("transPlanId"));
|
|
|
+ map.put("materialId",orderList.get(0).get("materialId"));
|
|
|
+ map.put("unloadPointId",orderList.get(0).get("unloadPointId"));
|
|
|
//新增TMS
|
|
|
return tmsFeign.purchaseTrainUnload(map);
|
|
|
}
|
|
|
@@ -714,4 +747,11 @@ public class TMSController extends BaseRESTfulController {
|
|
|
public RESTfulResult updateWeight(@RequestBody Map<String,Object> map) {
|
|
|
return tmsFeign.updateWeight(map);
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation("checkWeightResult")
|
|
|
+ @PostMapping("/checkWeightResult")
|
|
|
+ @LogAround(foreignKeys = {"resultId"}, foreignKeyTypes = {"计量实绩"})
|
|
|
+ public Map<String,Object> checkWeightResult(@RequestBody Map<String,Object> map) {
|
|
|
+ return tmsFeign.checkWeightResult(map);
|
|
|
+ }
|
|
|
}
|