|
@@ -707,12 +707,38 @@ public class TMSController extends BaseRESTfulController {
|
|
|
//校验行
|
|
//校验行
|
|
|
if(item.get("通知单号")==null || item.get("通知单号").equals("")
|
|
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("")
|
|
|
|
|
- || item.get("皮重")==null || item.get("皮重").equals("")
|
|
|
|
|
- || item.get("毛重")==null || item.get("毛重").equals("")){
|
|
|
|
|
- throw new Exception("单元格数据异常(通知单号/车号/卸车日期/净重),请检查模板或数据是否正确!");
|
|
|
|
|
|
|
+ || item.get("卸车日期")==null || item.get("卸车日期").equals("")){
|
|
|
|
|
+ throw new Exception("单元格数据异常(通知单号/车号/卸车日期),请检查模板或数据是否正确!");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(item.get("净重") == null || item.get("净重").equals("")){
|
|
|
|
|
+ //净重为空
|
|
|
|
|
+ if(item.get("毛重") != null && !item.get("毛重").equals("")
|
|
|
|
|
+ && item.get("皮重") != null && !item.get("皮重").equals("")){
|
|
|
|
|
+ item.put("净重", DataChange.dataToBigDecimal(item.get("毛重")).subtract(DataChange.dataToBigDecimal(item.get("皮重"))));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ throw new Exception("单元格数据异常(净重),请检查模板或数据是否正确!");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(item.get("毛重") == null || item.get("毛重").equals("")){
|
|
|
|
|
+ //毛重为空
|
|
|
|
|
+ if(item.get("净重") != null && !item.get("净重").equals("")
|
|
|
|
|
+ && item.get("皮重") != null && !item.get("皮重").equals("")){
|
|
|
|
|
+ item.put("毛重", DataChange.dataToBigDecimal(item.get("净重")).add(DataChange.dataToBigDecimal(item.get("皮重"))));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ throw new Exception("单元格数据异常(毛重),请检查模板或数据是否正确!");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(item.get("皮重") == null || item.get("皮重").equals("")){
|
|
|
|
|
+ //毛重为空
|
|
|
|
|
+ if(item.get("净重") != null && !item.get("净重").equals("")
|
|
|
|
|
+ && item.get("毛重") != null && !item.get("毛重").equals("")){
|
|
|
|
|
+ item.put("皮重", DataChange.dataToBigDecimal(item.get("毛重")).subtract(DataChange.dataToBigDecimal(item.get("净重"))));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ throw new Exception("单元格数据异常(皮重),请检查模板或数据是否正确!");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- item.put("净重", DataChange.dataToBigDecimal(item.get("毛重")).subtract(DataChange.dataToBigDecimal(item.get("皮重"))));
|
|
|
|
|
//校验数据
|
|
//校验数据
|
|
|
// if(unloadTime == null){
|
|
// if(unloadTime == null){
|
|
|
// unloadTime = item.get("卸车日期").toString();
|
|
// unloadTime = item.get("卸车日期").toString();
|
|
@@ -762,17 +788,17 @@ public class TMSController extends BaseRESTfulController {
|
|
|
map.put(requireNumber,requirementMap);
|
|
map.put(requireNumber,requirementMap);
|
|
|
}
|
|
}
|
|
|
Map<String,Object> result = null;
|
|
Map<String,Object> result = null;
|
|
|
- for(String requireNumber : requireList){
|
|
|
|
|
- Map<String,Object> requirementMap =(Map<String, Object>) map.get(requireNumber);
|
|
|
|
|
- List<Map<String,Object>> orderList = (ArrayList) requirementMap.get("orderList");
|
|
|
|
|
-// if(universalMapper.countTransOrder(requirementMap) != orderList.size()){
|
|
|
|
|
-// throw new Exception("卸车车数与装车车数不一致!");
|
|
|
|
|
|
|
+// for(String requireNumber : requireList){
|
|
|
|
|
+// Map<String,Object> requirementMap =(Map<String, Object>) map.get(requireNumber);
|
|
|
|
|
+// List<Map<String,Object>> orderList = (ArrayList) requirementMap.get("orderList");
|
|
|
|
|
+//// if(universalMapper.countTransOrder(requirementMap) != orderList.size()){
|
|
|
|
|
+//// throw new Exception("卸车车数与装车车数不一致!");
|
|
|
|
|
+//// }
|
|
|
|
|
+// result = tmsFeign.purchaseTrainUnload(requirementMap);
|
|
|
|
|
+// if (!"succeed".equals(result.get("status"))) {
|
|
|
|
|
+// throw new Exception("上传失败:" + result.get("message"));
|
|
|
// }
|
|
// }
|
|
|
- result = tmsFeign.purchaseTrainUnload(requirementMap);
|
|
|
|
|
- if (!"succeed".equals(result.get("status"))) {
|
|
|
|
|
- throw new Exception("上传失败:" + result.get("message"));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// }
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|