Kaynağa Gözat

'销售订单'

HUJIANGUO 3 yıl önce
ebeveyn
işleme
a6b707e7d8

+ 1 - 1
pom.xml

@@ -194,7 +194,7 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-                        <table>AMS_SALE_MATERIAL</table>
+                        <table>RMS_CONSIGNEE</table>
                     </tables>
                 </configuration>
                 <executions>

+ 64 - 3
src/main/java/com/steerinfo/dil/model/RmsConsignee.java

@@ -3,6 +3,7 @@ package com.steerinfo.dil.model;
 import com.steerinfo.framework.model.IBasePO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -51,7 +52,7 @@ public class RmsConsignee implements IBasePO<BigDecimal> {
     private String consigneeContactName;
 
     /**
-     * 质保书份数(CONSIGNEE_WARRANTY_AMOUNT,DECIMAL,38)
+     * 质保书份数(CONSIGNEE_WARRANTY_AMOUNT,DECIMAL,0)
      */
     @ApiModelProperty(value="质保书份数",required=false)
     private BigDecimal consigneeWarrantyAmount;
@@ -69,7 +70,7 @@ public class RmsConsignee implements IBasePO<BigDecimal> {
     private String consigneeContactTel;
 
     /**
-     * 换票送货单份数(CONSIGNEE_EXCHANGE_DELIVERY,DECIMAL,38)
+     * 换票送货单份数(CONSIGNEE_EXCHANGE_DELIVERY,DECIMAL,0)
      */
     @ApiModelProperty(value="换票送货单份数",required=false)
     private BigDecimal consigneeExchangeDelivery;
@@ -122,7 +123,31 @@ public class RmsConsignee implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="收货客户编码",required=false)
     private String consigneeCode;
 
-    private static final long serialVersionUID = 1L;
+    /**
+     * 收货单位父节点ID(CONSIGNEE_FAR_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="收货单位父节点ID",required=false)
+    private BigDecimal consigneeFarId;
+
+    /**
+     * 销售组ID(AREA_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="销售组ID",required=false)
+    private BigDecimal areaId;
+
+    /**
+     * SSO主键(CONSIGNEE_SSO_ID,VARCHAR,40)
+     */
+    @ApiModelProperty(value="SSO主键",required=false)
+    private String consigneeSsoId;
+
+    /**
+     * SSO账号(CONSIGNEE_SSO_CODE,VARCHAR,36)
+     */
+    @ApiModelProperty(value="SSO账号",required=false)
+    private String consigneeSsoCode;
+
+    private static final Long serialVersionUID = 1L;
 
     @Override
     public BigDecimal getId() {
@@ -286,6 +311,38 @@ public class RmsConsignee implements IBasePO<BigDecimal> {
         this.consigneeCode = consigneeCode == null ? null : consigneeCode.trim();
     }
 
+    public BigDecimal getConsigneeFarId() {
+        return consigneeFarId;
+    }
+
+    public void setConsigneeFarId(BigDecimal consigneeFarId) {
+        this.consigneeFarId = consigneeFarId;
+    }
+
+    public BigDecimal getAreaId() {
+        return areaId;
+    }
+
+    public void setAreaId(BigDecimal areaId) {
+        this.areaId = areaId;
+    }
+
+    public String getConsigneeSsoId() {
+        return consigneeSsoId;
+    }
+
+    public void setConsigneeSsoId(String consigneeSsoId) {
+        this.consigneeSsoId = consigneeSsoId == null ? null : consigneeSsoId.trim();
+    }
+
+    public String getConsigneeSsoCode() {
+        return consigneeSsoCode;
+    }
+
+    public void setConsigneeSsoCode(String consigneeSsoCode) {
+        this.consigneeSsoCode = consigneeSsoCode == null ? null : consigneeSsoCode.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -311,6 +368,10 @@ public class RmsConsignee implements IBasePO<BigDecimal> {
         sb.append(", deleted=").append(deleted);
         sb.append(", easConsigneeId=").append(easConsigneeId);
         sb.append(", consigneeCode=").append(consigneeCode);
+        sb.append(", consigneeFarId=").append(consigneeFarId);
+        sb.append(", areaId=").append(areaId);
+        sb.append(", consigneeSsoId=").append(consigneeSsoId);
+        sb.append(", consigneeSsoCode=").append(consigneeSsoCode);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 4 - 1
src/main/java/com/steerinfo/dil/service/impl/AmsSaleOrderServiceImpl.java

@@ -73,10 +73,13 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
             entry.put("taxRate",taxRate);
             entry.put("customer",customer);
             entry.replace("stEntryId",stEntryId.toString());
-            entry.replace("isPoundSale",isPoundSale.toString());
+            entry.put("isTheory",isPoundSale.toString());
             entry.replace("forChangdu", forChangdu == null ? "" : forChangdu.toString());
         }
         Map<String,Object> input = new HashMap<>();
+        head.remove("unitPrice");
+        head.remove("tax");
+        head.remove("customer");
         input.put("head",head);
         input.put("entries",entries);
         return input;

+ 3 - 5
src/main/java/com/steerinfo/dil/service/impl/RmsConsigneeServiceImpl.java

@@ -5,8 +5,6 @@ import com.steerinfo.dil.feign.TokenFeign;
 import com.steerinfo.dil.mapper.RmsConsigneeMapper;
 import com.steerinfo.dil.model.RmsConsignee;
 import com.steerinfo.dil.service.IRmsConsigneeService;
-import com.steerinfo.dil.util.HttpUtil;
-import feign.RequestTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -98,7 +96,6 @@ public class RmsConsigneeServiceImpl implements IRmsConsigneeService {
 //        String s = HttpUtil.doJsonPost("https://wl.dasteel.cn:32322/icore.icp.web/pass/v1/sysusers/", json, token);
         // 传formData格式--URL?参数&参数
         Map<String, Object> resultMap = ssoFeign.addUser("Bearer " + token,consigneeCompanyName, consigneeCompanyName, "shouhuokehu", "收货客户", "506514577756917769", "713710108567277568", "958023746726268928");
-        System.out.println(resultMap);
         // 赋权
         String code = (String) resultMap.get("code");
         String userId = null;
@@ -107,8 +104,9 @@ public class RmsConsigneeServiceImpl implements IRmsConsigneeService {
             userId = (String) userData.get("userId");
         }
         if (userId != null) {
-            Map<String, Object> rolesMap = ssoFeign.addUserroles("Bearer " + token,userId, consigneeCompanyName, "958038344527384576");
-            System.out.println(rolesMap);
+            ssoFeign.addUserroles("Bearer " + token,userId, consigneeCompanyName, "958038344527384576");
+            rmsConsignee.setConsigneeSsoId(userId);
+            rmsConsignee.setConsigneeSsoCode(consigneeCompanyName);
         }
         int result = 0;
         List<RmsConsignee> rmsRmsConsignees = rmsConsigneeMapper.selectByParameters(map);

+ 110 - 10
src/main/resources/com/steerinfo/dil/mapper/RmsConsigneeMapper.xml

@@ -21,20 +21,25 @@
     <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" />
+    <result column="AREA_ID" jdbcType="DECIMAL" property="areaId" />
+    <result column="CONSIGNEE_SSO_ID" jdbcType="VARCHAR" property="consigneeSsoId" />
+    <result column="CONSIGNEE_SSO_CODE" jdbcType="VARCHAR" property="consigneeSsoCode" />
   </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, AREA_ID, CONSIGNEE_SSO_ID, CONSIGNEE_SSO_CODE
   </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, t.AREA_ID, t.CONSIGNEE_SSO_ID, t.CONSIGNEE_SSO_CODE
   </sql>
   <sql id="select">
     SELECT <include refid="columns" /> FROM RMS_CONSIGNEE
@@ -101,6 +106,18 @@
       <if test="consigneeCode != null and consigneeCode != ''">
         and CONSIGNEE_CODE = #{consigneeCode}
       </if>
+      <if test="consigneeFarId != null">
+        and CONSIGNEE_FAR_ID = #{consigneeFarId}
+      </if>
+      <if test="areaId != null">
+        and AREA_ID = #{areaId}
+      </if>
+      <if test="consigneeSsoId != null and consigneeSsoId != ''">
+        and CONSIGNEE_SSO_ID = #{consigneeSsoId}
+      </if>
+      <if test="consigneeSsoCode != null and consigneeSsoCode != ''">
+        and CONSIGNEE_SSO_CODE = #{consigneeSsoCode}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
@@ -162,6 +179,18 @@
       <if test="consigneeCode != null and consigneeCode != ''">
         and CONSIGNEE_CODE LIKE '%${consigneeCode}%'
       </if>
+      <if test="consigneeFarId != null">
+        and CONSIGNEE_FAR_ID = #{consigneeFarId}
+      </if>
+      <if test="areaId != null">
+        and AREA_ID = #{areaId}
+      </if>
+      <if test="consigneeSsoId != null and consigneeSsoId != ''">
+        and CONSIGNEE_SSO_ID LIKE '%${consigneeSsoId}%'
+      </if>
+      <if test="consigneeSsoCode != null and consigneeSsoCode != ''">
+        and CONSIGNEE_SSO_CODE LIKE '%${consigneeSsoCode}%'
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
@@ -225,6 +254,18 @@
     <if test="consigneeCode != null and consigneeCode != ''">
       or CONSIGNEE_CODE = #{consigneeCode}
     </if>
+    <if test="consigneeFarId != null">
+      or CONSIGNEE_FAR_ID = #{consigneeFarId}
+    </if>
+    <if test="areaId != null">
+      or AREA_ID = #{areaId}
+    </if>
+    <if test="consigneeSsoId != null and consigneeSsoId != ''">
+      or CONSIGNEE_SSO_ID = #{consigneeSsoId}
+    </if>
+    <if test="consigneeSsoCode != null and consigneeSsoCode != ''">
+      or CONSIGNEE_SSO_CODE = #{consigneeSsoCode}
+    </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.dil.model.RmsConsignee">
     insert into RMS_CONSIGNEE (CONSIGNEE_ID, CONSIGNEE_COMPANY_NAME,
@@ -235,7 +276,8 @@
                                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, AREA_ID,
+                               CONSIGNEE_SSO_ID, CONSIGNEE_SSO_CODE)
     values (#{consigneeId,jdbcType=DECIMAL}, #{consigneeCompanyName,jdbcType=VARCHAR},
             #{consigneeAbbreviation,jdbcType=VARCHAR}, #{consigneeRegisteredAddress,jdbcType=VARCHAR},
             #{consigneeReceiveAddress,jdbcType=VARCHAR}, #{consigneeRegistrationTime,jdbcType=TIMESTAMP},
@@ -244,7 +286,8 @@
             #{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}, #{areaId,jdbcType=DECIMAL},
+            #{consigneeSsoId,jdbcType=VARCHAR}, #{consigneeSsoCode,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsConsignee">
     insert into RMS_CONSIGNEE
@@ -306,6 +349,18 @@
       <if test="consigneeCode != null">
         CONSIGNEE_CODE,
       </if>
+      <if test="consigneeFarId != null">
+        CONSIGNEE_FAR_ID,
+      </if>
+      <if test="areaId != null">
+        AREA_ID,
+      </if>
+      <if test="consigneeSsoId != null">
+        CONSIGNEE_SSO_ID,
+      </if>
+      <if test="consigneeSsoCode != null">
+        CONSIGNEE_SSO_CODE,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="consigneeId != null">
@@ -365,6 +420,18 @@
       <if test="consigneeCode != null">
         #{consigneeCode,jdbcType=VARCHAR},
       </if>
+      <if test="consigneeFarId != null">
+        #{consigneeFarId,jdbcType=DECIMAL},
+      </if>
+      <if test="areaId != null">
+        #{areaId,jdbcType=DECIMAL},
+      </if>
+      <if test="consigneeSsoId != null">
+        #{consigneeSsoId,jdbcType=VARCHAR},
+      </if>
+      <if test="consigneeSsoCode != null">
+        #{consigneeSsoCode,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsConsignee">
@@ -386,7 +453,11 @@
         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},
+        AREA_ID = #{areaId,jdbcType=DECIMAL},
+        CONSIGNEE_SSO_ID = #{consigneeSsoId,jdbcType=VARCHAR},
+        CONSIGNEE_SSO_CODE = #{consigneeSsoCode,jdbcType=VARCHAR}
     where CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsConsignee">
@@ -446,6 +517,18 @@
       <if test="consigneeCode != null">
         CONSIGNEE_CODE = #{consigneeCode,jdbcType=VARCHAR},
       </if>
+      <if test="consigneeFarId != null">
+        CONSIGNEE_FAR_ID = #{consigneeFarId,jdbcType=DECIMAL},
+      </if>
+      <if test="areaId != null">
+        AREA_ID = #{areaId,jdbcType=DECIMAL},
+      </if>
+      <if test="consigneeSsoId != null">
+        CONSIGNEE_SSO_ID = #{consigneeSsoId,jdbcType=VARCHAR},
+      </if>
+      <if test="consigneeSsoCode != null">
+        CONSIGNEE_SSO_CODE = #{consigneeSsoCode,jdbcType=VARCHAR},
+      </if>
     </set>
     where CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL}
   </update>
@@ -472,8 +555,9 @@
     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, AREA_ID, CONSIGNEE_SSO_ID,
+    CONSIGNEE_SSO_CODE)
     ( <foreach collection="list" item="item" separator="union all">
     select
     #{item.consigneeId,jdbcType=DECIMAL},
@@ -485,8 +569,9 @@
     #{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}, #{item.areaId,jdbcType=DECIMAL}, #{item.consigneeSsoId,jdbcType=VARCHAR},
+    #{item.consigneeSsoCode,jdbcType=VARCHAR} from dual
   </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
@@ -568,6 +653,22 @@
     <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>
+    ,AREA_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case CONSIGNEE_ID" separator=" ">
+      when #{item.consigneeId,jdbcType=DECIMAL} then #{item.areaId,jdbcType=DECIMAL}
+    </foreach>
+    ,CONSIGNEE_SSO_ID=
+    <foreach close="end" collection="list" index="index" item="item" open="case CONSIGNEE_ID" separator=" ">
+      when #{item.consigneeId,jdbcType=DECIMAL} then #{item.consigneeSsoId,jdbcType=VARCHAR}
+    </foreach>
+    ,CONSIGNEE_SSO_CODE=
+    <foreach close="end" collection="list" index="index" item="item" open="case CONSIGNEE_ID" separator=" ">
+      when #{item.consigneeId,jdbcType=DECIMAL} then #{item.consigneeSsoCode,jdbcType=VARCHAR}
+    </foreach>
     where CONSIGNEE_ID in
     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
       #{item.consigneeId,jdbcType=DECIMAL}
@@ -582,5 +683,4 @@
   </delete>
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-
 </mapper>