Quellcode durchsuchen

Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent

# Conflicts:
#	watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/sales_order_list.ftl
wangxiaoming vor 6 Jahren
Ursprung
Commit
4bfb76a1dc

+ 10 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/approval/ApprovalApplyPick.java

@@ -17,6 +17,8 @@ public class ApprovalApplyPick implements Serializable {
     private Integer applyPickId;
     //审批订单信息id
     private Integer approvalId;
+    //绑定生产审批id
+    private Integer productionApprovalId;
     //申请人id
     private Integer adminId;
     //姓名
@@ -127,4 +129,12 @@ public class ApprovalApplyPick implements Serializable {
     public void setListApplyPickItem(List<ApprovalApplyPickItem> listApplyPickItem) {
         this.listApplyPickItem = listApplyPickItem;
     }
+
+    public Integer getProductionApprovalId() {
+        return productionApprovalId;
+    }
+
+    public void setProductionApprovalId(Integer productionApprovalId) {
+        this.productionApprovalId = productionApprovalId;
+    }
 }

+ 21 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/approval/ApprovalProductionService.java

@@ -0,0 +1,21 @@
+package com.iamberry.rst.faces.approval;
+
+import com.iamberry.rst.core.approval.ApprovalProduction;
+
+import java.util.List;
+
+public interface ApprovalProductionService {
+    /**
+     * 获取集合
+     * @param  approvalProduction
+     * @return List
+     */
+    List<ApprovalProduction> getApprovalProductionList(ApprovalProduction  approvalProduction);
+
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  approvalProduction
+     */
+    ApprovalProduction  getApprovalProductionById(Integer  id);
+}

+ 14 - 14
watero-rst-service/src/main/java/com/iamberry/rst/service/approval/ApplyPickServiceImpl.java

@@ -70,20 +70,6 @@ public class ApplyPickServiceImpl  implements ApplyPickService {
     @Transactional
     public  Integer  save(ApprovalApplyPick  approvalApplyPick, String openid, Map<String, Object> tasknfo,List<ApprovalProductionContract> approvalProductionContractList){
         Admin admin = sysMapper.getByOpenid(openid);
-        approvalApplyPick.setAdminId(admin.getAdminId());
-
-        Integer flag = applyPickMapper.save(approvalApplyPick);
-        if(flag < 1){
-            throw new RuntimeException("添加提货失败");
-        }
-        for (ApprovalApplyPickItem approvalApplyPickItem:approvalApplyPick.getListApplyPickItem()) {
-            approvalApplyPickItem.setApplyPickId(approvalApplyPick.getApplyPickId());
-        }
-        flag = applyPickItemMapper.saveList(approvalApplyPick.getListApplyPickItem());
-        if(flag < 1){
-            throw new RuntimeException("添加提货项失败");
-        }
-
         //添加审批信息
         ApprovalInfo approvalInfo = new ApprovalInfo();
         approvalInfo.setApprovalName(admin.getAdminName()+"的提货订单");
@@ -99,6 +85,20 @@ public class ApplyPickServiceImpl  implements ApplyPickService {
             throw new RuntimeException("添加审批信息失败");
         }
 
+        approvalApplyPick.setApprovalId(approvalInfo.getApprovalId());
+        approvalApplyPick.setAdminId(admin.getAdminId());
+        Integer flag = applyPickMapper.save(approvalApplyPick);
+        if(flag < 1){
+            throw new RuntimeException("添加提货失败");
+        }
+        for (ApprovalApplyPickItem approvalApplyPickItem:approvalApplyPick.getListApplyPickItem()) {
+            approvalApplyPickItem.setApplyPickId(approvalApplyPick.getApplyPickId());
+        }
+        flag = applyPickItemMapper.saveList(approvalApplyPick.getListApplyPickItem());
+        if(flag < 1){
+            throw new RuntimeException("添加提货项失败");
+        }
+
         for (ApprovalProductionContract apc:approvalProductionContractList) {
             apc.setApprovalId(approvalInfo.getApprovalId());
             apc.setContractName(admin.getAdminName()+"的提货订单");

+ 37 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/approval/ApprovalProductionServiceImpl.java

@@ -0,0 +1,37 @@
+package com.iamberry.rst.service.approval;
+import com.iamberry.rst.core.approval.ApprovalProduction;
+import com.iamberry.rst.faces.approval.ApprovalProductionService;
+import com.iamberry.rst.service.approval.mapper.ApprovalProductionMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ *  接口
+ * @author
+ * @Date 2018-10-23
+ */
+@Service
+public class ApprovalProductionServiceImpl  implements ApprovalProductionService {
+    @Autowired
+    private ApprovalProductionMapper approvalProductionMapper;
+    /**
+     * 获取集合
+     * @param  approvalProduction
+     * @return List
+     */
+    @Override
+    public List<ApprovalProduction> getApprovalProductionList(ApprovalProduction  approvalProduction){
+        return  approvalProductionMapper.getApprovalProductionList(approvalProduction);
+    }
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  approvalProduction
+     */
+    @Override
+    public  ApprovalProduction  getApprovalProductionById(Integer  id){
+        return  approvalProductionMapper.getApprovalProductionById(id);
+    }
+}

+ 25 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/approval/mapper/ApprovalProductionMapper.java

@@ -0,0 +1,25 @@
+package com.iamberry.rst.service.approval.mapper;
+
+import com.iamberry.rst.core.approval.ApprovalProduction;
+
+import java.util.List;
+
+/**
+ *  接口
+ * @author
+ * @Date 2018-10-23
+ */
+public interface ApprovalProductionMapper {
+    /**
+     * 获取集合
+     * @param  approvalProduction
+     * @return List
+     */
+    List<ApprovalProduction> getApprovalProductionList(ApprovalProduction  approvalProduction);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  approvalProduction
+     */
+    ApprovalProduction  getApprovalProductionById(Integer  id);
+}

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

@@ -5,6 +5,7 @@
     <sql    id="Base_List" >
         t.apply_pick_id,
         t.approval_id,
+        t.production_approval_id,
         t.admin_id,
         t.apply_pick_name,
         t.apply_pick_tel,
@@ -25,6 +26,9 @@
             <if test="approvalId != null ">
                 AND t.approval_id = #{approvalId}
             </if >
+            <if test="productionApprovalId != null ">
+                AND t.production_approval_id = #{productionApprovalId}
+            </if >
             <if test="adminId != null ">
                 AND t.admin_id = #{adminId}
             </if >
@@ -43,6 +47,7 @@
     <resultMap  id="BaseResultMap" type="ApprovalApplyPick" >
         <result    column="apply_pick_id"    property="applyPickId" />
         <result    column="approval_id"    property="approvalId" />
+        <result    column="production_approval_id"    property="productionApprovalId" />
         <result    column="admin_id"    property="adminId" />
         <result    column="apply_pick_name"    property="applyPickName" />
         <result    column="apply_pick_tel"    property="applyPickTel" />
@@ -79,6 +84,9 @@
             <if test="approvalId != null ">
                 AND t.approval_id = #{approvalId}
             </if >
+            <if test="productionApprovalId != null ">
+                AND t.production_approval_id = #{productionApprovalId}
+            </if >
             <if test="adminId != null ">
                 AND t.admin_id = #{adminId}
             </if >
@@ -113,6 +121,7 @@
         (
         apply_pick_id,
         approval_id,
+        production_approval_id,
         admin_id,
         apply_pick_name,
         apply_pick_tel,
@@ -124,6 +133,7 @@
         (
         #{applyPickId},
         #{approvalId},
+        #{productionApprovalId},
         #{adminId},
         #{applyPickName},
         #{applyPickTel},
@@ -139,6 +149,9 @@
             <if test="approvalId != null ">
                 approval_id = #{approvalId},
             </if >
+            <if test="productionApprovalId != null ">
+                production_approval_id = #{productionApprovalId}
+            </if >
             <if test="adminId != null ">
                 admin_id = #{adminId},
             </if >

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

@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.iamberry.rst.service.approval.mapper.ApprovalProductionMapper">
+    <resultMap  id="BaseResultMap" type="ApprovalProduction" >
+        <result    column="production_id"    property="productionId" />
+        <result    column="approval_id"    property="approvalId" />
+        <result    column="applicant_order_no"    property="applicantOrderNo" />
+        <result    column="applicant_name"    property="applicantName" />
+        <result    column="applicant_id"    property="applicantId" />
+        <result    column="order_name"    property="orderName" />
+        <result    column="company_name"    property="companyName" />
+        <result    column="contact_name"    property="contactName" />
+        <result    column="contact_tel"    property="contactTel" />
+        <result    column="production_delivery_date"    property="productionDeliveryDate" />
+        <result    column="production_delivery_way"    property="productionDeliveryWay" />
+        <result    column="production_delivery_desc"    property="productionDeliveryDesc" />
+        <result    column="production_state"    property="productionState" />
+        <result    column="production_packing_way"    property="productionPackingWay" />
+        <result    column="production_remark"    property="productionRemark" />
+        <result    column="production_create_time"    property="productionCreateTime" />
+        <result    column="production_update_time"    property="productionUpdateTime" />
+        <result    column="contract_name"    property="contractName" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.production_id,
+        t.approval_id,
+        t.applicant_order_no,
+        t.applicant_name,
+        t.applicant_id,
+        t.order_name,
+        t.company_name,
+        t.contact_name,
+        t.contact_tel,
+        t.production_delivery_date,
+        t.production_delivery_way,
+        t.production_delivery_desc,
+        t.production_state,
+        t.production_packing_way,
+        t.production_remark,
+        t.production_create_time,
+        t.production_update_time,
+        t.contract_name
+    </sql>
+    <select id="getApprovalProductionList" resultMap="BaseResultMap" parameterType="ApprovalProduction" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_approval_production t
+        <where>
+            <if test="productionId != null ">
+                AND t.production_id = #{productionId}
+            </if >
+            <if test="approvalId != null ">
+                AND t.approval_id = #{approvalId}
+            </if >
+            <if test="applicantOrderNo != null and applicantOrderNo != ''">
+                AND t.applicant_order_no = #{applicantOrderNo}
+            </if >
+            <if test="applicantName != null and applicantName != ''">
+                AND t.applicant_name  like  CONCAT ('%',#{applicantName},'%')
+            </if >
+            <if test="applicantId != null ">
+                AND t.applicant_id = #{applicantId}
+            </if >
+            <if test="orderName != null and orderName != ''">
+                AND t.order_name  like  CONCAT ('%',#{orderName},'%')
+            </if >
+            <if test="companyName != null and companyName != ''">
+                AND t.company_name  like  CONCAT ('%',#{companyName},'%')
+            </if >
+            <if test="contactName != null and contactName != ''">
+                AND t.contact_name  like  CONCAT ('%',#{contactName},'%')
+            </if >
+            <if test="contactTel != null and contactTel != ''">
+                AND t.contact_tel  like  CONCAT ('%',#{contactTel},'%')
+            </if >
+            <if test="productionDeliveryWay != null and productionDeliveryWay != ''">
+                AND t.production_delivery_way = #{productionDeliveryWay}
+            </if >
+            <if test="productionState != null and productionState != ''">
+                AND t.production_state = #{productionState}
+            </if >
+            <if test="contractName != null and contractName != ''">
+                AND t.contract_name  like  CONCAT ('%',#{contractName},'%')
+            </if >
+        </where>
+    </select>
+    <select id="getApprovalProductionById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_approval_production t
+        where t.production_id= #{productionId}
+    </select>
+</mapper>

+ 21 - 11
watero-rst-web/src/main/java/com/iamberry/rst/controllers/approval/ApplyPickController.java

@@ -1,18 +1,12 @@
 package com.iamberry.rst.controllers.approval;
 
-import com.iamberry.rst.core.approval.ApprovalApplyPick;
-import com.iamberry.rst.core.approval.ApprovalApplyPickItem;
-import com.iamberry.rst.core.approval.ApprovalInfo;
-import com.iamberry.rst.core.approval.ApprovalProductionContract;
+import com.iamberry.rst.core.approval.*;
 import com.iamberry.rst.core.cm.SendProdcue;
 import com.iamberry.rst.core.order.OrderBatch;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.sys.Admin;
-import com.iamberry.rst.faces.approval.ApplyPickItemService;
-import com.iamberry.rst.faces.approval.ApplyPickService;
-import com.iamberry.rst.faces.approval.ApprovalOrderService;
-import com.iamberry.rst.faces.approval.ApprovalTaskService;
+import com.iamberry.rst.faces.approval.*;
 import com.iamberry.rst.faces.sys.SysService;
 import com.iamberry.rst.service.approval.ApprovalProductionContractServiceImpl;
 import com.iamberry.rst.utils.StitchAttrUtil;
@@ -47,6 +41,8 @@ public class ApplyPickController {
     private ApprovalOrderService approvalOrderService;
     @Autowired
     private ApprovalProductionContractServiceImpl approvalProductionContractService;
+    @Autowired
+    private ApprovalProductionService approvalProductionService;
 
     /**
      * 获取已审批通过的订单
@@ -145,13 +141,13 @@ public class ApplyPickController {
             map.put("msg","电话号码为空");
             return map;
         }
-        if(approvalApplyPick.getApprovalId() == null || "".equals(approvalApplyPick.getApprovalId())){
+        if(approvalApplyPick.getProductionApprovalId() == null || "".equals(approvalApplyPick.getProductionApprovalId())){
             map.put("msg","未选择审批订单");
             return map;
         }else{
-            ApprovalInfo approvalInfo = approvalOrderService.getApprovalInfoById(approvalApplyPick.getApprovalId());
+            ApprovalInfo approvalInfo = approvalOrderService.getApprovalInfoById(approvalApplyPick.getProductionApprovalId());
             if(approvalInfo == null){
-                map.put("msg","审批订单信息id错误");
+                map.put("msg","选择生产审批订单id错误");
                 return map;
             }
         }
@@ -181,9 +177,23 @@ public class ApplyPickController {
         approvalProductionContract.setApprovalId(approvalApplyPick.getApprovalId());
         List<ApprovalProductionContract>  approvalProductionContractList = approvalProductionContractService.getApprovalProductionContractList(approvalProductionContract);
 
+        /*该提货所属的审批信息*/
+        ApprovalInfo approvalInfo = approvalOrderService.getApprovalInfoById(approvalApplyPick.getApprovalId());
+
+        /*绑定的生产审批信息*/
+        ApprovalInfo productionApprovalInfo = approvalOrderService.getApprovalInfoById(approvalApplyPick.getProductionApprovalId());
+
+        ApprovalProduction  ap = new ApprovalProduction();
+        ap.setApprovalId(productionApprovalInfo.getApprovalId());
+        List<ApprovalProduction> approvalProductionList = approvalProductionService.getApprovalProductionList(ap);
+
+//        approvalProductionService.get
+
         ResponseJson rj = ResponseJson.getSUCCESS();
         rj.addResponseKeyValue("approvalApplyPick",approvalApplyPick);
         rj.addResponseKeyValue("productionContractList",approvalProductionContractList);
+        rj.addResponseKeyValue("approvalInfo",approvalInfo);
+        rj.addResponseKeyValue("productionApprovalInfo",productionApprovalInfo);
         return rj;
     }
 

+ 1 - 0
watero-rst-web/src/main/resources/watero-rst-orm.xml

@@ -244,6 +244,7 @@
 		<mapper resource="com/iamberry/rst/service/approval/mapper/applyPickMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/approval/mapper/approvalOrderMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/approval/mapper/approvalProductionContractMapper.xml"/>
+		<mapper resource="com/iamberry/rst/service/approval/mapper/approvalProductionMapper.xml"/>
 
 		<!--member-->
 		<mapper resource="com/iamberry/rst/service/member/mapper/memberMapper.xml"/>