zelong.shao

customer|历史附件查询

Showing 17 changed files with 640 additions and 7 deletions
......@@ -3,6 +3,7 @@ package com.fedex.connect.customer.controller;
import com.fedex.connect.common.dependencies.date.vo.ResponseResultVo;
import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil;
import com.fedex.connect.customer.service.biz.IAttachmentService;
import com.fedex.connect.customer.service.biz.IConsignmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
......@@ -25,6 +26,9 @@ public class AbstractEtController {
@Autowired
protected IConsignmentService consignmentService;
@Autowired
protected IAttachmentService attachmentService;
public <T> ResponseEntity<T> seeOther(String url) {
HttpHeaders httpHeaders = new HttpHeaders();
......
package com.fedex.connect.customer.controller.biz;
public interface IAttachmentController {
}
package com.fedex.connect.customer.controller.biz.impl;
import com.fedex.connect.common.dependencies.date.model.LogShowModel;
import com.fedex.connect.common.dependencies.date.vo.ResponseResultVo;
import com.fedex.connect.common.dependencies.enums.ResponseCode;
import com.fedex.connect.common.dependencies.util.CurrentUserInfo;
import com.fedex.connect.customer.controller.AbstractEtController;
import com.fedex.connect.customer.controller.biz.IAttachmentController;
import com.fedex.connect.customer.data.bo.LongBo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author Szl
* @Description 类说明 附件相关
* @Date 2024/11/4
*/
@RestController
@RequestMapping(value = "/attachment", name = "附件相关")
@Api(value = "AttachmentControllerImpl", tags = {"附件相关"})
public class AttachmentControllerImpl extends AbstractEtController implements IAttachmentController {
private static final Logger logger = LoggerFactory.getLogger(AttachmentControllerImpl.class);
@PostMapping("/find/history")
@ApiOperation(value = "历史上传记录查询")
public ResponseResultVo findHistory(@RequestBody LongBo bo) {
Long userId = null;
try {
userId = CurrentUserInfo.getUserId();
//userId = 0L;
} catch (Exception e) {
logger.error(LogShowModel.showException("Exception", e));
return ResponseResultVo.fail(localeMessageUtil.getMessage(ResponseCode.TOKEN_FORMAT_ERROR.getMsg()));
}
if (userId == null) {
return ResponseResultVo.fail(localeMessageUtil.getMessage(ResponseCode.OVERDUE_TOKEN_CODE.getMsg()));
}
return attachmentService.findHistory(userId,bo.getId());
}
}
package com.fedex.connect.customer.data.bo;
import lombok.Data;
@Data
public class LongBo {
Long id;
}
package com.fedex.connect.customer.data.dto;
import lombok.Data;
import java.util.Date;
@Data
public class AttachmentHistoryDto {
private String uploadUserName;
private Long uploadUserId;
private Date uploadTime;
private String statusName;
private String filePath;
private Integer creatorFlag;
}
......@@ -13,7 +13,7 @@ import java.util.List;
/**
* @Author Szl
* @Description 类说明 查询条件对象
* @Description 类说明 运单查询条件对象
* @Date 2024/10/31
*/
public class ConsignmentQuery extends PageBase {
......
package com.fedex.connect.customer.repository.base;
import com.fedex.connect.customer.repository.dao.AttachmentMapper;
import com.fedex.connect.customer.repository.dao.ConsignmentExtMapper;
import org.springframework.beans.factory.annotation.Autowired;
public class BaseDao {
@Autowired
public ConsignmentExtMapper consignmentExtMapper;
@Autowired
public AttachmentMapper attachmentMapper;
}
......
package com.fedex.connect.customer.repository.dao;
import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface AttachmentMapper {
List<AttachmentHistoryDto> findHistory(@Param("bizId") Long bizId);
}
<?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.AttachmentMapper">
<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">
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>
</sql>
<select id="findHistory" resultType="com.fedex.connect.customer.data.dto.AttachmentHistoryDto">
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
FROM
T_BIZ_ATTACHMENT a
JOIN
T_BIZ_CONSIGNMENT c
ON
a.BIZ_ID = c.ID
WHERE
c.ID = #{bizId}
</select>
</mapper>
\ No newline at end of file
package com.fedex.connect.customer.repository.repo;
import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
import java.util.List;
public interface IAttachmentRepository {
List<AttachmentHistoryDto> findHistory(Long bizId);
}
\ No newline at end of file
package com.fedex.connect.customer.repository.repo.impl;
import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
import com.fedex.connect.customer.repository.base.BaseDao;
import com.fedex.connect.customer.repository.repo.IAttachmentRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class AttachmentRepositoryImpl extends BaseDao implements IAttachmentRepository {
@Override
public List<AttachmentHistoryDto> findHistory(Long bizId) {
return attachmentMapper.findHistory(bizId);
}
}
......@@ -2,7 +2,8 @@ package com.fedex.connect.customer.service;
import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil;
import com.fedex.connect.customer.repository.repo.impl.ConsignmentExtRepositoryImpl;
import com.fedex.connect.customer.repository.repo.IAttachmentRepository;
import com.fedex.connect.customer.repository.repo.IConsignmentExtRepository;
import org.springframework.beans.factory.annotation.Autowired;
import javax.annotation.Resource;
......@@ -13,7 +14,10 @@ public class AbstractEtService {
protected LocaleMessageUtil localeMessageUtil;
@Autowired
protected ConsignmentExtRepositoryImpl consignmentExtRepository;
protected IConsignmentExtRepository consignmentExtRepository;
@Autowired
protected IAttachmentRepository attachmentRepository;
/**
* repository
......
package com.fedex.connect.customer.service.biz;
import com.fedex.connect.common.dependencies.date.vo.ResponseResultVo;
public interface IAttachmentService {
ResponseResultVo findHistory(Long userId, Long bizId);
}
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.ResponseResultVo;
import com.fedex.connect.customer.data.dto.AttachmentHistoryDto;
import com.fedex.connect.customer.service.AbstractEtService;
import com.fedex.connect.customer.service.biz.IAttachmentService;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
* @Author Szl
* @Description 类说明 附件相关service
* @Date 2024/11/4
*/
@Service
public class AttachmentServiceImpl extends AbstractEtService implements IAttachmentService {
public ResponseResultVo findHistory(Long userId, Long bizId) {
List<AttachmentHistoryDto> history = attachmentRepository.findHistory(bizId);
if (history != null) {
history.forEach(attachmentHistoryDto ->
attachmentHistoryDto.setCreatorFlag(
(attachmentHistoryDto.getUploadUserId() != null &&
attachmentHistoryDto.getUploadUserId().equals(userId)) ?
DigitConstants.DIGIT_ONE : DigitConstants.DIGIT_ZERO
)
);
}
PageResult pageResult = new PageResult();
pageResult.setList(history != null ? history : Collections.emptyList());
return ResponseResultVo.succ(pageResult);
}
}
package com.fedex.connect.common.dependencies.enums.sys;
public enum UserTypeEnum {
LOCAL(0L,"LOCAL","本地账号"),
FCL(1L,"FCL","FCL账号");
private Long code;
private String enMsg;
private String msg;
UserTypeEnum(Long code, String enMsg,String msg) {
this.code = code;
this.enMsg = enMsg;
this.msg = msg;
}
public Long getCode() {
return code;
}
public void setCode(Long code) {
this.code = code;
}
public String getEnMsg() {
return enMsg;
}
public void setEnMsg(String enMsg) {
this.enMsg = enMsg;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
package com.fedex.connect.common.dependencies.repository.repo.bi.impl;
import com.fedex.connect.common.dependencies.contants.DatabaseConstants;
import com.fedex.connect.common.dependencies.repository.base.BaseDao;
import com.fedex.connect.common.dependencies.repository.repo.bi.IDictionaryEntriesRepository;
import com.fedex.connect.common.model.bi.DictionaryEntries;
......@@ -13,6 +14,9 @@ public class DictionaryEntriesImpl extends BaseDao implements IDictionaryEntries
@Override
public List<DictionaryEntries> selectByExample(DictionaryEntriesExample example) {
DictionaryEntriesExample.Criteria criteria = example.createCriteria();
criteria.andStatusEqualTo(DatabaseConstants.GLOBAL_STATUS_VALID);
example.setOrderByClause("CREATE_TIME DESC");
return dictionaryEntriesMapper.selectByExample(example);
}
}
......
package com.fedex.connect.common.dependencies.service.bi.impl;
import com.fedex.connect.common.dependencies.contants.DatabaseConstants;
import com.fedex.connect.common.dependencies.date.model.LogShowModel;
import com.fedex.connect.common.dependencies.service.base.BaseService;
import com.fedex.connect.common.dependencies.service.bi.IDictionaryEntriesService;
......@@ -20,9 +19,6 @@ public class DictionaryEntriesServiceImpl extends BaseService implements IDictio
public List<DictionaryEntries> findAll() {
try{
DictionaryEntriesExample example = new DictionaryEntriesExample();
DictionaryEntriesExample.Criteria criteria = example.createCriteria();
criteria.andStatusEqualTo(DatabaseConstants.GLOBAL_STATUS_VALID);
example.setOrderByClause("CREATE_TIME DESC");
return dictionaryEntriesRepository.selectByExample(example);
} catch (Exception e){
log.error(LogShowModel.showException("Exception",e));
......