Browse Source

审批--提货

wangxiaoming 6 years ago
parent
commit
6ca8046eb1

+ 11 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/approval/mapper/applyPickMapper.xml

@@ -11,6 +11,8 @@
         t.apply_pick_tel,
         t.apply_pick_reason,
         t.apply_pick_struts,
+        t.apply_pick_ship_way,
+        t.apply_pick_ship_certificate,
         t.apply_pick_remk,
         t.apply_pick_create_time,
         t.apply_pick_update_time
@@ -53,6 +55,8 @@
         <result    column="apply_pick_tel"    property="applyPickTel" />
         <result    column="apply_pick_reason"    property="applyPickReason" />
         <result    column="apply_pick_struts"    property="applyPickStruts" />
+        <result    column="apply_pick_ship_way"    property="applyPickShipWay" />
+        <result    column="apply_pick_ship_certificate"    property="applyPickShipCertificate" />
         <result    column="apply_pick_remk"    property="applyPickRemk" />
         <result    column="apply_pick_create_time"    property="applyPickCreateTime" />
         <result    column="apply_pick_update_time"    property="applyPickUpdateTime" />
@@ -127,6 +131,8 @@
         apply_pick_tel,
         apply_pick_reason,
         apply_pick_struts,
+        apply_pick_ship_way,
+        apply_pick_ship_certificate,
         apply_pick_remk
         )
         values
@@ -139,6 +145,8 @@
         #{applyPickTel},
         #{applyPickReason},
         #{applyPickStruts},
+        #{applyPickShipWay},
+        #{applyPickShipCertificate},
         #{applyPickRemk}
         )
     </insert>
@@ -167,6 +175,9 @@
             <if test="applyPickStruts != null ">
                 apply_pick_struts = #{applyPickStruts},
             </if >
+            <if test="applyPickShipWay != null ">
+                apply_pick_ship_way = #{applyPickShipWay},
+            </if >
             <if test="applyPickShipCertificate != null ">
                 apply_pick_ship_certificate = #{applyPickShipCertificate},
             </if >

+ 23 - 10
watero-rst-web/src/main/java/com/iamberry/rst/controllers/approval/ApplyPickController.java

@@ -90,6 +90,10 @@ public class ApplyPickController {
 
     /**
      * 添加提货
+     * @param request
+     * @param approvalApplyPick 提货信息
+     * @param listApplyPickItemJson 提货选定的生产产品信息
+     * @param imageJson 合同信息
      * @return
      */
     @ResponseBody
@@ -130,7 +134,7 @@ public class ApplyPickController {
      * @param approvalApplyPick
      * @return
      */
-    public Map<String,Object> verification(ApprovalApplyPick approvalApplyPick){
+    private Map<String,Object> verification(ApprovalApplyPick approvalApplyPick){
         Map<String,Object> map = new HashMap<>();
         map.put("status",false);
         if(approvalApplyPick.getApplyPickName() == null || "".equals(approvalApplyPick.getApplyPickName())){
@@ -204,28 +208,37 @@ public class ApplyPickController {
 
     /**
      * 发货
+     * @param request
+     * @param applyPickId 提货id
+     * @param applyPickShipWay 发货方式
+     * @param applyPickShipCertificate 发货凭证
      * @return
      */
     @ResponseBody
     @RequestMapping("/ship")
-    public ResponseJson ship(HttpServletRequest request,Integer applyPickId, String applyPickShipWay,String applyPickCertificate) {
-        if(applyPickId == null || applyPickCertificate == null || "".equals(applyPickCertificate) ){
-            return new ResponseJson(500, "FAILURE", 500);
+    public ResponseJson ship(HttpServletRequest request,Integer applyPickId, String applyPickShipWay,String applyPickShipCertificate) {
+        if(applyPickShipWay == null || "".equals(applyPickShipWay)){
+            return new ResponseJson(500, "发货方式为空!", 500);
         }
-        if(applyPickCertificate == null || "".equals(applyPickCertificate) ){
-            return new ResponseJson(500, "FAILURE", 500);
+        if(applyPickShipCertificate == null || "".equals(applyPickShipCertificate) ){
+            return new ResponseJson(500, "发货凭证为空!", 500);
         }
-        if(applyPickCertificate == null || "".equals(applyPickCertificate) ){
-            return new ResponseJson(500, "FAILURE", 500);
+        ApprovalApplyPick aap =  applyPickService.getApprovalApplyPickById(applyPickId);
+        if(aap == null){
+            return new ResponseJson(500, "提货信息有误!", 500);
+        }
+        if(aap.getApplyPickStruts() != 1){
+            return new ResponseJson(500, "该提货信息操作已发货!", 500);
         }
         ResponseJson rj = ResponseJson.getSUCCESS();
         ApprovalApplyPick approvalApplyPick = new ApprovalApplyPick();
         approvalApplyPick.setApplyPickStruts(2);
         approvalApplyPick.setApplyPickId(applyPickId);
-//        approvalApplyPick.(applyPickCertificate);
+        approvalApplyPick.setApplyPickShipCertificate(applyPickShipCertificate);
+        approvalApplyPick.setApplyPickShipWay(applyPickShipWay);
         Integer flag = applyPickService.update(approvalApplyPick);
         if(flag < 1){
-            return new ResponseJson(500, "FAILURE", 500);
+            return new ResponseJson(500, "发货失败", 500);
         }
         return rj;
     }

+ 1 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/wechat/TestController.java

@@ -14,7 +14,7 @@ public class TestController {
 
     @ResponseBody
     @RequestMapping(value = "/test")
-    public ResponseJson updateApplyPick(HttpServletRequest request
+    public ResponseJson test(HttpServletRequest request
             ) throws Exception {
 
         String openId = WechatUtils.getUserBySession(request).getUserOpenid();