liyg 1 year ago
parent
commit
63c4797326

+ 15 - 0
src/main/java/com/steerinfo/dil/controller/AMScontroller.java

@@ -1048,4 +1048,19 @@ public class AMScontroller  extends BaseRESTfulController {
     public Map<String, Object> withdrawRequirement(@RequestBody Map<String, Object> params) throws Exception {
         return amsFeign.withdrawRequirement(params);
     }
+
+    @ApiOperation(value = "展示生产需求详情-绑定")
+    @PostMapping(value = "/getProductionRequirementListBind")
+    Map<String, Object> getProductionRequirementListBind(@RequestBody(required = false) Map<String, Object> mapValue,
+                                                       Integer apiId,
+                                                       Integer pageNum,
+                                                       Integer pageSize) {
+        return amsFeign.getProductionRequirementListBind(mapValue == null ? new HashMap<>() : mapValue, apiId, pageNum, pageSize);
+    }
+
+    @ApiOperation("修改绑定需求")
+    @PostMapping("/updateBindRequirement")
+    public Map<String, Object> updateBindRequirement(@RequestBody Map<String, Object> params) throws Exception {
+        return amsFeign.updateBindRequirement(params);
+    }
 }

+ 41 - 15
src/main/java/com/steerinfo/dil/controller/TMSController.java

@@ -707,12 +707,38 @@ public class TMSController extends BaseRESTfulController {
             //校验行
             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("")){
-                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){
 //                unloadTime = item.get("卸车日期").toString();
@@ -762,17 +788,17 @@ public class TMSController extends BaseRESTfulController {
             map.put(requireNumber,requirementMap);
         }
         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;
     }
 

+ 8 - 0
src/main/java/com/steerinfo/dil/controller/UniversalController.java

@@ -317,6 +317,14 @@ public class UniversalController extends BaseRESTfulController {
         return success(requireMap);
     }
 
+
+    @ApiOperation("通知单边输边查")
+    @PostMapping("/getRequirementByLike")
+    public RESTfulResult getRequirementByLike(@RequestBody Map<String,Object> map) {
+        List<Map<String, Object>> list = universalMapper.getRequirementByLike(map);
+        return success(list);
+    }
+
     @ApiOperation("查询APP版本更新")
     @PostMapping("/getAppVersion")
     public RESTfulResult getAppVersion() {

+ 8 - 0
src/main/java/com/steerinfo/dil/feign/AmsFeign.java

@@ -382,4 +382,12 @@ public interface AmsFeign {
     @PostMapping(value = "api/v1/ams/amstransrequirements/withdrawRequirement")
     Map<String, Object> withdrawRequirement(@RequestBody Map<String, Object> map);
 
+    @PostMapping(value = "api/v1/ams/amstransrequirements/getProductionRequirementListBind")
+    Map<String, Object> getProductionRequirementListBind(@RequestBody(required=false) Map<String,Object> mapValue,
+                                                       @RequestParam  Integer apiId,
+                                                       @RequestParam  Integer pageNum,
+                                                       @RequestParam  Integer pageSize);
+
+    @PostMapping(value = "api/v1/ams/amstransrequirements/updateBindRequirement")
+    Map<String, Object> updateBindRequirement(@RequestBody Map<String, Object> map);
 }

+ 1 - 0
src/main/java/com/steerinfo/dil/mapper/UniversalMapper.java

@@ -115,4 +115,5 @@ public interface UniversalMapper {
 
     List<Map<String, Object>> getQueueGridList(Map<String, Object> map);
 
+    List<Map<String, Object>> getRequirementByLike(Map<String, Object> map);
 }

+ 35 - 0
src/main/resources/com/steerinfo/dil/mapper/UniversalMapper.xml

@@ -2080,4 +2080,39 @@
         FROM TMS_QUEUE_GRID
         where DELETED = 0
     </select>
+    <select id="getRequirementByLike" resultType="java.util.Map">
+        SELECT * FROM (
+            SELECT
+            TRANS_REQUIREMENT_ID "id",
+            TRANS_REQUIREMENT_ID "value",
+            SERIAL_NUMBER "label",
+            SERIAL_NUMBER "text"
+            FROM
+            AMS_TRANS_REQUIREMENT
+            <where>
+                DELETED NOT IN (2,5)
+                <if test="index!=null and index!=''">
+                    AND REGEXP_LIKE(SERIAL_NUMBER, #{index})
+                </if>
+                <if test="businessScene!=null and businessScene!=''">
+                    AND REGEXP_LIKE(BUSINESS_SCENE, #{businessScene})
+                </if>
+            </where>
+            FETCH NEXT 10 ROWS ONLY
+        )
+        <if test="id!=null and id.size>0">
+            UNION
+            SELECT
+            TRANS_REQUIREMENT_ID "id",
+            TRANS_REQUIREMENT_ID "value",
+            SERIAL_NUMBER "label",
+            SERIAL_NUMBER "text"
+            FROM
+            AMS_TRANS_REQUIREMENT
+            WHERE TRANS_REQUIREMENT_ID IN
+            <foreach collection="id" item="item"  open="(" close=")" separator="," >
+                #{item}
+            </foreach>
+        </if>
+    </select>
 </mapper>