浏览代码

rms收货客户

zhouzh 3 年之前
父节点
当前提交
322581fef0

+ 1 - 1
pom.xml

@@ -111,7 +111,7 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-                        <param>RMS_PERSONNEL</param>
+                        <param>RMS_CONSIGNEE</param>
                     </tables>
                 </configuration>
                 <executions>

+ 9 - 0
src/main/java/com/steerinfo/dil/controller/RmsConsigneeController.java

@@ -142,4 +142,13 @@ public class RmsConsigneeController extends BaseRESTfulController {
         return success(list);
     }
 
+    /*
+    *边输边查收货客户父节点
+    * */
+    @ApiOperation(value = "边输边查收货客户父节点")
+    @PostMapping(value = "getConsigneeFarId")
+    public RESTfulResult getConsigneeFarId(@RequestParam(value ="state") String state){
+        List<Map<String,Object>> result=rmsConsigneeService.getConsigneeFarId(state);
+        return success(result);
+    }
 }

+ 2 - 0
src/main/java/com/steerinfo/dil/mapper/RmsConsigneeMapper.java

@@ -19,4 +19,6 @@ public interface RmsConsigneeMapper extends IBaseMapper<RmsConsignee, BigDecimal
     List<Map<String, Object>> getConsigneeById(BigDecimal id);
 
     int getConsigneeByCompanyName(String companyName);
+
+    List<Map<String, Object>> getConsigneeFarId(String state);
 }

+ 14 - 0
src/main/java/com/steerinfo/dil/model/RmsConsignee.java

@@ -123,8 +123,22 @@ public class RmsConsignee implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="收货客户编码",required=false)
     private String consigneeCode;
 
+    /**
+     * 收货单位父节点ID(CONSIGNEE_FAR_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="收货单位父节点ID",required=false)
+    private BigDecimal consigneeFarId;
+
     private static final long serialVersionUID = 1L;
 
+    public BigDecimal getConsigneeFarId() {
+        return consigneeFarId;
+    }
+
+    public void setConsigneeFarId(BigDecimal consigneeFarId) {
+        this.consigneeFarId = consigneeFarId;
+    }
+
     @Override
     public BigDecimal getId() {
         return this.consigneeId;

+ 2 - 0
src/main/java/com/steerinfo/dil/service/IRmsConsigneeService.java

@@ -32,4 +32,6 @@ public interface IRmsConsigneeService{
     int deleteConsignee(BigDecimal id);
 
     List<Map<String, Object>> getConsigneeById(BigDecimal id);
+
+    List<Map<String, Object>> getConsigneeFarId(String state);
 }

+ 17 - 0
src/main/java/com/steerinfo/dil/service/impl/RmsConsigneeServiceImpl.java

@@ -58,6 +58,9 @@ public class RmsConsigneeServiceImpl implements IRmsConsigneeService {
         Date time = simpleDateFormat.parse(consigneeRegistrationTime);
         String consigneeContactName=(String) mapVal.get("consigneeContactName");
         String consigneeContactTel=(String)mapVal.get("consigneeContactTel");
+        //收货客户父节点
+        BigDecimal consigneeFarId=DataChange.dataToBigDecimal(mapVal.get("consigneeFarId"));
+
         int i=0;
         int rmsConsignees=rmsConsigneeMapper.getConsigneeByCompanyName(companyName);
         RmsConsignee rmsConsignee=new RmsConsignee();
@@ -69,6 +72,7 @@ public class RmsConsigneeServiceImpl implements IRmsConsigneeService {
             rmsConsignee.setConsigneeRegistrationTime(time);
             rmsConsignee.setConsigneeContactName(consigneeContactName);
             rmsConsignee.setConsigneeContactTel(consigneeContactTel);
+            rmsConsignee.setConsigneeFarId(consigneeFarId);
             rmsConsignee.setDeleted(new BigDecimal(0));
             rmsConsignee.setInsertTime(new Date());
             rmsConsignee.setInsertUsername("admin");
@@ -97,6 +101,8 @@ public class RmsConsigneeServiceImpl implements IRmsConsigneeService {
         Date time = simpleDateFormat.parse(consigneeRegistrationTime);
         String consigneeContactName=(String) mapVal.get("consigneeContactName");
         String consigneeContactTel=(String)mapVal.get("consigneeContactTel");
+        //收货客户父节点
+        BigDecimal consigneeFarId=DataChange.dataToBigDecimal(mapVal.get("consigneeFarId"));
         RmsConsignee rmsConsignee=new RmsConsignee();
         rmsConsignee.setConsigneeId(consigneeId);
         rmsConsignee.setConsigneeCompanyName(companyName);
@@ -106,6 +112,7 @@ public class RmsConsigneeServiceImpl implements IRmsConsigneeService {
         rmsConsignee.setConsigneeRegistrationTime(time);
         rmsConsignee.setConsigneeContactName(consigneeContactName);
         rmsConsignee.setConsigneeContactTel(consigneeContactTel);
+        rmsConsignee.setConsigneeFarId(consigneeFarId);
         rmsConsignee.setUpdateTime(new Date());
         rmsConsignee.setUpdateUsername("admin");
         return rmsConsigneeMapper.updateByPrimaryKeySelective(rmsConsignee);
@@ -132,4 +139,14 @@ public class RmsConsigneeServiceImpl implements IRmsConsigneeService {
         return rmsConsigneeMapper.getConsigneeById(id);
     }
 
+
+    /*
+    * 边输边查收货单位父节点
+    * */
+    @Override
+    public List<Map<String, Object>> getConsigneeFarId(String state) {
+        state = "%"+state+"%";
+        return rmsConsigneeMapper.getConsigneeFarId(state);
+    }
+
 }

+ 111 - 78
src/main/resources/com/steerinfo/dil/mapper/RmsConsigneeMapper.xml

@@ -21,20 +21,22 @@
     <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
     <result column="EAS_CONSIGNEE_ID" jdbcType="VARCHAR" property="easConsigneeId" />
     <result column="CONSIGNEE_CODE" jdbcType="VARCHAR" property="consigneeCode" />
+    <result column="CONSIGNEE_FAR_ID" jdbcType="DECIMAL" property="consigneeFarId" />
   </resultMap>
   <sql id="columns">
     CONSIGNEE_ID, CONSIGNEE_COMPANY_NAME, CONSIGNEE_ABBREVIATION, CONSIGNEE_REGISTERED_ADDRESS, 
     CONSIGNEE_RECEIVE_ADDRESS, CONSIGNEE_REGISTRATION_TIME, CONSIGNEE_CONTACT_NAME, CONSIGNEE_WARRANTY_AMOUNT, 
     CONSIGNEE_WARRANTY_WEIGHT, CONSIGNEE_CONTACT_TEL, CONSIGNEE_EXCHANGE_DELIVERY, INSERT_USERNAME, 
     INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, EAS_CONSIGNEE_ID, 
-    CONSIGNEE_CODE
+    CONSIGNEE_CODE, CONSIGNEE_FAR_ID
   </sql>
   <sql id="columns_alias">
     t.CONSIGNEE_ID, t.CONSIGNEE_COMPANY_NAME, t.CONSIGNEE_ABBREVIATION, t.CONSIGNEE_REGISTERED_ADDRESS, 
     t.CONSIGNEE_RECEIVE_ADDRESS, t.CONSIGNEE_REGISTRATION_TIME, t.CONSIGNEE_CONTACT_NAME, 
     t.CONSIGNEE_WARRANTY_AMOUNT, t.CONSIGNEE_WARRANTY_WEIGHT, t.CONSIGNEE_CONTACT_TEL, 
     t.CONSIGNEE_EXCHANGE_DELIVERY, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, 
-    t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.EAS_CONSIGNEE_ID, t.CONSIGNEE_CODE
+    t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.EAS_CONSIGNEE_ID, t.CONSIGNEE_CODE, 
+    t.CONSIGNEE_FAR_ID
   </sql>
   <sql id="select">
     SELECT <include refid="columns" /> FROM RMS_CONSIGNEE
@@ -101,6 +103,9 @@
       <if test="consigneeCode != null and consigneeCode != ''">
         and CONSIGNEE_CODE = #{consigneeCode}
       </if>
+      <if test="consigneeFarId != null">
+        and CONSIGNEE_FAR_ID = #{consigneeFarId}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
@@ -162,6 +167,9 @@
       <if test="consigneeCode != null and consigneeCode != ''">
         and CONSIGNEE_CODE LIKE '%${consigneeCode}%'
       </if>
+      <if test="consigneeFarId != null">
+        and CONSIGNEE_FAR_ID = #{consigneeFarId}
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
@@ -225,6 +233,9 @@
       <if test="consigneeCode != null and consigneeCode != ''">
         or CONSIGNEE_CODE = #{consigneeCode}
       </if>
+      <if test="consigneeFarId != null">
+        or CONSIGNEE_FAR_ID = #{consigneeFarId}
+      </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.dil.model.RmsConsignee">
     insert into RMS_CONSIGNEE (CONSIGNEE_ID, CONSIGNEE_COMPANY_NAME, 
@@ -235,7 +246,7 @@
       CONSIGNEE_EXCHANGE_DELIVERY, INSERT_USERNAME, 
       INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, 
       INSERT_UPDATE_REMARK, DELETED, EAS_CONSIGNEE_ID, 
-      CONSIGNEE_CODE)
+      CONSIGNEE_CODE, CONSIGNEE_FAR_ID)
     values (#{consigneeId,jdbcType=DECIMAL}, #{consigneeCompanyName,jdbcType=VARCHAR}, 
       #{consigneeAbbreviation,jdbcType=VARCHAR}, #{consigneeRegisteredAddress,jdbcType=VARCHAR}, 
       #{consigneeReceiveAddress,jdbcType=VARCHAR}, #{consigneeRegistrationTime,jdbcType=TIMESTAMP}, 
@@ -244,7 +255,7 @@
       #{consigneeExchangeDelivery,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, 
       #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
       #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}, #{easConsigneeId,jdbcType=VARCHAR}, 
-      #{consigneeCode,jdbcType=VARCHAR})
+      #{consigneeCode,jdbcType=VARCHAR}, #{consigneeFarId,jdbcType=DECIMAL})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsConsignee">
     insert into RMS_CONSIGNEE
@@ -306,6 +317,9 @@
       <if test="consigneeCode != null">
         CONSIGNEE_CODE,
       </if>
+      <if test="consigneeFarId != null">
+        CONSIGNEE_FAR_ID,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="consigneeId != null">
@@ -365,6 +379,9 @@
       <if test="consigneeCode != null">
         #{consigneeCode,jdbcType=VARCHAR},
       </if>
+      <if test="consigneeFarId != null">
+        #{consigneeFarId,jdbcType=DECIMAL},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsConsignee">
@@ -386,7 +403,8 @@
       INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
       DELETED = #{deleted,jdbcType=DECIMAL},
       EAS_CONSIGNEE_ID = #{easConsigneeId,jdbcType=VARCHAR},
-      CONSIGNEE_CODE = #{consigneeCode,jdbcType=VARCHAR}
+      CONSIGNEE_CODE = #{consigneeCode,jdbcType=VARCHAR},
+      CONSIGNEE_FAR_ID = #{consigneeFarId,jdbcType=DECIMAL}
     where CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsConsignee">
@@ -446,10 +464,13 @@
       <if test="consigneeCode != null">
         CONSIGNEE_CODE = #{consigneeCode,jdbcType=VARCHAR},
       </if>
+      <if test="consigneeFarId != null">
+        CONSIGNEE_FAR_ID = #{consigneeFarId,jdbcType=DECIMAL},
+      </if>
     </set>
     where CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL}
   </update>
-  <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <include refid="select" />
     where CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL}
   </select>
@@ -472,8 +493,8 @@
       INSERT_USERNAME, INSERT_TIME, 
       UPDATE_USERNAME, UPDATE_TIME, 
       INSERT_UPDATE_REMARK, DELETED, 
-      EAS_CONSIGNEE_ID, CONSIGNEE_CODE
-      )
+      EAS_CONSIGNEE_ID, CONSIGNEE_CODE, 
+      CONSIGNEE_FAR_ID)
     ( <foreach collection="list" item="item" separator="union all"> 
    select  
       #{item.consigneeId,jdbcType=DECIMAL}, 
@@ -485,8 +506,8 @@
       #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP}, 
       #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
       #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL}, 
-      #{item.easConsigneeId,jdbcType=VARCHAR}, #{item.consigneeCode,jdbcType=VARCHAR}
-       from dual  
+      #{item.easConsigneeId,jdbcType=VARCHAR}, #{item.consigneeCode,jdbcType=VARCHAR}, 
+      #{item.consigneeFarId,jdbcType=DECIMAL} from dual  
    </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
@@ -568,6 +589,10 @@
        <foreach close="end" collection="list" index="index" item="item" open="case CONSIGNEE_ID" separator=" ">
           when #{item.consigneeId,jdbcType=DECIMAL} then #{item.consigneeCode,jdbcType=VARCHAR}
        </foreach>
+       ,CONSIGNEE_FAR_ID=
+       <foreach close="end" collection="list" index="index" item="item" open="case CONSIGNEE_ID" separator=" ">
+          when #{item.consigneeId,jdbcType=DECIMAL} then #{item.consigneeFarId,jdbcType=DECIMAL}
+       </foreach>
      where CONSIGNEE_ID in 
      <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
     #{item.consigneeId,jdbcType=DECIMAL}
@@ -582,76 +607,76 @@
   </delete>
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <select id="getConsigneeList" parameterType="java.util.Map" resultType="java.util.Map">
-   SELECT *
-   FROM (
-   SELECT
-      RC.CONSIGNEE_ID AS "consigneeId",
-      RC.CONSIGNEE_COMPANY_NAME AS "companyName",
-      RC.CONSIGNEE_ABBREVIATION AS "consigneeAbbreviation",
-      RC.CONSIGNEE_REGISTERED_ADDRESS AS "consigneeRegisteredAddress",
-      RC.CONSIGNEE_RECEIVE_ADDRESS AS "consigneeReceiveAddress",
-      RC.CONSIGNEE_REGISTRATION_TIME AS "consigneeRegistrationTime",
-      RC.CONSIGNEE_CONTACT_NAME AS "consigneeContactName",
-      RC.CONSIGNEE_CONTACT_TEL AS "consigneeContactTel"
-   FROM RMS_CONSIGNEE RC
-   WHERE RC.DELETED!=1
-   ORDER BY RC.INSERT_TIME DESC
-   )
-   WHERE rownum &lt; 100
-   <where>
-   <if test="companyName!= null">
-     and
-     <foreach collection="companyName" item="item" open="(" separator="," close=")">
-       "companyName" in #{item}
-     </foreach>
-   </if>
-   <if test="consigneeAbbreviation!= null">
-     and
-     <foreach collection="consigneeAbbreviation" item="item" open="(" separator="," close=")">
-       "consigneeAbbreviation" in #{item}
-     </foreach>
-   </if>
-   <if test="consigneeRegisteredAddress!= null">
-     and
-     <foreach collection="consigneeRegisteredAddress" item="item" open="(" separator="," close=")">
-       "consigneeRegisteredAddress" in #{item}
-     </foreach>
-   </if>
-   <if test="consigneeReceiveAddress= null">
-     and
-     <foreach collection="consigneeReceiveAddress" item="item" open="(" separator="," close=")">
-       "consigneeReceiveAddress" in #{item}
-     </foreach>
-   </if>
-   <if test="consigneeRegistrationTime!= null">
-     and
-     <foreach collection="consigneeRegistrationTime" item="item" open="(" separator="," close=")">
-       "consigneeRegistrationTime" in #{item}
-     </foreach>
-   </if>
-   <if test="consigneeContactName!= null">
-     and
-     <foreach collection="consigneeContactName" item="item" open="(" separator="," close=")">
-       "consigneeContactName" in #{item}
-     </foreach>
-   </if>
-   <if test="consigneeContactTel!= null">
-     and
-     <foreach collection="consigneeContactTel" item="item" open="(" separator="," close=")">
-       "consigneeContactTel" in #{item}
-     </foreach>
-   </if>
-   </where>
-   <include refid="orderBy"></include>
- </select>
+  <select id="getConsigneeList" parameterType="java.util.Map" resultType="java.util.Map">
+    SELECT *
+    FROM (
+    SELECT
+    RC.CONSIGNEE_ID AS "consigneeId",
+    RC.CONSIGNEE_COMPANY_NAME AS "companyName",
+    RC.CONSIGNEE_ABBREVIATION AS "consigneeAbbreviation",
+    RC.CONSIGNEE_REGISTERED_ADDRESS AS "consigneeRegisteredAddress",
+    RC.CONSIGNEE_RECEIVE_ADDRESS AS "consigneeReceiveAddress",
+    RC.CONSIGNEE_REGISTRATION_TIME AS "consigneeRegistrationTime",
+    RC.CONSIGNEE_CONTACT_NAME AS "consigneeContactName",
+    RC.CONSIGNEE_CONTACT_TEL AS "consigneeContactTel"
+    FROM RMS_CONSIGNEE RC
+    WHERE RC.DELETED!=1
+    ORDER BY RC.INSERT_TIME DESC
+    )
+    WHERE rownum &lt; 100
+    <where>
+      <if test="companyName!= null">
+        and
+        <foreach collection="companyName" item="item" open="(" separator="," close=")">
+          "companyName" in #{item}
+        </foreach>
+      </if>
+      <if test="consigneeAbbreviation!= null">
+        and
+        <foreach collection="consigneeAbbreviation" item="item" open="(" separator="," close=")">
+          "consigneeAbbreviation" in #{item}
+        </foreach>
+      </if>
+      <if test="consigneeRegisteredAddress!= null">
+        and
+        <foreach collection="consigneeRegisteredAddress" item="item" open="(" separator="," close=")">
+          "consigneeRegisteredAddress" in #{item}
+        </foreach>
+      </if>
+      <if test="consigneeReceiveAddress= null">
+        and
+        <foreach collection="consigneeReceiveAddress" item="item" open="(" separator="," close=")">
+          "consigneeReceiveAddress" in #{item}
+        </foreach>
+      </if>
+      <if test="consigneeRegistrationTime!= null">
+        and
+        <foreach collection="consigneeRegistrationTime" item="item" open="(" separator="," close=")">
+          "consigneeRegistrationTime" in #{item}
+        </foreach>
+      </if>
+      <if test="consigneeContactName!= null">
+        and
+        <foreach collection="consigneeContactName" item="item" open="(" separator="," close=")">
+          "consigneeContactName" in #{item}
+        </foreach>
+      </if>
+      <if test="consigneeContactTel!= null">
+        and
+        <foreach collection="consigneeContactTel" item="item" open="(" separator="," close=")">
+          "consigneeContactTel" in #{item}
+        </foreach>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+  </select>
   <sql id="orderBy">
-  <if test="orderField!=null and orderField !=''">
-    order by "${orderField}"
-    <if test="orderType !=null and orderType !=''">
-      ${orderType}
+    <if test="orderField!=null and orderField !=''">
+      order by "${orderField}"
+      <if test="orderType !=null and orderType !=''">
+        ${orderType}
+      </if>
     </if>
-  </if>
   </sql>
 
 
@@ -680,4 +705,12 @@
     and RC.DELETED!=1
   </select>
 
+  <select id="getConsigneeFarId"  resultType="java.util.Map" parameterType="java.lang.String">
+    select
+        RC.CONSIGNEE_FAR_ID as "consigneeFarId",
+        RC.CONSIGNEE_COMPANY_NAME as "consigneeCompanyName"
+    from RMS_CONSIGNEE RC
+    where RC.CONSIGNEE_FAR_ID=RC.CONSIGNEE_ID
+    and RC.CONSIGNEE_COMPANY_NAME like #{state}
+  </select>
 </mapper>