|
@@ -536,7 +536,7 @@ public class TMSController extends BaseRESTfulController {
|
|
|
map.put("userName",userName);
|
|
map.put("userName",userName);
|
|
|
map.put("businessType",businessType);
|
|
map.put("businessType",businessType);
|
|
|
//获取火车运单及计量详情
|
|
//获取火车运单及计量详情
|
|
|
- List<Map<String,Object>> orderList = universalMapper.findTrainOrder(map);
|
|
|
|
|
|
|
+ List<Map<String,Object>> orderList = universalMapper.findTrainWeight(map);
|
|
|
if (orderList.size() <= 0) {
|
|
if (orderList.size() <= 0) {
|
|
|
throw new Exception("未查询到装车信息,请先上传装车作业!");
|
|
throw new Exception("未查询到装车信息,请先上传装车作业!");
|
|
|
}
|
|
}
|
|
@@ -555,6 +555,81 @@ public class TMSController extends BaseRESTfulController {
|
|
|
return tmsFeign.purchaseTrainWeightList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
|
|
return tmsFeign.purchaseTrainWeightList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "采购火运卸车作业")
|
|
|
|
|
+ @ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
|
|
|
|
|
+ @PostMapping(value = "/purchaseTrainUnload")
|
|
|
|
|
+// @LogAround(foreignKeys = {"resultId"},foreignKeyTypes = {"计量实绩"})
|
|
|
|
|
+ public Map<String, Object> purchaseTrainUnload(@RequestBody MultipartFile file,
|
|
|
|
|
+ String businessType,
|
|
|
|
|
+ String userId,
|
|
|
|
|
+ String userName) throws Exception {
|
|
|
|
|
+ File excel = ExcelToolUtils.multipartFileToFile(file);
|
|
|
|
|
+ FileInputStream is = null;
|
|
|
|
|
+ String fileName = excel.getName();
|
|
|
|
|
+ // 解决fileName兼容性问题
|
|
|
|
|
+ int lastindex = fileName.lastIndexOf("\\");
|
|
|
|
|
+ fileName = fileName.substring(lastindex + 1);
|
|
|
|
|
+ if (fileName != null && fileName.length() > 0) {
|
|
|
|
|
+ is = new FileInputStream(excel);
|
|
|
|
|
+ }
|
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
|
+ //获取Excel中包含的对象数组
|
|
|
|
|
+ List<Map<String, Object>> list = ExcelToolUtils.getExcelList(is, fileName, 0);
|
|
|
|
|
+ map.put("list", list);
|
|
|
|
|
+ Set<String> capacitySet = new HashSet<>();//车牌号
|
|
|
|
|
+ for (Map<String, Object> item : list) {
|
|
|
|
|
+ //校验行
|
|
|
|
|
+ if(item.get("通知单号")==null || item.get("通知单号").equals("")
|
|
|
|
|
+ || item.get("车号")==null || item.get("车号").equals("")
|
|
|
|
|
+ || item.get("卸车日期")==null || item.get("卸车日期").equals("")
|
|
|
|
|
+ || item.get("净重")==null || item.get("净重").equals("")){
|
|
|
|
|
+ throw new Exception("单元格数据异常(通知单号/车号/卸车日期/净重),请检查模板或数据是否正确!");
|
|
|
|
|
+ }
|
|
|
|
|
+ //校验数据
|
|
|
|
|
+ String requirementNumber = item.get("通知单号").toString();
|
|
|
|
|
+ if (map.get("requirementNumber") != null) {
|
|
|
|
|
+ if (map.get("requirementNumber").equals(requirementNumber)) {
|
|
|
|
|
+ String unloadTime = map.get("unloadTime").toString();
|
|
|
|
|
+ if(!unloadTime.equals(item.get("卸车日期").toString())){
|
|
|
|
|
+ throw new Exception("同一个Excel只允许一批车辆,请检查卸车日期!");
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new Exception("同一个Excel文件中只允许有一个通知单号!");
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //不存在,新增
|
|
|
|
|
+ map.put("requirementNumber", requirementNumber);
|
|
|
|
|
+ map.put("unloadTime",item.get("卸车日期").toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ //车牌号去重
|
|
|
|
|
+ capacitySet.add(item.get("车号").toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ String[] capacities = capacitySet.toArray(new String[0]);//车牌号
|
|
|
|
|
+ if (capacities.length != list.size()) {
|
|
|
|
|
+ throw new Exception("车号不允许重复!");
|
|
|
|
|
+ }
|
|
|
|
|
+ map.put("userId",userId);
|
|
|
|
|
+ map.put("userName",userName);
|
|
|
|
|
+ map.put("businessType",businessType);
|
|
|
|
|
+ //获取火车运单及计量详情
|
|
|
|
|
+ List<Map<String,Object>> orderList = universalMapper.findTrainUnload(map);
|
|
|
|
|
+ if (orderList.size() <= 0) {
|
|
|
|
|
+ throw new Exception("未查询到装车信息,请先上传装车作业!");
|
|
|
|
|
+ }
|
|
|
|
|
+ map.put("orderList",orderList);
|
|
|
|
|
+ //新增TMS
|
|
|
|
|
+ return tmsFeign.purchaseTrainUnload(map);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "查询采购火运卸车")
|
|
|
|
|
+ @PostMapping("/purchaseTrainUnloadList")
|
|
|
|
|
+ public Map<String, Object> purchaseTrainUnloadList(@RequestBody(required = false) Map<String, Object> map,
|
|
|
|
|
+ Integer apiId,
|
|
|
|
|
+ Integer pageNum,
|
|
|
|
|
+ Integer pageSize) {
|
|
|
|
|
+ return tmsFeign.purchaseTrainUnloadList(map == null ? new HashMap<>() : map, apiId, pageNum, pageSize);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@ApiOperation(value = "更改销售运输订单状态")
|
|
@ApiOperation(value = "更改销售运输订单状态")
|
|
|
@ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
|
|
@ApiImplicitParam(name = "map", value = "JSON格式数据", required = true, dataType = "Map<String, Object>")
|
|
|
@PostMapping(value = "/changeSaleTransOrder")
|
|
@PostMapping(value = "/changeSaleTransOrder")
|