Showing
27 changed files
with
477 additions
and
56 deletions
| ... | @@ -4,4 +4,6 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo; | ... | @@ -4,4 +4,6 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo; |
| 4 | 4 | ||
| 5 | public interface IAttachmentQueryController { | 5 | public interface IAttachmentQueryController { |
| 6 | ResponseVo queryInfo(Long consignmentId); | 6 | ResponseVo queryInfo(Long consignmentId); |
| 7 | + | ||
| 8 | + ResponseVo queryByRecord(Long recordId); | ||
| 7 | } | 9 | } | ... | ... |
| 1 | package com.fedex.connect.customer.controller.biz; | 1 | package com.fedex.connect.customer.controller.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.AttachmentHistoryQuery; | ||
| 4 | 5 | ||
| 5 | public interface IUploadRecordController { | 6 | public interface IUploadRecordController { |
| 6 | - ResponseVo queryHistoryList(Long consignmentId); | 7 | + ResponseVo queryHistoryList(AttachmentHistoryQuery attachmentHistoryQuery); |
| 7 | } | 8 | } | ... | ... |
| ... | @@ -5,13 +5,15 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo; | ... | @@ -5,13 +5,15 @@ 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.IAttachmentQueryController; | 7 | import com.fedex.connect.customer.controller.biz.IAttachmentQueryController; |
| 8 | -import com.fedex.connect.customer.data.bo.LongBo; | ||
| 9 | import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; | 8 | import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; |
| 10 | import io.swagger.annotations.Api; | 9 | import io.swagger.annotations.Api; |
| 11 | import io.swagger.annotations.ApiOperation; | 10 | import io.swagger.annotations.ApiOperation; |
| 12 | import io.swagger.annotations.ApiParam; | 11 | import io.swagger.annotations.ApiParam; |
| 13 | import lombok.extern.slf4j.Slf4j; | 12 | import lombok.extern.slf4j.Slf4j; |
| 14 | -import org.springframework.web.bind.annotation.*; | 13 | +import org.springframework.web.bind.annotation.PathVariable; |
| 14 | +import org.springframework.web.bind.annotation.PostMapping; | ||
| 15 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 16 | +import org.springframework.web.bind.annotation.RestController; | ||
| 15 | 17 | ||
| 16 | /** | 18 | /** |
| 17 | * @Author Szl | 19 | * @Author Szl |
| ... | @@ -43,4 +45,23 @@ public class AttachmentQueryController extends BaseController implements IAttach | ... | @@ -43,4 +45,23 @@ public class AttachmentQueryController extends BaseController implements IAttach |
| 43 | UserConsignmentInfoQuery userConsignmentInfoQuery = UserConsignmentInfoQuery.getInstance(user,consignmentId); | 45 | UserConsignmentInfoQuery userConsignmentInfoQuery = UserConsignmentInfoQuery.getInstance(user,consignmentId); |
| 44 | return attachmentQueryService.queryInfo(userConsignmentInfoQuery); | 46 | return attachmentQueryService.queryInfo(userConsignmentInfoQuery); |
| 45 | } | 47 | } |
| 48 | + | ||
| 49 | + @Override | ||
| 50 | + @PostMapping("/queryByRecord/{recordId}") | ||
| 51 | + @ApiOperation(value = "ResponseVo", notes = "根据批次号查询用户上传记录") | ||
| 52 | + @OperationMethodLog(describe = "business_log_20005") | ||
| 53 | + public ResponseVo queryByRecord(@ApiParam(value="Record ID",required = true) @PathVariable(value = "recordId") Long recordId) { | ||
| 54 | + /** | ||
| 55 | + * 运单id非空校验 | ||
| 56 | + */ | ||
| 57 | + consignmentInfoValidate.validateConsignmentId(recordId); | ||
| 58 | + /** | ||
| 59 | + * 获取当前用户信息 | ||
| 60 | + */ | ||
| 61 | + User user = this.getCurrentUserInfo(); | ||
| 62 | + /** | ||
| 63 | + * 构造查询对象 | ||
| 64 | + */ | ||
| 65 | + return attachmentQueryService.queryByRecord(recordId); | ||
| 66 | + } | ||
| 46 | } | 67 | } | ... | ... |
| ... | @@ -8,10 +8,9 @@ import com.fedex.connect.customer.controller.biz.IUploadRecordController; | ... | @@ -8,10 +8,9 @@ import com.fedex.connect.customer.controller.biz.IUploadRecordController; |
| 8 | import com.fedex.connect.customer.data.query.AttachmentHistoryQuery; | 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; | ||
| 12 | import lombok.extern.slf4j.Slf4j; | 11 | import lombok.extern.slf4j.Slf4j; |
| 13 | -import org.springframework.web.bind.annotation.PathVariable; | ||
| 14 | import org.springframework.web.bind.annotation.PostMapping; | 12 | import org.springframework.web.bind.annotation.PostMapping; |
| 13 | +import org.springframework.web.bind.annotation.RequestBody; | ||
| 15 | import org.springframework.web.bind.annotation.RequestMapping; | 14 | import org.springframework.web.bind.annotation.RequestMapping; |
| 16 | import org.springframework.web.bind.annotation.RestController; | 15 | import org.springframework.web.bind.annotation.RestController; |
| 17 | 16 | ||
| ... | @@ -30,8 +29,7 @@ public class UploadRecordController extends BaseController implements IUploadRec | ... | @@ -30,8 +29,7 @@ public class UploadRecordController extends BaseController implements IUploadRec |
| 30 | @PostMapping("/queryHistoryList/{consignmentId}") | 29 | @PostMapping("/queryHistoryList/{consignmentId}") |
| 31 | @ApiOperation(value = "ResponseVo", notes = "运单历史上传记录查询") | 30 | @ApiOperation(value = "ResponseVo", notes = "运单历史上传记录查询") |
| 32 | @OperationMethodLog(describe = "business_log_20006") | 31 | @OperationMethodLog(describe = "business_log_20006") |
| 33 | - public ResponseVo queryHistoryList(@ApiParam(value="运单ID",required = true) @PathVariable(value = "consignmentId") Long consignmentId) { | 32 | + public ResponseVo queryHistoryList(@RequestBody AttachmentHistoryQuery attachmentHistoryQuery) { |
| 34 | - AttachmentHistoryQuery attachmentHistoryQuery = AttachmentHistoryQuery.getInstance(consignmentId); | ||
| 35 | /** | 33 | /** |
| 36 | * 运单id非空校验 | 34 | * 运单id非空校验 |
| 37 | */ | 35 | */ | ... | ... |
| 1 | package com.fedex.connect.customer.data.bo; | 1 | package com.fedex.connect.customer.data.bo; |
| 2 | 2 | ||
| 3 | import com.fedex.connect.common.dependencies.annotation.BaseNotBlank; | 3 | import com.fedex.connect.common.dependencies.annotation.BaseNotBlank; |
| 4 | +import com.fedex.connect.common.model.biz.Attachment; | ||
| 4 | import lombok.Data; | 5 | import lombok.Data; |
| 5 | 6 | ||
| 6 | import java.util.List; | 7 | import java.util.List; |
| ... | @@ -29,5 +30,5 @@ public class ConsignmentBo { | ... | @@ -29,5 +30,5 @@ public class ConsignmentBo { |
| 29 | private String destinationCountry; | 30 | private String destinationCountry; |
| 30 | //文件业务类型AWB,INV,PKL,OTH(分运单,发票,箱单和其它这四种类型) | 31 | //文件业务类型AWB,INV,PKL,OTH(分运单,发票,箱单和其它这四种类型) |
| 31 | @BaseNotBlank(describe = "business_field_31008") | 32 | @BaseNotBlank(describe = "business_field_31008") |
| 32 | - private List<String> attachmentBizTypeList; | 33 | + private List<Attachment> attachmentBizTypeList; |
| 33 | } | 34 | } | ... | ... |
| 1 | package com.fedex.connect.customer.data.dto; | 1 | package com.fedex.connect.customer.data.dto; |
| 2 | 2 | ||
| 3 | +import com.fedex.connect.common.model.biz.UploadRecord; | ||
| 3 | import lombok.Data; | 4 | import lombok.Data; |
| 4 | 5 | ||
| 5 | -import java.util.Date; | ||
| 6 | - | ||
| 7 | @Data | 6 | @Data |
| 8 | public class AttachmentHistoryDto { | 7 | public class AttachmentHistoryDto { |
| 9 | - private String uploadUserName; | 8 | + private UploadRecord uploadRecord; |
| 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; | 9 | private Integer creatorFlag; |
| 20 | 10 | ||
| 21 | } | 11 | } | ... | ... |
| ... | @@ -3,6 +3,7 @@ package com.fedex.connect.customer.repository.base; | ... | @@ -3,6 +3,7 @@ package com.fedex.connect.customer.repository.base; |
| 3 | import com.fedex.connect.common.dao.biz.*; | 3 | import com.fedex.connect.common.dao.biz.*; |
| 4 | import com.fedex.connect.customer.repository.dao.AttachmentExtMapper; | 4 | import com.fedex.connect.customer.repository.dao.AttachmentExtMapper; |
| 5 | import com.fedex.connect.customer.repository.dao.ConsignmentExtMapper; | 5 | import com.fedex.connect.customer.repository.dao.ConsignmentExtMapper; |
| 6 | +import com.fedex.connect.customer.repository.dao.UploadRecordExtMapper; | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | 8 | ||
| 8 | public class BaseDao { | 9 | public class BaseDao { |
| ... | @@ -22,4 +23,6 @@ public class BaseDao { | ... | @@ -22,4 +23,6 @@ public class BaseDao { |
| 22 | protected AttachmentExtMapper attachmentExtMapper; | 23 | protected AttachmentExtMapper attachmentExtMapper; |
| 23 | @Autowired | 24 | @Autowired |
| 24 | protected EmailMapper emailMapper; | 25 | protected EmailMapper emailMapper; |
| 26 | + @Autowired | ||
| 27 | + protected UploadRecordExtMapper uploadRecordExtMapper; | ||
| 25 | } | 28 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
server/biz-customer/src/main/java/com/fedex/connect/customer/repository/dao/AttachmentExtMapper.java
| ... | @@ -18,4 +18,8 @@ public interface AttachmentExtMapper { | ... | @@ -18,4 +18,8 @@ public interface AttachmentExtMapper { |
| 18 | "(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} " + |
| 19 | "AND CONSIGNMENT_ID = #{query.consignmentId}) AND STATUS = 1") | 19 | "AND CONSIGNMENT_ID = #{query.consignmentId}) AND STATUS = 1") |
| 20 | List<Attachment> queryInfo(@Param("query") UserConsignmentInfoQuery query); | 20 | List<Attachment> queryInfo(@Param("query") UserConsignmentInfoQuery query); |
| 21 | + | ||
| 22 | + @Select("SELECT * FROM T_BIZ_ATTACHMENT WHERE UPLOAD_RECORD_ID = #{uploadRecordId}") | ||
| 23 | + List<Attachment> getAttachmentsByUploadRecordId(@Param("uploadRecordId") Long uploadRecordId); | ||
| 24 | + | ||
| 21 | } | 25 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -25,7 +25,7 @@ public interface ConsignmentExtMapper { | ... | @@ -25,7 +25,7 @@ public interface ConsignmentExtMapper { |
| 25 | ") WHERE ROWNUM = 1") | 25 | ") WHERE ROWNUM = 1") |
| 26 | Consignment findByConsignmentCode(@Param("consignmentCode") String consignmentCode, @Param("dateParam") LocalDate dateParam); | 26 | Consignment findByConsignmentCode(@Param("consignmentCode") String consignmentCode, @Param("dateParam") LocalDate dateParam); |
| 27 | 27 | ||
| 28 | - @Select("SELECT BC.* FROM T_BIZ_CONSIGNMENT BC INNER JOIN T_BIZ_USER_CONSIGNMENT_MAPPING BUCM ON(BC.ID = BUCM.CONSIGNMENT_ID) " + | 28 | + @Select("SELECT BC.* FROM T_BIZ_CONSIGNMENT BC LEFT JOIN T_BIZ_USER_CONSIGNMENT_MAPPING BUCM ON(BC.ID = BUCM.CONSIGNMENT_ID) " + |
| 29 | "WHERE BC.ID = #{query.consignmentId} AND (BC.USER_UUID = #{query.userUuid} OR BUCM.USER_ID = #{query.userId})") | 29 | "WHERE BC.ID = #{query.consignmentId} AND (BC.USER_UUID = #{query.userUuid} OR BUCM.USER_ID = #{query.userId})") |
| 30 | Consignment findConsignmentInfo(@Param("query") UserConsignmentInfoQuery query); | 30 | Consignment findConsignmentInfo(@Param("query") UserConsignmentInfoQuery query); |
| 31 | 31 | ... | ... |
| 1 | package com.fedex.connect.customer.repository.dao; | 1 | package com.fedex.connect.customer.repository.dao; |
| 2 | 2 | ||
| 3 | +import com.fedex.connect.common.model.biz.UploadRecord; | ||
| 4 | +import com.fedex.connect.customer.data.query.AttachmentHistoryQuery; | ||
| 3 | import org.apache.ibatis.annotations.Mapper; | 5 | import org.apache.ibatis.annotations.Mapper; |
| 4 | 6 | ||
| 7 | +import java.util.List; | ||
| 8 | + | ||
| 5 | @Mapper | 9 | @Mapper |
| 6 | public interface UploadRecordExtMapper { | 10 | public interface UploadRecordExtMapper { |
| 11 | + List<UploadRecord> getUploadRecordsByConsignmentId(AttachmentHistoryQuery attachmentHistoryQuery); | ||
| 7 | } | 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.UploadRecordExtMapper"> | ||
| 4 | + <resultMap id="BaseResultMap" type="com.fedex.connect.common.model.biz.UploadRecord"> | ||
| 5 | + <id column="ID" jdbcType="NUMERIC" property="id" /> | ||
| 6 | + <result column="CONSIGNMENT_ID" jdbcType="NUMERIC" property="consignmentId" /> | ||
| 7 | + <result column="STATUS_CODE" jdbcType="VARCHAR" property="statusCode" /> | ||
| 8 | + <result column="STATUS_NAME" jdbcType="VARCHAR" property="statusName" /> | ||
| 9 | + <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" /> | ||
| 10 | + <result column="CREATE_USER_ID" jdbcType="NUMERIC" property="createUserId" /> | ||
| 11 | + <result column="CREATE_USER_NAME" jdbcType="VARCHAR" property="createUserName" /> | ||
| 12 | + <result column="MODIFY_TIME" jdbcType="TIMESTAMP" property="modifyTime" /> | ||
| 13 | + <result column="MODIFY_USER_ID" jdbcType="NUMERIC" property="modifyUserId" /> | ||
| 14 | + <result column="MODIFY_USER_NAME" jdbcType="VARCHAR" property="modifyUserName" /> | ||
| 15 | + <result column="CONSIGNMENT_CODE" jdbcType="VARCHAR" property="consignmentCode" /> | ||
| 16 | + </resultMap> | ||
| 17 | + <sql id="Example_Where_Clause"> | ||
| 18 | + <where> | ||
| 19 | + <foreach collection="oredCriteria" item="criteria" separator="or"> | ||
| 20 | + <if test="criteria.valid"> | ||
| 21 | + <trim prefix="(" prefixOverrides="and" suffix=")"> | ||
| 22 | + <foreach collection="criteria.criteria" item="criterion"> | ||
| 23 | + <choose> | ||
| 24 | + <when test="criterion.noValue"> | ||
| 25 | + and ${criterion.condition} | ||
| 26 | + </when> | ||
| 27 | + <when test="criterion.singleValue"> | ||
| 28 | + and ${criterion.condition} #{criterion.value} | ||
| 29 | + </when> | ||
| 30 | + <when test="criterion.betweenValue"> | ||
| 31 | + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} | ||
| 32 | + </when> | ||
| 33 | + <when test="criterion.listValue"> | ||
| 34 | + and ${criterion.condition} | ||
| 35 | + <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> | ||
| 36 | + #{listItem} | ||
| 37 | + </foreach> | ||
| 38 | + </when> | ||
| 39 | + </choose> | ||
| 40 | + </foreach> | ||
| 41 | + </trim> | ||
| 42 | + </if> | ||
| 43 | + </foreach> | ||
| 44 | + </where> | ||
| 45 | + </sql> | ||
| 46 | + <sql id="Update_By_Example_Where_Clause"> | ||
| 47 | + <where> | ||
| 48 | + <foreach collection="example.oredCriteria" item="criteria" separator="or"> | ||
| 49 | + <if test="criteria.valid"> | ||
| 50 | + <trim prefix="(" prefixOverrides="and" suffix=")"> | ||
| 51 | + <foreach collection="criteria.criteria" item="criterion"> | ||
| 52 | + <choose> | ||
| 53 | + <when test="criterion.noValue"> | ||
| 54 | + and ${criterion.condition} | ||
| 55 | + </when> | ||
| 56 | + <when test="criterion.singleValue"> | ||
| 57 | + and ${criterion.condition} #{criterion.value} | ||
| 58 | + </when> | ||
| 59 | + <when test="criterion.betweenValue"> | ||
| 60 | + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} | ||
| 61 | + </when> | ||
| 62 | + <when test="criterion.listValue"> | ||
| 63 | + and ${criterion.condition} | ||
| 64 | + <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> | ||
| 65 | + #{listItem} | ||
| 66 | + </foreach> | ||
| 67 | + </when> | ||
| 68 | + </choose> | ||
| 69 | + </foreach> | ||
| 70 | + </trim> | ||
| 71 | + </if> | ||
| 72 | + </foreach> | ||
| 73 | + </where> | ||
| 74 | + </sql> | ||
| 75 | + <sql id="Base_Column_List"> | ||
| 76 | + ID, CONSIGNMENT_ID, STATUS_CODE, STATUS_NAME, CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME, | ||
| 77 | + MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME, CONSIGNMENT_CODE | ||
| 78 | + </sql> | ||
| 79 | + <select id="selectByExample" parameterType="com.fedex.connect.common.model.biz.UploadRecordExample" resultMap="BaseResultMap"> | ||
| 80 | + <include refid="OracleDialectPrefix" /> | ||
| 81 | + select | ||
| 82 | + <if test="distinct"> | ||
| 83 | + distinct | ||
| 84 | + </if> | ||
| 85 | + 'true' as QUERYID, | ||
| 86 | + <include refid="Base_Column_List" /> | ||
| 87 | + from T_BIZ_UPLOAD_RECORD | ||
| 88 | + <if test="_parameter != null"> | ||
| 89 | + <include refid="Example_Where_Clause" /> | ||
| 90 | + </if> | ||
| 91 | + <if test="orderByClause != null"> | ||
| 92 | + order by ${orderByClause} | ||
| 93 | + </if> | ||
| 94 | + <include refid="OracleDialectSuffix" /> | ||
| 95 | + </select> | ||
| 96 | + <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | ||
| 97 | + select | ||
| 98 | + <include refid="Base_Column_List" /> | ||
| 99 | + from T_BIZ_UPLOAD_RECORD | ||
| 100 | + where ID = #{id,jdbcType=NUMERIC} | ||
| 101 | + </select> | ||
| 102 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> | ||
| 103 | + delete from T_BIZ_UPLOAD_RECORD | ||
| 104 | + where ID = #{id,jdbcType=NUMERIC} | ||
| 105 | + </delete> | ||
| 106 | + <delete id="deleteByExample" parameterType="com.fedex.connect.common.model.biz.UploadRecordExample"> | ||
| 107 | + delete from T_BIZ_UPLOAD_RECORD | ||
| 108 | + <if test="_parameter != null"> | ||
| 109 | + <include refid="Example_Where_Clause" /> | ||
| 110 | + </if> | ||
| 111 | + </delete> | ||
| 112 | + <insert id="insert" parameterType="com.fedex.connect.common.model.biz.UploadRecord"> | ||
| 113 | + <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> | ||
| 114 | + SELECT SEQ_T_BIZ_UPLOAD_RECORD.NEXTVAL FROM DUAL | ||
| 115 | + </selectKey> | ||
| 116 | + insert into T_BIZ_UPLOAD_RECORD (ID, CONSIGNMENT_ID, STATUS_CODE, | ||
| 117 | + STATUS_NAME, CREATE_TIME, CREATE_USER_ID, | ||
| 118 | + CREATE_USER_NAME, MODIFY_TIME, MODIFY_USER_ID, | ||
| 119 | + MODIFY_USER_NAME, CONSIGNMENT_CODE) | ||
| 120 | + values (#{id,jdbcType=NUMERIC}, #{consignmentId,jdbcType=NUMERIC}, #{statusCode,jdbcType=VARCHAR}, | ||
| 121 | + #{statusName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=NUMERIC}, | ||
| 122 | + #{createUserName,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, #{modifyUserId,jdbcType=NUMERIC}, | ||
| 123 | + #{modifyUserName,jdbcType=VARCHAR}, #{consignmentCode,jdbcType=VARCHAR}) | ||
| 124 | + </insert> | ||
| 125 | + <insert id="insertSelective" parameterType="com.fedex.connect.common.model.biz.UploadRecord"> | ||
| 126 | + <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> | ||
| 127 | + SELECT SEQ_T_BIZ_UPLOAD_RECORD.NEXTVAL FROM DUAL | ||
| 128 | + </selectKey> | ||
| 129 | + insert into T_BIZ_UPLOAD_RECORD | ||
| 130 | + <trim prefix="(" suffix=")" suffixOverrides=","> | ||
| 131 | + ID, | ||
| 132 | + <if test="consignmentId != null"> | ||
| 133 | + CONSIGNMENT_ID, | ||
| 134 | + </if> | ||
| 135 | + <if test="statusCode != null"> | ||
| 136 | + STATUS_CODE, | ||
| 137 | + </if> | ||
| 138 | + <if test="statusName != null"> | ||
| 139 | + STATUS_NAME, | ||
| 140 | + </if> | ||
| 141 | + <if test="createTime != null"> | ||
| 142 | + CREATE_TIME, | ||
| 143 | + </if> | ||
| 144 | + <if test="createUserId != null"> | ||
| 145 | + CREATE_USER_ID, | ||
| 146 | + </if> | ||
| 147 | + <if test="createUserName != null"> | ||
| 148 | + CREATE_USER_NAME, | ||
| 149 | + </if> | ||
| 150 | + <if test="modifyTime != null"> | ||
| 151 | + MODIFY_TIME, | ||
| 152 | + </if> | ||
| 153 | + <if test="modifyUserId != null"> | ||
| 154 | + MODIFY_USER_ID, | ||
| 155 | + </if> | ||
| 156 | + <if test="modifyUserName != null"> | ||
| 157 | + MODIFY_USER_NAME, | ||
| 158 | + </if> | ||
| 159 | + <if test="consignmentCode != null"> | ||
| 160 | + CONSIGNMENT_CODE, | ||
| 161 | + </if> | ||
| 162 | + </trim> | ||
| 163 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | ||
| 164 | + #{id,jdbcType=NUMERIC}, | ||
| 165 | + <if test="consignmentId != null"> | ||
| 166 | + #{consignmentId,jdbcType=NUMERIC}, | ||
| 167 | + </if> | ||
| 168 | + <if test="statusCode != null"> | ||
| 169 | + #{statusCode,jdbcType=VARCHAR}, | ||
| 170 | + </if> | ||
| 171 | + <if test="statusName != null"> | ||
| 172 | + #{statusName,jdbcType=VARCHAR}, | ||
| 173 | + </if> | ||
| 174 | + <if test="createTime != null"> | ||
| 175 | + #{createTime,jdbcType=TIMESTAMP}, | ||
| 176 | + </if> | ||
| 177 | + <if test="createUserId != null"> | ||
| 178 | + #{createUserId,jdbcType=NUMERIC}, | ||
| 179 | + </if> | ||
| 180 | + <if test="createUserName != null"> | ||
| 181 | + #{createUserName,jdbcType=VARCHAR}, | ||
| 182 | + </if> | ||
| 183 | + <if test="modifyTime != null"> | ||
| 184 | + #{modifyTime,jdbcType=TIMESTAMP}, | ||
| 185 | + </if> | ||
| 186 | + <if test="modifyUserId != null"> | ||
| 187 | + #{modifyUserId,jdbcType=NUMERIC}, | ||
| 188 | + </if> | ||
| 189 | + <if test="modifyUserName != null"> | ||
| 190 | + #{modifyUserName,jdbcType=VARCHAR}, | ||
| 191 | + </if> | ||
| 192 | + <if test="consignmentCode != null"> | ||
| 193 | + #{consignmentCode,jdbcType=VARCHAR}, | ||
| 194 | + </if> | ||
| 195 | + </trim> | ||
| 196 | + </insert> | ||
| 197 | + <select id="countByExample" parameterType="com.fedex.connect.common.model.biz.UploadRecordExample" resultType="java.lang.Long"> | ||
| 198 | + select count(*) from T_BIZ_UPLOAD_RECORD | ||
| 199 | + <if test="_parameter != null"> | ||
| 200 | + <include refid="Example_Where_Clause" /> | ||
| 201 | + </if> | ||
| 202 | + </select> | ||
| 203 | + <update id="updateByExampleSelective" parameterType="map"> | ||
| 204 | + update T_BIZ_UPLOAD_RECORD | ||
| 205 | + <set> | ||
| 206 | + <if test="record.id != null"> | ||
| 207 | + ID = #{record.id,jdbcType=NUMERIC}, | ||
| 208 | + </if> | ||
| 209 | + <if test="record.consignmentId != null"> | ||
| 210 | + CONSIGNMENT_ID = #{record.consignmentId,jdbcType=NUMERIC}, | ||
| 211 | + </if> | ||
| 212 | + <if test="record.statusCode != null"> | ||
| 213 | + STATUS_CODE = #{record.statusCode,jdbcType=VARCHAR}, | ||
| 214 | + </if> | ||
| 215 | + <if test="record.statusName != null"> | ||
| 216 | + STATUS_NAME = #{record.statusName,jdbcType=VARCHAR}, | ||
| 217 | + </if> | ||
| 218 | + <if test="record.createTime != null"> | ||
| 219 | + CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP}, | ||
| 220 | + </if> | ||
| 221 | + <if test="record.createUserId != null"> | ||
| 222 | + CREATE_USER_ID = #{record.createUserId,jdbcType=NUMERIC}, | ||
| 223 | + </if> | ||
| 224 | + <if test="record.createUserName != null"> | ||
| 225 | + CREATE_USER_NAME = #{record.createUserName,jdbcType=VARCHAR}, | ||
| 226 | + </if> | ||
| 227 | + <if test="record.modifyTime != null"> | ||
| 228 | + MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP}, | ||
| 229 | + </if> | ||
| 230 | + <if test="record.modifyUserId != null"> | ||
| 231 | + MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC}, | ||
| 232 | + </if> | ||
| 233 | + <if test="record.modifyUserName != null"> | ||
| 234 | + MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR}, | ||
| 235 | + </if> | ||
| 236 | + <if test="record.consignmentCode != null"> | ||
| 237 | + CONSIGNMENT_CODE = #{record.consignmentCode,jdbcType=VARCHAR}, | ||
| 238 | + </if> | ||
| 239 | + </set> | ||
| 240 | + <if test="_parameter != null"> | ||
| 241 | + <include refid="Update_By_Example_Where_Clause" /> | ||
| 242 | + </if> | ||
| 243 | + </update> | ||
| 244 | + <update id="updateByExample" parameterType="map"> | ||
| 245 | + update T_BIZ_UPLOAD_RECORD | ||
| 246 | + set ID = #{record.id,jdbcType=NUMERIC}, | ||
| 247 | + CONSIGNMENT_ID = #{record.consignmentId,jdbcType=NUMERIC}, | ||
| 248 | + STATUS_CODE = #{record.statusCode,jdbcType=VARCHAR}, | ||
| 249 | + STATUS_NAME = #{record.statusName,jdbcType=VARCHAR}, | ||
| 250 | + CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP}, | ||
| 251 | + CREATE_USER_ID = #{record.createUserId,jdbcType=NUMERIC}, | ||
| 252 | + CREATE_USER_NAME = #{record.createUserName,jdbcType=VARCHAR}, | ||
| 253 | + MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP}, | ||
| 254 | + MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC}, | ||
| 255 | + MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR}, | ||
| 256 | + CONSIGNMENT_CODE = #{record.consignmentCode,jdbcType=VARCHAR} | ||
| 257 | + <if test="_parameter != null"> | ||
| 258 | + <include refid="Update_By_Example_Where_Clause" /> | ||
| 259 | + </if> | ||
| 260 | + </update> | ||
| 261 | + <update id="updateByPrimaryKeySelective" parameterType="com.fedex.connect.common.model.biz.UploadRecord"> | ||
| 262 | + update T_BIZ_UPLOAD_RECORD | ||
| 263 | + <set> | ||
| 264 | + <if test="consignmentId != null"> | ||
| 265 | + CONSIGNMENT_ID = #{consignmentId,jdbcType=NUMERIC}, | ||
| 266 | + </if> | ||
| 267 | + <if test="statusCode != null"> | ||
| 268 | + STATUS_CODE = #{statusCode,jdbcType=VARCHAR}, | ||
| 269 | + </if> | ||
| 270 | + <if test="statusName != null"> | ||
| 271 | + STATUS_NAME = #{statusName,jdbcType=VARCHAR}, | ||
| 272 | + </if> | ||
| 273 | + <if test="createTime != null"> | ||
| 274 | + CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}, | ||
| 275 | + </if> | ||
| 276 | + <if test="createUserId != null"> | ||
| 277 | + CREATE_USER_ID = #{createUserId,jdbcType=NUMERIC}, | ||
| 278 | + </if> | ||
| 279 | + <if test="createUserName != null"> | ||
| 280 | + CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR}, | ||
| 281 | + </if> | ||
| 282 | + <if test="modifyTime != null"> | ||
| 283 | + MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP}, | ||
| 284 | + </if> | ||
| 285 | + <if test="modifyUserId != null"> | ||
| 286 | + MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC}, | ||
| 287 | + </if> | ||
| 288 | + <if test="modifyUserName != null"> | ||
| 289 | + MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR}, | ||
| 290 | + </if> | ||
| 291 | + <if test="consignmentCode != null"> | ||
| 292 | + CONSIGNMENT_CODE = #{consignmentCode,jdbcType=VARCHAR}, | ||
| 293 | + </if> | ||
| 294 | + </set> | ||
| 295 | + where ID = #{id,jdbcType=NUMERIC} | ||
| 296 | + </update> | ||
| 297 | + <update id="updateByPrimaryKey" parameterType="com.fedex.connect.common.model.biz.UploadRecord"> | ||
| 298 | + update T_BIZ_UPLOAD_RECORD | ||
| 299 | + set CONSIGNMENT_ID = #{consignmentId,jdbcType=NUMERIC}, | ||
| 300 | + STATUS_CODE = #{statusCode,jdbcType=VARCHAR}, | ||
| 301 | + STATUS_NAME = #{statusName,jdbcType=VARCHAR}, | ||
| 302 | + CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}, | ||
| 303 | + CREATE_USER_ID = #{createUserId,jdbcType=NUMERIC}, | ||
| 304 | + CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR}, | ||
| 305 | + MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP}, | ||
| 306 | + MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC}, | ||
| 307 | + MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR}, | ||
| 308 | + CONSIGNMENT_CODE = #{consignmentCode,jdbcType=VARCHAR} | ||
| 309 | + where ID = #{id,jdbcType=NUMERIC} | ||
| 310 | + </update> | ||
| 311 | + <sql id="OracleDialectPrefix"> | ||
| 312 | + <if test="start != null and start >= 0 and size != null and size >= 0"> | ||
| 313 | + select * from ( select row_.*, rownum rownum_ from ( | ||
| 314 | + </if> | ||
| 315 | + </sql> | ||
| 316 | + | ||
| 317 | + <sql id="OracleDialectSuffix"> | ||
| 318 | + <if test="start != null and start >= 0 and size != null and size >= 0"> | ||
| 319 | + <![CDATA[ ) row_ ) where rownum_ > #{start} and rownum_ <= #{start} + #{size} ]]> | ||
| 320 | + </if> | ||
| 321 | + </sql> | ||
| 322 | + | ||
| 323 | + <select id="getUploadRecordsByConsignmentId" resultType="com.fedex.connect.common.model.biz.UploadRecord"> | ||
| 324 | + <include refid="OracleDialectPrefix"/> | ||
| 325 | + SELECT | ||
| 326 | + * | ||
| 327 | + FROM | ||
| 328 | + T_BIZ_UPLOAD_RECORD | ||
| 329 | + WHERE | ||
| 330 | + CONSIGNMENT_ID = #{consignmentId} | ||
| 331 | + <include refid="OracleDialectSuffix" /> | ||
| 332 | + </select> | ||
| 333 | +</mapper> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -15,4 +15,6 @@ public interface IAttachmentRepository { | ... | @@ -15,4 +15,6 @@ public interface IAttachmentRepository { |
| 15 | Attachment saveOrUpdate(Attachment entity); | 15 | Attachment saveOrUpdate(Attachment entity); |
| 16 | 16 | ||
| 17 | void saveOrUpdateAll(List<Attachment> list); | 17 | void saveOrUpdateAll(List<Attachment> list); |
| 18 | + | ||
| 19 | + List<Attachment> getAttachmentsByUploadRecordId(Long uploadRecordId); | ||
| 18 | } | 20 | } |
| ... | \ 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.UploadRecord; | 3 | import com.fedex.connect.common.model.biz.UploadRecord; |
| 4 | +import com.fedex.connect.customer.data.query.AttachmentHistoryQuery; | ||
| 4 | 5 | ||
| 5 | import java.util.List; | 6 | import java.util.List; |
| 6 | 7 | ||
| ... | @@ -21,4 +22,12 @@ public interface IUploadRecordRepository { | ... | @@ -21,4 +22,12 @@ public interface IUploadRecordRepository { |
| 21 | * @return void | 22 | * @return void |
| 22 | */ | 23 | */ |
| 23 | void saveOrUpdateAll(List<UploadRecord> list); | 24 | void saveOrUpdateAll(List<UploadRecord> list); |
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * @Author Szl | ||
| 28 | + * @Description 功能说明 根据运单id查询历史上传数据 | ||
| 29 | + * @Date 2024/12/16 | ||
| 30 | + * @return java.util.List<com.fedex.connect.common.model.biz.UploadRecord> | ||
| 31 | + */ | ||
| 32 | + List<UploadRecord> getUploadRecordsByConsignmentId(AttachmentHistoryQuery attachmentHistoryQuery); | ||
| 24 | } | 33 | } | ... | ... |
| 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.Attachment; | 3 | import com.fedex.connect.common.model.biz.Attachment; |
| 4 | -import com.fedex.connect.common.model.biz.UploadRecord; | ||
| 5 | import com.fedex.connect.customer.data.dto.AttachmentHistoryDto; | 4 | import com.fedex.connect.customer.data.dto.AttachmentHistoryDto; |
| 6 | import com.fedex.connect.customer.data.query.AttachmentHistoryQuery; | 5 | import com.fedex.connect.customer.data.query.AttachmentHistoryQuery; |
| 7 | import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; | 6 | import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; |
| ... | @@ -52,4 +51,9 @@ public class AttachmentRepositoryImpl extends BaseDao implements IAttachmentRepo | ... | @@ -52,4 +51,9 @@ public class AttachmentRepositoryImpl extends BaseDao implements IAttachmentRepo |
| 52 | } | 51 | } |
| 53 | }); | 52 | }); |
| 54 | } | 53 | } |
| 54 | + | ||
| 55 | + @Override | ||
| 56 | + public List<Attachment> getAttachmentsByUploadRecordId(Long uploadRecordId) { | ||
| 57 | + return attachmentExtMapper.getAttachmentsByUploadRecordId(uploadRecordId); | ||
| 58 | + } | ||
| 55 | } | 59 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 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.UploadRecord; | 3 | import com.fedex.connect.common.model.biz.UploadRecord; |
| 4 | +import com.fedex.connect.customer.data.query.AttachmentHistoryQuery; | ||
| 4 | import com.fedex.connect.customer.repository.base.BaseDao; | 5 | import com.fedex.connect.customer.repository.base.BaseDao; |
| 5 | import com.fedex.connect.customer.repository.repo.IUploadRecordRepository; | 6 | import com.fedex.connect.customer.repository.repo.IUploadRecordRepository; |
| 6 | import org.springframework.stereotype.Repository; | 7 | import org.springframework.stereotype.Repository; |
| ... | @@ -31,4 +32,11 @@ public class UploadRecordRepositoryImpl extends BaseDao implements IUploadRecord | ... | @@ -31,4 +32,11 @@ public class UploadRecordRepositoryImpl extends BaseDao implements IUploadRecord |
| 31 | } | 32 | } |
| 32 | }); | 33 | }); |
| 33 | } | 34 | } |
| 35 | + | ||
| 36 | + @Override | ||
| 37 | + public List<UploadRecord> getUploadRecordsByConsignmentId(AttachmentHistoryQuery attachmentHistoryQuery) { | ||
| 38 | + return uploadRecordExtMapper.getUploadRecordsByConsignmentId(attachmentHistoryQuery); | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + | ||
| 34 | } | 42 | } | ... | ... |
| ... | @@ -5,4 +5,6 @@ import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; | ... | @@ -5,4 +5,6 @@ import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery; |
| 5 | 5 | ||
| 6 | public interface IAttachmentQueryService { | 6 | public interface IAttachmentQueryService { |
| 7 | ResponseVo queryInfo(UserConsignmentInfoQuery userConsignmentInfoQuery); | 7 | ResponseVo queryInfo(UserConsignmentInfoQuery userConsignmentInfoQuery); |
| 8 | + | ||
| 9 | + ResponseVo queryByRecord(Long recordId); | ||
| 8 | } | 10 | } | ... | ... |
| ... | @@ -8,7 +8,7 @@ import java.util.List; | ... | @@ -8,7 +8,7 @@ import java.util.List; |
| 8 | 8 | ||
| 9 | public interface IAttachmentService { | 9 | public interface IAttachmentService { |
| 10 | List<Attachment> uploadAttachments(MultipartFile[] files, | 10 | List<Attachment> uploadAttachments(MultipartFile[] files, |
| 11 | - List<String> attachmentBizTypeList, | 11 | + List<Attachment> attachmentBizTypeList, |
| 12 | User user, | 12 | User user, |
| 13 | String consignmentCode); | 13 | String consignmentCode); |
| 14 | 14 | ... | ... |
| ... | @@ -28,4 +28,9 @@ public class AttachmentQueryServiceImpl extends BaseService implements IAttachme | ... | @@ -28,4 +28,9 @@ public class AttachmentQueryServiceImpl extends BaseService implements IAttachme |
| 28 | List<Attachment> attachmentList = attachmentRepository.queryInfo(userConsignmentInfoQuery); | 28 | List<Attachment> attachmentList = attachmentRepository.queryInfo(userConsignmentInfoQuery); |
| 29 | return responseUtils.success(attachmentList); | 29 | return responseUtils.success(attachmentList); |
| 30 | } | 30 | } |
| 31 | + | ||
| 32 | + @Override | ||
| 33 | + public ResponseVo queryByRecord(Long recordId) { | ||
| 34 | + return responseUtils.success(attachmentRepository.getAttachmentsByUploadRecordId(recordId)); | ||
| 35 | + } | ||
| 31 | } | 36 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -7,6 +7,7 @@ import com.fedex.connect.common.model.sys.User; | ... | @@ -7,6 +7,7 @@ import com.fedex.connect.common.model.sys.User; |
| 7 | import com.fedex.connect.customer.service.base.BaseService; | 7 | import com.fedex.connect.customer.service.base.BaseService; |
| 8 | import com.fedex.connect.customer.service.biz.IAttachmentService; | 8 | import com.fedex.connect.customer.service.biz.IAttachmentService; |
| 9 | import com.fedex.connect.customer.util.service.biz.AttachmentUtil; | 9 | import com.fedex.connect.customer.util.service.biz.AttachmentUtil; |
| 10 | +import org.apache.commons.lang3.StringUtils; | ||
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
| 12 | import org.springframework.web.multipart.MultipartFile; | 13 | import org.springframework.web.multipart.MultipartFile; |
| ... | @@ -48,19 +49,33 @@ public class AttachmentServiceImpl extends BaseService implements IAttachmentSer | ... | @@ -48,19 +49,33 @@ public class AttachmentServiceImpl extends BaseService implements IAttachmentSer |
| 48 | * @return void | 49 | * @return void |
| 49 | */ | 50 | */ |
| 50 | public List<Attachment> uploadAttachments(MultipartFile[] files, | 51 | public List<Attachment> uploadAttachments(MultipartFile[] files, |
| 51 | - List<String> attachmentBizTypeList, | 52 | + List<Attachment> attachmentBizTypeList, |
| 52 | User user, | 53 | User user, |
| 53 | String consignmentCode){ | 54 | String consignmentCode){ |
| 54 | List<Attachment> attachmentList = new ArrayList<>(); | 55 | List<Attachment> attachmentList = new ArrayList<>(); |
| 55 | String yyyyMMddHHmmss = DateUtil.yyyyMMddHHmmss(new Date()); | 56 | String yyyyMMddHHmmss = DateUtil.yyyyMMddHHmmss(new Date()); |
| 56 | try { | 57 | try { |
| 57 | - for (int i = 0; i < files.length; i++) { | 58 | + int i = 0; |
| 58 | - MultipartFile file = files[i]; | 59 | + for (Attachment attachment : attachmentBizTypeList) { |
| 59 | - String bizType = attachmentBizTypeList.get(i); | 60 | + /** |
| 61 | + * 判断是否为需要复制过来的历史图片,如果是则复制,如果不是则新增 | ||
| 62 | + */ | ||
| 63 | + String bizType = attachment.getBizTypeCode(); | ||
| 60 | //构造文件后缀 | 64 | //构造文件后缀 |
| 61 | String fileSuffix = yyyyMMddHHmmss + BaseSeparatorConstants.SEPARATOR_UNDERLINE + String.format("%03d",(i + 1)); | 65 | String fileSuffix = yyyyMMddHHmmss + BaseSeparatorConstants.SEPARATOR_UNDERLINE + String.format("%03d",(i + 1)); |
| 62 | - Attachment attachment = attachmentUtil.uploadFile(file, bizType, user, consignmentCode, fileSuffix); | 66 | + String filePath = attachment.getFilePath(); |
| 63 | - attachmentList.add(attachment); | 67 | + Attachment attachmentNew = null; |
| 68 | + if (StringUtils.isEmpty(filePath)){ | ||
| 69 | + MultipartFile file = attachmentUtil.findFileByName(files,attachment.getFileName()); | ||
| 70 | + attachmentNew = attachmentUtil.uploadFile(file, bizType, user, consignmentCode, fileSuffix); | ||
| 71 | + }else { | ||
| 72 | + attachmentNew = attachment; | ||
| 73 | + attachmentNew.setId(null); | ||
| 74 | + attachmentNew.setCreateTime(new Date()); | ||
| 75 | + attachmentNew.setModifyTime(new Date()); | ||
| 76 | + } | ||
| 77 | + attachmentList.add(attachmentNew); | ||
| 78 | + ++i; | ||
| 64 | } | 79 | } |
| 65 | }catch(Exception ex){ | 80 | }catch(Exception ex){ |
| 66 | //如果上传过程中存在失败,则所有已上传的文件进行删除 | 81 | //如果上传过程中存在失败,则所有已上传的文件进行删除 | ... | ... |
| ... | @@ -3,6 +3,7 @@ package com.fedex.connect.customer.service.biz.impl; | ... | @@ -3,6 +3,7 @@ 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.biz.UploadRecord; | ||
| 6 | import com.fedex.connect.common.model.sys.User; | 7 | import com.fedex.connect.common.model.sys.User; |
| 7 | import com.fedex.connect.customer.data.dto.AttachmentHistoryDto; | 8 | import com.fedex.connect.customer.data.dto.AttachmentHistoryDto; |
| 8 | import com.fedex.connect.customer.data.query.AttachmentHistoryQuery; | 9 | import com.fedex.connect.customer.data.query.AttachmentHistoryQuery; |
| ... | @@ -10,6 +11,7 @@ import com.fedex.connect.customer.service.base.BaseService; | ... | @@ -10,6 +11,7 @@ import com.fedex.connect.customer.service.base.BaseService; |
| 10 | import com.fedex.connect.customer.service.biz.IUploadRecordService; | 11 | import com.fedex.connect.customer.service.biz.IUploadRecordService; |
| 11 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
| 12 | 13 | ||
| 14 | +import java.util.ArrayList; | ||
| 13 | import java.util.Collections; | 15 | import java.util.Collections; |
| 14 | import java.util.List; | 16 | import java.util.List; |
| 15 | 17 | ||
| ... | @@ -29,22 +31,23 @@ public class UploadRecordServiceImpl extends BaseService implements IUploadRecor | ... | @@ -29,22 +31,23 @@ public class UploadRecordServiceImpl extends BaseService implements IUploadRecor |
| 29 | * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo | 31 | * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo |
| 30 | */ | 32 | */ |
| 31 | public ResponseVo findHistory(AttachmentHistoryQuery attachmentHistoryQuery, User user) { | 33 | public ResponseVo findHistory(AttachmentHistoryQuery attachmentHistoryQuery, User user) { |
| 32 | - List<AttachmentHistoryDto> history = attachmentRepository.findHistory(attachmentHistoryQuery); | 34 | + List<UploadRecord> history = uploadRecordRepository.getUploadRecordsByConsignmentId(attachmentHistoryQuery); |
| 33 | - | 35 | + List<AttachmentHistoryDto> attachmentHistoryDtos = new ArrayList<>(); |
| 34 | if (history != null) { | 36 | if (history != null) { |
| 35 | - history.forEach(attachmentHistoryDto -> | 37 | + for (UploadRecord uploadRecord : history) { |
| 38 | + AttachmentHistoryDto attachmentHistoryDto = new AttachmentHistoryDto(); | ||
| 39 | + attachmentHistoryDto.setUploadRecord(uploadRecord); | ||
| 36 | attachmentHistoryDto.setCreatorFlag( | 40 | attachmentHistoryDto.setCreatorFlag( |
| 37 | - (attachmentHistoryDto.getUploadUserId() != null && | 41 | + (uploadRecord.getCreateUserId() != null) ? |
| 38 | - attachmentHistoryDto.getUploadUserId().equals(user.getId())) ? | ||
| 39 | DigitConstants.DIGIT_ONE : DigitConstants.DIGIT_ZERO | 42 | DigitConstants.DIGIT_ONE : DigitConstants.DIGIT_ZERO |
| 40 | - ) | ||
| 41 | ); | 43 | ); |
| 44 | + attachmentHistoryDtos.add(attachmentHistoryDto); | ||
| 45 | + } | ||
| 42 | } | 46 | } |
| 43 | - | ||
| 44 | PageResult pageResult = new PageResult(); | 47 | PageResult pageResult = new PageResult(); |
| 45 | pageResult.setPage(attachmentHistoryQuery.getPage()); | 48 | pageResult.setPage(attachmentHistoryQuery.getPage()); |
| 46 | pageResult.setSize(attachmentHistoryQuery.getSize()); | 49 | pageResult.setSize(attachmentHistoryQuery.getSize()); |
| 47 | - pageResult.setList(history != null ? history : Collections.emptyList()); | 50 | + pageResult.setList(attachmentHistoryDtos != null ? attachmentHistoryDtos : Collections.emptyList()); |
| 48 | 51 | ||
| 49 | return responseUtils.success(pageResult); | 52 | return responseUtils.success(pageResult); |
| 50 | } | 53 | } | ... | ... |
| ... | @@ -108,7 +108,7 @@ public class AttachmentUtil { | ... | @@ -108,7 +108,7 @@ public class AttachmentUtil { |
| 108 | //用户上传原文件名称 | 108 | //用户上传原文件名称 |
| 109 | attachment.setSourceFileName(sourceFileName); | 109 | attachment.setSourceFileName(sourceFileName); |
| 110 | //生成系统文件名称例子:AWB_123456789012_20241023164532982_001.pdf | 110 | //生成系统文件名称例子:AWB_123456789012_20241023164532982_001.pdf |
| 111 | - String fileName = AttachmentBizTypeEnum.valueOf(bizType).getExt1() + BaseSeparatorConstants.SEPARATOR_UNDERLINE + | 111 | + String fileName = AttachmentBizTypeEnum.getExt1ByCode(bizType) + BaseSeparatorConstants.SEPARATOR_UNDERLINE + |
| 112 | consignmentCode + BaseSeparatorConstants.SEPARATOR_UNDERLINE + fileSuffix + suffix; | 112 | consignmentCode + BaseSeparatorConstants.SEPARATOR_UNDERLINE + fileSuffix + suffix; |
| 113 | //系统生成文件名称 | 113 | //系统生成文件名称 |
| 114 | attachment.setFileName(fileName); | 114 | attachment.setFileName(fileName); |
| ... | @@ -139,4 +139,13 @@ public class AttachmentUtil { | ... | @@ -139,4 +139,13 @@ public class AttachmentUtil { |
| 139 | } | 139 | } |
| 140 | return attachment; | 140 | return attachment; |
| 141 | } | 141 | } |
| 142 | + | ||
| 143 | + public static MultipartFile findFileByName(MultipartFile[] files, String fileName) { | ||
| 144 | + for (MultipartFile file : files) { | ||
| 145 | + if (file.getOriginalFilename().equals(fileName)) { | ||
| 146 | + return file; // 找到匹配的文件,返回该文件 | ||
| 147 | + } | ||
| 148 | + } | ||
| 149 | + return null; // 如果没有找到匹配的文件,返回 null | ||
| 150 | + } | ||
| 142 | } | 151 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | package com.fedex.connect.customer.validate.controller.biz; | 1 | package com.fedex.connect.customer.validate.controller.biz; |
| 2 | 2 | ||
| 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.enums.biz.AttachmentBizTypeEnum; | ||
| 5 | import com.fedex.connect.common.dependencies.util.ResponseUtils; | 4 | import com.fedex.connect.common.dependencies.util.ResponseUtils; |
| 6 | import com.fedex.connect.common.dependencies.util.Utils; | 5 | import com.fedex.connect.common.dependencies.util.Utils; |
| 7 | import com.fedex.connect.customer.constants.CustomerConstant; | 6 | import com.fedex.connect.customer.constants.CustomerConstant; |
| ... | @@ -57,17 +56,5 @@ public class AttachmentValidate { | ... | @@ -57,17 +56,5 @@ public class AttachmentValidate { |
| 57 | if(totalSize > CustomerConstant.VALIDATE_KEYS.UPLOAD_FILE_MAX_SIZE){ | 56 | if(totalSize > CustomerConstant.VALIDATE_KEYS.UPLOAD_FILE_MAX_SIZE){ |
| 58 | responseUtils.fail(ResponseCode.MESSAGE_CODE_30008,CustomerConstant.VALIDATE_KEYS.UPLOAD_FILE_MAX_SIZE); | 57 | responseUtils.fail(ResponseCode.MESSAGE_CODE_30008,CustomerConstant.VALIDATE_KEYS.UPLOAD_FILE_MAX_SIZE); |
| 59 | } | 58 | } |
| 60 | - List<String> fileBizTypeList = consignmentBo.getAttachmentBizTypeList(); | ||
| 61 | - //运单或发票未上传 | ||
| 62 | - if(!fileBizTypeList.contains(AttachmentBizTypeEnum.AWB.getExt1()) || | ||
| 63 | - !fileBizTypeList.contains(AttachmentBizTypeEnum.INV.getExt1())){ | ||
| 64 | - responseUtils.fail(ResponseCode.MESSAGE_CODE_30009); | ||
| 65 | - } | ||
| 66 | - //文件类型不在范围内 | ||
| 67 | - fileBizTypeList.stream().forEach(p -> { | ||
| 68 | - if(Objects.isNull(AttachmentBizTypeEnum.valueOf(p))){ | ||
| 69 | - responseUtils.fail(ResponseCode.MESSAGE_CODE_30010); | ||
| 70 | - }; | ||
| 71 | - }); | ||
| 72 | } | 59 | } |
| 73 | } | 60 | } | ... | ... |
| ... | @@ -5,6 +5,7 @@ business_log_20003=运单查询 | ... | @@ -5,6 +5,7 @@ business_log_20003=运单查询 |
| 5 | business_log_20004=运单详细信息查询 | 5 | business_log_20004=运单详细信息查询 |
| 6 | business_log_20005=根据运单ID查询用户上传记录 | 6 | business_log_20005=根据运单ID查询用户上传记录 |
| 7 | business_log_20006=运单历史上传记录查询 | 7 | business_log_20006=运单历史上传记录查询 |
| 8 | +business_log_20007=上传历史附件记录 | ||
| 8 | system_exception_20003=提示信息过长,未保存成功 | 9 | system_exception_20003=提示信息过长,未保存成功 |
| 9 | 10 | ||
| 10 | #******************鉴权相关提示,需要做国际化****************** | 11 | #******************鉴权相关提示,需要做国际化****************** | ... | ... |
| ... | @@ -5,6 +5,7 @@ business_log_20003=运单查询 | ... | @@ -5,6 +5,7 @@ business_log_20003=运单查询 |
| 5 | business_log_20004=运单详细信息查询 | 5 | business_log_20004=运单详细信息查询 |
| 6 | business_log_20005=根据运单ID查询用户上传记录 | 6 | business_log_20005=根据运单ID查询用户上传记录 |
| 7 | business_log_20006=运单历史上传记录查询 | 7 | business_log_20006=运单历史上传记录查询 |
| 8 | +business_log_20007=上传历史附件记录 | ||
| 8 | system_exception_20003=提示信息过长,未保存成功 | 9 | system_exception_20003=提示信息过长,未保存成功 |
| 9 | 10 | ||
| 10 | #******************鉴权相关提示,需要做国际化****************** | 11 | #******************鉴权相关提示,需要做国际化****************** | ... | ... |
| ... | @@ -29,6 +29,7 @@ import javax.annotation.Resource; | ... | @@ -29,6 +29,7 @@ import javax.annotation.Resource; |
| 29 | import javax.servlet.http.HttpServletRequest; | 29 | import javax.servlet.http.HttpServletRequest; |
| 30 | import javax.servlet.http.HttpServletResponse; | 30 | import javax.servlet.http.HttpServletResponse; |
| 31 | import java.util.*; | 31 | import java.util.*; |
| 32 | +import java.util.stream.Collectors; | ||
| 32 | 33 | ||
| 33 | /** | 34 | /** |
| 34 | * 定义切面。用于处理定义的切点。 | 35 | * 定义切面。用于处理定义的切点。 |
| ... | @@ -97,13 +98,19 @@ public class OperationLogAspect { | ... | @@ -97,13 +98,19 @@ public class OperationLogAspect { |
| 97 | //如果是MultipartFile类型,只记录文件的名称 | 98 | //如果是MultipartFile类型,只记录文件的名称 |
| 98 | Object[] param = pjp.getArgs(); | 99 | Object[] param = pjp.getArgs(); |
| 99 | param = Arrays.stream(pjp.getArgs()) | 100 | param = Arrays.stream(pjp.getArgs()) |
| 100 | - .filter(o -> !( o instanceof HttpServletResponse)) | 101 | + .filter(o -> !(o instanceof HttpServletResponse)) |
| 101 | - .filter(o -> !( o instanceof HttpServletRequest)) | 102 | + .filter(o -> !(o instanceof HttpServletRequest)) |
| 102 | .map(o -> { | 103 | .map(o -> { |
| 103 | - if (o instanceof MultipartFile){ | 104 | + if (o instanceof MultipartFile) { |
| 105 | + // 单个 MultipartFile,返回文件名 | ||
| 104 | return ((MultipartFile) o).getOriginalFilename(); | 106 | return ((MultipartFile) o).getOriginalFilename(); |
| 107 | + } else if (o instanceof MultipartFile[]) { | ||
| 108 | + // MultipartFile[],拼接所有文件名,用逗号分隔 | ||
| 109 | + return Arrays.stream((MultipartFile[]) o) | ||
| 110 | + .map(MultipartFile::getOriginalFilename) | ||
| 111 | + .collect(Collectors.joining(", ")); | ||
| 105 | } | 112 | } |
| 106 | - return o; | 113 | + return o; // 其他类型参数保持不变 |
| 107 | }) | 114 | }) |
| 108 | .toArray(); | 115 | .toArray(); |
| 109 | //获取请求的参数进行处理 | 116 | //获取请求的参数进行处理 | ... | ... |
| ... | @@ -55,4 +55,14 @@ public enum AttachmentBizTypeEnum { | ... | @@ -55,4 +55,14 @@ public enum AttachmentBizTypeEnum { |
| 55 | public void setExt1(String ext1) { | 55 | public void setExt1(String ext1) { |
| 56 | this.ext1 = ext1; | 56 | this.ext1 = ext1; |
| 57 | } | 57 | } |
| 58 | + | ||
| 59 | + // 通过 code 获取对应的 ext1 | ||
| 60 | + public static String getExt1ByCode(String code) { | ||
| 61 | + for (AttachmentBizTypeEnum type : AttachmentBizTypeEnum.values()) { | ||
| 62 | + if (type.getCode().equals(code)) { | ||
| 63 | + return type.getExt1(); | ||
| 64 | + } | ||
| 65 | + } | ||
| 66 | + return null; // 如果没有找到匹配的 code,返回 null | ||
| 67 | + } | ||
| 58 | } | 68 | } | ... | ... |
| ... | @@ -203,7 +203,7 @@ public class Dm501Util { | ... | @@ -203,7 +203,7 @@ public class Dm501Util { |
| 203 | /** | 203 | /** |
| 204 | * 初始化运单表原产国、目的国 | 204 | * 初始化运单表原产国、目的国 |
| 205 | */ | 205 | */ |
| 206 | - this.initOriginCountryDestinationCountry(ceInfo,consignment); | 206 | + this.initOriginCountryDestinationCountry(ceInfo,resultConsignment); |
| 207 | /** | 207 | /** |
| 208 | * 初始化表基础字段 | 208 | * 初始化表基础字段 |
| 209 | */ | 209 | */ | ... | ... |
-
Please register or login to post a comment