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;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.controller.base.BaseController;
import com.fedex.connect.customer.controller.biz.IConsignmentQueryController;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.customer.data.query.ConsignmentQuery;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
......@@ -36,7 +36,7 @@ public class ConsignmentQueryController extends BaseController implements IConsi
ConsignmentQuery query = ConsignmentQuery.dataProcessing(consignmentQuery);
query.setUserId(user.getId());
query.setUuid(user.getUserUuid());
return consignmentQueryService.findConsignments(query);
return consignmentQueryService.findConsignments(query,user);
}
@Override
......
......@@ -5,7 +5,7 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.controller.base.BaseController;
import com.fedex.connect.customer.controller.biz.IUploadRecordController;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.customer.data.query.AttachmentHistoryQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
......@@ -31,18 +31,15 @@ public class UploadRecordController extends BaseController implements IUploadRec
@ApiOperation(value = "ResponseVo", notes = "运单历史上传记录查询")
@OperationMethodLog(describe = "business_log_20006")
public ResponseVo queryHistoryList(@ApiParam(value="运单ID",required = true) @PathVariable(value = "consignmentId") Long consignmentId) {
AttachmentHistoryQuery attachmentHistoryQuery = AttachmentHistoryQuery.getInstance(consignmentId);
/**
* 运单id非空校验
*/
consignmentInfoValidate.validateConsignmentId(consignmentId);
consignmentInfoValidate.validateConsignmentId(attachmentHistoryQuery.getConsignmentId());
/**
* 获取当前用户信息
*/
User user = this.getCurrentUserInfo();
/**
* 构造查询对象
*/
UserConsignmentInfoQuery userConsignmentInfoQuery = UserConsignmentInfoQuery.getInstance(user,consignmentId);
return uploadRecordService.findHistory(userConsignmentInfoQuery);
return uploadRecordService.findHistory(attachmentHistoryQuery,user);
}
}
......
package com.fedex.connect.customer.data.query;
import com.fedex.connect.customer.data.PageBase;
import lombok.Data;
/**
* @Author Szl
* @Description 类说明 用于运单的附件历史上传查询
* @Date 2024/11/12
*/
@Data
public class AttachmentHistoryQuery extends PageBase {
private Long consignmentId;
/**
* @Author Szl
* @Description 功能说明 实例化查询对象
* @Date 2024/11/12
* @param consignmentId
* @return com.fedex.connect.customer.data.query.AttachmentHistoryQuery
*/
public static AttachmentHistoryQuery getInstance(Long consignmentId){
AttachmentHistoryQuery attachmentHistoryQuery = new AttachmentHistoryQuery();
attachmentHistoryQuery.setConsignmentId(consignmentId);
attachmentHistoryQuery.setStart(attachmentHistoryQuery.getStart());
return attachmentHistoryQuery;
}
}
......@@ -2,6 +2,7 @@ package com.fedex.connect.customer.repository.dao;
import com.fedex.connect.common.model.biz.Attachment;
import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
import com.fedex.connect.customer.data.query.AttachmentHistoryQuery;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -11,7 +12,7 @@ import java.util.List;
@Mapper
public interface AttachmentExtMapper {
List<AttachmentHistoryDto> findHistory(@Param("bizId") Long bizId);
List<AttachmentHistoryDto> findHistory(AttachmentHistoryQuery attachmentHistoryQuery);
@Select("SELECT * FROM T_BIZ_ATTACHMENT WHERE UPLOAD_RECORD_ID = " +
"(SELECT MAX(ID) FROM T_BIZ_UPLOAD_RECORD WHERE CREATE_USER_ID = #{query.userId} " +
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fedex.connect.customer.repository.dao.AttachmentExtMapper">
<resultMap id="BaseResultMap" type="com.fedex.connect.common.model.biz.Attachment">
<id column="ID" jdbcType="NUMERIC" property="id" />
<result column="BIZ_ID" jdbcType="NUMERIC" property="bizId" />
<result column="BIZ_TYPE_ID" jdbcType="NUMERIC" property="bizTypeId" />
<result column="BIZ_TYPE_NAME" jdbcType="VARCHAR" property="bizTypeName" />
<result column="SOURCE_FILE_NAME" jdbcType="VARCHAR" property="sourceFileName" />
<result column="FILE_NAME" jdbcType="VARCHAR" property="fileName" />
<result column="FILE_PATH" jdbcType="VARCHAR" property="filePath" />
<result column="FILE_TYPE_ID" jdbcType="NUMERIC" property="fileTypeId" />
<result column="FILE_TYPE_NAME" jdbcType="VARCHAR" property="fileTypeName" />
<result column="STATUS" jdbcType="NUMERIC" property="status" />
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
<result column="CREATE_USER_ID" jdbcType="NUMERIC" property="createUserId" />
<result column="CREATE_USER_NAME" jdbcType="VARCHAR" property="createUserName" />
<result column="MODIFY_TIME" jdbcType="TIMESTAMP" property="modifyTime" />
<result column="MODIFY_USER_ID" jdbcType="NUMERIC" property="modifyUserId" />
<result column="MODIFY_USER_NAME" jdbcType="VARCHAR" property="modifyUserName" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
ID, BIZ_ID, BIZ_TYPE_ID, BIZ_TYPE_NAME, SOURCE_FILE_NAME, FILE_NAME, FILE_PATH, FILE_TYPE_ID,
FILE_TYPE_NAME, STATUS, CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME, MODIFY_TIME,
MODIFY_USER_ID, MODIFY_USER_NAME
</sql>
<select id="selectByExample" parameterType="com.fedex.connect.common.model.biz.AttachmentExample" resultMap="BaseResultMap">
<include refid="OracleDialectPrefix" />
select
<if test="distinct">
distinct
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from T_BIZ_ATTACHMENT
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<include refid="OracleDialectSuffix" />
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from T_BIZ_ATTACHMENT
where ID = #{id,jdbcType=NUMERIC}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from T_BIZ_ATTACHMENT
where ID = #{id,jdbcType=NUMERIC}
</delete>
<delete id="deleteByExample" parameterType="com.fedex.connect.common.model.biz.AttachmentExample">
delete from T_BIZ_ATTACHMENT
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.fedex.connect.common.model.biz.Attachment">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_BIZ_ATTACHMENT.NEXTVAL FROM DUAL
</selectKey>
insert into T_BIZ_ATTACHMENT (ID, BIZ_ID, BIZ_TYPE_ID,
BIZ_TYPE_NAME, SOURCE_FILE_NAME, FILE_NAME,
FILE_PATH, FILE_TYPE_ID, FILE_TYPE_NAME,
STATUS, CREATE_TIME, CREATE_USER_ID,
CREATE_USER_NAME, MODIFY_TIME, MODIFY_USER_ID,
MODIFY_USER_NAME)
values (#{id,jdbcType=NUMERIC}, #{bizId,jdbcType=NUMERIC}, #{bizTypeId,jdbcType=NUMERIC},
#{bizTypeName,jdbcType=VARCHAR}, #{sourceFileName,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR},
#{filePath,jdbcType=VARCHAR}, #{fileTypeId,jdbcType=NUMERIC}, #{fileTypeName,jdbcType=VARCHAR},
#{status,jdbcType=NUMERIC}, #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=NUMERIC},
#{createUserName,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, #{modifyUserId,jdbcType=NUMERIC},
#{modifyUserName,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.fedex.connect.common.model.biz.Attachment">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_BIZ_ATTACHMENT.NEXTVAL FROM DUAL
</selectKey>
insert into T_BIZ_ATTACHMENT
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="bizId != null">
BIZ_ID,
</if>
<if test="bizTypeId != null">
BIZ_TYPE_ID,
</if>
<if test="bizTypeName != null">
BIZ_TYPE_NAME,
</if>
<if test="sourceFileName != null">
SOURCE_FILE_NAME,
</if>
<if test="fileName != null">
FILE_NAME,
</if>
<if test="filePath != null">
FILE_PATH,
</if>
<if test="fileTypeId != null">
FILE_TYPE_ID,
</if>
<if test="fileTypeName != null">
FILE_TYPE_NAME,
</if>
<if test="status != null">
STATUS,
</if>
<if test="createTime != null">
CREATE_TIME,
</if>
<if test="createUserId != null">
CREATE_USER_ID,
</if>
<if test="createUserName != null">
CREATE_USER_NAME,
</if>
<if test="modifyTime != null">
MODIFY_TIME,
</if>
<if test="modifyUserId != null">
MODIFY_USER_ID,
</if>
<if test="modifyUserName != null">
MODIFY_USER_NAME,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=NUMERIC},
<if test="bizId != null">
#{bizId,jdbcType=NUMERIC},
</if>
<if test="bizTypeId != null">
#{bizTypeId,jdbcType=NUMERIC},
</if>
<if test="bizTypeName != null">
#{bizTypeName,jdbcType=VARCHAR},
</if>
<if test="sourceFileName != null">
#{sourceFileName,jdbcType=VARCHAR},
</if>
<if test="fileName != null">
#{fileName,jdbcType=VARCHAR},
</if>
<if test="filePath != null">
#{filePath,jdbcType=VARCHAR},
</if>
<if test="fileTypeId != null">
#{fileTypeId,jdbcType=NUMERIC},
</if>
<if test="fileTypeName != null">
#{fileTypeName,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=NUMERIC},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createUserId != null">
#{createUserId,jdbcType=NUMERIC},
</if>
<if test="createUserName != null">
#{createUserName,jdbcType=VARCHAR},
</if>
<if test="modifyTime != null">
#{modifyTime,jdbcType=TIMESTAMP},
</if>
<if test="modifyUserId != null">
#{modifyUserId,jdbcType=NUMERIC},
</if>
<if test="modifyUserName != null">
#{modifyUserName,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.fedex.connect.common.model.biz.AttachmentExample" resultType="java.lang.Long">
select count(*) from T_BIZ_ATTACHMENT
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update T_BIZ_ATTACHMENT
<set>
<if test="record.id != null">
ID = #{record.id,jdbcType=NUMERIC},
</if>
<if test="record.bizId != null">
BIZ_ID = #{record.bizId,jdbcType=NUMERIC},
</if>
<if test="record.bizTypeId != null">
BIZ_TYPE_ID = #{record.bizTypeId,jdbcType=NUMERIC},
</if>
<if test="record.bizTypeName != null">
BIZ_TYPE_NAME = #{record.bizTypeName,jdbcType=VARCHAR},
</if>
<if test="record.sourceFileName != null">
SOURCE_FILE_NAME = #{record.sourceFileName,jdbcType=VARCHAR},
</if>
<if test="record.fileName != null">
FILE_NAME = #{record.fileName,jdbcType=VARCHAR},
</if>
<if test="record.filePath != null">
FILE_PATH = #{record.filePath,jdbcType=VARCHAR},
</if>
<if test="record.fileTypeId != null">
FILE_TYPE_ID = #{record.fileTypeId,jdbcType=NUMERIC},
</if>
<if test="record.fileTypeName != null">
FILE_TYPE_NAME = #{record.fileTypeName,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
STATUS = #{record.status,jdbcType=NUMERIC},
</if>
<if test="record.createTime != null">
CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.createUserId != null">
CREATE_USER_ID = #{record.createUserId,jdbcType=NUMERIC},
</if>
<if test="record.createUserName != null">
CREATE_USER_NAME = #{record.createUserName,jdbcType=VARCHAR},
</if>
<if test="record.modifyTime != null">
MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP},
</if>
<if test="record.modifyUserId != null">
MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC},
</if>
<if test="record.modifyUserName != null">
MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update T_BIZ_ATTACHMENT
set ID = #{record.id,jdbcType=NUMERIC},
BIZ_ID = #{record.bizId,jdbcType=NUMERIC},
BIZ_TYPE_ID = #{record.bizTypeId,jdbcType=NUMERIC},
BIZ_TYPE_NAME = #{record.bizTypeName,jdbcType=VARCHAR},
SOURCE_FILE_NAME = #{record.sourceFileName,jdbcType=VARCHAR},
FILE_NAME = #{record.fileName,jdbcType=VARCHAR},
FILE_PATH = #{record.filePath,jdbcType=VARCHAR},
FILE_TYPE_ID = #{record.fileTypeId,jdbcType=NUMERIC},
FILE_TYPE_NAME = #{record.fileTypeName,jdbcType=VARCHAR},
STATUS = #{record.status,jdbcType=NUMERIC},
CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
CREATE_USER_ID = #{record.createUserId,jdbcType=NUMERIC},
CREATE_USER_NAME = #{record.createUserName,jdbcType=VARCHAR},
MODIFY_TIME = #{record.modifyTime,jdbcType=TIMESTAMP},
MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC},
MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.fedex.connect.common.model.biz.Attachment">
update T_BIZ_ATTACHMENT
<set>
<if test="bizId != null">
BIZ_ID = #{bizId,jdbcType=NUMERIC},
</if>
<if test="bizTypeId != null">
BIZ_TYPE_ID = #{bizTypeId,jdbcType=NUMERIC},
</if>
<if test="bizTypeName != null">
BIZ_TYPE_NAME = #{bizTypeName,jdbcType=VARCHAR},
</if>
<if test="sourceFileName != null">
SOURCE_FILE_NAME = #{sourceFileName,jdbcType=VARCHAR},
</if>
<if test="fileName != null">
FILE_NAME = #{fileName,jdbcType=VARCHAR},
</if>
<if test="filePath != null">
FILE_PATH = #{filePath,jdbcType=VARCHAR},
</if>
<if test="fileTypeId != null">
FILE_TYPE_ID = #{fileTypeId,jdbcType=NUMERIC},
</if>
<if test="fileTypeName != null">
FILE_TYPE_NAME = #{fileTypeName,jdbcType=VARCHAR},
</if>
<if test="status != null">
STATUS = #{status,jdbcType=NUMERIC},
</if>
<if test="createTime != null">
CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createUserId != null">
CREATE_USER_ID = #{createUserId,jdbcType=NUMERIC},
</if>
<if test="createUserName != null">
CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR},
</if>
<if test="modifyTime != null">
MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP},
</if>
<if test="modifyUserId != null">
MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC},
</if>
<if test="modifyUserName != null">
MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
</if>
</set>
where ID = #{id,jdbcType=NUMERIC}
</update>
<update id="updateByPrimaryKey" parameterType="com.fedex.connect.common.model.biz.Attachment">
update T_BIZ_ATTACHMENT
set BIZ_ID = #{bizId,jdbcType=NUMERIC},
BIZ_TYPE_ID = #{bizTypeId,jdbcType=NUMERIC},
BIZ_TYPE_NAME = #{bizTypeName,jdbcType=VARCHAR},
SOURCE_FILE_NAME = #{sourceFileName,jdbcType=VARCHAR},
FILE_NAME = #{fileName,jdbcType=VARCHAR},
FILE_PATH = #{filePath,jdbcType=VARCHAR},
FILE_TYPE_ID = #{fileTypeId,jdbcType=NUMERIC},
FILE_TYPE_NAME = #{fileTypeName,jdbcType=VARCHAR},
STATUS = #{status,jdbcType=NUMERIC},
CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
CREATE_USER_ID = #{createUserId,jdbcType=NUMERIC},
CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR},
MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP},
MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC},
MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR}
where ID = #{id,jdbcType=NUMERIC}
</update>
<sql id="OracleDialectPrefix">
<if test="limitStart != null and limitStart>=0">
<if test="start != null and start >= 0 and size != null and size >= 0">
select * from ( select row_.*, rownum rownum_ from (
</if>
</sql>
<sql id="OracleDialectSuffix">
<if test="limitStart != null and limitStart>=0">
<![CDATA[ ) row_ ) where rownum_ > #{limitStart} and rownum_ <= #{limitStart}+#{limitSize} ]]>
<if test="start != null and start >= 0 and size != null and size >= 0">
<![CDATA[ ) row_ ) where rownum_ > #{start} and rownum_ <= #{start} + #{size} ]]>
</if>
</sql>
<select id="findHistory" resultType="com.fedex.connect.customer.data.dto.AttachmentHistoryDto">
<include refid="OracleDialectPrefix"/>
SELECT
a.CREATE_USER_NAME AS uploadUserName,
a.CREATE_TIME AS uploadTime,
a.FILE_PATH AS filePath,
a.CREATE_USER_ID AS uploadUserId,
c.STATUS_NAME AS statusName
r.STATUS_NAME AS statusName
FROM
T_BIZ_ATTACHMENT a
JOIN
T_BIZ_CONSIGNMENT c
T_BIZ_UPLOAD_RECORD r
ON
a.BIZ_ID = c.ID
a.UPLOAD_RECORD_ID = r.ID
WHERE
c.ID = #{consignmentId}
r.CONSIGNMENT_ID = #{consignmentId}
<include refid="OracleDialectSuffix" />
</select>
</mapper>
\ No newline at end of file
......
......@@ -28,7 +28,7 @@
c.CREATE_TIME,
c.COMMIT_TIME,
c.STATUS_NAME
</sql>
</sql>
<select id="findConsignments" resultType="com.fedex.connect.customer.data.dto.FindConsignmentsDto">
<include refid="OracleDialectPrefix"/>
......
......@@ -2,12 +2,13 @@ package com.fedex.connect.customer.repository.repo;
import com.fedex.connect.common.model.biz.Attachment;
import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
import com.fedex.connect.customer.data.query.AttachmentHistoryQuery;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import java.util.List;
public interface IAttachmentRepository {
List<AttachmentHistoryDto> findHistory(Long bizId);
List<AttachmentHistoryDto> findHistory(AttachmentHistoryQuery attachmentHistoryQuery);
Attachment queryInfo(UserConsignmentInfoQuery userConsignmentInfoQuery);
}
\ No newline at end of file
......
package com.fedex.connect.customer.repository.repo;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.data.dto.FindConsignmentsDto;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.customer.data.query.ConsignmentQuery;
......@@ -8,7 +9,7 @@ import com.fedex.connect.customer.data.query.ConsignmentQuery;
import java.util.List;
public interface IConsignmentRepository {
List<FindConsignmentsDto> findConsignments(ConsignmentQuery query);
List<FindConsignmentsDto> findConsignments(ConsignmentQuery query, User user);
Long findAllCount(ConsignmentQuery query);
......
......@@ -2,6 +2,7 @@ package com.fedex.connect.customer.repository.repo.impl;
import com.fedex.connect.common.model.biz.Attachment;
import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
import com.fedex.connect.customer.data.query.AttachmentHistoryQuery;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.customer.repository.base.BaseDao;
import com.fedex.connect.customer.repository.repo.IAttachmentRepository;
......@@ -12,8 +13,8 @@ import java.util.List;
@Repository
public class AttachmentRepositoryImpl extends BaseDao implements IAttachmentRepository {
@Override
public List<AttachmentHistoryDto> findHistory(Long consignmentId) {
return attachmentExtMapper.findHistory(consignmentId);
public List<AttachmentHistoryDto> findHistory(AttachmentHistoryQuery attachmentHistoryQuery) {
return attachmentExtMapper.findHistory(attachmentHistoryQuery);
}
/**
......
package com.fedex.connect.customer.repository.repo.impl;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.data.dto.FindConsignmentsDto;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.customer.data.query.ConsignmentQuery;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.customer.repository.base.BaseDao;
import com.fedex.connect.customer.repository.repo.IConsignmentRepository;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;
import java.util.Collections;
import java.util.List;
@Repository
public class ConsignmentRepositoryImpl extends BaseDao implements IConsignmentRepository {
/**
* @Author Szl
* @Description 功能说明 运单创建人如果为空则取当前用户
* @Date 2024/11/12
* @param query
* @param user
* @return java.util.List<com.fedex.connect.customer.data.dto.FindConsignmentsDto>
*/
@Override
public List<FindConsignmentsDto> findConsignments(ConsignmentQuery query) {
return consignmentExtMapper.findConsignments(query);
public List<FindConsignmentsDto> findConsignments(ConsignmentQuery query, User user) {
List<FindConsignmentsDto> consignments = consignmentExtMapper.findConsignments(query);
if (consignments == null) {
return Collections.emptyList();
}
consignments.forEach(consignment -> {
if (StringUtils.isBlank(consignment.getCreateUserName())) {
consignment.setCreateUserName(user.getUserName());
}
});
return consignments;
}
@Override
......
package com.fedex.connect.customer.service.biz;
import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.customer.data.query.ConsignmentQuery;
......@@ -12,7 +13,7 @@ public interface IConsignmentQueryService {
* @param query
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
ResponseVo findConsignments(ConsignmentQuery query);
ResponseVo findConsignments(ConsignmentQuery query,User user);
/**
* @Author mt
......
package com.fedex.connect.customer.service.biz;
import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.data.query.AttachmentHistoryQuery;
public interface IUploadRecordService {
ResponseVo findHistory(UserConsignmentInfoQuery userConsignmentInfoQuery);
ResponseVo findHistory(AttachmentHistoryQuery attachmentHistoryQuery, User user);
}
......
......@@ -5,6 +5,7 @@ import com.fedex.connect.common.dependencies.date.vo.PageResult;
import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.common.dependencies.util.Utils;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.data.dto.FindConsignmentsDto;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.customer.data.query.ConsignmentQuery;
......@@ -30,7 +31,7 @@ public class ConsignmentQueryServiceImpl extends BaseService implements IConsign
* @param query
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
public ResponseVo findConsignments(ConsignmentQuery query) {
public ResponseVo findConsignments(ConsignmentQuery query, User user) {
List<String> consignmentCodeList = query.getConsignmentCodeList();
if (Utils.isNotEmpty(consignmentCodeList) && consignmentCodeList.size() > GlobalConstantFedex.DECLARE_COUNT) {
responseUtils.fail(ResponseCode.MESSAGE_CODE_30002);
......@@ -44,7 +45,7 @@ public class ConsignmentQueryServiceImpl extends BaseService implements IConsign
pageResult.setPage(query.getPage());
pageResult.setSize(query.getSize());
if (total != null && total > 0) {
List<FindConsignmentsDto> consignments = consignmentRepository.findConsignments(query);
List<FindConsignmentsDto> consignments = consignmentRepository.findConsignments(query,user);
pageResult.setList(consignments);
}
return responseUtils.success(pageResult);
......
......@@ -3,10 +3,10 @@ package com.fedex.connect.customer.service.biz.impl;
import com.fedex.connect.common.dependencies.contants.DigitConstants;
import com.fedex.connect.common.dependencies.date.vo.PageResult;
import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.customer.data.query.AttachmentHistoryQuery;
import com.fedex.connect.customer.service.base.BaseService;
import com.fedex.connect.customer.service.biz.IAttachmentQueryService;
import com.fedex.connect.customer.service.biz.IUploadRecordService;
import org.springframework.stereotype.Service;
......@@ -25,23 +25,25 @@ public class UploadRecordServiceImpl extends BaseService implements IUploadRecor
* @Author Szl
* @Description 功能说明 查询该运单历史数据
* @Date 2024/11/5
* @param userConsignmentInfoQuery
* @param attachmentHistoryQuery
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
public ResponseVo findHistory(UserConsignmentInfoQuery userConsignmentInfoQuery) {
List<AttachmentHistoryDto> history = attachmentRepository.findHistory(userConsignmentInfoQuery.getConsignmentId());
public ResponseVo findHistory(AttachmentHistoryQuery attachmentHistoryQuery, User user) {
List<AttachmentHistoryDto> history = attachmentRepository.findHistory(attachmentHistoryQuery);
if (history != null) {
history.forEach(attachmentHistoryDto ->
attachmentHistoryDto.setCreatorFlag(
(attachmentHistoryDto.getUploadUserId() != null &&
attachmentHistoryDto.getUploadUserId().equals(userConsignmentInfoQuery.getUserId())) ?
attachmentHistoryDto.getUploadUserId().equals(user.getId())) ?
DigitConstants.DIGIT_ONE : DigitConstants.DIGIT_ZERO
)
);
}
PageResult pageResult = new PageResult();
pageResult.setPage(attachmentHistoryQuery.getPage());
pageResult.setSize(attachmentHistoryQuery.getSize());
pageResult.setList(history != null ? history : Collections.emptyList());
return responseUtils.success(pageResult);
......