zelong.shao

customer|查询历史附件调整

Showing 14 changed files with 94 additions and 423 deletions
...@@ -5,8 +5,8 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo; ...@@ -5,8 +5,8 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
5 import com.fedex.connect.common.model.sys.User; 5 import com.fedex.connect.common.model.sys.User;
6 import com.fedex.connect.customer.controller.base.BaseController; 6 import com.fedex.connect.customer.controller.base.BaseController;
7 import com.fedex.connect.customer.controller.biz.IConsignmentQueryController; 7 import com.fedex.connect.customer.controller.biz.IConsignmentQueryController;
8 -import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
9 import com.fedex.connect.customer.data.query.ConsignmentQuery; 8 import com.fedex.connect.customer.data.query.ConsignmentQuery;
9 +import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
10 import io.swagger.annotations.Api; 10 import io.swagger.annotations.Api;
11 import io.swagger.annotations.ApiOperation; 11 import io.swagger.annotations.ApiOperation;
12 import io.swagger.annotations.ApiParam; 12 import io.swagger.annotations.ApiParam;
...@@ -36,7 +36,7 @@ public class ConsignmentQueryController extends BaseController implements IConsi ...@@ -36,7 +36,7 @@ public class ConsignmentQueryController extends BaseController implements IConsi
36 ConsignmentQuery query = ConsignmentQuery.dataProcessing(consignmentQuery); 36 ConsignmentQuery query = ConsignmentQuery.dataProcessing(consignmentQuery);
37 query.setUserId(user.getId()); 37 query.setUserId(user.getId());
38 query.setUuid(user.getUserUuid()); 38 query.setUuid(user.getUserUuid());
39 - return consignmentQueryService.findConsignments(query); 39 + return consignmentQueryService.findConsignments(query,user);
40 } 40 }
41 41
42 @Override 42 @Override
......
...@@ -5,7 +5,7 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo; ...@@ -5,7 +5,7 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
5 import com.fedex.connect.common.model.sys.User; 5 import com.fedex.connect.common.model.sys.User;
6 import com.fedex.connect.customer.controller.base.BaseController; 6 import com.fedex.connect.customer.controller.base.BaseController;
7 import com.fedex.connect.customer.controller.biz.IUploadRecordController; 7 import com.fedex.connect.customer.controller.biz.IUploadRecordController;
8 -import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; 8 +import com.fedex.connect.customer.data.query.AttachmentHistoryQuery;
9 import io.swagger.annotations.Api; 9 import io.swagger.annotations.Api;
10 import io.swagger.annotations.ApiOperation; 10 import io.swagger.annotations.ApiOperation;
11 import io.swagger.annotations.ApiParam; 11 import io.swagger.annotations.ApiParam;
...@@ -31,18 +31,15 @@ public class UploadRecordController extends BaseController implements IUploadRec ...@@ -31,18 +31,15 @@ public class UploadRecordController extends BaseController implements IUploadRec
31 @ApiOperation(value = "ResponseVo", notes = "运单历史上传记录查询") 31 @ApiOperation(value = "ResponseVo", notes = "运单历史上传记录查询")
32 @OperationMethodLog(describe = "business_log_20006") 32 @OperationMethodLog(describe = "business_log_20006")
33 public ResponseVo queryHistoryList(@ApiParam(value="运单ID",required = true) @PathVariable(value = "consignmentId") Long consignmentId) { 33 public ResponseVo queryHistoryList(@ApiParam(value="运单ID",required = true) @PathVariable(value = "consignmentId") Long consignmentId) {
34 + AttachmentHistoryQuery attachmentHistoryQuery = AttachmentHistoryQuery.getInstance(consignmentId);
34 /** 35 /**
35 * 运单id非空校验 36 * 运单id非空校验
36 */ 37 */
37 - consignmentInfoValidate.validateConsignmentId(consignmentId); 38 + consignmentInfoValidate.validateConsignmentId(attachmentHistoryQuery.getConsignmentId());
38 /** 39 /**
39 * 获取当前用户信息 40 * 获取当前用户信息
40 */ 41 */
41 User user = this.getCurrentUserInfo(); 42 User user = this.getCurrentUserInfo();
42 - /** 43 + return uploadRecordService.findHistory(attachmentHistoryQuery,user);
43 - * 构造查询对象
44 - */
45 - UserConsignmentInfoQuery userConsignmentInfoQuery = UserConsignmentInfoQuery.getInstance(user,consignmentId);
46 - return uploadRecordService.findHistory(userConsignmentInfoQuery);
47 } 44 }
48 } 45 }
......
1 +package com.fedex.connect.customer.data.query;
2 +
3 +import com.fedex.connect.customer.data.PageBase;
4 +import lombok.Data;
5 +/**
6 + * @Author Szl
7 + * @Description 类说明 用于运单的附件历史上传查询
8 + * @Date 2024/11/12
9 + */
10 +@Data
11 +public class AttachmentHistoryQuery extends PageBase {
12 +
13 + private Long consignmentId;
14 +
15 + /**
16 + * @Author Szl
17 + * @Description 功能说明 实例化查询对象
18 + * @Date 2024/11/12
19 + * @param consignmentId
20 + * @return com.fedex.connect.customer.data.query.AttachmentHistoryQuery
21 + */
22 + public static AttachmentHistoryQuery getInstance(Long consignmentId){
23 + AttachmentHistoryQuery attachmentHistoryQuery = new AttachmentHistoryQuery();
24 + attachmentHistoryQuery.setConsignmentId(consignmentId);
25 + attachmentHistoryQuery.setStart(attachmentHistoryQuery.getStart());
26 + return attachmentHistoryQuery;
27 + }
28 +}
...@@ -2,6 +2,7 @@ package com.fedex.connect.customer.repository.dao; ...@@ -2,6 +2,7 @@ package com.fedex.connect.customer.repository.dao;
2 2
3 import com.fedex.connect.common.model.biz.Attachment; 3 import com.fedex.connect.common.model.biz.Attachment;
4 import com.fedex.connect.customer.data.dto.AttachmentHistoryDto; 4 import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
5 +import com.fedex.connect.customer.data.query.AttachmentHistoryQuery;
5 import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; 6 import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
6 import org.apache.ibatis.annotations.Mapper; 7 import org.apache.ibatis.annotations.Mapper;
7 import org.apache.ibatis.annotations.Param; 8 import org.apache.ibatis.annotations.Param;
...@@ -11,7 +12,7 @@ import java.util.List; ...@@ -11,7 +12,7 @@ import java.util.List;
11 12
12 @Mapper 13 @Mapper
13 public interface AttachmentExtMapper { 14 public interface AttachmentExtMapper {
14 - List<AttachmentHistoryDto> findHistory(@Param("bizId") Long bizId); 15 + List<AttachmentHistoryDto> findHistory(AttachmentHistoryQuery attachmentHistoryQuery);
15 16
16 @Select("SELECT * FROM T_BIZ_ATTACHMENT WHERE UPLOAD_RECORD_ID = " + 17 @Select("SELECT * FROM T_BIZ_ATTACHMENT WHERE UPLOAD_RECORD_ID = " +
17 "(SELECT MAX(ID) FROM T_BIZ_UPLOAD_RECORD WHERE CREATE_USER_ID = #{query.userId} " + 18 "(SELECT MAX(ID) FROM T_BIZ_UPLOAD_RECORD WHERE CREATE_USER_ID = #{query.userId} " +
......
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.fedex.connect.customer.repository.dao.AttachmentExtMapper"> 3 <mapper namespace="com.fedex.connect.customer.repository.dao.AttachmentExtMapper">
4 - <resultMap id="BaseResultMap" type="com.fedex.connect.common.model.biz.Attachment"> 4 +
5 - <id column="ID" jdbcType="NUMERIC" property="id" />
6 - <result column="BIZ_ID" jdbcType="NUMERIC" property="bizId" />
7 - <result column="BIZ_TYPE_ID" jdbcType="NUMERIC" property="bizTypeId" />
8 - <result column="BIZ_TYPE_NAME" jdbcType="VARCHAR" property="bizTypeName" />
9 - <result column="SOURCE_FILE_NAME" jdbcType="VARCHAR" property="sourceFileName" />
10 - <result column="FILE_NAME" jdbcType="VARCHAR" property="fileName" />
11 - <result column="FILE_PATH" jdbcType="VARCHAR" property="filePath" />
12 - <result column="FILE_TYPE_ID" jdbcType="NUMERIC" property="fileTypeId" />
13 - <result column="FILE_TYPE_NAME" jdbcType="VARCHAR" property="fileTypeName" />
14 - <result column="STATUS" jdbcType="NUMERIC" property="status" />
15 - <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
16 - <result column="CREATE_USER_ID" jdbcType="NUMERIC" property="createUserId" />
17 - <result column="CREATE_USER_NAME" jdbcType="VARCHAR" property="createUserName" />
18 - <result column="MODIFY_TIME" jdbcType="TIMESTAMP" property="modifyTime" />
19 - <result column="MODIFY_USER_ID" jdbcType="NUMERIC" property="modifyUserId" />
20 - <result column="MODIFY_USER_NAME" jdbcType="VARCHAR" property="modifyUserName" />
21 - </resultMap>
22 - <sql id="Example_Where_Clause">
23 - <where>
24 - <foreach collection="oredCriteria" item="criteria" separator="or">
25 - <if test="criteria.valid">
26 - <trim prefix="(" prefixOverrides="and" suffix=")">
27 - <foreach collection="criteria.criteria" item="criterion">
28 - <choose>
29 - <when test="criterion.noValue">
30 - and ${criterion.condition}
31 - </when>
32 - <when test="criterion.singleValue">
33 - and ${criterion.condition} #{criterion.value}
34 - </when>
35 - <when test="criterion.betweenValue">
36 - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
37 - </when>
38 - <when test="criterion.listValue">
39 - and ${criterion.condition}
40 - <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
41 - #{listItem}
42 - </foreach>
43 - </when>
44 - </choose>
45 - </foreach>
46 - </trim>
47 - </if>
48 - </foreach>
49 - </where>
50 - </sql>
51 - <sql id="Update_By_Example_Where_Clause">
52 - <where>
53 - <foreach collection="example.oredCriteria" item="criteria" separator="or">
54 - <if test="criteria.valid">
55 - <trim prefix="(" prefixOverrides="and" suffix=")">
56 - <foreach collection="criteria.criteria" item="criterion">
57 - <choose>
58 - <when test="criterion.noValue">
59 - and ${criterion.condition}
60 - </when>
61 - <when test="criterion.singleValue">
62 - and ${criterion.condition} #{criterion.value}
63 - </when>
64 - <when test="criterion.betweenValue">
65 - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
66 - </when>
67 - <when test="criterion.listValue">
68 - and ${criterion.condition}
69 - <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
70 - #{listItem}
71 - </foreach>
72 - </when>
73 - </choose>
74 - </foreach>
75 - </trim>
76 - </if>
77 - </foreach>
78 - </where>
79 - </sql>
80 - <sql id="Base_Column_List">
81 - ID, BIZ_ID, BIZ_TYPE_ID, BIZ_TYPE_NAME, SOURCE_FILE_NAME, FILE_NAME, FILE_PATH, FILE_TYPE_ID,
82 - FILE_TYPE_NAME, STATUS, CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME, MODIFY_TIME,
83 - MODIFY_USER_ID, MODIFY_USER_NAME
84 - </sql>
85 - <select id="selectByExample" parameterType="com.fedex.connect.common.model.biz.AttachmentExample" resultMap="BaseResultMap">
86 - <include refid="OracleDialectPrefix" />
87 - select
88 - <if test="distinct">
89 - distinct
90 - </if>
91 - 'true' as QUERYID,
92 - <include refid="Base_Column_List" />
93 - from T_BIZ_ATTACHMENT
94 - <if test="_parameter != null">
95 - <include refid="Example_Where_Clause" />
96 - </if>
97 - <if test="orderByClause != null">
98 - order by ${orderByClause}
99 - </if>
100 - <include refid="OracleDialectSuffix" />
101 - </select>
102 - <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
103 - select
104 - <include refid="Base_Column_List" />
105 - from T_BIZ_ATTACHMENT
106 - where ID = #{id,jdbcType=NUMERIC}
107 - </select>
108 - <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
109 - delete from T_BIZ_ATTACHMENT
110 - where ID = #{id,jdbcType=NUMERIC}
111 - </delete>
112 - <delete id="deleteByExample" parameterType="com.fedex.connect.common.model.biz.AttachmentExample">
113 - delete from T_BIZ_ATTACHMENT
114 - <if test="_parameter != null">
115 - <include refid="Example_Where_Clause" />
116 - </if>
117 - </delete>
118 - <insert id="insert" parameterType="com.fedex.connect.common.model.biz.Attachment">
119 - <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
120 - SELECT SEQ_T_BIZ_ATTACHMENT.NEXTVAL FROM DUAL
121 - </selectKey>
122 - insert into T_BIZ_ATTACHMENT (ID, BIZ_ID, BIZ_TYPE_ID,
123 - BIZ_TYPE_NAME, SOURCE_FILE_NAME, FILE_NAME,
124 - FILE_PATH, FILE_TYPE_ID, FILE_TYPE_NAME,
125 - STATUS, CREATE_TIME, CREATE_USER_ID,
126 - CREATE_USER_NAME, MODIFY_TIME, MODIFY_USER_ID,
127 - MODIFY_USER_NAME)
128 - values (#{id,jdbcType=NUMERIC}, #{bizId,jdbcType=NUMERIC}, #{bizTypeId,jdbcType=NUMERIC},
129 - #{bizTypeName,jdbcType=VARCHAR}, #{sourceFileName,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR},
130 - #{filePath,jdbcType=VARCHAR}, #{fileTypeId,jdbcType=NUMERIC}, #{fileTypeName,jdbcType=VARCHAR},
131 - #{status,jdbcType=NUMERIC}, #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=NUMERIC},
132 - #{createUserName,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, #{modifyUserId,jdbcType=NUMERIC},
133 - #{modifyUserName,jdbcType=VARCHAR})
134 - </insert>
135 - <insert id="insertSelective" parameterType="com.fedex.connect.common.model.biz.Attachment">
136 - <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
137 - SELECT SEQ_T_BIZ_ATTACHMENT.NEXTVAL FROM DUAL
138 - </selectKey>
139 - insert into T_BIZ_ATTACHMENT
140 - <trim prefix="(" suffix=")" suffixOverrides=",">
141 - ID,
142 - <if test="bizId != null">
143 - BIZ_ID,
144 - </if>
145 - <if test="bizTypeId != null">
146 - BIZ_TYPE_ID,
147 - </if>
148 - <if test="bizTypeName != null">
149 - BIZ_TYPE_NAME,
150 - </if>
151 - <if test="sourceFileName != null">
152 - SOURCE_FILE_NAME,
153 - </if>
154 - <if test="fileName != null">
155 - FILE_NAME,
156 - </if>
157 - <if test="filePath != null">
158 - FILE_PATH,
159 - </if>
160 - <if test="fileTypeId != null">
161 - FILE_TYPE_ID,
162 - </if>
163 - <if test="fileTypeName != null">
164 - FILE_TYPE_NAME,
165 - </if>
166 - <if test="status != null">
167 - STATUS,
168 - </if>
169 - <if test="createTime != null">
170 - CREATE_TIME,
171 - </if>
172 - <if test="createUserId != null">
173 - CREATE_USER_ID,
174 - </if>
175 - <if test="createUserName != null">
176 - CREATE_USER_NAME,
177 - </if>
178 - <if test="modifyTime != null">
179 - MODIFY_TIME,
180 - </if>
181 - <if test="modifyUserId != null">
182 - MODIFY_USER_ID,
183 - </if>
184 - <if test="modifyUserName != null">
185 - MODIFY_USER_NAME,
186 - </if>
187 - </trim>
188 - <trim prefix="values (" suffix=")" suffixOverrides=",">
189 - #{id,jdbcType=NUMERIC},
190 - <if test="bizId != null">
191 - #{bizId,jdbcType=NUMERIC},
192 - </if>
193 - <if test="bizTypeId != null">
194 - #{bizTypeId,jdbcType=NUMERIC},
195 - </if>
196 - <if test="bizTypeName != null">
197 - #{bizTypeName,jdbcType=VARCHAR},
198 - </if>
199 - <if test="sourceFileName != null">
200 - #{sourceFileName,jdbcType=VARCHAR},
201 - </if>
202 - <if test="fileName != null">
203 - #{fileName,jdbcType=VARCHAR},
204 - </if>
205 - <if test="filePath != null">
206 - #{filePath,jdbcType=VARCHAR},
207 - </if>
208 - <if test="fileTypeId != null">
209 - #{fileTypeId,jdbcType=NUMERIC},
210 - </if>
211 - <if test="fileTypeName != null">
212 - #{fileTypeName,jdbcType=VARCHAR},
213 - </if>
214 - <if test="status != null">
215 - #{status,jdbcType=NUMERIC},
216 - </if>
217 - <if test="createTime != null">
218 - #{createTime,jdbcType=TIMESTAMP},
219 - </if>
220 - <if test="createUserId != null">
221 - #{createUserId,jdbcType=NUMERIC},
222 - </if>
223 - <if test="createUserName != null">
224 - #{createUserName,jdbcType=VARCHAR},
225 - </if>
226 - <if test="modifyTime != null">
227 - #{modifyTime,jdbcType=TIMESTAMP},
228 - </if>
229 - <if test="modifyUserId != null">
230 - #{modifyUserId,jdbcType=NUMERIC},
231 - </if>
232 - <if test="modifyUserName != null">
233 - #{modifyUserName,jdbcType=VARCHAR},
234 - </if>
235 - </trim>
236 - </insert>
237 - <select id="countByExample" parameterType="com.fedex.connect.common.model.biz.AttachmentExample" resultType="java.lang.Long">
238 - select count(*) from T_BIZ_ATTACHMENT
239 - <if test="_parameter != null">
240 - <include refid="Example_Where_Clause" />
241 - </if>
242 - </select>
243 - <update id="updateByExampleSelective" parameterType="map">
244 - update T_BIZ_ATTACHMENT
245 - <set>
246 - <if test="record.id != null">
247 - ID = #{record.id,jdbcType=NUMERIC},
248 - </if>
249 - <if test="record.bizId != null">
250 - BIZ_ID = #{record.bizId,jdbcType=NUMERIC},
251 - </if>
252 - <if test="record.bizTypeId != null">
253 - BIZ_TYPE_ID = #{record.bizTypeId,jdbcType=NUMERIC},
254 - </if>
255 - <if test="record.bizTypeName != null">
256 - BIZ_TYPE_NAME = #{record.bizTypeName,jdbcType=VARCHAR},
257 - </if>
258 - <if test="record.sourceFileName != null">
259 - SOURCE_FILE_NAME = #{record.sourceFileName,jdbcType=VARCHAR},
260 - </if>
261 - <if test="record.fileName != null">
262 - FILE_NAME = #{record.fileName,jdbcType=VARCHAR},
263 - </if>
264 - <if test="record.filePath != null">
265 - FILE_PATH = #{record.filePath,jdbcType=VARCHAR},
266 - </if>
267 - <if test="record.fileTypeId != null">
268 - FILE_TYPE_ID = #{record.fileTypeId,jdbcType=NUMERIC},
269 - </if>
270 - <if test="record.fileTypeName != null">
271 - FILE_TYPE_NAME = #{record.fileTypeName,jdbcType=VARCHAR},
272 - </if>
273 - <if test="record.status != null">
274 - STATUS = #{record.status,jdbcType=NUMERIC},
275 - </if>
276 - <if test="record.createTime != null">
277 - CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
278 - </if>
279 - <if test="record.createUserId != null">
280 - CREATE_USER_ID = #{record.createUserId,jdbcType=NUMERIC},
281 - </if>
282 - <if test="record.createUserName != null">
283 - CREATE_USER_NAME = #{record.createUserName,jdbcType=VARCHAR},
284 - </if>
285 - <if test="record.modifyTime != null">
286 - MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP},
287 - </if>
288 - <if test="record.modifyUserId != null">
289 - MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC},
290 - </if>
291 - <if test="record.modifyUserName != null">
292 - MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
293 - </if>
294 - </set>
295 - <if test="_parameter != null">
296 - <include refid="Update_By_Example_Where_Clause" />
297 - </if>
298 - </update>
299 - <update id="updateByExample" parameterType="map">
300 - update T_BIZ_ATTACHMENT
301 - set ID = #{record.id,jdbcType=NUMERIC},
302 - BIZ_ID = #{record.bizId,jdbcType=NUMERIC},
303 - BIZ_TYPE_ID = #{record.bizTypeId,jdbcType=NUMERIC},
304 - BIZ_TYPE_NAME = #{record.bizTypeName,jdbcType=VARCHAR},
305 - SOURCE_FILE_NAME = #{record.sourceFileName,jdbcType=VARCHAR},
306 - FILE_NAME = #{record.fileName,jdbcType=VARCHAR},
307 - FILE_PATH = #{record.filePath,jdbcType=VARCHAR},
308 - FILE_TYPE_ID = #{record.fileTypeId,jdbcType=NUMERIC},
309 - FILE_TYPE_NAME = #{record.fileTypeName,jdbcType=VARCHAR},
310 - STATUS = #{record.status,jdbcType=NUMERIC},
311 - CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
312 - CREATE_USER_ID = #{record.createUserId,jdbcType=NUMERIC},
313 - CREATE_USER_NAME = #{record.createUserName,jdbcType=VARCHAR},
314 - MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP},
315 - MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC},
316 - MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR}
317 - <if test="_parameter != null">
318 - <include refid="Update_By_Example_Where_Clause" />
319 - </if>
320 - </update>
321 - <update id="updateByPrimaryKeySelective" parameterType="com.fedex.connect.common.model.biz.Attachment">
322 - update T_BIZ_ATTACHMENT
323 - <set>
324 - <if test="bizId != null">
325 - BIZ_ID = #{bizId,jdbcType=NUMERIC},
326 - </if>
327 - <if test="bizTypeId != null">
328 - BIZ_TYPE_ID = #{bizTypeId,jdbcType=NUMERIC},
329 - </if>
330 - <if test="bizTypeName != null">
331 - BIZ_TYPE_NAME = #{bizTypeName,jdbcType=VARCHAR},
332 - </if>
333 - <if test="sourceFileName != null">
334 - SOURCE_FILE_NAME = #{sourceFileName,jdbcType=VARCHAR},
335 - </if>
336 - <if test="fileName != null">
337 - FILE_NAME = #{fileName,jdbcType=VARCHAR},
338 - </if>
339 - <if test="filePath != null">
340 - FILE_PATH = #{filePath,jdbcType=VARCHAR},
341 - </if>
342 - <if test="fileTypeId != null">
343 - FILE_TYPE_ID = #{fileTypeId,jdbcType=NUMERIC},
344 - </if>
345 - <if test="fileTypeName != null">
346 - FILE_TYPE_NAME = #{fileTypeName,jdbcType=VARCHAR},
347 - </if>
348 - <if test="status != null">
349 - STATUS = #{status,jdbcType=NUMERIC},
350 - </if>
351 - <if test="createTime != null">
352 - CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
353 - </if>
354 - <if test="createUserId != null">
355 - CREATE_USER_ID = #{createUserId,jdbcType=NUMERIC},
356 - </if>
357 - <if test="createUserName != null">
358 - CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR},
359 - </if>
360 - <if test="modifyTime != null">
361 - MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP},
362 - </if>
363 - <if test="modifyUserId != null">
364 - MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC},
365 - </if>
366 - <if test="modifyUserName != null">
367 - MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
368 - </if>
369 - </set>
370 - where ID = #{id,jdbcType=NUMERIC}
371 - </update>
372 - <update id="updateByPrimaryKey" parameterType="com.fedex.connect.common.model.biz.Attachment">
373 - update T_BIZ_ATTACHMENT
374 - set BIZ_ID = #{bizId,jdbcType=NUMERIC},
375 - BIZ_TYPE_ID = #{bizTypeId,jdbcType=NUMERIC},
376 - BIZ_TYPE_NAME = #{bizTypeName,jdbcType=VARCHAR},
377 - SOURCE_FILE_NAME = #{sourceFileName,jdbcType=VARCHAR},
378 - FILE_NAME = #{fileName,jdbcType=VARCHAR},
379 - FILE_PATH = #{filePath,jdbcType=VARCHAR},
380 - FILE_TYPE_ID = #{fileTypeId,jdbcType=NUMERIC},
381 - FILE_TYPE_NAME = #{fileTypeName,jdbcType=VARCHAR},
382 - STATUS = #{status,jdbcType=NUMERIC},
383 - CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
384 - CREATE_USER_ID = #{createUserId,jdbcType=NUMERIC},
385 - CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR},
386 - MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP},
387 - MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC},
388 - MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR}
389 - where ID = #{id,jdbcType=NUMERIC}
390 - </update>
391 <sql id="OracleDialectPrefix"> 5 <sql id="OracleDialectPrefix">
392 - <if test="limitStart != null and limitStart>=0"> 6 + <if test="start != null and start >= 0 and size != null and size >= 0">
393 select * from ( select row_.*, rownum rownum_ from ( 7 select * from ( select row_.*, rownum rownum_ from (
394 </if> 8 </if>
395 </sql> 9 </sql>
10 +
396 <sql id="OracleDialectSuffix"> 11 <sql id="OracleDialectSuffix">
397 - <if test="limitStart != null and limitStart>=0"> 12 + <if test="start != null and start >= 0 and size != null and size >= 0">
398 - <![CDATA[ ) row_ ) where rownum_ > #{limitStart} and rownum_ <= #{limitStart}+#{limitSize} ]]> 13 + <![CDATA[ ) row_ ) where rownum_ > #{start} and rownum_ <= #{start} + #{size} ]]>
399 </if> 14 </if>
400 </sql> 15 </sql>
401 16
402 <select id="findHistory" resultType="com.fedex.connect.customer.data.dto.AttachmentHistoryDto"> 17 <select id="findHistory" resultType="com.fedex.connect.customer.data.dto.AttachmentHistoryDto">
18 + <include refid="OracleDialectPrefix"/>
403 SELECT 19 SELECT
404 a.CREATE_USER_NAME AS uploadUserName, 20 a.CREATE_USER_NAME AS uploadUserName,
405 a.CREATE_TIME AS uploadTime, 21 a.CREATE_TIME AS uploadTime,
406 a.FILE_PATH AS filePath, 22 a.FILE_PATH AS filePath,
407 a.CREATE_USER_ID AS uploadUserId, 23 a.CREATE_USER_ID AS uploadUserId,
408 - c.STATUS_NAME AS statusName 24 + r.STATUS_NAME AS statusName
409 FROM 25 FROM
410 T_BIZ_ATTACHMENT a 26 T_BIZ_ATTACHMENT a
411 JOIN 27 JOIN
412 - T_BIZ_CONSIGNMENT c 28 + T_BIZ_UPLOAD_RECORD r
413 ON 29 ON
414 - a.BIZ_ID = c.ID 30 + a.UPLOAD_RECORD_ID = r.ID
415 WHERE 31 WHERE
416 - c.ID = #{consignmentId} 32 + r.CONSIGNMENT_ID = #{consignmentId}
33 + <include refid="OracleDialectSuffix" />
417 </select> 34 </select>
418 </mapper> 35 </mapper>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
28 c.CREATE_TIME, 28 c.CREATE_TIME,
29 c.COMMIT_TIME, 29 c.COMMIT_TIME,
30 c.STATUS_NAME 30 c.STATUS_NAME
31 -</sql> 31 + </sql>
32 32
33 <select id="findConsignments" resultType="com.fedex.connect.customer.data.dto.FindConsignmentsDto"> 33 <select id="findConsignments" resultType="com.fedex.connect.customer.data.dto.FindConsignmentsDto">
34 <include refid="OracleDialectPrefix"/> 34 <include refid="OracleDialectPrefix"/>
......
...@@ -2,12 +2,13 @@ package com.fedex.connect.customer.repository.repo; ...@@ -2,12 +2,13 @@ package com.fedex.connect.customer.repository.repo;
2 2
3 import com.fedex.connect.common.model.biz.Attachment; 3 import com.fedex.connect.common.model.biz.Attachment;
4 import com.fedex.connect.customer.data.dto.AttachmentHistoryDto; 4 import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
5 +import com.fedex.connect.customer.data.query.AttachmentHistoryQuery;
5 import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; 6 import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
6 7
7 import java.util.List; 8 import java.util.List;
8 9
9 public interface IAttachmentRepository { 10 public interface IAttachmentRepository {
10 - List<AttachmentHistoryDto> findHistory(Long bizId); 11 + List<AttachmentHistoryDto> findHistory(AttachmentHistoryQuery attachmentHistoryQuery);
11 12
12 Attachment queryInfo(UserConsignmentInfoQuery userConsignmentInfoQuery); 13 Attachment queryInfo(UserConsignmentInfoQuery userConsignmentInfoQuery);
13 } 14 }
...\ No newline at end of file ...\ No newline at end of file
......
1 package com.fedex.connect.customer.repository.repo; 1 package com.fedex.connect.customer.repository.repo;
2 2
3 import com.fedex.connect.common.model.biz.Consignment; 3 import com.fedex.connect.common.model.biz.Consignment;
4 +import com.fedex.connect.common.model.sys.User;
4 import com.fedex.connect.customer.data.dto.FindConsignmentsDto; 5 import com.fedex.connect.customer.data.dto.FindConsignmentsDto;
5 import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; 6 import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
6 import com.fedex.connect.customer.data.query.ConsignmentQuery; 7 import com.fedex.connect.customer.data.query.ConsignmentQuery;
...@@ -8,7 +9,7 @@ import com.fedex.connect.customer.data.query.ConsignmentQuery; ...@@ -8,7 +9,7 @@ import com.fedex.connect.customer.data.query.ConsignmentQuery;
8 import java.util.List; 9 import java.util.List;
9 10
10 public interface IConsignmentRepository { 11 public interface IConsignmentRepository {
11 - List<FindConsignmentsDto> findConsignments(ConsignmentQuery query); 12 + List<FindConsignmentsDto> findConsignments(ConsignmentQuery query, User user);
12 13
13 Long findAllCount(ConsignmentQuery query); 14 Long findAllCount(ConsignmentQuery query);
14 15
......
...@@ -2,6 +2,7 @@ package com.fedex.connect.customer.repository.repo.impl; ...@@ -2,6 +2,7 @@ package com.fedex.connect.customer.repository.repo.impl;
2 2
3 import com.fedex.connect.common.model.biz.Attachment; 3 import com.fedex.connect.common.model.biz.Attachment;
4 import com.fedex.connect.customer.data.dto.AttachmentHistoryDto; 4 import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
5 +import com.fedex.connect.customer.data.query.AttachmentHistoryQuery;
5 import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; 6 import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
6 import com.fedex.connect.customer.repository.base.BaseDao; 7 import com.fedex.connect.customer.repository.base.BaseDao;
7 import com.fedex.connect.customer.repository.repo.IAttachmentRepository; 8 import com.fedex.connect.customer.repository.repo.IAttachmentRepository;
...@@ -12,8 +13,8 @@ import java.util.List; ...@@ -12,8 +13,8 @@ import java.util.List;
12 @Repository 13 @Repository
13 public class AttachmentRepositoryImpl extends BaseDao implements IAttachmentRepository { 14 public class AttachmentRepositoryImpl extends BaseDao implements IAttachmentRepository {
14 @Override 15 @Override
15 - public List<AttachmentHistoryDto> findHistory(Long consignmentId) { 16 + public List<AttachmentHistoryDto> findHistory(AttachmentHistoryQuery attachmentHistoryQuery) {
16 - return attachmentExtMapper.findHistory(consignmentId); 17 + return attachmentExtMapper.findHistory(attachmentHistoryQuery);
17 } 18 }
18 19
19 /** 20 /**
......
1 package com.fedex.connect.customer.repository.repo.impl; 1 package com.fedex.connect.customer.repository.repo.impl;
2 2
3 import com.fedex.connect.common.model.biz.Consignment; 3 import com.fedex.connect.common.model.biz.Consignment;
4 +import com.fedex.connect.common.model.sys.User;
4 import com.fedex.connect.customer.data.dto.FindConsignmentsDto; 5 import com.fedex.connect.customer.data.dto.FindConsignmentsDto;
5 -import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
6 import com.fedex.connect.customer.data.query.ConsignmentQuery; 6 import com.fedex.connect.customer.data.query.ConsignmentQuery;
7 +import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
7 import com.fedex.connect.customer.repository.base.BaseDao; 8 import com.fedex.connect.customer.repository.base.BaseDao;
8 import com.fedex.connect.customer.repository.repo.IConsignmentRepository; 9 import com.fedex.connect.customer.repository.repo.IConsignmentRepository;
10 +import org.apache.commons.lang3.StringUtils;
9 import org.springframework.stereotype.Repository; 11 import org.springframework.stereotype.Repository;
10 12
13 +import java.util.Collections;
11 import java.util.List; 14 import java.util.List;
12 15
13 @Repository 16 @Repository
14 public class ConsignmentRepositoryImpl extends BaseDao implements IConsignmentRepository { 17 public class ConsignmentRepositoryImpl extends BaseDao implements IConsignmentRepository {
15 18
19 + /**
20 + * @Author Szl
21 + * @Description 功能说明 运单创建人如果为空则取当前用户
22 + * @Date 2024/11/12
23 + * @param query
24 + * @param user
25 + * @return java.util.List<com.fedex.connect.customer.data.dto.FindConsignmentsDto>
26 + */
16 @Override 27 @Override
17 - public List<FindConsignmentsDto> findConsignments(ConsignmentQuery query) { 28 + public List<FindConsignmentsDto> findConsignments(ConsignmentQuery query, User user) {
18 - return consignmentExtMapper.findConsignments(query); 29 + List<FindConsignmentsDto> consignments = consignmentExtMapper.findConsignments(query);
30 + if (consignments == null) {
31 + return Collections.emptyList();
32 + }
33 + consignments.forEach(consignment -> {
34 + if (StringUtils.isBlank(consignment.getCreateUserName())) {
35 + consignment.setCreateUserName(user.getUserName());
36 + }
37 + });
38 + return consignments;
19 } 39 }
20 40
21 @Override 41 @Override
......
1 package com.fedex.connect.customer.service.biz; 1 package com.fedex.connect.customer.service.biz;
2 2
3 import com.fedex.connect.common.dependencies.date.vo.ResponseVo; 3 import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
4 +import com.fedex.connect.common.model.sys.User;
4 import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; 5 import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
5 import com.fedex.connect.customer.data.query.ConsignmentQuery; 6 import com.fedex.connect.customer.data.query.ConsignmentQuery;
6 7
...@@ -12,7 +13,7 @@ public interface IConsignmentQueryService { ...@@ -12,7 +13,7 @@ public interface IConsignmentQueryService {
12 * @param query 13 * @param query
13 * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo 14 * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
14 */ 15 */
15 - ResponseVo findConsignments(ConsignmentQuery query); 16 + ResponseVo findConsignments(ConsignmentQuery query,User user);
16 17
17 /** 18 /**
18 * @Author mt 19 * @Author mt
......
1 package com.fedex.connect.customer.service.biz; 1 package com.fedex.connect.customer.service.biz;
2 2
3 import com.fedex.connect.common.dependencies.date.vo.ResponseVo; 3 import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
4 -import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; 4 +import com.fedex.connect.common.model.sys.User;
5 +import com.fedex.connect.customer.data.query.AttachmentHistoryQuery;
5 6
6 public interface IUploadRecordService { 7 public interface IUploadRecordService {
7 - ResponseVo findHistory(UserConsignmentInfoQuery userConsignmentInfoQuery); 8 + ResponseVo findHistory(AttachmentHistoryQuery attachmentHistoryQuery, User user);
8 } 9 }
......
...@@ -5,6 +5,7 @@ import com.fedex.connect.common.dependencies.date.vo.PageResult; ...@@ -5,6 +5,7 @@ import com.fedex.connect.common.dependencies.date.vo.PageResult;
5 import com.fedex.connect.common.dependencies.date.vo.ResponseVo; 5 import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
6 import com.fedex.connect.common.dependencies.util.Utils; 6 import com.fedex.connect.common.dependencies.util.Utils;
7 import com.fedex.connect.common.model.biz.Consignment; 7 import com.fedex.connect.common.model.biz.Consignment;
8 +import com.fedex.connect.common.model.sys.User;
8 import com.fedex.connect.customer.data.dto.FindConsignmentsDto; 9 import com.fedex.connect.customer.data.dto.FindConsignmentsDto;
9 import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; 10 import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
10 import com.fedex.connect.customer.data.query.ConsignmentQuery; 11 import com.fedex.connect.customer.data.query.ConsignmentQuery;
...@@ -30,7 +31,7 @@ public class ConsignmentQueryServiceImpl extends BaseService implements IConsign ...@@ -30,7 +31,7 @@ public class ConsignmentQueryServiceImpl extends BaseService implements IConsign
30 * @param query 31 * @param query
31 * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo 32 * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
32 */ 33 */
33 - public ResponseVo findConsignments(ConsignmentQuery query) { 34 + public ResponseVo findConsignments(ConsignmentQuery query, User user) {
34 List<String> consignmentCodeList = query.getConsignmentCodeList(); 35 List<String> consignmentCodeList = query.getConsignmentCodeList();
35 if (Utils.isNotEmpty(consignmentCodeList) && consignmentCodeList.size() > GlobalConstantFedex.DECLARE_COUNT) { 36 if (Utils.isNotEmpty(consignmentCodeList) && consignmentCodeList.size() > GlobalConstantFedex.DECLARE_COUNT) {
36 responseUtils.fail(ResponseCode.MESSAGE_CODE_30002); 37 responseUtils.fail(ResponseCode.MESSAGE_CODE_30002);
...@@ -44,7 +45,7 @@ public class ConsignmentQueryServiceImpl extends BaseService implements IConsign ...@@ -44,7 +45,7 @@ public class ConsignmentQueryServiceImpl extends BaseService implements IConsign
44 pageResult.setPage(query.getPage()); 45 pageResult.setPage(query.getPage());
45 pageResult.setSize(query.getSize()); 46 pageResult.setSize(query.getSize());
46 if (total != null && total > 0) { 47 if (total != null && total > 0) {
47 - List<FindConsignmentsDto> consignments = consignmentRepository.findConsignments(query); 48 + List<FindConsignmentsDto> consignments = consignmentRepository.findConsignments(query,user);
48 pageResult.setList(consignments); 49 pageResult.setList(consignments);
49 } 50 }
50 return responseUtils.success(pageResult); 51 return responseUtils.success(pageResult);
......
...@@ -3,10 +3,10 @@ package com.fedex.connect.customer.service.biz.impl; ...@@ -3,10 +3,10 @@ package com.fedex.connect.customer.service.biz.impl;
3 import com.fedex.connect.common.dependencies.contants.DigitConstants; 3 import com.fedex.connect.common.dependencies.contants.DigitConstants;
4 import com.fedex.connect.common.dependencies.date.vo.PageResult; 4 import com.fedex.connect.common.dependencies.date.vo.PageResult;
5 import com.fedex.connect.common.dependencies.date.vo.ResponseVo; 5 import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
6 +import com.fedex.connect.common.model.sys.User;
6 import com.fedex.connect.customer.data.dto.AttachmentHistoryDto; 7 import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
7 -import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; 8 +import com.fedex.connect.customer.data.query.AttachmentHistoryQuery;
8 import com.fedex.connect.customer.service.base.BaseService; 9 import com.fedex.connect.customer.service.base.BaseService;
9 -import com.fedex.connect.customer.service.biz.IAttachmentQueryService;
10 import com.fedex.connect.customer.service.biz.IUploadRecordService; 10 import com.fedex.connect.customer.service.biz.IUploadRecordService;
11 import org.springframework.stereotype.Service; 11 import org.springframework.stereotype.Service;
12 12
...@@ -25,23 +25,25 @@ public class UploadRecordServiceImpl extends BaseService implements IUploadRecor ...@@ -25,23 +25,25 @@ public class UploadRecordServiceImpl extends BaseService implements IUploadRecor
25 * @Author Szl 25 * @Author Szl
26 * @Description 功能说明 查询该运单历史数据 26 * @Description 功能说明 查询该运单历史数据
27 * @Date 2024/11/5 27 * @Date 2024/11/5
28 - * @param userConsignmentInfoQuery 28 + * @param attachmentHistoryQuery
29 * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo 29 * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
30 */ 30 */
31 - public ResponseVo findHistory(UserConsignmentInfoQuery userConsignmentInfoQuery) { 31 + public ResponseVo findHistory(AttachmentHistoryQuery attachmentHistoryQuery, User user) {
32 - List<AttachmentHistoryDto> history = attachmentRepository.findHistory(userConsignmentInfoQuery.getConsignmentId()); 32 + List<AttachmentHistoryDto> history = attachmentRepository.findHistory(attachmentHistoryQuery);
33 33
34 if (history != null) { 34 if (history != null) {
35 history.forEach(attachmentHistoryDto -> 35 history.forEach(attachmentHistoryDto ->
36 attachmentHistoryDto.setCreatorFlag( 36 attachmentHistoryDto.setCreatorFlag(
37 (attachmentHistoryDto.getUploadUserId() != null && 37 (attachmentHistoryDto.getUploadUserId() != null &&
38 - attachmentHistoryDto.getUploadUserId().equals(userConsignmentInfoQuery.getUserId())) ? 38 + attachmentHistoryDto.getUploadUserId().equals(user.getId())) ?
39 DigitConstants.DIGIT_ONE : DigitConstants.DIGIT_ZERO 39 DigitConstants.DIGIT_ONE : DigitConstants.DIGIT_ZERO
40 ) 40 )
41 ); 41 );
42 } 42 }
43 43
44 PageResult pageResult = new PageResult(); 44 PageResult pageResult = new PageResult();
45 + pageResult.setPage(attachmentHistoryQuery.getPage());
46 + pageResult.setSize(attachmentHistoryQuery.getSize());
45 pageResult.setList(history != null ? history : Collections.emptyList()); 47 pageResult.setList(history != null ? history : Collections.emptyList());
46 48
47 return responseUtils.success(pageResult); 49 return responseUtils.success(pageResult);
......