zelong.shao

customer|历史附件查询

Showing 17 changed files with 640 additions and 7 deletions
...@@ -3,6 +3,7 @@ package com.fedex.connect.customer.controller; ...@@ -3,6 +3,7 @@ package com.fedex.connect.customer.controller;
3 3
4 import com.fedex.connect.common.dependencies.date.vo.ResponseResultVo; 4 import com.fedex.connect.common.dependencies.date.vo.ResponseResultVo;
5 import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil; 5 import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil;
6 +import com.fedex.connect.customer.service.biz.IAttachmentService;
6 import com.fedex.connect.customer.service.biz.IConsignmentService; 7 import com.fedex.connect.customer.service.biz.IConsignmentService;
7 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.http.HttpHeaders; 9 import org.springframework.http.HttpHeaders;
...@@ -25,6 +26,9 @@ public class AbstractEtController { ...@@ -25,6 +26,9 @@ public class AbstractEtController {
25 @Autowired 26 @Autowired
26 protected IConsignmentService consignmentService; 27 protected IConsignmentService consignmentService;
27 28
29 + @Autowired
30 + protected IAttachmentService attachmentService;
31 +
28 32
29 public <T> ResponseEntity<T> seeOther(String url) { 33 public <T> ResponseEntity<T> seeOther(String url) {
30 HttpHeaders httpHeaders = new HttpHeaders(); 34 HttpHeaders httpHeaders = new HttpHeaders();
......
1 +package com.fedex.connect.customer.controller.biz;
2 +
3 +public interface IAttachmentController {
4 +}
1 +package com.fedex.connect.customer.controller.biz.impl;
2 +
3 +import com.fedex.connect.common.dependencies.date.model.LogShowModel;
4 +import com.fedex.connect.common.dependencies.date.vo.ResponseResultVo;
5 +import com.fedex.connect.common.dependencies.enums.ResponseCode;
6 +import com.fedex.connect.common.dependencies.util.CurrentUserInfo;
7 +import com.fedex.connect.customer.controller.AbstractEtController;
8 +import com.fedex.connect.customer.controller.biz.IAttachmentController;
9 +import com.fedex.connect.customer.data.bo.LongBo;
10 +import io.swagger.annotations.Api;
11 +import io.swagger.annotations.ApiOperation;
12 +import org.slf4j.Logger;
13 +import org.slf4j.LoggerFactory;
14 +import org.springframework.web.bind.annotation.PostMapping;
15 +import org.springframework.web.bind.annotation.RequestBody;
16 +import org.springframework.web.bind.annotation.RequestMapping;
17 +import org.springframework.web.bind.annotation.RestController;
18 +
19 +/**
20 + * @Author Szl
21 + * @Description 类说明 附件相关
22 + * @Date 2024/11/4
23 + */
24 +@RestController
25 +@RequestMapping(value = "/attachment", name = "附件相关")
26 +@Api(value = "AttachmentControllerImpl", tags = {"附件相关"})
27 +public class AttachmentControllerImpl extends AbstractEtController implements IAttachmentController {
28 + private static final Logger logger = LoggerFactory.getLogger(AttachmentControllerImpl.class);
29 +
30 + @PostMapping("/find/history")
31 + @ApiOperation(value = "历史上传记录查询")
32 + public ResponseResultVo findHistory(@RequestBody LongBo bo) {
33 + Long userId = null;
34 + try {
35 + userId = CurrentUserInfo.getUserId();
36 + //userId = 0L;
37 + } catch (Exception e) {
38 + logger.error(LogShowModel.showException("Exception", e));
39 + return ResponseResultVo.fail(localeMessageUtil.getMessage(ResponseCode.TOKEN_FORMAT_ERROR.getMsg()));
40 + }
41 + if (userId == null) {
42 + return ResponseResultVo.fail(localeMessageUtil.getMessage(ResponseCode.OVERDUE_TOKEN_CODE.getMsg()));
43 + }
44 + return attachmentService.findHistory(userId,bo.getId());
45 + }
46 +
47 +}
1 +package com.fedex.connect.customer.data.bo;
2 +
3 +import lombok.Data;
4 +
5 +@Data
6 +public class LongBo {
7 + Long id;
8 +}
1 +package com.fedex.connect.customer.data.dto;
2 +
3 +import lombok.Data;
4 +
5 +import java.util.Date;
6 +
7 +@Data
8 +public class AttachmentHistoryDto {
9 + private String uploadUserName;
10 +
11 + private Long uploadUserId;
12 +
13 + private Date uploadTime;
14 +
15 + private String statusName;
16 +
17 + private String filePath;
18 +
19 + private Integer creatorFlag;
20 +
21 +}
...@@ -13,7 +13,7 @@ import java.util.List; ...@@ -13,7 +13,7 @@ import java.util.List;
13 13
14 /** 14 /**
15 * @Author Szl 15 * @Author Szl
16 - * @Description 类说明 查询条件对象 16 + * @Description 类说明 运单查询条件对象
17 * @Date 2024/10/31 17 * @Date 2024/10/31
18 */ 18 */
19 public class ConsignmentQuery extends PageBase { 19 public class ConsignmentQuery extends PageBase {
......
1 package com.fedex.connect.customer.repository.base; 1 package com.fedex.connect.customer.repository.base;
2 2
3 +import com.fedex.connect.customer.repository.dao.AttachmentMapper;
3 import com.fedex.connect.customer.repository.dao.ConsignmentExtMapper; 4 import com.fedex.connect.customer.repository.dao.ConsignmentExtMapper;
4 import org.springframework.beans.factory.annotation.Autowired; 5 import org.springframework.beans.factory.annotation.Autowired;
5 6
6 public class BaseDao { 7 public class BaseDao {
7 @Autowired 8 @Autowired
8 public ConsignmentExtMapper consignmentExtMapper; 9 public ConsignmentExtMapper consignmentExtMapper;
10 + @Autowired
11 + public AttachmentMapper attachmentMapper;
9 } 12 }
......
1 +package com.fedex.connect.customer.repository.dao;
2 +
3 +import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
4 +import org.apache.ibatis.annotations.Mapper;
5 +import org.apache.ibatis.annotations.Param;
6 +
7 +import java.util.List;
8 +
9 +@Mapper
10 +public interface AttachmentMapper {
11 + List<AttachmentHistoryDto> findHistory(@Param("bizId") Long bizId);
12 +}
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">
3 +<mapper namespace="com.fedex.connect.customer.repository.dao.AttachmentMapper">
4 + <resultMap id="BaseResultMap" type="com.fedex.connect.common.model.biz.Attachment">
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">
392 + <if test="limitStart != null and limitStart>=0">
393 + select * from ( select row_.*, rownum rownum_ from (
394 + </if>
395 + </sql>
396 + <sql id="OracleDialectSuffix">
397 + <if test="limitStart != null and limitStart>=0">
398 + <![CDATA[ ) row_ ) where rownum_ > #{limitStart} and rownum_ <= #{limitStart}+#{limitSize} ]]>
399 + </if>
400 + </sql>
401 +
402 + <select id="findHistory" resultType="com.fedex.connect.customer.data.dto.AttachmentHistoryDto">
403 + SELECT
404 + a.CREATE_USER_NAME AS uploadUserName,
405 + a.CREATE_TIME AS uploadTime,
406 + a.FILE_PATH AS filePath,
407 + a.CREATE_USER_ID AS uploadUserId,
408 + c.STATUS_NAME AS statusName
409 + FROM
410 + T_BIZ_ATTACHMENT a
411 + JOIN
412 + T_BIZ_CONSIGNMENT c
413 + ON
414 + a.BIZ_ID = c.ID
415 + WHERE
416 + c.ID = #{bizId}
417 + </select>
418 +</mapper>
...\ No newline at end of file ...\ No newline at end of file
1 +package com.fedex.connect.customer.repository.repo;
2 +
3 +import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
4 +
5 +import java.util.List;
6 +
7 +public interface IAttachmentRepository {
8 + List<AttachmentHistoryDto> findHistory(Long bizId);
9 +}
...\ No newline at end of file ...\ No newline at end of file
1 +package com.fedex.connect.customer.repository.repo.impl;
2 +
3 +import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
4 +import com.fedex.connect.customer.repository.base.BaseDao;
5 +import com.fedex.connect.customer.repository.repo.IAttachmentRepository;
6 +import org.springframework.stereotype.Repository;
7 +
8 +import java.util.List;
9 +
10 +@Repository
11 +public class AttachmentRepositoryImpl extends BaseDao implements IAttachmentRepository {
12 + @Override
13 + public List<AttachmentHistoryDto> findHistory(Long bizId) {
14 + return attachmentMapper.findHistory(bizId);
15 + }
16 +}
...@@ -2,7 +2,8 @@ package com.fedex.connect.customer.service; ...@@ -2,7 +2,8 @@ package com.fedex.connect.customer.service;
2 2
3 3
4 import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil; 4 import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil;
5 -import com.fedex.connect.customer.repository.repo.impl.ConsignmentExtRepositoryImpl; 5 +import com.fedex.connect.customer.repository.repo.IAttachmentRepository;
6 +import com.fedex.connect.customer.repository.repo.IConsignmentExtRepository;
6 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
7 8
8 import javax.annotation.Resource; 9 import javax.annotation.Resource;
...@@ -13,7 +14,10 @@ public class AbstractEtService { ...@@ -13,7 +14,10 @@ public class AbstractEtService {
13 protected LocaleMessageUtil localeMessageUtil; 14 protected LocaleMessageUtil localeMessageUtil;
14 15
15 @Autowired 16 @Autowired
16 - protected ConsignmentExtRepositoryImpl consignmentExtRepository; 17 + protected IConsignmentExtRepository consignmentExtRepository;
18 +
19 + @Autowired
20 + protected IAttachmentRepository attachmentRepository;
17 21
18 /** 22 /**
19 * repository 23 * repository
......
1 +package com.fedex.connect.customer.service.biz;
2 +
3 +import com.fedex.connect.common.dependencies.date.vo.ResponseResultVo;
4 +
5 +public interface IAttachmentService {
6 + ResponseResultVo findHistory(Long userId, Long bizId);
7 +}
1 +package com.fedex.connect.customer.service.biz.impl;
2 +
3 +import com.fedex.connect.common.dependencies.contants.DigitConstants;
4 +import com.fedex.connect.common.dependencies.date.vo.PageResult;
5 +import com.fedex.connect.common.dependencies.date.vo.ResponseResultVo;
6 +import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
7 +import com.fedex.connect.customer.service.AbstractEtService;
8 +import com.fedex.connect.customer.service.biz.IAttachmentService;
9 +import org.springframework.stereotype.Service;
10 +
11 +import java.util.Collections;
12 +import java.util.List;
13 +
14 +/**
15 + * @Author Szl
16 + * @Description 类说明 附件相关service
17 + * @Date 2024/11/4
18 + */
19 +@Service
20 +public class AttachmentServiceImpl extends AbstractEtService implements IAttachmentService {
21 + public ResponseResultVo findHistory(Long userId, Long bizId) {
22 + List<AttachmentHistoryDto> history = attachmentRepository.findHistory(bizId);
23 +
24 + if (history != null) {
25 + history.forEach(attachmentHistoryDto ->
26 + attachmentHistoryDto.setCreatorFlag(
27 + (attachmentHistoryDto.getUploadUserId() != null &&
28 + attachmentHistoryDto.getUploadUserId().equals(userId)) ?
29 + DigitConstants.DIGIT_ONE : DigitConstants.DIGIT_ZERO
30 + )
31 + );
32 + }
33 +
34 + PageResult pageResult = new PageResult();
35 + pageResult.setList(history != null ? history : Collections.emptyList());
36 +
37 + return ResponseResultVo.succ(pageResult);
38 + }
39 +
40 +}
1 +package com.fedex.connect.common.dependencies.enums.sys;
2 +
3 +public enum UserTypeEnum {
4 + LOCAL(0L,"LOCAL","本地账号"),
5 + FCL(1L,"FCL","FCL账号");
6 +
7 + private Long code;
8 + private String enMsg;
9 + private String msg;
10 +
11 + UserTypeEnum(Long code, String enMsg,String msg) {
12 + this.code = code;
13 + this.enMsg = enMsg;
14 + this.msg = msg;
15 + }
16 +
17 + public Long getCode() {
18 + return code;
19 + }
20 +
21 + public void setCode(Long code) {
22 + this.code = code;
23 + }
24 +
25 + public String getEnMsg() {
26 + return enMsg;
27 + }
28 +
29 + public void setEnMsg(String enMsg) {
30 + this.enMsg = enMsg;
31 + }
32 +
33 + public String getMsg() {
34 + return msg;
35 + }
36 +
37 + public void setMsg(String msg) {
38 + this.msg = msg;
39 + }
40 +}
1 package com.fedex.connect.common.dependencies.repository.repo.bi.impl; 1 package com.fedex.connect.common.dependencies.repository.repo.bi.impl;
2 2
3 +import com.fedex.connect.common.dependencies.contants.DatabaseConstants;
3 import com.fedex.connect.common.dependencies.repository.base.BaseDao; 4 import com.fedex.connect.common.dependencies.repository.base.BaseDao;
4 import com.fedex.connect.common.dependencies.repository.repo.bi.IDictionaryEntriesRepository; 5 import com.fedex.connect.common.dependencies.repository.repo.bi.IDictionaryEntriesRepository;
5 import com.fedex.connect.common.model.bi.DictionaryEntries; 6 import com.fedex.connect.common.model.bi.DictionaryEntries;
...@@ -13,6 +14,9 @@ public class DictionaryEntriesImpl extends BaseDao implements IDictionaryEntries ...@@ -13,6 +14,9 @@ public class DictionaryEntriesImpl extends BaseDao implements IDictionaryEntries
13 14
14 @Override 15 @Override
15 public List<DictionaryEntries> selectByExample(DictionaryEntriesExample example) { 16 public List<DictionaryEntries> selectByExample(DictionaryEntriesExample example) {
17 + DictionaryEntriesExample.Criteria criteria = example.createCriteria();
18 + criteria.andStatusEqualTo(DatabaseConstants.GLOBAL_STATUS_VALID);
19 + example.setOrderByClause("CREATE_TIME DESC");
16 return dictionaryEntriesMapper.selectByExample(example); 20 return dictionaryEntriesMapper.selectByExample(example);
17 } 21 }
18 } 22 }
......
1 package com.fedex.connect.common.dependencies.service.bi.impl; 1 package com.fedex.connect.common.dependencies.service.bi.impl;
2 2
3 -import com.fedex.connect.common.dependencies.contants.DatabaseConstants;
4 import com.fedex.connect.common.dependencies.date.model.LogShowModel; 3 import com.fedex.connect.common.dependencies.date.model.LogShowModel;
5 import com.fedex.connect.common.dependencies.service.base.BaseService; 4 import com.fedex.connect.common.dependencies.service.base.BaseService;
6 import com.fedex.connect.common.dependencies.service.bi.IDictionaryEntriesService; 5 import com.fedex.connect.common.dependencies.service.bi.IDictionaryEntriesService;
...@@ -20,9 +19,6 @@ public class DictionaryEntriesServiceImpl extends BaseService implements IDictio ...@@ -20,9 +19,6 @@ public class DictionaryEntriesServiceImpl extends BaseService implements IDictio
20 public List<DictionaryEntries> findAll() { 19 public List<DictionaryEntries> findAll() {
21 try{ 20 try{
22 DictionaryEntriesExample example = new DictionaryEntriesExample(); 21 DictionaryEntriesExample example = new DictionaryEntriesExample();
23 - DictionaryEntriesExample.Criteria criteria = example.createCriteria();
24 - criteria.andStatusEqualTo(DatabaseConstants.GLOBAL_STATUS_VALID);
25 - example.setOrderByClause("CREATE_TIME DESC");
26 return dictionaryEntriesRepository.selectByExample(example); 22 return dictionaryEntriesRepository.selectByExample(example);
27 } catch (Exception e){ 23 } catch (Exception e){
28 log.error(LogShowModel.showException("Exception",e)); 24 log.error(LogShowModel.showException("Exception",e));
......