liyg 2 年之前
父节点
当前提交
c125b33ec1

+ 1 - 1
pom.xml

@@ -116,7 +116,7 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-<!--                        <param>BMSTRUCK_DETAILS_ORDER</param>&lt;!&ndash;运力&ndash;&gt;-->
+                        <param>BMSTRUCK_STATEMENT</param><!--运力-->
                     </tables>
                 </configuration>
                 <executions>

+ 16 - 1
src/main/java/com/steerinfo/dil/model/BmstruckStatement.java

@@ -123,11 +123,17 @@ public class BmstruckStatement implements IBasePO<BigDecimal> {
     private BigDecimal carrierId;
 
     /**
-     * 发票图片(PHOTO,VARCHAR,255)
+     * 发票图片(PHOTO,VARCHAR,700)
      */
     @ApiModelProperty(value="发票图片",required=false)
     private String photo;
 
+    /**
+     * 账单日期(STATEMENT_TIME,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="账单日期",required=false)
+    private Date statementTime;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -300,6 +306,14 @@ public class BmstruckStatement implements IBasePO<BigDecimal> {
         this.photo = photo == null ? null : photo.trim();
     }
 
+    public Date getStatementTime() {
+        return statementTime;
+    }
+
+    public void setStatementTime(Date statementTime) {
+        this.statementTime = statementTime;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -326,6 +340,7 @@ public class BmstruckStatement implements IBasePO<BigDecimal> {
         sb.append(", consigneeId=").append(consigneeId);
         sb.append(", carrierId=").append(carrierId);
         sb.append(", photo=").append(photo);
+        sb.append(", statementTime=").append(statementTime);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 2 - 9
src/main/java/com/steerinfo/dil/service/impl/BmstruckStatementServiceImpl.java

@@ -100,6 +100,8 @@ public class BmstruckStatementServiceImpl implements IBmstruckStatementService {
         bmstruckStatement.setConsigneeId(DataChange.dataToBigDecimal(companys.get(0).get("consigneeId")));
         bmstruckStatement.setCarrierId(DataChange.dataToBigDecimal(companys.get(0).get("carrierId")));
         bmstruckStatement.setStatementExcludTax(excludeTax.setScale(2,BigDecimal.ROUND_HALF_UP));
+        String statementTime=""+map.get("statementTime");
+        bmstruckStatement.setStatementTime(new Date(Long.parseLong(statementTime)));
         bmstruckStatement.setPhoto(url);
         // 汽运账单主键
         BigDecimal statementId = bmstruckStatementMapper.selectStatementId();
@@ -121,15 +123,6 @@ public class BmstruckStatementServiceImpl implements IBmstruckStatementService {
         //详单绑定账单ID
         map.put("statementId",statementId);
         bmstruckStatementMapper.batchUpdateDetails(map);
-//        // 调用金蝶接口
-//        List<Map<String, Object>> entries = joinApiFeign.getSaleDetailsOrder(statementId.intValue());
-//        Map<String,Object> head = joinApiFeign.getStatement(statementId.intValue());
-//        Map<String,Object> input = new HashMap<>();
-//        input.put("entries",entries);
-//        input.put("head",head);
-//        Map<String, Object> totalMap = easUtil.getTotalMap();
-//        totalMap.put("input",input);
-//        joinApiFeign.WSFaceWay(totalMap);
         return code;
     }
 

+ 50 - 16
src/main/resources/com/steerinfo/dil/mapper/BmstruckStatementMapper.xml

@@ -22,18 +22,19 @@
         <result column="CONSIGNEE_ID" jdbcType="DECIMAL" property="consigneeId" />
         <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
         <result column="PHOTO" jdbcType="VARCHAR" property="photo" />
+        <result column="STATEMENT_TIME" jdbcType="TIMESTAMP" property="statementTime" />
     </resultMap>
     <sql id="columns">
         STATEMENT_ID, STATEMENT_NUMBER, COST_ID, STATEMENT_PAYMENT_UNIT, STATEMENT_EXCLUD_TAX,
     STATEMENT_INCLUD_TAX, STATEMENT_REMARK, STATEMENT_SETTLEMENT_STATUS, INSERT_USERNAME,
     INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, STATEMENT_TYPE,
-    EAS_AMOUNT, SUM_AMOUNT, CAR_NUM, CONSIGNEE_ID, CARRIER_ID, PHOTO
+    EAS_AMOUNT, SUM_AMOUNT, CAR_NUM, CONSIGNEE_ID, CARRIER_ID, PHOTO, STATEMENT_TIME
     </sql>
     <sql id="columns_alias">
         t.STATEMENT_ID, t.STATEMENT_NUMBER, t.COST_ID, t.STATEMENT_PAYMENT_UNIT, t.STATEMENT_EXCLUD_TAX,
     t.STATEMENT_INCLUD_TAX, t.STATEMENT_REMARK, t.STATEMENT_SETTLEMENT_STATUS, t.INSERT_USERNAME,
     t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.STATEMENT_TYPE,
-    t.EAS_AMOUNT, t.SUM_AMOUNT, t.CAR_NUM, t.CONSIGNEE_ID, t.CARRIER_ID, t.PHOTO
+    t.EAS_AMOUNT, t.SUM_AMOUNT, t.CAR_NUM, t.CONSIGNEE_ID, t.CARRIER_ID, t.PHOTO, t.STATEMENT_TIME
     </sql>
     <sql id="select">
         SELECT <include refid="columns" /> FROM BMSTRUCK_STATEMENT
@@ -103,6 +104,9 @@
             <if test="photo != null and photo != ''">
                 and PHOTO = #{photo}
             </if>
+            <if test="statementTime != null">
+                and TO_CHAR(STATEMENT_TIME,'yyyy-MM-dd') = #{statementTime}
+            </if>
         </where>
     </sql>
     <sql id="whereLike">
@@ -167,6 +171,9 @@
             <if test="photo != null and photo != ''">
                 and PHOTO LIKE '%${photo}%'
             </if>
+            <if test="statementTime != null">
+                and TO_CHAR(STATEMENT_TIME,'yyyy-MM-dd') = #{statementTime}
+            </if>
         </where>
     </sql>
     <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
@@ -233,6 +240,9 @@
         <if test="photo != null and photo != ''">
             or PHOTO = #{photo}
         </if>
+        <if test="statementTime != null">
+            or TO_CHAR(STATEMENT_TIME,'yyyy-MM-dd') = '#{statementTime}'
+        </if>
     </delete>
     <insert id="insert" parameterType="com.steerinfo.dil.model.BmstruckStatement">
         insert into BMSTRUCK_STATEMENT (STATEMENT_ID, STATEMENT_NUMBER, COST_ID,
@@ -241,16 +251,16 @@
                                         INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
                                         UPDATE_TIME, INSERT_UPDATE_REMARK, STATEMENT_TYPE,
                                         EAS_AMOUNT, SUM_AMOUNT, CAR_NUM,
-                                        CONSIGNEE_ID, CARRIER_ID, PHOTO
-        )
+                                        CONSIGNEE_ID, CARRIER_ID, PHOTO,
+                                        STATEMENT_TIME)
         values (#{statementId,jdbcType=DECIMAL}, #{statementNumber,jdbcType=VARCHAR}, #{costId,jdbcType=DECIMAL},
                 #{statementPaymentUnit,jdbcType=VARCHAR}, #{statementExcludTax,jdbcType=DECIMAL},
                 #{statementIncludTax,jdbcType=DECIMAL}, #{statementRemark,jdbcType=VARCHAR}, #{statementSettlementStatus,jdbcType=VARCHAR},
                 #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
                 #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{statementType,jdbcType=DECIMAL},
                 #{easAmount,jdbcType=DECIMAL}, #{sumAmount,jdbcType=DECIMAL}, #{carNum,jdbcType=DECIMAL},
-                #{consigneeId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL}, #{photo,jdbcType=VARCHAR}
-               )
+                #{consigneeId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL}, #{photo,jdbcType=VARCHAR},
+                #{statementTime,jdbcType=TIMESTAMP})
     </insert>
     <insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmstruckStatement">
         insert into BMSTRUCK_STATEMENT
@@ -315,6 +325,9 @@
             <if test="photo != null">
                 PHOTO,
             </if>
+            <if test="statementTime != null">
+                STATEMENT_TIME,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="statementId != null">
@@ -377,6 +390,9 @@
             <if test="photo != null">
                 #{photo,jdbcType=VARCHAR},
             </if>
+            <if test="statementTime != null">
+                #{statementTime,jdbcType=TIMESTAMP},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.BmstruckStatement">
@@ -399,7 +415,8 @@
             CAR_NUM = #{carNum,jdbcType=DECIMAL},
             CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL},
             CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
-            PHOTO = #{photo,jdbcType=VARCHAR}
+            PHOTO = #{photo,jdbcType=VARCHAR},
+            STATEMENT_TIME = #{statementTime,jdbcType=TIMESTAMP}
         where STATEMENT_ID = #{statementId,jdbcType=DECIMAL}
     </update>
     <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.BmstruckStatement">
@@ -462,6 +479,9 @@
             <if test="photo != null">
                 PHOTO = #{photo,jdbcType=VARCHAR},
             </if>
+            <if test="statementTime != null">
+                STATEMENT_TIME = #{statementTime,jdbcType=TIMESTAMP},
+            </if>
         </set>
         where STATEMENT_ID = #{statementId,jdbcType=DECIMAL}
     </update>
@@ -487,8 +507,8 @@
         UPDATE_USERNAME, UPDATE_TIME,
         INSERT_UPDATE_REMARK, STATEMENT_TYPE,
         EAS_AMOUNT, SUM_AMOUNT, CAR_NUM,
-        CONSIGNEE_ID, CARRIER_ID, PHOTO
-        )
+        CONSIGNEE_ID, CARRIER_ID, PHOTO,
+        STATEMENT_TIME)
         ( <foreach collection="list" item="item" separator="union all">
         select
         #{item.statementId,jdbcType=DECIMAL},
@@ -499,8 +519,8 @@
         #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
         #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.statementType,jdbcType=DECIMAL},
         #{item.easAmount,jdbcType=DECIMAL}, #{item.sumAmount,jdbcType=DECIMAL}, #{item.carNum,jdbcType=DECIMAL},
-        #{item.consigneeId,jdbcType=DECIMAL}, #{item.carrierId,jdbcType=DECIMAL}, #{item.photo,jdbcType=VARCHAR}
-        from dual
+        #{item.consigneeId,jdbcType=DECIMAL}, #{item.carrierId,jdbcType=DECIMAL}, #{item.photo,jdbcType=VARCHAR},
+        #{item.statementTime,jdbcType=TIMESTAMP} from dual
     </foreach> )
     </insert>
     <update id="batchUpdate" parameterType="java.util.List">
@@ -586,6 +606,10 @@
         <foreach close="end" collection="list" index="index" item="item" open="case STATEMENT_ID" separator=" ">
             when #{item.statementId,jdbcType=DECIMAL} then #{item.photo,jdbcType=VARCHAR}
         </foreach>
+        ,STATEMENT_TIME=
+        <foreach close="end" collection="list" index="index" item="item" open="case STATEMENT_ID" separator=" ">
+            when #{item.statementId,jdbcType=DECIMAL} then #{item.statementTime,jdbcType=TIMESTAMP}
+        </foreach>
         where STATEMENT_ID in
         <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
             #{item.statementId,jdbcType=DECIMAL}
@@ -613,7 +637,7 @@
             BS.CAR_NUM "carNum",
             RC.CONSIGNEE_COMPANY_NAME "consigneeName",
             RCA.CARRIER_NAME "carrierName",
-            BS.INSERT_TIME "insertTime",
+            BS.STATEMENT_TIME "insertTime",
             BS.CONSIGNEE_ID "consigneeId",
             BS .CARRIER_ID "carrierId"
             FROM BMSTRUCK_STATEMENT BS
@@ -625,17 +649,17 @@
                     and SU.USER_ID=#{userId}
                 </if>
                 <if test="oneDate != null">
-                    and to_char(to_date(#{oneDate}, 'yyyy-mm-dd'),'yyyy-mm') = to_char(BS.INSERT_TIME,'yyyy-mm')
+                    and to_char(to_date(#{oneDate}, 'yyyy-mm-dd'),'yyyy-mm') = to_char(BS.STATEMENT_TIME,'yyyy-mm')
                 </if>
                 <if test="startDate != null">
-                    and to_date(#{startDate}, 'yyyy-mm-dd') &lt;=  to_date(to_char(BS.INSERT_TIME,'yyyy-mm-dd'),'yyyy-mm-dd')
-                    and to_date(#{endDate}, 'yyyy-mm-dd') >=  to_date(to_char(BS.INSERT_TIME,'yyyy-mm-dd'),'yyyy-mm-dd')
+                    and to_date(#{startDate}, 'yyyy-mm-dd') &lt;=  to_date(to_char(BS.STATEMENT_TIME,'yyyy-mm-dd'),'yyyy-mm-dd')
+                    and to_date(#{endDate}, 'yyyy-mm-dd') >=  to_date(to_char(BS.STATEMENT_TIME,'yyyy-mm-dd'),'yyyy-mm-dd')
                 </if>
             </where>
         )
         <where>
             <if test="con!= null and con!=''.toString()">
-                and "consigneeName" like CONCAT('%',CONCAT(#{con},'%'))
+                and "consigneeName" || "carrierName" like CONCAT('%',CONCAT(#{con},'%'))
             </if>
             <if test="consigneeName!= null">
                 and "consigneeName" in
@@ -890,6 +914,14 @@
         END)
         "carrierName",
         OO.ORDER_NUMBER "orderNo",
+        (CASE WHEN
+        ASM.SALE_MAKE_DATE IS NULL
+        THEN null
+        WHEN  ASM.IS_POUND_SALE = 0
+        THEN TWR.RESULT_NET_WEIGHT
+        WHEN ASM.IS_POUND_SALE = 1
+        THEN ASM.MATERIAL_WEIGHT
+        END) "materialAcWeight",
         TO_CHAR(ACTP.PRICE_VALUE,'9999999990.99') AS "priceValue",
         TO_CHAR(BDO.DETAILS_AMOUNT,'9999999990.99') "detailsAmount",
         case
@@ -955,6 +987,8 @@
         RRP.UNLOAD_TYPE "unloadType",
         --计划件数
         ASM.MATERIAL_PLAN_NUMBER "materialPlanNumber",
+        --操作人
+        OO.RECORD_USERNAME "recordUserName",
         --制单时间
         ASM.SALE_MAKE_DATE "saleMakeDate"
         FROM AMS_SALE_ORDER ASO