瀏覽代碼

添加卸货工人ID

txf 3 年之前
父節點
當前提交
c7b28114b6

+ 15 - 0
src/main/java/com/steerinfo/dil/model/TmstruckUnloadResult.java

@@ -111,6 +111,12 @@ public class TmstruckUnloadResult implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="物资ID",required=false)
     private BigDecimal materialId;
 
+    /**
+     * 卸货人(UNLOADER_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="卸货人",required=false)
+    private BigDecimal unloaderId;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -259,6 +265,14 @@ public class TmstruckUnloadResult implements IBasePO<BigDecimal> {
         this.materialId = materialId;
     }
 
+    public BigDecimal getUnloaderId() {
+        return unloaderId;
+    }
+
+    public void setUnloaderId(BigDecimal unloaderId) {
+        this.unloaderId = unloaderId;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -282,6 +296,7 @@ public class TmstruckUnloadResult implements IBasePO<BigDecimal> {
         sb.append(", resultUnloadPlaceId=").append(resultUnloadPlaceId);
         sb.append(", segmentSqe=").append(segmentSqe);
         sb.append(", materialId=").append(materialId);
+        sb.append(", unloaderId=").append(unloaderId);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 7 - 0
src/main/java/com/steerinfo/dil/service/impl/TmstruckUnloadResultServiceImpl.java

@@ -199,6 +199,13 @@ public class TmstruckUnloadResultServiceImpl implements ITmstruckUnloadResultSer
         if(map.get("warehouseId") != null){
             tmstruckUnloadResult.setResultUnloadPlaceId(DataChange.dataToBigDecimal(map.get("warehouseId")));
         }
+        if(map.get("personnelSsoId") != null){
+            //通过SSo主键查询人员管理主键
+            Integer personnelId = utilsMapper.getPersonnelIdBySsoId((String) map.get("personnelSsoId"));
+            if(personnelId != null){
+                tmstruckUnloadResult.setUnloaderId(new BigDecimal(personnelId));
+            }
+        }
         //判断物资id是否为空
         if (map.get("materialId") != null){
             tmstruckUnloadResult.setMaterialId(DataChange.dataToBigDecimal(map.get("materialId")));

+ 40 - 12
src/main/resources/com/steerinfo/dil/mapper/TmstruckUnloadResultMapper.xml

@@ -19,17 +19,18 @@
         <result column="RESULT_UNLOAD_PLACE_ID" jdbcType="DECIMAL" property="resultUnloadPlaceId" />
         <result column="SEGMENT_SQE" jdbcType="DECIMAL" property="segmentSqe" />
         <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
+        <result column="UNLOADER_ID" jdbcType="DECIMAL" property="unloaderId" />
     </resultMap>
     <sql id="columns">
-        RESULT_ID, RESULT_NUMBER, RESULT_TOTAL_ID, RESULT_START_TIME, RESULT_END_TIME, RESULT_DURATION,
-    UNLOAD_STATUS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
-    DELETE_NAME, DELETE_TIME, RESULT_UNLOAD_PLACE_ID, SEGMENT_SQE, MATERIAL_ID
+        RESULT_ID, RESULT_NUMBER, RESULT_TOTAL_ID, RESULT_START_TIME, RESULT_END_TIME, RESULT_DURATION, 
+    UNLOAD_STATUS, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, 
+    DELETE_NAME, DELETE_TIME, RESULT_UNLOAD_PLACE_ID, SEGMENT_SQE, MATERIAL_ID, UNLOADER_ID
     </sql>
     <sql id="columns_alias">
-        t.RESULT_ID, t.RESULT_NUMBER, t.RESULT_TOTAL_ID, t.RESULT_START_TIME, t.RESULT_END_TIME,
-    t.RESULT_DURATION, t.UNLOAD_STATUS, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
-    t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETE_NAME, t.DELETE_TIME, t.RESULT_UNLOAD_PLACE_ID,
-    t.SEGMENT_SQE, t.MATERIAL_ID
+        t.RESULT_ID, t.RESULT_NUMBER, t.RESULT_TOTAL_ID, t.RESULT_START_TIME, t.RESULT_END_TIME, 
+    t.RESULT_DURATION, t.UNLOAD_STATUS, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, 
+    t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETE_NAME, t.DELETE_TIME, t.RESULT_UNLOAD_PLACE_ID, 
+    t.SEGMENT_SQE, t.MATERIAL_ID, t.UNLOADER_ID
     </sql>
     <sql id="select">
         SELECT <include refid="columns" /> FROM TMSTRUCK_UNLOAD_RESULT
@@ -90,6 +91,9 @@
             <if test="materialId != null">
                 and MATERIAL_ID = #{materialId}
             </if>
+            <if test="unloaderId != null">
+                and UNLOADER_ID = #{unloaderId}
+            </if>
         </where>
     </sql>
     <sql id="whereLike">
@@ -145,6 +149,9 @@
             <if test="materialId != null">
                 and MATERIAL_ID = #{materialId}
             </if>
+            <if test="unloaderId != null">
+                and UNLOADER_ID = #{unloaderId}
+            </if>
         </where>
     </sql>
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
@@ -202,6 +209,9 @@
         <if test="materialId != null">
             or MATERIAL_ID = #{materialId}
         </if>
+        <if test="unloaderId != null">
+            or UNLOADER_ID = #{unloaderId}
+        </if>
     </delete>
     <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
         insert into TMSTRUCK_UNLOAD_RESULT (RESULT_ID, RESULT_NUMBER, RESULT_TOTAL_ID,
@@ -209,13 +219,15 @@
                                             UNLOAD_STATUS, INSERT_USERNAME, INSERT_TIME,
                                             UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
                                             DELETE_NAME, DELETE_TIME, RESULT_UNLOAD_PLACE_ID,
-                                            SEGMENT_SQE, MATERIAL_ID)
+                                            SEGMENT_SQE, MATERIAL_ID, UNLOADER_ID
+        )
         values (#{resultId,jdbcType=DECIMAL}, #{resultNumber,jdbcType=VARCHAR}, #{resultTotalId,jdbcType=DECIMAL},
                 #{resultStartTime,jdbcType=TIMESTAMP}, #{resultEndTime,jdbcType=TIMESTAMP}, #{resultDuration,jdbcType=DECIMAL},
                 #{unloadStatus,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
                 #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
                 #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{resultUnloadPlaceId,jdbcType=DECIMAL},
-                #{segmentSqe,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL})
+                #{segmentSqe,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{unloaderId,jdbcType=DECIMAL}
+               )
     </insert>
     <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
         insert into TMSTRUCK_UNLOAD_RESULT
@@ -271,6 +283,9 @@
             <if test="materialId != null">
                 MATERIAL_ID,
             </if>
+            <if test="unloaderId != null">
+                UNLOADER_ID,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="resultId != null">
@@ -324,6 +339,9 @@
             <if test="materialId != null">
                 #{materialId,jdbcType=DECIMAL},
             </if>
+            <if test="unloaderId != null">
+                #{unloaderId,jdbcType=DECIMAL},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
@@ -343,7 +361,8 @@
             DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
             RESULT_UNLOAD_PLACE_ID = #{resultUnloadPlaceId,jdbcType=DECIMAL},
             SEGMENT_SQE = #{segmentSqe,jdbcType=DECIMAL},
-            MATERIAL_ID = #{materialId,jdbcType=DECIMAL}
+            MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
+            UNLOADER_ID = #{unloaderId,jdbcType=DECIMAL}
         where RESULT_ID = #{resultId,jdbcType=DECIMAL}
     </update>
     <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckUnloadResult">
@@ -397,6 +416,9 @@
             <if test="materialId != null">
                 MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
             </if>
+            <if test="unloaderId != null">
+                UNLOADER_ID = #{unloaderId,jdbcType=DECIMAL},
+            </if>
         </set>
         where RESULT_ID = #{resultId,jdbcType=DECIMAL}
     </update>
@@ -422,7 +444,8 @@
         UPDATE_USERNAME, UPDATE_TIME,
         INSERT_UPDATE_REMARK, DELETE_NAME,
         DELETE_TIME, RESULT_UNLOAD_PLACE_ID,
-        SEGMENT_SQE, MATERIAL_ID)
+        SEGMENT_SQE, MATERIAL_ID, UNLOADER_ID
+        )
         ( <foreach collection="list" item="item" separator="union all">
         select
         #{item.resultId,jdbcType=DECIMAL},
@@ -433,7 +456,8 @@
         #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
         #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR},
         #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.resultUnloadPlaceId,jdbcType=DECIMAL},
-        #{item.segmentSqe,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL} from dual
+        #{item.segmentSqe,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL}, #{item.unloaderId,jdbcType=DECIMAL}
+        from dual
     </foreach> )
     </insert>
     <update id="batchUpdate" parameterType="java.util.List">
@@ -507,6 +531,10 @@
         <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
             when #{item.resultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
         </foreach>
+        ,UNLOADER_ID=
+        <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
+            when #{item.resultId,jdbcType=DECIMAL} then #{item.unloaderId,jdbcType=DECIMAL}
+        </foreach>
         where RESULT_ID in
         <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
             #{item.resultId,jdbcType=DECIMAL}