jinhui.wang

Merge remote-tracking branch 'origin/master' into ver1.0.0-wjh

Showing 195 changed files with 4265 additions and 2213 deletions
......@@ -9,6 +9,7 @@ cd ../../
base_dir=`pwd`
pName='package'
server='server'
prefix='ipc-'
mkdir $base_dir/${pName}
rm -f $base_dir/${pName}/*.war
......@@ -30,7 +31,7 @@ echo '######## 打包模块: '${moduleName}
cd $base_dir/${server}/${moduleName}
mvn clean install -Dmaven.test.skip=true -P$profile
oriName=${moduleName}-${sVersion}_${profile}.war.original
tarName=${moduleName}-${version}_${profile}.war
tarName=${prefix}${moduleName}-${version}_${profile}.war
cp target/${oriName} $base_dir && mv $base_dir/${oriName} $base_dir/${pName}/${tarName}
echo '######## 打包完成目录: '$base_dir/${pName}/${tarName}
......@@ -41,7 +42,7 @@ echo '######## 打包模块: '${moduleName}
cd $base_dir/${server}/${moduleName}
mvn clean install -Dmaven.test.skip=true -P$profile
oriName=${moduleName}-${sVersion}_${profile}.war.original
tarName=${moduleName}-${version}_${profile}.war
tarName=${prefix}${moduleName}-${version}_${profile}.war
cp target/${oriName} $base_dir && mv $base_dir/${oriName} $base_dir/${pName}/${tarName}
echo '######## 打包完成目录: '$base_dir/${pName}/${tarName}
......@@ -52,7 +53,7 @@ echo '######## 打包模块: '${moduleName}
cd $base_dir/${server}/${moduleName}
mvn clean install -Dmaven.test.skip=true -P$profile
oriName=${moduleName}-${sVersion}_${profile}.war.original
tarName=${moduleName}-${version}_${profile}.war
tarName=${prefix}${moduleName}-${version}_${profile}.war
cp target/${oriName} $base_dir && mv $base_dir/${oriName} $base_dir/${pName}/${tarName}
echo '######## 打包完成目录: '$base_dir/${pName}/${tarName}
......@@ -63,7 +64,7 @@ echo '######## 打包模块: '${moduleName}
cd $base_dir/${server}/${moduleName}
mvn clean install -Dmaven.test.skip=true -P$profile
oriName=${moduleName}-${sVersion}_${profile}.war.original
tarName=${moduleName}-${version}_${profile}.war
tarName=${prefix}${moduleName}-${version}_${profile}.war
cp target/${oriName} $base_dir && mv $base_dir/${oriName} $base_dir/${pName}/${tarName}
echo '######## 打包完成目录: '$base_dir/${pName}/${tarName}
......
......@@ -14,8 +14,9 @@ public interface CustomerConstant {
interface VALIDATE_KEYS{
//最大上传文件个数100个
Integer UPLOAD_FILE_MAX_TOTAL = 100;
//最大上传总文件大小95M
Integer UPLOAD_FILE_MAX_SIZE = 95 * 1024 * 1024;
//文件大小95M
Integer FILE_MAX_SIZE = 95;
//最大上传总文件大小95kb
Integer UPLOAD_FILE_MAX_SIZE = FILE_MAX_SIZE * 1024 * 1024;
}
}
\ No newline at end of file
......
package com.fedex.connect.customer.controller.biz.impl;
import com.fedex.connect.common.dependencies.annotation.OperationMethodLog;
import com.fedex.connect.common.dependencies.contants.AnnotationConstants;
import com.fedex.connect.common.dependencies.util.FileUtil;
import com.fedex.connect.customer.controller.base.BaseController;
import com.fedex.connect.customer.controller.biz.IAttachmentController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @Author Szl
* @Description 类说明 附件相关
......@@ -18,4 +27,15 @@ import org.springframework.web.bind.annotation.RestController;
@Api(value = "AttachmentControllerImpl", tags = {"附件操作相关"})
public class AttachmentController extends BaseController implements IAttachmentController {
@GetMapping(value = "/downLoadFile")
@OperationMethodLog(describe = "business_log_20008",remarkType = AnnotationConstants.LOG_REMARK_TYPE_SPECIAL,status = AnnotationConstants.LOG_STATUS_SHOW)
@ApiOperation(value = "下载单个文件")
public void downLoadFile(HttpServletRequest request, HttpServletResponse response,
@RequestParam(name = "path") String path, @RequestParam(name = "name") String name) throws Exception {
name = new String(name.getBytes("UTF-8"), "ISO-8859-1");
String contentType = FileUtil.getContentType(name);
response.setHeader("Content-Disposition", "attachment;filename=" + name +";content-type:"+contentType);
FileUtil.download(request, response, path + FileUtil.SIGN, name,contentType);
}
}
......
......@@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
public class UploadRecordController extends BaseController implements IUploadRecordController {
@Override
@PostMapping("/queryHistoryList/{consignmentId}")
@PostMapping("/queryHistoryList")
@ApiOperation(value = "ResponseVo", notes = "运单历史上传记录查询")
@OperationMethodLog(describe = "business_log_20006")
public ResponseVo queryHistoryList(@RequestBody AttachmentHistoryQuery attachmentHistoryQuery) {
......
......@@ -31,4 +31,6 @@ public class ConsignmentBo {
//文件业务类型AWB,INV,PKL,OTH(分运单,发票,箱单和其它这四种类型)
@BaseNotBlank(describe = "business_field_31008")
private List<Attachment> attachmentBizTypeList;
//是否使用DM005标志
private Long ceFlag;
}
......
......@@ -8,5 +8,5 @@ public class ConsignmentAddDto {
* 是否为该用户的运单 1:是 0:否
*/
private Integer isCreatorFlag;
private Long consignmentId;
private ConsignmentDto consignment;
}
......
package com.fedex.connect.customer.data.dto;
import com.fedex.connect.common.model.biz.Consignment;
import lombok.Data;
@Data
public class ConsignmentDto extends Consignment {
private Long ceFlag;
}
......@@ -34,4 +34,6 @@ public class FindConsignmentsDto {
private String userInputOriginCountryCode;
private String userInputOriginCountry;
private Long ceFlag;
}
......
package com.fedex.connect.customer.data.query;
import com.fedex.connect.common.dependencies.util.DateUtil;
import com.fedex.connect.common.dependencies.util.Utils;
import com.fedex.connect.customer.data.PageBase;
import lombok.Data;
import org.springframework.util.CollectionUtils;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Date;
import java.time.format.DateTimeFormatter;
import java.util.List;
/**
......@@ -24,15 +22,34 @@ public class ConsignmentQuery extends PageBase {
if (Utils.isNotEmpty(query.getConsignmentCode())) {
query.setConsignmentCodeList(Utils.split(query.getConsignmentCode(), "[;\\n]"));
}
if(!CollectionUtils.isEmpty(query.getConsignmentCodeList())) {
query.setCreateTimeFrom(null);
query.setCreateTimeTo(null);
}
//如果没有输入查询条件,则默认查三天的数据
if (CollectionUtils.isEmpty(query.getConsignmentCodeList()) && Utils.isEmpty(query.getConsignmentCode())){
if(!CollectionUtils.isEmpty(query.getConsignmentCodeList()) && Utils.isEmpty(query.getCreateTimeFrom()) && Utils.isEmpty(query.getCreateTimeTo())) {
// 获取当前日期,减去180天
LocalDate localDate = LocalDate.now().minusDays(180);
// 设置 createTimeFrom 为 180 天前的日期(不带时分秒)
String createTimeFrom = localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
query.setCreateTimeFrom(createTimeFrom);
// 获取当前日期(不带时分秒)
LocalDate currentDate = LocalDate.now();
// 设置 createTimeTo 为今天的日期(不带时分秒)
String createTimeTo = currentDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
query.setCreateTimeTo(createTimeTo);
}else if (Utils.isEmpty(query.getCreateTimeFrom()) && Utils.isEmpty(query.getCreateTimeTo())) {
// 获取当前日期,减去3天
LocalDate localDate = LocalDate.now().minusDays(3);
query.setCreateTimeFrom(DateUtil.timeFormat(Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant())));
query.setCreateTimeTo(DateUtil.timeFormat(new Date()));
// 设置 createTimeFrom 为 3 天前的日期(不带时分秒)
String createTimeFrom = localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
query.setCreateTimeFrom(createTimeFrom);
// 获取当前日期(不带时分秒)
LocalDate currentDate = LocalDate.now();
// 设置 createTimeTo 为今天的日期(不带时分秒)
String createTimeTo = currentDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
query.setCreateTimeTo(createTimeTo);
}
query.setStart(query.getStart());
return query;
......
......@@ -34,6 +34,10 @@ public enum ResponseCode {
MESSAGE_CODE_30014(30014,"business_exception_30014"),
MESSAGE_CODE_30015(30015,"business_success_30015"),
MESSAGE_CODE_30016(30016,"business_exception_30016"),
MESSAGE_CODE_30017(30017,"business_exception_30017"),
MESSAGE_CODE_30018(30018,"business_exception_30018"),
MESSAGE_CODE_30019(30019,"business_exception_30019"),
MESSAGE_CODE_30020(30020,"business_exception_30020"),
/******打个样,编写样例*****/
// MESSAGE_CODE_30001(30001,"business_exception_30001"),
......
......@@ -4,6 +4,7 @@ import com.fedex.connect.common.dao.biz.*;
import com.fedex.connect.customer.repository.dao.AttachmentExtMapper;
import com.fedex.connect.customer.repository.dao.ConsignmentExtMapper;
import com.fedex.connect.customer.repository.dao.UploadRecordExtMapper;
import com.fedex.connect.customer.repository.dao.UserExtMapper;
import org.springframework.beans.factory.annotation.Autowired;
public class BaseDao {
......@@ -25,4 +26,6 @@ public class BaseDao {
protected EmailMapper emailMapper;
@Autowired
protected UploadRecordExtMapper uploadRecordExtMapper;
@Autowired
protected UserExtMapper userExtMapper;
}
\ No newline at end of file
......
......@@ -25,8 +25,9 @@ public interface ConsignmentExtMapper {
") WHERE ROWNUM = 1")
Consignment findByConsignmentCode(@Param("consignmentCode") String consignmentCode, @Param("dateParam") LocalDate dateParam);
@Select("SELECT BC.* FROM T_BIZ_CONSIGNMENT BC LEFT JOIN T_BIZ_USER_CONSIGNMENT_MAPPING BUCM ON(BC.ID = BUCM.CONSIGNMENT_ID) " +
"WHERE BC.ID = #{query.consignmentId} AND (BC.USER_UUID = #{query.userUuid} OR BUCM.USER_ID = #{query.userId})")
@Select("SELECT BC.* FROM T_BIZ_CONSIGNMENT BC WHERE BC.ID = #{query.consignmentId}")
Consignment findConsignmentInfo(@Param("query") UserConsignmentInfoQuery query);
@Select("SELECT ID FROM T_BIZ_CONSIGNMENT WHERE ID = #{id} FOR UPDATE NOWAIT")
Long lockConsignmentRow(@Param("id") Long id);
}
......
package com.fedex.connect.customer.repository.dao;
import com.fedex.connect.common.model.sys.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface UserExtMapper {
@Select("SELECT * FROM T_SYS_USER WHERE USER_UUID = #{uuid}")
public User findUserByUuid(@Param("uuid") String uuid);
}
......@@ -33,7 +33,8 @@
c.SHIPPER_ACCOUNT,
c.USER_INPUT_SHIPPER_ACCOUNT,
c.USER_INPUT_ORIGIN_COUNTRY_CODE,
c.USER_INPUT_ORIGIN_COUNTRY
c.USER_INPUT_ORIGIN_COUNTRY,
MAX(m.CE_FLAG) AS CE_FLAG
</sql>
<select id="findConsignments" resultType="com.fedex.connect.customer.data.dto.FindConsignmentsDto">
......@@ -47,14 +48,17 @@
(m.user_id = #{userId} AND m.consignment_id IS NOT NULL)
OR c.user_uuid = #{uuid,jdbcType=VARCHAR}
)
<if test="statusCode != null and statusCode != ''">
<if test="statusCode != null and statusCode != '' and statusCode != 'null'">
AND c.STATUS_CODE = #{statusCode}
</if>
<if test="statusCode == 'null'">
AND c.STATUS_CODE IS NULL
</if>
<if test="createTimeFrom != null and createTimeFrom != ''">
AND c.CREATE_TIME &gt;= TO_DATE(#{createTimeFrom}, 'YYYY-MM-DD HH24:MI:SS')
AND c.CREATE_TIME &gt; TO_DATE(#{createTimeFrom} || ' 00:00:00', 'YYYY-MM-DD HH24:MI:SS')
</if>
<if test="createTimeTo != null and createTimeTo != ''">
AND c.CREATE_TIME &lt;= TO_DATE(#{createTimeTo}, 'YYYY-MM-DD HH24:MI:SS')
AND c.CREATE_TIME &lt; TO_DATE(#{createTimeTo} || ' 23:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if>
<if test="consignmentCodeList != null and consignmentCodeList.size() != 0">
AND c.CONSIGNMENT_CODE IN
......@@ -62,6 +66,13 @@
#{item}
</foreach>
</if>
GROUP BY
c.ID, c.CONSIGNMENT_CODE, c.RECIPIENT_CONTACT_NAME, c.RECIPIENT_COMPANY,
c.ORIGIN_COUNTRY, c.DOC_NONDOC_FLAG, c.CREATE_USER_NAME, c.CREATE_TIME,
c.MODIFY_TIME, c.STATUS_NAME, c.USER_UUID, c.SHIPPER_ACCOUNT,
c.USER_INPUT_SHIPPER_ACCOUNT, c.USER_INPUT_ORIGIN_COUNTRY_CODE,
c.USER_INPUT_ORIGIN_COUNTRY
ORDER BY c.CREATE_TIME DESC
<include refid="OracleDialectSuffix" />
</select>
......@@ -76,10 +87,10 @@
OR c.user_uuid = #{uuid,jdbcType=VARCHAR}
)
<if test="createTimeFrom != null and createTimeFrom != ''">
AND c.CREATE_TIME &gt;= TO_DATE(#{createTimeFrom}, 'YYYY-MM-DD HH24:MI:SS')
AND c.CREATE_TIME &gt; TO_DATE(#{createTimeFrom} || ' 00:00:00', 'YYYY-MM-DD HH24:MI:SS')
</if>
<if test="createTimeTo != null and createTimeTo != ''">
AND c.CREATE_TIME &lt;= TO_DATE(#{createTimeTo}, 'YYYY-MM-DD HH24:MI:SS')
AND c.CREATE_TIME &lt; TO_DATE(#{createTimeTo} || ' 23:59:59', 'YYYY-MM-DD HH24:MI:SS')
</if>
<if test="consignmentCodeList != null and consignmentCodeList.size() != 0">
AND c.CONSIGNMENT_CODE IN
......@@ -91,4 +102,5 @@
</mapper>
\ No newline at end of file
......
......@@ -327,7 +327,7 @@
FROM
T_BIZ_UPLOAD_RECORD
WHERE
CONSIGNMENT_ID = #{consignmentId}
CONSIGNMENT_ID = #{consignmentId} ORDER BY ID DESC
<include refid="OracleDialectSuffix" />
</select>
</mapper>
\ No newline at end of file
......
......@@ -23,4 +23,6 @@ public interface IConsignmentRepository {
Consignment saveOrUpdate(Consignment entity);
void saveOrUpdateAll(List<Consignment> list);
void lockConsignmentRow(Long id);
}
......
......@@ -30,4 +30,14 @@ public interface IUserConsignmentMappingRepository {
* @return void
*/
void saveOrUpdateAll(List<UserConsignmentMapping> list);
/**
* @Author Szl
* @Description 功能说明 根据用户id和运单号查询mapping
* @Date 2024/12/31
* @param userId
* @param consignmentCode
* @return com.fedex.connect.common.model.biz.UserConsignmentMapping
*/
UserConsignmentMapping findByUserIdAndConsignmentCode(Long userId,String consignmentCode);
}
......
package com.fedex.connect.customer.repository.repo;
import com.fedex.connect.common.model.sys.User;
public interface IUserRepository {
User findUserByUuid(String uuid);
}
......@@ -8,6 +8,7 @@ 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.time.LocalDate;
......@@ -45,14 +46,10 @@ public class ConsignmentRepositoryImpl extends BaseDao implements IConsignmentRe
if (SystemDefaultUserConstants.SYSTEM_USER_KEYS.USER_NAME.equals(consignment.getCreateUserName())){
consignment.setCreateUserName(user.getUserName());
}
if (!user.getUserUuid().equals(consignment.getUserUuid()) && !user.getAccountNo().equals(consignment.getShipperAccount())){
if (!StringUtils.equals(user.getUserUuid(), consignment.getUserUuid()) && (consignment.getCeFlag() != null && consignment.getCeFlag() == 0)) {
consignment.setRecipientContactName(null);
consignment.setRecipientCompany(null);
consignment.setDocNondocFlag(null);
consignment.setCreateUserName(null);
consignment.setCreateTime(null);
consignment.setModifyTime(null);
consignment.setStatusName(null);
consignment.setUserUuid(null);
consignment.setShipperAccount(null);
consignment.setOriginCountry(consignment.getUserInputOriginCountry());
......@@ -97,4 +94,16 @@ public class ConsignmentRepositoryImpl extends BaseDao implements IConsignmentRe
}
});
}
/**
* @Author mt
* @Description 为运单表增加行级锁,行级锁使用主键id作为标志,否则可能锁表
* @Date 2024/12/20
* @param id
* @return void
*/
@Override
public void lockConsignmentRow(Long id){
consignmentExtMapper.lockConsignmentRow(id);
}
}
......
......@@ -51,4 +51,22 @@ public class UserConsignmentMappingRepositoryImpl extends BaseDao implements IUs
}
});
}
/**
* @Author Szl
* @Description 功能说明 根据用户id和运单号查询mapping
* @Date 2024/12/31
* @param userId
* @param consignmentCode
* @return com.fedex.connect.common.model.biz.UserConsignmentMapping
*/
@Override
public UserConsignmentMapping findByUserIdAndConsignmentCode(Long userId,String consignmentCode){
UserConsignmentMappingExample example = new UserConsignmentMappingExample();
UserConsignmentMappingExample.Criteria criteria = example.createCriteria();
criteria.andUserIdEqualTo(userId);
criteria.andConsignmentCodeEqualTo(consignmentCode);
criteria.andStatusEqualTo(StatusEnum.YES.getCode());
return CollectionUtils.firstElement(userConsignmentMappingMapper.selectByExample(example));
}
}
......
package com.fedex.connect.customer.repository.repo.impl;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.repository.base.BaseDao;
import com.fedex.connect.customer.repository.repo.IUserRepository;
import org.springframework.stereotype.Repository;
@Repository
public class UserRepositoryImpl extends BaseDao implements IUserRepository {
@Override
public User findUserByUuid(String uuid) {
return userExtMapper.findUserByUuid(uuid);
}
}
package com.fedex.connect.customer.service.biz;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.biz.UploadRecord;
import com.fedex.connect.common.model.sys.User;
public interface IEmailService {
void saveNotificationEmail(Consignment consignment, User user) throws Exception;
void savePushConsignmentFileEmail(Consignment consignment, UploadRecord uploadRecord) throws Exception;
}
......
......@@ -78,8 +78,8 @@ public class AttachmentServiceImpl extends BaseService implements IAttachmentSer
++i;
}
}catch(Exception ex){
//如果上传过程中存在失败,则所有已上传的文件进行删除
attachmentUtil.deleteAttachments(attachmentList);
//如果上传过程中存在失败,则所有已上传的文件进行删除,已上传文件不进行删除
// attachmentUtil.deleteAttachments(attachmentList);
throw ex;
}
return attachmentList;
......
......@@ -7,11 +7,13 @@ 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;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.customer.enums.ResponseCode;
import com.fedex.connect.customer.service.base.BaseService;
import com.fedex.connect.customer.service.biz.IConsignmentQueryService;
import com.fedex.connect.customer.util.service.biz.ConsignmentQueryUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
......@@ -24,6 +26,10 @@ import java.util.Objects;
*/
@Service
public class ConsignmentQueryServiceImpl extends BaseService implements IConsignmentQueryService {
@Autowired
ConsignmentQueryUtil consignmentQueryUtil;
/**
* @Author Szl
* @Description 功能说明 运单查询
......@@ -60,19 +66,12 @@ public class ConsignmentQueryServiceImpl extends BaseService implements IConsign
* @param userConsignmentInfoQuery
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
public ResponseVo findConsignmentInfo(UserConsignmentInfoQuery userConsignmentInfoQuery){
public ResponseVo findConsignmentInfo(UserConsignmentInfoQuery userConsignmentInfoQuery) {
Consignment consignment = consignmentRepository.findConsignmentInfo(userConsignmentInfoQuery);
if(Objects.nonNull(consignment)
&& !consignment.getUserUuid().equals(userConsignmentInfoQuery.getUserUuid())
&& !consignment.getShipperAccount().equals(userConsignmentInfoQuery.getShipperAccount())){
Consignment consignmentTemp = new Consignment();
consignmentTemp.setId(consignment.getId());
consignmentTemp.setConsignmentCode(consignment.getConsignmentCode());
consignmentTemp.setShipperAccount(consignment.getShipperAccount());
consignmentTemp.setOriginCountry(consignment.getOriginCountry());
consignmentTemp.setDestinationCountry(consignment.getDestinationCountry());
consignment = consignmentTemp;
}
return responseUtils.success(consignment);
/**
* 对查询数据进行筛选
*/
Consignment resultConsignment = consignmentQueryUtil.findConsignment(userConsignmentInfoQuery,consignment);
return responseUtils.success(resultConsignment);
}
}
\ No newline at end of file
......
......@@ -2,7 +2,11 @@ package com.fedex.connect.customer.service.biz.impl;
import com.fedex.connect.common.dependencies.contants.DigitConstants;
import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.common.model.biz.*;
import com.fedex.connect.common.dependencies.exception.OpErrorException;
import com.fedex.connect.common.model.biz.Attachment;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.biz.UploadRecord;
import com.fedex.connect.common.model.biz.UserConsignmentMapping;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.data.bo.AddBo;
import com.fedex.connect.customer.data.bo.ConsignmentBo;
......@@ -11,28 +15,25 @@ import com.fedex.connect.customer.enums.ResponseCode;
import com.fedex.connect.customer.service.base.BaseService;
import com.fedex.connect.customer.service.biz.IAttachmentService;
import com.fedex.connect.customer.service.biz.IConsignmentService;
import com.fedex.connect.customer.service.biz.IEmailService;
import com.fedex.connect.customer.util.service.biz.ConsignmentUtil;
import com.fedex.connect.customer.util.service.biz.PushObUtil;
import com.fedex.connect.customer.util.service.biz.UploadRecordUtil;
import com.fedex.connect.customer.util.service.biz.UserConsignmentMappingUtil;
import com.fedex.connect.customer.validate.controller.biz.AttachmentValidate;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
* @Author Szl
* @Description 类说明 运单操作相关service
* @Date 2024/10/31
*/
@Slf4j
@Service
public class ConsignmentServiceImpl extends BaseService implements IConsignmentService {
@Autowired
......@@ -40,13 +41,9 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
@Autowired
private UploadRecordUtil uploadRecordUtil;
@Autowired
private UserConsignmentMappingUtil userConsignmentMappingUtil;
@Autowired
private PushObUtil pushObUtil;
@Autowired
private IAttachmentService attachmentService;
@Autowired
private IEmailService emailService;
private AttachmentValidate attachmentValidate;
/**
* @Author Szl
......@@ -57,6 +54,15 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
public ResponseVo add(AddBo bo, User user){
ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto();
if (StringUtils.isEmpty(bo.getConsignmentCode()) || !bo.getConsignmentCode().matches("\\d{12}")) {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO);
responseUtils.fail(ResponseCode.MESSAGE_CODE_30017);
}
if (!StringUtils.isEmpty(bo.getShipperAccount()) && !bo.getShipperAccount().matches("\\d{9}")) {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO);
responseUtils.fail(ResponseCode.MESSAGE_CODE_30019);
}
//查询运单表是否存在已提交的运单
LocalDate thirtyDaysAgo = LocalDate.now().minusDays(30);
Consignment consignment = consignmentRepository.findByConsignmentCode(bo.getConsignmentCode(),thirtyDaysAgo);
......@@ -64,7 +70,6 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
* 不存在则直接返回
*/
if (consignment == null){
ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto();
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ZERO);
if (!StringUtils.isEmpty(bo.getShipperAccount())){
if (Objects.equals(user.getAccountNo(),bo.getShipperAccount())){
......@@ -73,7 +78,7 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
/**
* 不存在运单,并且没有填写shipperAccount,则直接返回
*/
return responseUtils.success(consignmentAddDto);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30020,consignmentAddDto);
}
}else {
/**
......@@ -83,14 +88,23 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
}
}
/**
* 存在运单则获取mapping表
*/
UserConsignmentMapping byUserIdAndConsignmentCode = userConsignmentMappingRepository.findByUserIdAndConsignmentCode(user.getId(), consignment.getConsignmentCode());
Long ceFlag = 1L;
if (byUserIdAndConsignmentCode == null){
ceFlag = 3L;
}else if (byUserIdAndConsignmentCode.getCeFlag() != null){
ceFlag = byUserIdAndConsignmentCode.getCeFlag();
}
/**
* 根据是否是DM501返回不同的提示
*/
if (StringUtils.isEmpty(consignment.getUserUuid())){
if (StringUtils.isEmpty(consignment.getUserUuid()) && StringUtils.isEmpty(consignment.getShipperAccount())){
/**
* 非501数据
*/
if (StringUtils.isEmpty(bo.getShipperAccount())){
ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto();
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO);
return responseUtils.success(consignmentAddDto);
}
......@@ -99,7 +113,7 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
/**
* 501数据
*/
return consignmentUtil.consignmentCheckWithCe(consignment,bo,user);
return consignmentUtil.consignmentCheckWithCe(consignment,bo,user,ceFlag);
}
}
......@@ -122,6 +136,11 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
consignmentBo.getAttachmentBizTypeList(),
user,
consignmentBo.getConsignmentCode());
/**
* 拷贝附件后,需要再次进行附件信息验证
*/
attachmentValidate.validateAttachment(attachmentList);
/**
* 初始化运单信息
*/
......@@ -129,87 +148,24 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
/**
* 初始化上传记录信息
*/
UploadRecord uploadRecord = uploadRecordUtil.initUploadRecord(consignment.getConsignmentCode());
UploadRecord uploadRecord = uploadRecordUtil.initUploadRecord(consignment.getConsignmentCode(),user);
/**
* 保存运单相关信息
*/
this.submitInfo(consignment,attachmentList,uploadRecord,user);
consignmentUtil.submitInfo(consignment,attachmentList,uploadRecord,user,consignmentBo.getCeFlag());
}catch(OpErrorException ex){
/**
* 提交异常,需要删除对应已上传附件,已上传文件不进行删除
*/
// attachmentService.deleteAttachments(attachmentList);
throw ex;
}catch(Exception ex){
/**
* 提交异常,需要删除对应已上传附件
* 提交异常,需要删除对应已上传附件,已上传文件不进行删除
*/
attachmentService.deleteAttachments(attachmentList);
// attachmentService.deleteAttachments(attachmentList);
responseUtils.fail(ResponseCode.MESSAGE_CODE_30016,ex);
}
return responseUtils.success(ResponseCode.MESSAGE_CODE_30015);
}
/**
* @Author mt
* @Description 保存运单相关信息
* @Date 2024/11/19
* @param consignment
* @param attachmentList
* @param uploadRecord
* @param user
* @return void
*/
@Transactional(rollbackFor = Exception.class)
public void submitInfo(Consignment consignment,
List<Attachment> attachmentList,
UploadRecord uploadRecord,
User user) throws Exception{
/**
* 保存或更新运单表
*/
consignmentRepository.saveOrUpdate(consignment);
//设置上传记录表运单ID
uploadRecord.setConsignmentId(consignment.getId());
/**
* 保存上传记录表
*/
uploadRecordRepository.saveOrUpdate(uploadRecord);
//设置附件表运单id,上传记录表id
Optional.ofNullable(attachmentList).orElse(new ArrayList<>()).stream().filter(Objects::nonNull).forEach(p->{
p.setBizId(consignment.getId());
p.setUploadRecordId(uploadRecord.getId());
});
/**
* 保存附件表信息
*/
attachmentRepository.saveOrUpdateAll(attachmentList);
//用户uuid与运单uuid不一致,则需要添加用户运单中间表信息
if(!user.getUserUuid().equals(consignment.getUserUuid())){
/**
* 查找用户与运单关联信息
*/
UserConsignmentMapping userConsignmentMapping = userConsignmentMappingRepository.findByUserIdConsignmentId(user.getId(),consignment.getId());
if(Objects.isNull(userConsignmentMapping)){
/**
* 初始化插入预清关文件推送任务日志
*/
userConsignmentMapping = userConsignmentMappingUtil.initUserConsignmentMapping(user.getId(),consignment.getId());
/**
* 初始化插入预清关文件推送任务日志
*/
userConsignmentMappingRepository.saveOrUpdate(userConsignmentMapping);
}
}
/**
* Todo 初始化插入预清关文件推送任务日志,szl添加
*/
/**
* 初始化插入预清关文件邮件推送日志,mt添加
*/
PushOb pushOb = pushObUtil.initPushOb(consignment,user);
/**
* 初始化插入提醒发件人邮件日志
*/
emailService.saveNotificationEmail(consignment,user);
/**
* 推送进口文件主表
*/
pushObRepository.saveOrUpdate(pushOb);
}
}
\ No newline at end of file
......
......@@ -2,6 +2,7 @@ package com.fedex.connect.customer.service.biz.impl;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.biz.Email;
import com.fedex.connect.common.model.biz.UploadRecord;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.service.base.BaseService;
import com.fedex.connect.customer.service.biz.IEmailService;
......@@ -26,7 +27,7 @@ public class EmailServiceImpl extends BaseService implements IEmailService {
*/
@Override
public void saveNotificationEmail(Consignment consignment, User user) throws Exception {
if (!StringUtils.isEmpty(consignment.getUserUuid()) && consignment.getUserUuid().equals(user.getUserUuid())){
if (StringUtils.isEmpty(consignment.getUserUuid()) || consignment.getUserUuid().equals(user.getUserUuid())) {
return;
}
/**
......@@ -39,4 +40,17 @@ public class EmailServiceImpl extends BaseService implements IEmailService {
*/
emailRepository.save(email);
}
@Override
public void savePushConsignmentFileEmail(Consignment consignment,UploadRecord uploadRecord) throws Exception {
/**
* 初始化Email对象
*/
Email email = new Email();
emailUtil.initPushConsignmentFileEmail(email,consignment, uploadRecord);
/**
* 保存入库
*/
emailRepository.save(email);
}
}
......
......@@ -38,7 +38,7 @@ public class UploadRecordServiceImpl extends BaseService implements IUploadRecor
AttachmentHistoryDto attachmentHistoryDto = new AttachmentHistoryDto();
attachmentHistoryDto.setUploadRecord(uploadRecord);
attachmentHistoryDto.setCreatorFlag(
(uploadRecord.getCreateUserId() != null) ?
(uploadRecord.getCreateUserId() != null) && uploadRecord.getCreateUserId().equals(user.getId()) ?
DigitConstants.DIGIT_ONE : DigitConstants.DIGIT_ZERO
);
attachmentHistoryDtos.add(attachmentHistoryDto);
......
......@@ -52,10 +52,10 @@ public class AttachmentUtil {
private void initAttachment(Attachment attachment,String bizType,User user) throws Exception{
DictionaryEntries attachmentBizTypeEntries = cacheSystem.getDicAttachmentBizType(bizType);
attachment.setBizTypeCode(attachmentBizTypeEntries.getCode());
attachment.setBizTypeName(attachmentBizTypeEntries.getEnglishName());
attachment.setBizTypeName(attachmentBizTypeEntries.getDescription());
DictionaryEntries attachmentFileTypeEntries = cacheSystem.getDicAttachmentFileType(AttachmentFileTypeEnum.FILE.getCode());
attachment.setFileTypeCode(attachmentFileTypeEntries.getCode());
attachment.setFileTypeName(attachmentFileTypeEntries.getEnglishName());
attachment.setFileTypeName(attachmentFileTypeEntries.getDescription());
attachment.setStatus(StatusEnum.YES.getCode());
attachment.setCreateUserId(user.getId());
attachment.setCreateUserName(user.getUserName());
......@@ -142,6 +142,7 @@ public class AttachmentUtil {
public static MultipartFile findFileByName(MultipartFile[] files, String fileName) {
for (MultipartFile file : files) {
log.info("fileName:" + file.getOriginalFilename());
if (file.getOriginalFilename().equals(fileName)) {
return file; // 找到匹配的文件,返回该文件
}
......
package com.fedex.connect.customer.util.service.biz;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.biz.UserConsignmentMapping;
import com.fedex.connect.customer.data.query.UserConsignmentInfoQuery;
import com.fedex.connect.customer.repository.repo.IUserConsignmentMappingRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Objects;
/**
* @Author mt
* @Description 运单数据查询处理
* @Date 2024/12/24
*/
@Slf4j
@Component
public class ConsignmentQueryUtil {
@Autowired
protected IUserConsignmentMappingRepository userConsignmentMappingRepository;
/**
* @Author mt
* @Description 运单查询数据筛选
* @Date 2024/12/24
* @param userConsignmentInfoQuery
* @param consignment
* @return com.fedex.connect.common.model.biz.Consignment
*/
public Consignment findConsignment(UserConsignmentInfoQuery userConsignmentInfoQuery,Consignment consignment){
/**
* 查询mapping表
*/
UserConsignmentMapping byUserIdAndConsignmentCode = userConsignmentMappingRepository.findByUserIdAndConsignmentCode(userConsignmentInfoQuery.getUserId(), consignment.getConsignmentCode());
Consignment resultConsignment = null;
if(Objects.nonNull(consignment)){
//uuid相同,则将运单所有信息返回给到前端
if(Objects.equals(userConsignmentInfoQuery.getUserUuid(),consignment.getUserUuid()) || (byUserIdAndConsignmentCode.getCeFlag() == null || byUserIdAndConsignmentCode.getCeFlag() == 1L)){
//1:如果运单UUID与登录账号UUID相同或者用户shipperAccount与运单shipperAccount相同,则显示运单、收发件人信息,以及501信息
resultConsignment = consignment;
}else {
//如果运单UUID与登录账号UUID不同,用户shipperAccount与运单录入的shipperAccount一致,则只显示用户录入的运单号、shipperAccount、始发国
resultConsignment = new Consignment();
resultConsignment.setId(consignment.getId());
resultConsignment.setConsignmentCode(consignment.getConsignmentCode());
resultConsignment.setUserInputOriginCountry(consignment.getUserInputOriginCountry());
resultConsignment.setUserInputOriginCountryCode(consignment.getUserInputOriginCountryCode());
resultConsignment.setUserInputShipperAccount(consignment.getUserInputShipperAccount());
resultConsignment.setDestinationCountry(consignment.getDestinationCountry());
resultConsignment.setDestinationCountryCode(consignment.getDestinationCountryCode());
}
}
return resultConsignment;
}
}
......@@ -7,26 +7,31 @@ import com.fedex.connect.common.dependencies.enums.biz.ConsignmentStatusEnum;
import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.common.dependencies.util.ResponseUtils;
import com.fedex.connect.common.model.bi.DictionaryEntries;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.biz.*;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.customer.data.bo.AddBo;
import com.fedex.connect.customer.data.bo.ConsignmentBo;
import com.fedex.connect.customer.data.dto.ConsignmentAddDto;
import com.fedex.connect.customer.data.dto.ConsignmentDto;
import com.fedex.connect.customer.enums.ResponseCode;
import com.fedex.connect.customer.repository.repo.IConsignmentRepository;
import com.fedex.connect.customer.repository.repo.*;
import com.fedex.connect.customer.service.biz.IEmailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.util.Date;
import java.util.Objects;
import java.time.LocalDate;
import java.util.*;
/**
* @Author Szl
* @Description 类说明 运单相关util
* @Date 2024/11/5
*/
@Slf4j
@Component
public class ConsignmentUtil {
@Autowired
......@@ -35,6 +40,20 @@ public class ConsignmentUtil {
ResponseUtils responseUtils;
@Autowired
IConsignmentRepository consignmentRepository;
@Autowired
UserConsignmentMappingUtil userConsignmentMappingUtil;
@Autowired
PushObUtil pushObUtil;
@Autowired
IEmailService emailService;
@Autowired
IUploadRecordRepository uploadRecordRepository;
@Autowired
IPushObRepository pushObRepository;
@Autowired
IAttachmentRepository attachmentRepository;
@Autowired
IUserConsignmentMappingRepository userConsignmentMappingRepository;
/**
* @Author mt
......@@ -51,27 +70,39 @@ public class ConsignmentUtil {
Date nowDate = new Date();
//如果没有运单id,则是通过add添加进来的运单
if (Objects.isNull(consignment)) {
//根据运单号查询运单表最近30天内是否存在已提交的运单
LocalDate thirtyDaysAgo = LocalDate.now().minusDays(30);
consignment = consignmentRepository.findByConsignmentCode(consignmentBo.getConsignmentCode(),thirtyDaysAgo);
//如果最近30天内没有提交过该运单,则新建
if(consignment == null){
consignment = new Consignment();
//用户录入数据拷贝
BeanUtils.copyProperties(consignmentBo, consignment);
/******提交信息记录******/
consignment.setCreateTime(nowDate);
consignment.setCreateUserName(user.getUserName());
consignment.setCreateUserId(user.getId());
}
//运单号
consignment.setConsignmentCode(consignmentBo.getConsignmentCode());
//目的国全称
consignment.setDestinationCountry(consignmentBo.getDestinationCountry());
//目的国编码
consignment.setDestinationCountryCode(consignmentBo.getDestinationCountryCode());
//用户录入shipperaccount
consignment.setUserInputShipperAccount(consignmentBo.getShipperAccount());
//始发国名称
consignment.setUserInputOriginCountry(consignmentBo.getOriginCountry());
//始发国编码
consignment.setUserInputOriginCountryCode(consignmentBo.getOriginCountryCode());
/******提交信息记录******/
consignment.setFirstSubmitTime(nowDate);
consignment.setFirstSubmitter(user.getUserName());
consignment.setFirstSubmitterId(user.getId());
consignment.setCreateTime(nowDate);
consignment.setCreateUserName(user.getUserName());
consignment.setCreateUserId(user.getId());
} else {
consignment.setModifyTime(nowDate);
consignment.setModifyUserName(user.getUserName());
consignment.setModifyUserId(user.getId());
}
if (StringUtils.isEmpty(consignment.getFirstSubmitter())){
consignment.setFirstSubmitTime(nowDate);
consignment.setFirstSubmitter(user.getUserName());
consignment.setFirstSubmitterId(user.getId());
}
//记录当前提交人信息
consignment.setSubmitTime(nowDate);
consignment.setSubmitter(user.getUserName());
......@@ -99,13 +130,24 @@ public class ConsignmentUtil {
*/
public ResponseVo consignmentCheckWithNotCe(Consignment consignment, AddBo bo){
ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto();
consignmentAddDto.setConsignmentId(consignment.getId());
if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getShipperAccount())){
if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getUserInputShipperAccount())){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
ConsignmentDto consignmentUserInput = new ConsignmentDto();
consignmentUserInput.setId(consignment.getId());
consignmentUserInput.setConsignmentCode(consignment.getConsignmentCode());
consignmentUserInput.setUserInputShipperAccount(consignment.getUserInputShipperAccount());
consignmentUserInput.setUserInputOriginCountry(consignment.getUserInputOriginCountry());
consignmentUserInput.setUserInputOriginCountryCode(consignment.getUserInputOriginCountryCode());
consignmentUserInput.setOriginCountry(consignment.getUserInputOriginCountry());
consignmentUserInput.setOriginCountryCode(consignment.getUserInputOriginCountryCode());
consignmentUserInput.setShipperAccount(consignment.getUserInputShipperAccount());
consignmentUserInput.setDestinationCountryCode(consignment.getDestinationCountryCode());
consignmentUserInput.setDestinationCountry(consignment.getDestinationCountry());
consignmentUserInput.setCeFlag(0L);
consignmentAddDto.setConsignment(consignmentUserInput);
return responseUtils.success(consignmentAddDto);
}else {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_THREE);
consignmentAddDto.setConsignmentId(null);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30011,consignmentAddDto);
}
}
......@@ -119,15 +161,17 @@ public class ConsignmentUtil {
* @param user
* @return void
*/
public ResponseVo consignmentCheckWithCe(Consignment consignment, AddBo bo, User user) {
public ResponseVo consignmentCheckWithCe(Consignment consignment, AddBo bo, User user,Long ceFlag) {
ConsignmentAddDto consignmentAddDto = new ConsignmentAddDto();
consignmentAddDto.setConsignmentId(consignment.getId());
ConsignmentDto consignmentDto = new ConsignmentDto();
BeanUtils.copyProperties(consignment, consignmentDto);
/**
* uuid相同,直接返回所有运单信息
*/
if (Objects.equals(consignment.getUserUuid(), user.getUserUuid())) {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
consignmentDto.setCeFlag(1L);
consignmentAddDto.setConsignment(consignmentDto);
return responseUtils.success(consignmentAddDto);
}
......@@ -136,16 +180,34 @@ public class ConsignmentUtil {
*/
if (isShipperAccountMatch(user.getAccountNo(), consignment.getShipperAccount())) {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
consignmentDto.setCeFlag(1L);
consignmentAddDto.setConsignment(consignmentDto);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30004, consignmentAddDto);
}
/**
* mapping表判断,存在mapping则返回对应数据
*/
if (ceFlag == 0){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
ConsignmentDto consignmentUserInput = new ConsignmentDto();
this.initConByNotCe(consignmentUserInput,consignmentDto);
consignmentDto.setCeFlag(0L);
consignmentAddDto.setConsignment(consignmentUserInput);
return responseUtils.success(consignmentAddDto);
}else if (ceFlag == 1){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
consignmentDto.setCeFlag(1L);
consignmentAddDto.setConsignment(consignmentDto);
return responseUtils.success(consignmentAddDto);
}
/**
* uuid不一致且未填写shipperAccount
*/
if (!StringUtils.hasText(bo.getShipperAccount())){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO);
consignmentAddDto.setConsignmentId(null);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30012,consignmentAddDto);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30005,consignmentAddDto);
}
/**
......@@ -153,6 +215,8 @@ public class ConsignmentUtil {
*/
if (isShipperAccountMatch(bo.getShipperAccount(), consignment.getShipperAccount())) {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
consignmentDto.setCeFlag(1L);
consignmentAddDto.setConsignment(consignmentDto);
return responseUtils.success(consignmentAddDto);
}
......@@ -160,10 +224,13 @@ public class ConsignmentUtil {
if (!StringUtils.isEmpty(consignment.getUserInputShipperAccount())){
if (isShipperAccountMatch(bo.getShipperAccount(),consignment.getUserInputShipperAccount())){
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
ConsignmentDto consignmentUserInput = new ConsignmentDto();
this.initConByNotCe(consignmentUserInput,consignmentDto);
consignmentDto.setCeFlag(0L);
consignmentAddDto.setConsignment(consignmentUserInput);
return responseUtils.success(consignmentAddDto);
}else {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_THREE);
consignmentAddDto.setConsignmentId(null);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30011,consignmentAddDto);
}
}
......@@ -172,7 +239,7 @@ public class ConsignmentUtil {
* 都不一致,但是输入了shipperAccount,则给出提示
*/
if (StringUtils.hasText(bo.getShipperAccount())) {
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_ONE);
consignmentAddDto.setIsCreatorFlag(DigitConstants.DIGIT_TWO);
return responseUtils.success(ResponseCode.MESSAGE_CODE_30005,consignmentAddDto);
}
......@@ -183,4 +250,94 @@ public class ConsignmentUtil {
private boolean isShipperAccountMatch(String account1, String account2) {
return StringUtils.hasText(account1) && StringUtils.hasText(account2) && account1.equals(account2);
}
private Consignment initConByNotCe(ConsignmentDto consignmentUserInput,ConsignmentDto consignment){
consignmentUserInput.setId(consignment.getId());
consignmentUserInput.setConsignmentCode(consignment.getConsignmentCode());
consignmentUserInput.setUserInputShipperAccount(consignment.getUserInputShipperAccount());
consignmentUserInput.setUserInputOriginCountry(consignment.getUserInputOriginCountry());
consignmentUserInput.setUserInputOriginCountryCode(consignment.getUserInputOriginCountryCode());
consignmentUserInput.setOriginCountry(consignment.getUserInputOriginCountry());
consignmentUserInput.setOriginCountryCode(consignment.getUserInputOriginCountryCode());
consignmentUserInput.setShipperAccount(consignment.getUserInputShipperAccount());
consignmentUserInput.setDestinationCountryCode(consignment.getDestinationCountryCode());
consignmentUserInput.setDestinationCountry(consignment.getDestinationCountry());
return consignmentUserInput;
}
/**
* @Author mt
* @Description 保存运单相关信息
* @Date 2024/11/19
* @param consignment
* @param attachmentList
* @param uploadRecord
* @param user
* @return void
*/
@Transactional(rollbackFor = Exception.class)
public void submitInfo(Consignment consignment,
List<Attachment> attachmentList,
UploadRecord uploadRecord,
User user,
Long ceFlag) throws Exception{
if(Objects.nonNull(consignment) && Objects.nonNull(consignment.getId())){
try{
//增加行级锁
consignmentRepository.lockConsignmentRow(consignment.getId());
}catch(Exception ex){
responseUtils.fail(ResponseCode.MESSAGE_CODE_30018,ex);
}
}
/**
* 保存或更新运单表
*/
consignmentRepository.saveOrUpdate(consignment);
//设置上传记录表运单ID
uploadRecord.setConsignmentId(consignment.getId());
/**
* 保存上传记录表
*/
uploadRecordRepository.saveOrUpdate(uploadRecord);
//设置附件表运单id,上传记录表id
Optional.ofNullable(attachmentList).orElse(new ArrayList<>()).stream().filter(Objects::nonNull).forEach(p->{
p.setBizId(consignment.getId());
p.setUploadRecordId(uploadRecord.getId());
});
/**
* 保存附件表信息
*/
attachmentRepository.saveOrUpdateAll(attachmentList);
/**
* 查找用户与运单关联信息
*/
UserConsignmentMapping userConsignmentMapping = userConsignmentMappingRepository.findByUserIdConsignmentId(user.getId(),consignment.getId());
if(Objects.isNull(userConsignmentMapping)){
/**
* 初始化插入预清关文件推送任务日志
*/
userConsignmentMapping = userConsignmentMappingUtil.initUserConsignmentMapping(user.getId(),consignment);
}
userConsignmentMapping.setCeFlag(ceFlag);
/**
* 初始化插入预清关文件推送任务日志
*/
userConsignmentMappingRepository.saveOrUpdate(userConsignmentMapping);
/**
* 初始化插入预清关文件推送日志,mt添加
*/
PushOb pushOb = pushObUtil.initPushOb(consignment,uploadRecord,user);
/**
* 初始化插入提醒发件人邮件日志
*/
emailService.saveNotificationEmail(consignment,user);
/**
* 初始化插入预清关文件邮件推送日志
*/
emailService.savePushConsignmentFileEmail(consignment,uploadRecord);
/**
* 推送进口文件主表
*/
pushObRepository.saveOrUpdate(pushOb);
}
}
\ No newline at end of file
......
......@@ -2,23 +2,49 @@ package com.fedex.connect.customer.util.service.biz;
import com.fedex.connect.common.dependencies.enums.biz.EmailStatusEnum;
import com.fedex.connect.common.dependencies.enums.biz.EmailTypeEnum;
import com.fedex.connect.common.dependencies.template.clearanceEmail.DuplicateEmailTemplate;
import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.biz.Email;
import com.fedex.connect.common.model.biz.UploadRecord;
import com.fedex.connect.customer.repository.repo.IUserRepository;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Optional;
@Component
public class EmailUtil {
@Autowired
private IUserRepository iUserRepository;
@Autowired
private DuplicateEmailTemplate duplicateEmailTemplate;
public void initNotificationEmail(Email email, Consignment consignment) throws Exception{
email.setBizId(consignment.getId());
email.setBizCode(consignment.getConsignmentCode());
email.setToAddress(consignment.getShipperEmail());
email.setSubject("");
email.setSubject("");
String emailAddress = Optional.ofNullable(consignment.getUserUuid())
.map(iUserRepository::findUserByUuid)
.map(user -> StringUtils.defaultIfEmpty(user.getEmail(), consignment.getShipperEmail()))
.orElse(consignment.getShipperEmail());
email.setToAddress(emailAddress);
email.setSubject(duplicateEmailTemplate.getTitle(email.getBizCode()));
email.setTypeName(EmailTypeEnum.NOTIFICATION_SENDER.getMsg());
email.setTypeCode(EmailTypeEnum.NOTIFICATION_SENDER.getCode());
email.setStatusName(EmailStatusEnum.PENDING.getMsg());
email.setStatusCode(EmailStatusEnum.PENDING.getCode());
AssignmentFieldUtils.assignmentTableBaseField(email);
}
public void initPushConsignmentFileEmail(Email email, Consignment consignment,UploadRecord uploadRecord) throws Exception{
email.setBizId(uploadRecord.getId());
email.setBizCode(consignment.getConsignmentCode());
email.setSubject("");
email.setTypeName(EmailTypeEnum.PUSH_CON_FILE.getMsg());
email.setTypeCode(EmailTypeEnum.PUSH_CON_FILE.getCode());
email.setStatusName(EmailStatusEnum.PENDING.getMsg());
email.setStatusCode(EmailStatusEnum.PENDING.getCode());
AssignmentFieldUtils.assignmentTableBaseField(email);
}
}
......
......@@ -7,6 +7,7 @@ import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.common.model.bi.DictionaryEntries;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.biz.PushOb;
import com.fedex.connect.common.model.biz.UploadRecord;
import com.fedex.connect.common.model.sys.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -29,14 +30,15 @@ public class PushObUtil {
* @param
* @return com.fedex.connect.common.model.biz.PushOb
*/
public PushOb initPushOb(Consignment consignment, User user) throws Exception{
public PushOb initPushOb(Consignment consignment, UploadRecord uploadRecord, User user) throws Exception{
DictionaryEntries pushObStatus = cacheSystem.getDicPushObStatus(PushObStatusEnum.TO_BE_SENT.getCode());
PushOb pushOb = new PushOb();
pushOb.setConsignmentId(consignment.getId());
pushOb.setConsignmentCode(consignment.getConsignmentCode());
pushOb.setPushNum(DigitConstants.DIGIT_ZERO_LONG);
pushOb.setStatusCode(pushObStatus.getCode());
pushOb.setStatusName(pushObStatus.getEnglishName());
pushOb.setStatusName(pushObStatus.getDescription());
pushOb.setUploadRecordId(uploadRecord.getId());
pushOb.setCreateUserId(user.getId());
pushOb.setCreateUserName(user.getUserName());
pushOb.setModifyUserId(user.getId());
......
......@@ -6,6 +6,7 @@ import com.fedex.connect.common.dependencies.enums.biz.ConsignmentStatusEnum;
import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.common.model.bi.DictionaryEntries;
import com.fedex.connect.common.model.biz.UploadRecord;
import com.fedex.connect.common.model.sys.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -28,7 +29,7 @@ public class UploadRecordUtil {
* @param consignmentCode
* @return com.fedex.connect.common.model.biz.UploadRecord
*/
public UploadRecord initUploadRecord(String consignmentCode) throws Exception{
public UploadRecord initUploadRecord(String consignmentCode, User user) throws Exception{
DictionaryEntries consignmentStatusDic = cacheSystem.getDicConsignmentStatus(ConsignmentStatusEnum.CONSIGNMENT_STATUS_01.getCode());
UploadRecord uploadRecord = new UploadRecord();
//记录当前运单号
......@@ -36,6 +37,10 @@ public class UploadRecordUtil {
//记录当前运单状态
uploadRecord.setStatusCode(consignmentStatusDic.getCode());
uploadRecord.setStatusName(consignmentStatusDic.getEnglishName());
uploadRecord.setCreateUserId(user.getId());
uploadRecord.setCreateUserName(user.getUserName());
uploadRecord.setModifyUserId(user.getId());
uploadRecord.setModifyUserName(user.getUserName());
/**
* 初始化基础字段
*/
......
......@@ -2,6 +2,7 @@ package com.fedex.connect.customer.util.service.biz;
import com.fedex.connect.common.dependencies.enums.base.StatusEnum;
import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.biz.UserConsignmentMapping;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
......@@ -22,10 +23,11 @@ public class UserConsignmentMappingUtil {
* @param
* @return com.fedex.connect.common.model.biz.PushOb
*/
public UserConsignmentMapping initUserConsignmentMapping(Long userId,Long consignmentId) throws Exception{
public UserConsignmentMapping initUserConsignmentMapping(Long userId, Consignment consignment) throws Exception{
UserConsignmentMapping userConsignmentMapping = new UserConsignmentMapping();
userConsignmentMapping.setUserId(userId);
userConsignmentMapping.setConsignmentId(consignmentId);
userConsignmentMapping.setConsignmentId(consignment.getId());
userConsignmentMapping.setConsignmentCode(consignment.getConsignmentCode());
userConsignmentMapping.setStatus(StatusEnum.YES.getCode());
AssignmentFieldUtils.assignmentTableBaseField(userConsignmentMapping);
return userConsignmentMapping;
......
package com.fedex.connect.customer.validate.controller.biz;
import com.fedex.connect.common.dependencies.contants.DigitConstants;
import com.fedex.connect.common.dependencies.util.ResponseUtils;
import com.fedex.connect.common.dependencies.util.Utils;
import com.fedex.connect.common.model.biz.Attachment;
import com.fedex.connect.customer.constants.CustomerConstant;
import com.fedex.connect.customer.data.bo.ConsignmentBo;
import com.fedex.connect.customer.enums.ResponseCode;
......@@ -34,21 +34,53 @@ public class AttachmentValidate {
*/
public void validateFile(MultipartFile[] files, ConsignmentBo consignmentBo){
//文件为空
if(Objects.isNull(files)
|| files.length == DigitConstants.DIGIT_MINUS_ONE
|| Objects.isNull(consignmentBo)
if(Objects.isNull(consignmentBo)
|| Objects.isNull(consignmentBo.getAttachmentBizTypeList())){
responseUtils.fail(ResponseCode.MESSAGE_CODE_30006);
}
//上传最大文件个数限制
if(files.length > CustomerConstant.VALIDATE_KEYS.UPLOAD_FILE_MAX_TOTAL){
if(Objects.nonNull(files) && files.length > CustomerConstant.VALIDATE_KEYS.UPLOAD_FILE_MAX_TOTAL){
responseUtils.fail(ResponseCode.MESSAGE_CODE_30007,CustomerConstant.VALIDATE_KEYS.UPLOAD_FILE_MAX_TOTAL);
}
//上传总文件大小限制
List<Long> fileSizeList = new ArrayList<>();
for(MultipartFile file : files){
if(Objects.nonNull(files)) {
for (MultipartFile file : files) {
fileSizeList.add(file.getSize());
}
}
//总文件大小
Long totalSize = Utils.listOf(fileSizeList).stream().filter(Objects::nonNull)
.mapToLong(f -> Optional.ofNullable(f).orElse(0L)).sum();
//最大上传总文件大小超过95M
if(totalSize > CustomerConstant.VALIDATE_KEYS.UPLOAD_FILE_MAX_SIZE){
responseUtils.fail(ResponseCode.MESSAGE_CODE_30008,CustomerConstant.VALIDATE_KEYS.FILE_MAX_SIZE);
}
}
/**
* @Author mt
* @Description 附件信息校验
* @Date 2024/11/12
* @param files
* @return void
*/
public void validateAttachment(List<Attachment> files){
//文件为空
if(Objects.isNull(files)){
return;
}
//上传最大文件个数限制
if(Objects.nonNull(files) && files.size() > CustomerConstant.VALIDATE_KEYS.UPLOAD_FILE_MAX_TOTAL){
responseUtils.fail(ResponseCode.MESSAGE_CODE_30007,CustomerConstant.VALIDATE_KEYS.UPLOAD_FILE_MAX_TOTAL);
}
//上传总文件大小限制
List<Long> fileSizeList = new ArrayList<>();
if(Objects.nonNull(files)) {
for (Attachment file : files) {
fileSizeList.add(file.getFileSize());
}
}
//总文件大小
Long totalSize = Utils.listOf(fileSizeList).stream().filter(Objects::nonNull)
.mapToLong(f -> Optional.ofNullable(f).orElse(0L)).sum();
......
package com.fedex.connect.customer.validate.controller.biz;
import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil;
import com.fedex.connect.common.dependencies.util.ResponseUtils;
import com.fedex.connect.customer.enums.ResponseCode;
import org.springframework.beans.factory.annotation.Autowired;
......
......@@ -8,23 +8,7 @@ spring:
#系统环境
env: dev
export:
jwt:
securityKey: C*F-JaNdRgUkXn2r5u8x/A?D(G+KbPeShVmYq3s6v9y$B&E)H@McQfTjWnZr4u7w
urlWhiteList:
- /icleartw/auth
- /icleartw/monitor/ok
- /icleartw/sysUser/logout
- /icleartw/swagger-resources
- /icleartw/webjars
uriWhiteList:
- /icleartw/swagger-ui.html
- /icleartw/swagger-ui/*
- /icleartw/v2/api-docs
- /icleartw/login.html
expire_1H: 7200
expire_1D: 604800
mail:
smtp:
host: smtp.qiye.aliyun.com
......
spring:
datasource:
jndi-name: jdbc/iclearConnectDS
jndi-name: jdbc/iclconnectDS
profiles:
#系统环境
env: prod
export:
jwt:
securityKey: C*F-JaNdRgUkXn2r5u8x/A?D(G+KbPeShVmYq3s6v9y$B&E)H@McQfTjWnZr4u7w
urlWhiteList:
- /icleartw/auth
- /icleartw/monitor/ok
- /icleartw/sysUser/logout
- /icleartw/swagger-resources
- /icleartw/webjars
uriWhiteList:
- /icleartw/swagger-ui.html
- /icleartw/swagger-ui/*
- /icleartw/v2/api-docs
- /icleartw/login.html
expire_1H: 7200
expire_1D: 604800
mail:
smtp:
host: mapper.gslb.fedex.com
......@@ -38,4 +23,4 @@ export:
upload:
path:
attachment: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/attachment
\ No newline at end of file
attachment: /var/share/iClearPreCLR/upload/attachment
\ No newline at end of file
......
spring:
datasource:
jndi-name: jdbc/iclearConnectDS
jndi-name: jdbc/iclconnectDS
profiles:
#系统环境
env: test
export:
jwt:
securityKey: C*F-JaNdRgUkXn2r5u8x/A?D(G+KbPeShVmYq3s6v9y$B&E)H@McQfTjWnZr4u7w
urlWhiteList:
- /icleartw/auth
- /icleartw/monitor/ok
- /icleartw/sysUser/logout
- /icleartw/swagger-resources
- /icleartw/webjars
uriWhiteList:
- /icleartw/swagger-ui.html
- /icleartw/swagger-ui/*
- /icleartw/v2/api-docs
- /icleartw/login.html
expire_1H: 7200
expire_1D: 604800
mail:
smtp:
host: smtp.qiye.aliyun.com
......
spring:
datasource:
jndi-name: jdbc/iclearConnectDS
jndi-name: jdbc/iclconnectDS
profiles:
#系统环境
env: uat
export:
jwt:
securityKey: C*F-JaNdRgUkXn2r5u8x/A?D(G+KbPeShVmYq3s6v9y$B&E)H@McQfTjWnZr4u7w
urlWhiteList:
- /icleartw/auth
- /icleartw/monitor/ok
- /icleartw/sysUser/logout
- /icleartw/swagger-resources
- /icleartw/webjars
uriWhiteList:
- /icleartw/swagger-ui.html
- /icleartw/swagger-ui/*
- /icleartw/v2/api-docs
- /icleartw/login.html
expire_1H: 7200
expire_1D: 604800
mail:
smtp:
host: mapper.gslb.fedex.com
......@@ -38,4 +23,4 @@ export:
upload:
path:
attachment: /var/share/iclearConnect/upload/attachment
\ No newline at end of file
attachment: /var/share/iClearPreCLR/upload/attachment
\ No newline at end of file
......
......@@ -29,6 +29,7 @@ import:
- /biz-customer/user/logout
- /biz-customer/swagger-resources
- /biz-customer/webjars
- /biz-customer/csrf
uriWhiteList:
- /biz-customer/swagger-ui.html
- /biz-customer/swagger-ui/*
......@@ -44,3 +45,7 @@ mybatis:
#开启驼峰与下划线转换
map-underscore-to-camel-case: true
call-setters-on-nulls: true
#全局异常拦截是否生效
common:
exception-advice-webconfig:
enable: true
\ No newline at end of file
......
......@@ -2,7 +2,7 @@
<configuration>
<springProfile name="dev,uat,prod">
<!-- 日志存放路径 -->
<property name="log.path" value="/var/fedex/iclearConnect/weblogic/iclearConnect/biz-customer" />
<property name="log.path" value="/var/fedex/iclconnect/weblogic/biz-customer" />
</springProfile>
<springProfile name="test">
<!-- 日志存放路径 -->
......
#******************系统操作日志记录,中文展示******************
business_log_20001=添加运单
business_log_20002=提交运单
business_log_20003=运单查询
business_log_20004=运单详细信息查询
business_log_20005=根据运单ID查询用户上传记录
business_log_20006=运单历史上传记录查询
business_log_20007=上传历史附件记录
business_log_20008=下载附件
system_exception_20003=提示信息过长,未保存成功
#******************鉴权相关提示,需要做国际化******************
#authentication包
#没有访问权限
system_exception_10001=No access rights.
#没有通过权限认证
system_exception_10002=Failed to pass the authentication.
#登录身份异常
system_exception_10003=Login identity is abnormal.
#登录超过8小时,请重新登录
system_exception_10004=Login has exceeded 8 hours, please log in again.
#登录已过期,请重新登录
system_exception_10005=Login has expired, please log in again.
#******************业务相关、需要做国际化******************
#*********用于字段描述使用,不单独使用**********
#发货人计费账号
business_field_31001=shipper account
#运单ID
business_field_31002=tracking number ID
#运单号
business_field_31003=tracking number
#始发国编码
business_field_31004=origin country ID
#始发国名称
business_field_31005=origin country
#目的国编码
business_field_31006=destination country ID
#目的国全称
business_field_31007=destination country
#文件业务类型
business_field_31008=upload file type
#*********具体响应到前端**********
#{0}必填字段未填写
business_exception_30001=Required fields not filled in.
#单次最多可查询1000个运单号码
business_exception_30002=A maximum of 1,000 waybill numbers can be queried at a time.
#暂时没用,预留
business_exception_30003={0}不正确,请重新输入
business_exception_30004=The waybill you entered is generated by another user, whether continue uploading?
business_exception_30005=The waybill you entered is generated by another account, whether continue uploading?
#附件未上传
business_exception_30006=Attachment not uploaded.
#所有上传文件数量不超过{0}个文件
business_exception_30007=The total number of uploaded files should not exceed 100 files.
#所有上传文件总大小不超过{0}M
business_exception_30008=The total size of all uploaded files should not exceed {0}MB.
#暂时没用,预留
business_exception_30009=运单或发票未上传
#暂时没用,预留
business_exception_30010=文件类型不在:运单、发票、箱单、其他
#该运单已被其他人创建,不可以重复创建
business_exception_30011=This waybill has been created by someone else and cannot be created again.
#暂时没用,预留
business_exception_30012=UUID不一致
#文件名为:{0},上传失败,请检查后重试
business_exception_30013=File name: {0}, upload failed, please check and try again
#运单信息加载失败,请稍后重试
business_exception_30014=Air waybill information loading failed, please try again later
#提交成功
business_success_30015=Submission successful
#提交失败,请稍后重试!
business_exception_30016=Submission failed, please try again later!
#运单号填写错误,请检查!
business_exception_30017=Air waybill number is incorrect, please check!
#运单提交失败,该运单正在被其他用户操作,请稍后重试
business_exception_30018=Air waybill submission failed, the waybill is being operated by other users, please try again later.
#Shipper Account填写错误(Shipper Account是由9位数字组成)
business_exception_30019=Incorrect Shipper Account(Shipper Account is composed of 9 digits).
#您当前登录账号的shipper Account与您正在录入的shipperAccount不一致,请确认是否继续?
business_exception_30020=The Shipper Account you are entering is inconsistent with your login Shipper Account. Please confirm whether to continue?
\ No newline at end of file
......
......@@ -6,42 +6,77 @@ business_log_20004=运单详细信息查询
business_log_20005=根据运单ID查询用户上传记录
business_log_20006=运单历史上传记录查询
business_log_20007=上传历史附件记录
business_log_20008=下载附件
system_exception_20003=提示信息过长,未保存成功
#******************鉴权相关提示,需要做国际化******************
#authentication包
system_exception_10001=没有访问权限
system_exception_10002=没有通过权限认证
system_exception_10003=登录身份异常
system_exception_10004=登录超过8小时,请重新登录
system_exception_10005=登录已过期
system_exception_10006=登录已过期,请重新登录
#没有访问权限
system_exception_10001=No access rights.
#没有通过权限认证
system_exception_10002=Failed to pass the authentication.
#登录身份异常
system_exception_10003=Login identity is abnormal.
#登录超过8小时,请重新登录
system_exception_10004=Login has exceeded 8 hours, please log in again.
#登录已过期,请重新登录
system_exception_10005=Login has expired, please log in again.
#******************业务相关、需要做国际化******************
#*********用于字段描述使用,不单独使用**********
business_field_31001=发货人计费账号
business_field_31002=运单ID
business_field_31003=运单号
business_field_31004=原产国编码
business_field_31005=原产国名称
business_field_31006=目的国编码
business_field_31007=目的国全称
business_field_31008=文件业务类型
#发货人计费账号
business_field_31001=shipper account
#运单ID
business_field_31002=tracking number ID
#运单号
business_field_31003=tracking number
#始发国编码
business_field_31004=origin country ID
#始发国名称
business_field_31005=origin country
#目的国编码
business_field_31006=destination country ID
#目的国全称
business_field_31007=destination country
#文件业务类型
business_field_31008=upload file type
#*********具体响应到前端**********
business_exception_30001=#{0}必填字段未填写
business_exception_30002=单次最多可查询1000个运单号码
business_exception_30003=#{0}不正确,请重新输入
business_exception_30004=The waybill you entered is generated by another user, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
business_exception_30005=The waybill you entered is generated by another account, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
business_exception_30006=附件上传不符合标准
business_exception_30007=所有上传文件数量不超过#{0}个文件
business_exception_30008=所有上传文件总大小不超过#{0}M
#{0}必填字段未填写
business_exception_30001=Required fields not filled in.
#单次最多可查询1000个运单号码
business_exception_30002=A maximum of 1,000 waybill numbers can be queried at a time.
#暂时没用,预留
business_exception_30003={0}不正确,请重新输入
business_exception_30004=The waybill you entered is generated by another user, whether continue uploading?
business_exception_30005=The waybill you entered is generated by another account, whether continue uploading?
#附件未上传
business_exception_30006=Attachment not uploaded.
#所有上传文件数量不超过{0}个文件
business_exception_30007=The total number of uploaded files should not exceed 100 files.
#所有上传文件总大小不超过{0}M
business_exception_30008=The total size of all uploaded files should not exceed {0}MB.
#暂时没用,预留
business_exception_30009=运单或发票未上传
#暂时没用,预留
business_exception_30010=文件类型不在:运单、发票、箱单、其他
business_exception_30011=该运单已被其他人创建,不可以重复创建
#该运单已被其他人创建,不可以重复创建
business_exception_30011=This waybill has been created by someone else and cannot be created again.
#暂时没用,预留
business_exception_30012=UUID不一致
business_exception_30013=文件名为:#{0},上传失败,请检查后重试
business_exception_30014=运单信息加载失败,请稍后重试
business_success_30015=提交成功
business_exception_30016=运单提交失败
\ No newline at end of file
#文件名为:{0},上传失败,请检查后重试
business_exception_30013=File name: {0}, upload failed, please check and try again
#运单信息加载失败,请稍后重试
business_exception_30014=Air waybill information loading failed, please try again later
#提交成功
business_success_30015=Submission successful
#提交失败,请稍后重试!
business_exception_30016=Submission failed, please try again later!
#运单号填写错误,请检查!
business_exception_30017=Air waybill number is incorrect, please check!
#运单提交失败,该运单正在被其他用户操作,请稍后重试
business_exception_30018=Air waybill submission failed, the waybill is being operated by other users, please try again later.
#Shipper Account填写错误(Shipper Account是由9位数字组成)
business_exception_30019=Incorrect Shipper Account(Shipper Account is composed of 9 digits).
#您当前登录账号的shipper Account与您正在录入的shipperAccount不一致,请确认是否继续?
business_exception_30020=The Shipper Account you are entering is inconsistent with your login Shipper Account. Please confirm whether to continue?
\ No newline at end of file
......
#******************系统操作日志记录,中文展示******************
business_log_20001=添加运单
business_log_20002=提交运单
business_log_20003=运单查询
business_log_20004=运单详细信息查询
business_log_20005=根据运单ID查询用户上传记录
business_log_20006=运单历史上传记录查询
business_log_20007=上传历史附件记录
system_exception_20003=提示信息过长,未保存成功
#******************鉴权相关提示,需要做国际化******************
#authentication包
system_exception_10001=没有访问权限
system_exception_10002=没有通过权限认证
system_exception_10003=登录身份异常
system_exception_10004=登录超过8小时,请重新登录
system_exception_10005=登录已过期
system_exception_10006=登录已过期,请重新登录
#******************业务相关、需要做国际化******************
#*********用于字段描述使用,不单独使用**********
business_field_31001=发货人计费账号
business_field_31002=运单ID
business_field_31003=运单号
business_field_31004=原产国编码
business_field_31005=原产国名称
business_field_31006=目的国编码
business_field_31007=目的国全称
business_field_31008=文件业务类型
#*********具体响应到前端**********
business_exception_30001=${0}必填字段未填写
business_exception_30002=单次最多可查询1000个运单号码
business_exception_30003=${0}不正确,请重新输入
business_exception_30004=The waybill you entered is generated by another user, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
business_exception_30005=The waybill you entered is generated by another account, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
business_exception_30006=附件上传不符合标准
business_exception_30007=所有上传文件数量不超过50个文件
business_exception_30008=所有上传文件总大小不超过50M
business_exception_30009=运单或发票未上传
business_exception_30010=文件类型不在:运单、发票、箱单、其他
business_exception_30011=该运单已被其他人创建,不可以重复创建
business_exception_30012=UUID不一致
business_exception_30013=文件名为:#{0},上传失败,请检查后重试
business_exception_30014=运单信息加载失败,请稍后重试
business_success_30015=提交成功
business_exception_30016=运单提交失败
\ No newline at end of file
##******************系统操作日志记录,中文展示******************
#business_log_20001=添加运单
#business_log_20002=提交运单
#business_log_20003=运单查询
#business_log_20004=运单详细信息查询
#business_log_20005=根据运单ID查询用户上传记录
#business_log_20006=运单历史上传记录查询
#business_log_20007=上传历史附件记录
#business_log_20008=下载附件
#system_exception_20003=提示信息过长,未保存成功
#
##******************鉴权相关提示,需要做国际化******************
##authentication包
#system_exception_10001=没有访问权限
#system_exception_10002=没有通过权限认证
#system_exception_10003=登录身份异常
#system_exception_10004=登录超过8小时,请重新登录
#system_exception_10005=登录已过期,请重新登录
#
##******************业务相关、需要做国际化******************
##*********用于字段描述使用,不单独使用**********
##business_field_31001=发货人计费账号
#business_field_31001=shipper account
##business_field_31002=运单ID
#business_field_31002=tracking number ID
##business_field_31003=运单号
#business_field_31003=tracking number
##business_field_31004=始发国编码
#business_field_31004=origin country ID
##business_field_31005=始发国名称
#business_field_31005=origin country
##business_field_31006=目的国编码
#business_field_31006=destination country ID
##business_field_31007=目的国全称
#business_field_31007=destination country
##business_field_31008=文件业务类型
#business_field_31008=upload file type
#
##*********具体响应到前端**********
#business_exception_30001={0}必填字段未填写
#business_exception_30002=单次最多可查询1000个运单号码
#business_exception_30003={0}不正确,请重新输入
#business_exception_30004=The waybill you entered is generated by another user, whether continue uploading?
#business_exception_30005=The waybill you entered is generated by another account, whether continue uploading?
#business_exception_30006=附件未上传
#business_exception_30007=所有上传文件数量不超过{0}个文件
#business_exception_30008=所有上传文件总大小不超过{0}M
#business_exception_30009=运单或发票未上传
#business_exception_30010=文件类型不在:运单、发票、箱单、其他
#business_exception_30011=该运单已被其他人创建,不可以重复创建
#business_exception_30012=UUID不一致
#business_exception_30013=文件名为:{0},上传失败,请检查后重试
#business_exception_30014=运单信息加载失败,请稍后重试
#business_success_30015=提交成功
#business_exception_30016=提交失败,请稍后重试!
#business_exception_30017=运单号填写错误,请检查!
#business_exception_30018=运单提交失败,该运单正在被其他用户操作,请稍后重试
#business_exception_30019=Shipper Account填写错误(Shipper Account是由9位数字组成)
#business_exception_30020=您当前登录账号的shipper Account与您正在录入的shipperAccount不一致,请确认是否继续?
\ No newline at end of file
......
......@@ -2,6 +2,7 @@ package com.fedex.connect.common.dao.log;
import com.fedex.connect.common.model.log.Operation;
import com.fedex.connect.common.model.log.OperationExample;
import com.fedex.connect.common.model.log.OperationWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Param;
......@@ -12,25 +13,25 @@ public interface OperationMapper {
int deleteByPrimaryKey(Long id);
int insert(Operation record);
int insert(OperationWithBLOBs record);
int insertSelective(Operation record);
int insertSelective(OperationWithBLOBs record);
List<Operation> selectByExampleWithBLOBs(OperationExample example);
List<OperationWithBLOBs> selectByExampleWithBLOBs(OperationExample example);
List<Operation> selectByExample(OperationExample example);
Operation selectByPrimaryKey(Long id);
OperationWithBLOBs selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") Operation record, @Param("example") OperationExample example);
int updateByExampleSelective(@Param("record") OperationWithBLOBs record, @Param("example") OperationExample example);
int updateByExampleWithBLOBs(@Param("record") Operation record, @Param("example") OperationExample example);
int updateByExampleWithBLOBs(@Param("record") OperationWithBLOBs record, @Param("example") OperationExample example);
int updateByExample(@Param("record") Operation record, @Param("example") OperationExample example);
int updateByPrimaryKeySelective(Operation record);
int updateByPrimaryKeySelective(OperationWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(Operation record);
int updateByPrimaryKeyWithBLOBs(OperationWithBLOBs record);
int updateByPrimaryKey(Operation record);
}
\ No newline at end of file
......
......@@ -118,7 +118,7 @@
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from ICLEARIMP.T_BIZ_CE_INFO
from iclconnect.T_BIZ_CE_INFO
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -130,15 +130,15 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ICLEARIMP.T_BIZ_CE_INFO
from iclconnect.T_BIZ_CE_INFO
where ID = #{id,jdbcType=NUMERIC}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ICLEARIMP.T_BIZ_CE_INFO
delete from iclconnect.T_BIZ_CE_INFO
where ID = #{id,jdbcType=NUMERIC}
</delete>
<delete id="deleteByExample" parameterType="com.fedex.connect.common.model.biz.CeInfoExample">
delete from ICLEARIMP.T_BIZ_CE_INFO
delete from iclconnect.T_BIZ_CE_INFO
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -147,7 +147,7 @@
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_BIZ_CE_INFO.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_BIZ_CE_INFO (ID, CONSIGNMENT_CODE, SEND_TIME,
insert into iclconnect.T_BIZ_CE_INFO (ID, CONSIGNMENT_CODE, SEND_TIME,
SHIP_DATE, DEST_IATA_CODE, CREATE_TIME,
CREATE_USER_ID, CREATE_USER_NAME, MODIFY_TIME,
MODIFY_USER_ID, MODIFY_USER_NAME, CUSTOMS_CURRENCY,
......@@ -180,7 +180,7 @@
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_BIZ_CE_INFO.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_BIZ_CE_INFO
insert into iclconnect.T_BIZ_CE_INFO
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="consignmentCode != null">
......@@ -417,13 +417,13 @@
</trim>
</insert>
<select id="countByExample" parameterType="com.fedex.connect.common.model.biz.CeInfoExample" resultType="java.lang.Long">
select count(*) from ICLEARIMP.T_BIZ_CE_INFO
select count(*) from iclconnect.T_BIZ_CE_INFO
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update ICLEARIMP.T_BIZ_CE_INFO
update iclconnect.T_BIZ_CE_INFO
<set>
<if test="record.id != null">
ID = #{record.id,jdbcType=NUMERIC},
......@@ -548,7 +548,7 @@
</if>
</update>
<update id="updateByExample" parameterType="map">
update ICLEARIMP.T_BIZ_CE_INFO
update iclconnect.T_BIZ_CE_INFO
set ID = #{record.id,jdbcType=NUMERIC},
CONSIGNMENT_CODE = #{record.consignmentCode,jdbcType=VARCHAR},
SEND_TIME = #{record.sendTime,jdbcType=TIMESTAMP},
......@@ -593,7 +593,7 @@
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.fedex.connect.common.model.biz.CeInfo">
update ICLEARIMP.T_BIZ_CE_INFO
update iclconnect.T_BIZ_CE_INFO
<set>
<if test="consignmentCode != null">
CONSIGNMENT_CODE = #{consignmentCode,jdbcType=VARCHAR},
......@@ -713,7 +713,7 @@
where ID = #{id,jdbcType=NUMERIC}
</update>
<update id="updateByPrimaryKey" parameterType="com.fedex.connect.common.model.biz.CeInfo">
update ICLEARIMP.T_BIZ_CE_INFO
update iclconnect.T_BIZ_CE_INFO
set CONSIGNMENT_CODE = #{consignmentCode,jdbcType=VARCHAR},
SEND_TIME = #{sendTime,jdbcType=TIMESTAMP},
SHIP_DATE = #{shipDate,jdbcType=TIMESTAMP},
......
......@@ -19,6 +19,7 @@
<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" />
<result column="UPLOAD_RECORD_ID" jdbcType="NUMERIC" property="uploadRecordId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -81,7 +82,7 @@
<sql id="Base_Column_List">
ID, CONSIGNMENT_CODE, CONSIGNMENT_ID, PUSH_TIME, STATUS_CODE, STATUS_NAME, PUSH_NUM,
FILE_PATH, FILE_BACK_PATH, FILE_NAME, REMARK, CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME,
MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME
MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME, UPLOAD_RECORD_ID
</sql>
<select id="selectByExample" parameterType="com.fedex.connect.common.model.biz.PushObExample" resultMap="BaseResultMap">
<include refid="OracleDialectPrefix" />
......@@ -125,13 +126,15 @@
PUSH_NUM, FILE_PATH, FILE_BACK_PATH,
FILE_NAME, REMARK, CREATE_TIME,
CREATE_USER_ID, CREATE_USER_NAME, MODIFY_TIME,
MODIFY_USER_ID, MODIFY_USER_NAME)
MODIFY_USER_ID, MODIFY_USER_NAME, UPLOAD_RECORD_ID
)
values (#{id,jdbcType=NUMERIC}, #{consignmentCode,jdbcType=VARCHAR}, #{consignmentId,jdbcType=NUMERIC},
#{pushTime,jdbcType=TIMESTAMP}, #{statusCode,jdbcType=VARCHAR}, #{statusName,jdbcType=VARCHAR},
#{pushNum,jdbcType=NUMERIC}, #{filePath,jdbcType=VARCHAR}, #{fileBackPath,jdbcType=VARCHAR},
#{fileName,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{createUserId,jdbcType=NUMERIC}, #{createUserName,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP},
#{modifyUserId,jdbcType=NUMERIC}, #{modifyUserName,jdbcType=VARCHAR})
#{modifyUserId,jdbcType=NUMERIC}, #{modifyUserName,jdbcType=VARCHAR}, #{uploadRecordId,jdbcType=NUMERIC}
)
</insert>
<insert id="insertSelective" parameterType="com.fedex.connect.common.model.biz.PushOb">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
......@@ -188,6 +191,9 @@
<if test="modifyUserName != null">
MODIFY_USER_NAME,
</if>
<if test="uploadRecordId != null">
UPLOAD_RECORD_ID,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=NUMERIC},
......@@ -239,6 +245,9 @@
<if test="modifyUserName != null">
#{modifyUserName,jdbcType=VARCHAR},
</if>
<if test="uploadRecordId != null">
#{uploadRecordId,jdbcType=NUMERIC},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.fedex.connect.common.model.biz.PushObExample" resultType="java.lang.Long">
......@@ -301,6 +310,9 @@
<if test="record.modifyUserName != null">
MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
</if>
<if test="record.uploadRecordId != null">
UPLOAD_RECORD_ID = #{record.uploadRecordId,jdbcType=NUMERIC},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -324,7 +336,8 @@
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}
MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
UPLOAD_RECORD_ID = #{record.uploadRecordId,jdbcType=NUMERIC}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -380,6 +393,9 @@
<if test="modifyUserName != null">
MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
</if>
<if test="uploadRecordId != null">
UPLOAD_RECORD_ID = #{uploadRecordId,jdbcType=NUMERIC},
</if>
</set>
where ID = #{id,jdbcType=NUMERIC}
</update>
......@@ -400,7 +416,8 @@
CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR},
MODIFY_TIME = #{modifyTime,jdbcType=TIMESTAMP},
MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC},
MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR}
MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
UPLOAD_RECORD_ID = #{uploadRecordId,jdbcType=NUMERIC}
where ID = #{id,jdbcType=NUMERIC}
</update>
<sql id="OracleDialectPrefix">
......
......@@ -13,6 +13,7 @@
<result column="MODIFY_USER_ID" jdbcType="NUMERIC" property="modifyUserId" />
<result column="MODIFY_USER_NAME" jdbcType="VARCHAR" property="modifyUserName" />
<result column="CONSIGNMENT_CODE" jdbcType="VARCHAR" property="consignmentCode" />
<result column="CE_FLAG" jdbcType="NUMERIC" property="ceFlag" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -74,7 +75,7 @@
</sql>
<sql id="Base_Column_List">
ID, USER_ID, CONSIGNMENT_ID, STATUS, CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME,
MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME, CONSIGNMENT_CODE
MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME, CONSIGNMENT_CODE, CE_FLAG
</sql>
<select id="selectByExample" parameterType="com.fedex.connect.common.model.biz.UserConsignmentMappingExample" resultMap="BaseResultMap">
<include refid="OracleDialectPrefix" />
......@@ -84,7 +85,7 @@
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from ICLEARIMP.T_BIZ_USER_CONSIGNMENT_MAPPING
from iclconnect.T_BIZ_USER_CONSIGNMENT_MAPPING
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -96,15 +97,15 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ICLEARIMP.T_BIZ_USER_CONSIGNMENT_MAPPING
from iclconnect.T_BIZ_USER_CONSIGNMENT_MAPPING
where ID = #{id,jdbcType=NUMERIC}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ICLEARIMP.T_BIZ_USER_CONSIGNMENT_MAPPING
delete from iclconnect.T_BIZ_USER_CONSIGNMENT_MAPPING
where ID = #{id,jdbcType=NUMERIC}
</delete>
<delete id="deleteByExample" parameterType="com.fedex.connect.common.model.biz.UserConsignmentMappingExample">
delete from ICLEARIMP.T_BIZ_USER_CONSIGNMENT_MAPPING
delete from iclconnect.T_BIZ_USER_CONSIGNMENT_MAPPING
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -113,20 +114,20 @@
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_BIZ_USER_CONSIGNMENT_MAPPING.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_BIZ_USER_CONSIGNMENT_MAPPING (ID, USER_ID, CONSIGNMENT_ID,
insert into iclconnect.T_BIZ_USER_CONSIGNMENT_MAPPING (ID, USER_ID, CONSIGNMENT_ID,
STATUS, CREATE_TIME, CREATE_USER_ID,
CREATE_USER_NAME, MODIFY_TIME, MODIFY_USER_ID,
MODIFY_USER_NAME, CONSIGNMENT_CODE)
MODIFY_USER_NAME, CONSIGNMENT_CODE, CE_FLAG)
values (#{id,jdbcType=NUMERIC}, #{userId,jdbcType=NUMERIC}, #{consignmentId,jdbcType=NUMERIC},
#{status,jdbcType=NUMERIC}, #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=NUMERIC},
#{createUserName,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, #{modifyUserId,jdbcType=NUMERIC},
#{modifyUserName,jdbcType=VARCHAR}, #{consignmentCode,jdbcType=VARCHAR})
#{modifyUserName,jdbcType=VARCHAR}, #{consignmentCode,jdbcType=VARCHAR}, #{ceFlag,jdbcType=NUMERIC})
</insert>
<insert id="insertSelective" parameterType="com.fedex.connect.common.model.biz.UserConsignmentMapping">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_BIZ_USER_CONSIGNMENT_MAPPING.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_BIZ_USER_CONSIGNMENT_MAPPING
insert into iclconnect.T_BIZ_USER_CONSIGNMENT_MAPPING
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="userId != null">
......@@ -159,6 +160,9 @@
<if test="consignmentCode != null">
CONSIGNMENT_CODE,
</if>
<if test="ceFlag != null">
CE_FLAG,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=NUMERIC},
......@@ -192,16 +196,19 @@
<if test="consignmentCode != null">
#{consignmentCode,jdbcType=VARCHAR},
</if>
<if test="ceFlag != null">
#{ceFlag,jdbcType=NUMERIC},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.fedex.connect.common.model.biz.UserConsignmentMappingExample" resultType="java.lang.Long">
select count(*) from ICLEARIMP.T_BIZ_USER_CONSIGNMENT_MAPPING
select count(*) from iclconnect.T_BIZ_USER_CONSIGNMENT_MAPPING
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update ICLEARIMP.T_BIZ_USER_CONSIGNMENT_MAPPING
update iclconnect.T_BIZ_USER_CONSIGNMENT_MAPPING
<set>
<if test="record.id != null">
ID = #{record.id,jdbcType=NUMERIC},
......@@ -236,13 +243,16 @@
<if test="record.consignmentCode != null">
CONSIGNMENT_CODE = #{record.consignmentCode,jdbcType=VARCHAR},
</if>
<if test="record.ceFlag != null">
CE_FLAG = #{record.ceFlag,jdbcType=NUMERIC},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update ICLEARIMP.T_BIZ_USER_CONSIGNMENT_MAPPING
update iclconnect.T_BIZ_USER_CONSIGNMENT_MAPPING
set ID = #{record.id,jdbcType=NUMERIC},
USER_ID = #{record.userId,jdbcType=NUMERIC},
CONSIGNMENT_ID = #{record.consignmentId,jdbcType=NUMERIC},
......@@ -254,12 +264,13 @@
MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC},
MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
CONSIGNMENT_CODE = #{record.consignmentCode,jdbcType=VARCHAR}
CE_FLAG = #{record.ceFlag,jdbcType=NUMERIC}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.fedex.connect.common.model.biz.UserConsignmentMapping">
update ICLEARIMP.T_BIZ_USER_CONSIGNMENT_MAPPING
update iclconnect.T_BIZ_USER_CONSIGNMENT_MAPPING
<set>
<if test="userId != null">
USER_ID = #{userId,jdbcType=NUMERIC},
......@@ -291,11 +302,14 @@
<if test="consignmentCode != null">
CONSIGNMENT_CODE = #{consignmentCode,jdbcType=VARCHAR},
</if>
<if test="ceFlag != null">
CE_FLAG = #{ceFlag,jdbcType=NUMERIC},
</if>
</set>
where ID = #{id,jdbcType=NUMERIC}
</update>
<update id="updateByPrimaryKey" parameterType="com.fedex.connect.common.model.biz.UserConsignmentMapping">
update ICLEARIMP.T_BIZ_USER_CONSIGNMENT_MAPPING
update iclconnect.T_BIZ_USER_CONSIGNMENT_MAPPING
set USER_ID = #{userId,jdbcType=NUMERIC},
CONSIGNMENT_ID = #{consignmentId,jdbcType=NUMERIC},
STATUS = #{status,jdbcType=NUMERIC},
......@@ -306,6 +320,7 @@
MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC},
MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
CONSIGNMENT_CODE = #{consignmentCode,jdbcType=VARCHAR}
CE_FLAG = #{ceFlag,jdbcType=NUMERIC}
where ID = #{id,jdbcType=NUMERIC}
</update>
<sql id="OracleDialectPrefix">
......
......@@ -9,9 +9,6 @@
<result column="MODULE" jdbcType="VARCHAR" property="module" />
<result column="DESCRIBE" jdbcType="VARCHAR" property="describe" />
<result column="URL" jdbcType="VARCHAR" property="url" />
<result column="REQUEST_PARAMETERS" jdbcType="VARCHAR" property="requestParameters" />
<result column="RESULT" jdbcType="VARCHAR" property="result" />
<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" />
......@@ -21,9 +18,12 @@
<result column="REQUEST_TIME" jdbcType="TIMESTAMP" property="requestTime" />
<result column="RESPONSE_TIME" jdbcType="TIMESTAMP" property="responseTime" />
<result column="EXCEUTE_CONSUME" jdbcType="NUMERIC" property="exceuteConsume" />
<result column="STATUS" jdbcType="NUMERIC" property="status" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.fedex.connect.common.model.log.Operation">
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.fedex.connect.common.model.log.OperationWithBLOBs">
<result column="REMARK" jdbcType="CLOB" property="remark" />
<result column="REQUEST_PARAMETERS" jdbcType="CLOB" property="requestParameters" />
<result column="RESULT" jdbcType="CLOB" property="result" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -84,12 +84,12 @@
</where>
</sql>
<sql id="Base_Column_List">
ID, USER_ID, LOGIN_NAME, USER_NAME, MODULE, DESCRIBE, URL, REQUEST_PARAMETERS, RESULT,
STATUS, CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME, MODIFY_TIME, MODIFY_USER_ID,
MODIFY_USER_NAME, REQUEST_TIME, RESPONSE_TIME, EXCEUTE_CONSUME
ID, USER_ID, LOGIN_NAME, USER_NAME, MODULE, DESCRIBE, URL, CREATE_TIME, CREATE_USER_ID,
CREATE_USER_NAME, MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME, REQUEST_TIME, RESPONSE_TIME,
EXCEUTE_CONSUME, STATUS
</sql>
<sql id="Blob_Column_List">
REMARK
REMARK, REQUEST_PARAMETERS, RESULT
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.fedex.connect.common.model.log.OperationExample" resultMap="ResultMapWithBLOBs">
select
......@@ -100,7 +100,7 @@
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from ICLEARIMP.T_LOG_OPERATION
from iclconnect.T_LOG_OPERATION
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -116,7 +116,7 @@
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from ICLEARIMP.T_LOG_OPERATION
from iclconnect.T_LOG_OPERATION
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -130,43 +130,43 @@
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from ICLEARIMP.T_LOG_OPERATION
from iclconnect.T_LOG_OPERATION
where ID = #{id,jdbcType=NUMERIC}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ICLEARIMP.T_LOG_OPERATION
delete from iclconnect.T_LOG_OPERATION
where ID = #{id,jdbcType=NUMERIC}
</delete>
<delete id="deleteByExample" parameterType="com.fedex.connect.common.model.log.OperationExample">
delete from ICLEARIMP.T_LOG_OPERATION
delete from iclconnect.T_LOG_OPERATION
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.fedex.connect.common.model.log.Operation">
<insert id="insert" parameterType="com.fedex.connect.common.model.log.OperationWithBLOBs">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_LOG_OPERATION.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_LOG_OPERATION (ID, USER_ID, LOGIN_NAME,
insert into iclconnect.T_LOG_OPERATION (ID, USER_ID, LOGIN_NAME,
USER_NAME, MODULE, DESCRIBE,
URL, REQUEST_PARAMETERS, RESULT,
STATUS, CREATE_TIME, CREATE_USER_ID,
URL, CREATE_TIME, CREATE_USER_ID,
CREATE_USER_NAME, MODIFY_TIME, MODIFY_USER_ID,
MODIFY_USER_NAME, REQUEST_TIME, RESPONSE_TIME,
EXCEUTE_CONSUME, REMARK)
EXCEUTE_CONSUME, STATUS, REMARK,
REQUEST_PARAMETERS, RESULT)
values (#{id,jdbcType=NUMERIC}, #{userId,jdbcType=NUMERIC}, #{loginName,jdbcType=VARCHAR},
#{userName,jdbcType=VARCHAR}, #{module,jdbcType=VARCHAR}, #{describe,jdbcType=VARCHAR},
#{url,jdbcType=VARCHAR}, #{requestParameters,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR},
#{status,jdbcType=NUMERIC}, #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=NUMERIC},
#{url,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=NUMERIC},
#{createUserName,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, #{modifyUserId,jdbcType=NUMERIC},
#{modifyUserName,jdbcType=VARCHAR}, #{requestTime,jdbcType=TIMESTAMP}, #{responseTime,jdbcType=TIMESTAMP},
#{exceuteConsume,jdbcType=NUMERIC}, #{remark,jdbcType=CLOB})
#{exceuteConsume,jdbcType=NUMERIC}, #{status,jdbcType=NUMERIC}, #{remark,jdbcType=CLOB},
#{requestParameters,jdbcType=CLOB}, #{result,jdbcType=CLOB})
</insert>
<insert id="insertSelective" parameterType="com.fedex.connect.common.model.log.Operation">
<insert id="insertSelective" parameterType="com.fedex.connect.common.model.log.OperationWithBLOBs">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_LOG_OPERATION.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_LOG_OPERATION
insert into iclconnect.T_LOG_OPERATION
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="userId != null">
......@@ -187,15 +187,6 @@
<if test="url != null">
URL,
</if>
<if test="requestParameters != null">
REQUEST_PARAMETERS,
</if>
<if test="result != null">
RESULT,
</if>
<if test="status != null">
STATUS,
</if>
<if test="createTime != null">
CREATE_TIME,
</if>
......@@ -223,9 +214,18 @@
<if test="exceuteConsume != null">
EXCEUTE_CONSUME,
</if>
<if test="status != null">
STATUS,
</if>
<if test="remark != null">
REMARK,
</if>
<if test="requestParameters != null">
REQUEST_PARAMETERS,
</if>
<if test="result != null">
RESULT,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=NUMERIC},
......@@ -247,15 +247,6 @@
<if test="url != null">
#{url,jdbcType=VARCHAR},
</if>
<if test="requestParameters != null">
#{requestParameters,jdbcType=VARCHAR},
</if>
<if test="result != null">
#{result,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=NUMERIC},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
......@@ -283,19 +274,28 @@
<if test="exceuteConsume != null">
#{exceuteConsume,jdbcType=NUMERIC},
</if>
<if test="status != null">
#{status,jdbcType=NUMERIC},
</if>
<if test="remark != null">
#{remark,jdbcType=CLOB},
</if>
<if test="requestParameters != null">
#{requestParameters,jdbcType=CLOB},
</if>
<if test="result != null">
#{result,jdbcType=CLOB},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.fedex.connect.common.model.log.OperationExample" resultType="java.lang.Long">
select count(*) from ICLEARIMP.T_LOG_OPERATION
select count(*) from iclconnect.T_LOG_OPERATION
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update ICLEARIMP.T_LOG_OPERATION
update iclconnect.T_LOG_OPERATION
<set>
<if test="record.id != null">
ID = #{record.id,jdbcType=NUMERIC},
......@@ -318,15 +318,6 @@
<if test="record.url != null">
URL = #{record.url,jdbcType=VARCHAR},
</if>
<if test="record.requestParameters != null">
REQUEST_PARAMETERS = #{record.requestParameters,jdbcType=VARCHAR},
</if>
<if test="record.result != null">
RESULT = #{record.result,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>
......@@ -354,16 +345,25 @@
<if test="record.exceuteConsume != null">
EXCEUTE_CONSUME = #{record.exceuteConsume,jdbcType=NUMERIC},
</if>
<if test="record.status != null">
STATUS = #{record.status,jdbcType=NUMERIC},
</if>
<if test="record.remark != null">
REMARK = #{record.remark,jdbcType=CLOB},
</if>
<if test="record.requestParameters != null">
REQUEST_PARAMETERS = #{record.requestParameters,jdbcType=CLOB},
</if>
<if test="record.result != null">
RESULT = #{record.result,jdbcType=CLOB},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update ICLEARIMP.T_LOG_OPERATION
update iclconnect.T_LOG_OPERATION
set ID = #{record.id,jdbcType=NUMERIC},
USER_ID = #{record.userId,jdbcType=NUMERIC},
LOGIN_NAME = #{record.loginName,jdbcType=VARCHAR},
......@@ -371,9 +371,6 @@
MODULE = #{record.module,jdbcType=VARCHAR},
DESCRIBE = #{record.describe,jdbcType=VARCHAR},
URL = #{record.url,jdbcType=VARCHAR},
REQUEST_PARAMETERS = #{record.requestParameters,jdbcType=VARCHAR},
RESULT = #{record.result,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},
......@@ -383,13 +380,16 @@
REQUEST_TIME = #{record.requestTime,jdbcType=TIMESTAMP},
RESPONSE_TIME = #{record.responseTime,jdbcType=TIMESTAMP},
EXCEUTE_CONSUME = #{record.exceuteConsume,jdbcType=NUMERIC},
REMARK = #{record.remark,jdbcType=CLOB}
STATUS = #{record.status,jdbcType=NUMERIC},
REMARK = #{record.remark,jdbcType=CLOB},
REQUEST_PARAMETERS = #{record.requestParameters,jdbcType=CLOB},
RESULT = #{record.result,jdbcType=CLOB}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update ICLEARIMP.T_LOG_OPERATION
update iclconnect.T_LOG_OPERATION
set ID = #{record.id,jdbcType=NUMERIC},
USER_ID = #{record.userId,jdbcType=NUMERIC},
LOGIN_NAME = #{record.loginName,jdbcType=VARCHAR},
......@@ -397,9 +397,6 @@
MODULE = #{record.module,jdbcType=VARCHAR},
DESCRIBE = #{record.describe,jdbcType=VARCHAR},
URL = #{record.url,jdbcType=VARCHAR},
REQUEST_PARAMETERS = #{record.requestParameters,jdbcType=VARCHAR},
RESULT = #{record.result,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},
......@@ -408,13 +405,14 @@
MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
REQUEST_TIME = #{record.requestTime,jdbcType=TIMESTAMP},
RESPONSE_TIME = #{record.responseTime,jdbcType=TIMESTAMP},
EXCEUTE_CONSUME = #{record.exceuteConsume,jdbcType=NUMERIC}
EXCEUTE_CONSUME = #{record.exceuteConsume,jdbcType=NUMERIC},
STATUS = #{record.status,jdbcType=NUMERIC}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.fedex.connect.common.model.log.Operation">
update ICLEARIMP.T_LOG_OPERATION
<update id="updateByPrimaryKeySelective" parameterType="com.fedex.connect.common.model.log.OperationWithBLOBs">
update iclconnect.T_LOG_OPERATION
<set>
<if test="userId != null">
USER_ID = #{userId,jdbcType=NUMERIC},
......@@ -434,15 +432,6 @@
<if test="url != null">
URL = #{url,jdbcType=VARCHAR},
</if>
<if test="requestParameters != null">
REQUEST_PARAMETERS = #{requestParameters,jdbcType=VARCHAR},
</if>
<if test="result != null">
RESULT = #{result,jdbcType=VARCHAR},
</if>
<if test="status != null">
STATUS = #{status,jdbcType=NUMERIC},
</if>
<if test="createTime != null">
CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
</if>
......@@ -470,23 +459,29 @@
<if test="exceuteConsume != null">
EXCEUTE_CONSUME = #{exceuteConsume,jdbcType=NUMERIC},
</if>
<if test="status != null">
STATUS = #{status,jdbcType=NUMERIC},
</if>
<if test="remark != null">
REMARK = #{remark,jdbcType=CLOB},
</if>
<if test="requestParameters != null">
REQUEST_PARAMETERS = #{requestParameters,jdbcType=CLOB},
</if>
<if test="result != null">
RESULT = #{result,jdbcType=CLOB},
</if>
</set>
where ID = #{id,jdbcType=NUMERIC}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.fedex.connect.common.model.log.Operation">
update ICLEARIMP.T_LOG_OPERATION
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.fedex.connect.common.model.log.OperationWithBLOBs">
update iclconnect.T_LOG_OPERATION
set USER_ID = #{userId,jdbcType=NUMERIC},
LOGIN_NAME = #{loginName,jdbcType=VARCHAR},
USER_NAME = #{userName,jdbcType=VARCHAR},
MODULE = #{module,jdbcType=VARCHAR},
DESCRIBE = #{describe,jdbcType=VARCHAR},
URL = #{url,jdbcType=VARCHAR},
REQUEST_PARAMETERS = #{requestParameters,jdbcType=VARCHAR},
RESULT = #{result,jdbcType=VARCHAR},
STATUS = #{status,jdbcType=NUMERIC},
CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
CREATE_USER_ID = #{createUserId,jdbcType=NUMERIC},
CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR},
......@@ -496,20 +491,20 @@
REQUEST_TIME = #{requestTime,jdbcType=TIMESTAMP},
RESPONSE_TIME = #{responseTime,jdbcType=TIMESTAMP},
EXCEUTE_CONSUME = #{exceuteConsume,jdbcType=NUMERIC},
REMARK = #{remark,jdbcType=CLOB}
STATUS = #{status,jdbcType=NUMERIC},
REMARK = #{remark,jdbcType=CLOB},
REQUEST_PARAMETERS = #{requestParameters,jdbcType=CLOB},
RESULT = #{result,jdbcType=CLOB}
where ID = #{id,jdbcType=NUMERIC}
</update>
<update id="updateByPrimaryKey" parameterType="com.fedex.connect.common.model.log.Operation">
update ICLEARIMP.T_LOG_OPERATION
update iclconnect.T_LOG_OPERATION
set USER_ID = #{userId,jdbcType=NUMERIC},
LOGIN_NAME = #{loginName,jdbcType=VARCHAR},
USER_NAME = #{userName,jdbcType=VARCHAR},
MODULE = #{module,jdbcType=VARCHAR},
DESCRIBE = #{describe,jdbcType=VARCHAR},
URL = #{url,jdbcType=VARCHAR},
REQUEST_PARAMETERS = #{requestParameters,jdbcType=VARCHAR},
RESULT = #{result,jdbcType=VARCHAR},
STATUS = #{status,jdbcType=NUMERIC},
CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
CREATE_USER_ID = #{createUserId,jdbcType=NUMERIC},
CREATE_USER_NAME = #{createUserName,jdbcType=VARCHAR},
......@@ -518,7 +513,8 @@
MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
REQUEST_TIME = #{requestTime,jdbcType=TIMESTAMP},
RESPONSE_TIME = #{responseTime,jdbcType=TIMESTAMP},
EXCEUTE_CONSUME = #{exceuteConsume,jdbcType=NUMERIC}
EXCEUTE_CONSUME = #{exceuteConsume,jdbcType=NUMERIC},
STATUS = #{status,jdbcType=NUMERIC}
where ID = #{id,jdbcType=NUMERIC}
</update>
<sql id="OracleDialectPrefix">
......
......@@ -98,7 +98,7 @@
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY
from iclconnect.T_SYS_KAFKA_STORAGE_HISTORY
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -114,7 +114,7 @@
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY
from iclconnect.T_SYS_KAFKA_STORAGE_HISTORY
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -128,15 +128,15 @@
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY
from iclconnect.T_SYS_KAFKA_STORAGE_HISTORY
where ID = #{id,jdbcType=NUMERIC}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY
delete from iclconnect.T_SYS_KAFKA_STORAGE_HISTORY
where ID = #{id,jdbcType=NUMERIC}
</delete>
<delete id="deleteByExample" parameterType="com.fedex.connect.common.model.sys.KafkaStorageHistoryExample">
delete from ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY
delete from iclconnect.T_SYS_KAFKA_STORAGE_HISTORY
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -145,7 +145,7 @@
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_SYS_KAFKA_STORAGE_HISTORY.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY (ID, MESSAGE_ID, MESSAGE_CODE,
insert into iclconnect.T_SYS_KAFKA_STORAGE_HISTORY (ID, MESSAGE_ID, MESSAGE_CODE,
SENDER_ID, RECEIVER_ID, SEND_TIME,
CONSIGNMENT_CODE, FREQUENCY, STATUS,
STATUS_NAME, REMARK, CREATE_TIME,
......@@ -164,7 +164,7 @@
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_SYS_KAFKA_STORAGE_HISTORY.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY
insert into iclconnect.T_SYS_KAFKA_STORAGE_HISTORY
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="messageId != null">
......@@ -275,13 +275,13 @@
</trim>
</insert>
<select id="countByExample" parameterType="com.fedex.connect.common.model.sys.KafkaStorageHistoryExample" resultType="java.lang.Long">
select count(*) from ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY
select count(*) from iclconnect.T_SYS_KAFKA_STORAGE_HISTORY
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY
update iclconnect.T_SYS_KAFKA_STORAGE_HISTORY
<set>
<if test="record.id != null">
ID = #{record.id,jdbcType=NUMERIC},
......@@ -343,7 +343,7 @@
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY
update iclconnect.T_SYS_KAFKA_STORAGE_HISTORY
set ID = #{record.id,jdbcType=NUMERIC},
MESSAGE_ID = #{record.messageId,jdbcType=VARCHAR},
MESSAGE_CODE = #{record.messageCode,jdbcType=VARCHAR},
......@@ -367,7 +367,7 @@
</if>
</update>
<update id="updateByExample" parameterType="map">
update ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY
update iclconnect.T_SYS_KAFKA_STORAGE_HISTORY
set ID = #{record.id,jdbcType=NUMERIC},
MESSAGE_ID = #{record.messageId,jdbcType=VARCHAR},
MESSAGE_CODE = #{record.messageCode,jdbcType=VARCHAR},
......@@ -390,7 +390,7 @@
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.fedex.connect.common.model.sys.KafkaStorageHistory">
update ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY
update iclconnect.T_SYS_KAFKA_STORAGE_HISTORY
<set>
<if test="messageId != null">
MESSAGE_ID = #{messageId,jdbcType=VARCHAR},
......@@ -447,7 +447,7 @@
where ID = #{id,jdbcType=NUMERIC}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.fedex.connect.common.model.sys.KafkaStorageHistory">
update ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY
update iclconnect.T_SYS_KAFKA_STORAGE_HISTORY
set MESSAGE_ID = #{messageId,jdbcType=VARCHAR},
MESSAGE_CODE = #{messageCode,jdbcType=VARCHAR},
SENDER_ID = #{senderId,jdbcType=VARCHAR},
......@@ -468,7 +468,7 @@
where ID = #{id,jdbcType=NUMERIC}
</update>
<update id="updateByPrimaryKey" parameterType="com.fedex.connect.common.model.sys.KafkaStorageHistory">
update ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY
update iclconnect.T_SYS_KAFKA_STORAGE_HISTORY
set MESSAGE_ID = #{messageId,jdbcType=VARCHAR},
MESSAGE_CODE = #{messageCode,jdbcType=VARCHAR},
SENDER_ID = #{senderId,jdbcType=VARCHAR},
......
......@@ -98,7 +98,7 @@
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE
from iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -114,7 +114,7 @@
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE
from iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -128,15 +128,15 @@
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE
from iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE
where ID = #{id,jdbcType=NUMERIC}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE
delete from iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE
where ID = #{id,jdbcType=NUMERIC}
</delete>
<delete id="deleteByExample" parameterType="com.fedex.connect.common.model.sys.KafkaTemporaryStorageExample">
delete from ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE
delete from iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -145,7 +145,7 @@
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_SYS_KAFKA_TEMPORARY_STORAGE.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE (ID, MESSAGE_ID, MESSAGE_CODE,
insert into iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE (ID, MESSAGE_ID, MESSAGE_CODE,
SENDER_ID, RECEIVER_ID, SEND_TIME,
CONSIGNMENT_CODE, FREQUENCY, STATUS,
STATUS_NAME, REMARK, CREATE_TIME,
......@@ -164,7 +164,7 @@
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_SYS_KAFKA_TEMPORARY_STORAGE.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE
insert into iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="messageId != null">
......@@ -275,13 +275,13 @@
</trim>
</insert>
<select id="countByExample" parameterType="com.fedex.connect.common.model.sys.KafkaTemporaryStorageExample" resultType="java.lang.Long">
select count(*) from ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE
select count(*) from iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE
update iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE
<set>
<if test="record.id != null">
ID = #{record.id,jdbcType=NUMERIC},
......@@ -343,7 +343,7 @@
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE
update iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE
set ID = #{record.id,jdbcType=NUMERIC},
MESSAGE_ID = #{record.messageId,jdbcType=VARCHAR},
MESSAGE_CODE = #{record.messageCode,jdbcType=VARCHAR},
......@@ -367,7 +367,7 @@
</if>
</update>
<update id="updateByExample" parameterType="map">
update ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE
update iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE
set ID = #{record.id,jdbcType=NUMERIC},
MESSAGE_ID = #{record.messageId,jdbcType=VARCHAR},
MESSAGE_CODE = #{record.messageCode,jdbcType=VARCHAR},
......@@ -390,7 +390,7 @@
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.fedex.connect.common.model.sys.KafkaTemporaryStorage">
update ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE
update iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE
<set>
<if test="messageId != null">
MESSAGE_ID = #{messageId,jdbcType=VARCHAR},
......@@ -447,7 +447,7 @@
where ID = #{id,jdbcType=NUMERIC}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.fedex.connect.common.model.sys.KafkaTemporaryStorage">
update ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE
update iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE
set MESSAGE_ID = #{messageId,jdbcType=VARCHAR},
MESSAGE_CODE = #{messageCode,jdbcType=VARCHAR},
SENDER_ID = #{senderId,jdbcType=VARCHAR},
......@@ -468,7 +468,7 @@
where ID = #{id,jdbcType=NUMERIC}
</update>
<update id="updateByPrimaryKey" parameterType="com.fedex.connect.common.model.sys.KafkaTemporaryStorage">
update ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE
update iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE
set MESSAGE_ID = #{messageId,jdbcType=VARCHAR},
MESSAGE_CODE = #{messageCode,jdbcType=VARCHAR},
SENDER_ID = #{senderId,jdbcType=VARCHAR},
......
......@@ -90,7 +90,7 @@
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from ICLEARIMP.T_SYS_PARAM_CONFIG
from iclconnect.T_SYS_PARAM_CONFIG
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -102,15 +102,15 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ICLEARIMP.T_SYS_PARAM_CONFIG
from iclconnect.T_SYS_PARAM_CONFIG
where ID = #{id,jdbcType=NUMERIC}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ICLEARIMP.T_SYS_PARAM_CONFIG
delete from iclconnect.T_SYS_PARAM_CONFIG
where ID = #{id,jdbcType=NUMERIC}
</delete>
<delete id="deleteByExample" parameterType="com.fedex.connect.common.model.sys.ParamConfigExample">
delete from ICLEARIMP.T_SYS_PARAM_CONFIG
delete from iclconnect.T_SYS_PARAM_CONFIG
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -119,7 +119,7 @@
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_SYS_PARAM_CONFIG.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_SYS_PARAM_CONFIG (ID, CODE, NAME,
insert into iclconnect.T_SYS_PARAM_CONFIG (ID, CODE, NAME,
VALUE, TYPE_CODE, TYPE_NAME,
STATUS, DESCRIPTION, CREATE_TIME,
CREATE_USER_ID, CREATE_USER_NAME, MODIFY_TIME,
......@@ -136,7 +136,7 @@
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_SYS_PARAM_CONFIG.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_SYS_PARAM_CONFIG
insert into iclconnect.T_SYS_PARAM_CONFIG
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="code != null">
......@@ -241,13 +241,13 @@
</trim>
</insert>
<select id="countByExample" parameterType="com.fedex.connect.common.model.sys.ParamConfigExample" resultType="java.lang.Long">
select count(*) from ICLEARIMP.T_SYS_PARAM_CONFIG
select count(*) from iclconnect.T_SYS_PARAM_CONFIG
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update ICLEARIMP.T_SYS_PARAM_CONFIG
update iclconnect.T_SYS_PARAM_CONFIG
<set>
<if test="record.id != null">
ID = #{record.id,jdbcType=NUMERIC},
......@@ -306,7 +306,7 @@
</if>
</update>
<update id="updateByExample" parameterType="map">
update ICLEARIMP.T_SYS_PARAM_CONFIG
update iclconnect.T_SYS_PARAM_CONFIG
set ID = #{record.id,jdbcType=NUMERIC},
CODE = #{record.code,jdbcType=VARCHAR},
NAME = #{record.name,jdbcType=VARCHAR},
......@@ -329,7 +329,7 @@
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.fedex.connect.common.model.sys.ParamConfig">
update ICLEARIMP.T_SYS_PARAM_CONFIG
update iclconnect.T_SYS_PARAM_CONFIG
<set>
<if test="code != null">
CODE = #{code,jdbcType=VARCHAR},
......@@ -383,7 +383,7 @@
where ID = #{id,jdbcType=NUMERIC}
</update>
<update id="updateByPrimaryKey" parameterType="com.fedex.connect.common.model.sys.ParamConfig">
update ICLEARIMP.T_SYS_PARAM_CONFIG
update iclconnect.T_SYS_PARAM_CONFIG
set CODE = #{code,jdbcType=VARCHAR},
NAME = #{name,jdbcType=VARCHAR},
VALUE = #{value,jdbcType=VARCHAR},
......
......@@ -99,7 +99,7 @@
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from ICLEARIMP.T_SYS_USER
from iclconnect.T_SYS_USER
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -111,15 +111,15 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ICLEARIMP.T_SYS_USER
from iclconnect.T_SYS_USER
where ID = #{id,jdbcType=NUMERIC}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ICLEARIMP.T_SYS_USER
delete from iclconnect.T_SYS_USER
where ID = #{id,jdbcType=NUMERIC}
</delete>
<delete id="deleteByExample" parameterType="com.fedex.connect.common.model.sys.UserExample">
delete from ICLEARIMP.T_SYS_USER
delete from iclconnect.T_SYS_USER
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -128,7 +128,7 @@
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_SYS_USER.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_SYS_USER (ID, LOGIN_NAME, USER_NAME,
insert into iclconnect.T_SYS_USER (ID, LOGIN_NAME, USER_NAME,
PASSWORD, USER_UUID, EMAIL,
PHONE, COMPANY_NAME, ACCOUNT_NO,
UNIFIED_BUSINESS_NUM, CUSTOMS_SERIAL_NUM, TYPE_CODE,
......@@ -151,7 +151,7 @@
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_SYS_USER.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_SYS_USER
insert into iclconnect.T_SYS_USER
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="loginName != null">
......@@ -298,13 +298,13 @@
</trim>
</insert>
<select id="countByExample" parameterType="com.fedex.connect.common.model.sys.UserExample" resultType="java.lang.Long">
select count(*) from ICLEARIMP.T_SYS_USER
select count(*) from iclconnect.T_SYS_USER
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update ICLEARIMP.T_SYS_USER
update iclconnect.T_SYS_USER
<set>
<if test="record.id != null">
ID = #{record.id,jdbcType=NUMERIC},
......@@ -384,7 +384,7 @@
</if>
</update>
<update id="updateByExample" parameterType="map">
update ICLEARIMP.T_SYS_USER
update iclconnect.T_SYS_USER
set ID = #{record.id,jdbcType=NUMERIC},
LOGIN_NAME = #{record.loginName,jdbcType=VARCHAR},
USER_NAME = #{record.userName,jdbcType=VARCHAR},
......@@ -414,7 +414,7 @@
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.fedex.connect.common.model.sys.User">
update ICLEARIMP.T_SYS_USER
update iclconnect.T_SYS_USER
<set>
<if test="loginName != null">
LOGIN_NAME = #{loginName,jdbcType=VARCHAR},
......@@ -489,7 +489,7 @@
where ID = #{id,jdbcType=NUMERIC}
</update>
<update id="updateByPrimaryKey" parameterType="com.fedex.connect.common.model.sys.User">
update ICLEARIMP.T_SYS_USER
update iclconnect.T_SYS_USER
set LOGIN_NAME = #{loginName,jdbcType=VARCHAR},
USER_NAME = #{userName,jdbcType=VARCHAR},
PASSWORD = #{password,jdbcType=VARCHAR},
......
......@@ -83,7 +83,7 @@
</if>
'true' as QUERYID,
<include refid="Base_Column_List" />
from ICLEARIMP.T_SYS_USER_ROLE
from iclconnect.T_SYS_USER_ROLE
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -95,15 +95,15 @@
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ICLEARIMP.T_SYS_USER_ROLE
from iclconnect.T_SYS_USER_ROLE
where ID = #{id,jdbcType=NUMERIC}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ICLEARIMP.T_SYS_USER_ROLE
delete from iclconnect.T_SYS_USER_ROLE
where ID = #{id,jdbcType=NUMERIC}
</delete>
<delete id="deleteByExample" parameterType="com.fedex.connect.common.model.sys.UserRoleExample">
delete from ICLEARIMP.T_SYS_USER_ROLE
delete from iclconnect.T_SYS_USER_ROLE
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
......@@ -112,7 +112,7 @@
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_SYS_USER_ROLE.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_SYS_USER_ROLE (ID, USER_ID, ROLE_ID,
insert into iclconnect.T_SYS_USER_ROLE (ID, USER_ID, ROLE_ID,
STATUS, CREATE_TIME, CREATE_USER_ID,
CREATE_USER_NAME, MODIFY_TIME, MODIFY_USER_ID,
MODIFY_USER_NAME)
......@@ -125,7 +125,7 @@
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
SELECT SEQ_T_SYS_USER_ROLE.NEXTVAL FROM DUAL
</selectKey>
insert into ICLEARIMP.T_SYS_USER_ROLE
insert into iclconnect.T_SYS_USER_ROLE
<trim prefix="(" suffix=")" suffixOverrides=",">
ID,
<if test="userId != null">
......@@ -188,13 +188,13 @@
</trim>
</insert>
<select id="countByExample" parameterType="com.fedex.connect.common.model.sys.UserRoleExample" resultType="java.lang.Long">
select count(*) from ICLEARIMP.T_SYS_USER_ROLE
select count(*) from iclconnect.T_SYS_USER_ROLE
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update ICLEARIMP.T_SYS_USER_ROLE
update iclconnect.T_SYS_USER_ROLE
<set>
<if test="record.id != null">
ID = #{record.id,jdbcType=NUMERIC},
......@@ -232,7 +232,7 @@
</if>
</update>
<update id="updateByExample" parameterType="map">
update ICLEARIMP.T_SYS_USER_ROLE
update iclconnect.T_SYS_USER_ROLE
set ID = #{record.id,jdbcType=NUMERIC},
USER_ID = #{record.userId,jdbcType=NUMERIC},
ROLE_ID = #{record.roleId,jdbcType=NUMERIC},
......@@ -248,7 +248,7 @@
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.fedex.connect.common.model.sys.UserRole">
update ICLEARIMP.T_SYS_USER_ROLE
update iclconnect.T_SYS_USER_ROLE
<set>
<if test="userId != null">
USER_ID = #{userId,jdbcType=NUMERIC},
......@@ -281,7 +281,7 @@
where ID = #{id,jdbcType=NUMERIC}
</update>
<update id="updateByPrimaryKey" parameterType="com.fedex.connect.common.model.sys.UserRole">
update ICLEARIMP.T_SYS_USER_ROLE
update iclconnect.T_SYS_USER_ROLE
set USER_ID = #{userId,jdbcType=NUMERIC},
ROLE_ID = #{roleId,jdbcType=NUMERIC},
STATUS = #{status,jdbcType=NUMERIC},
......
......@@ -9,7 +9,7 @@ import java.util.Date;
/**
* DESC: CE501报文业务表,增加需要加密标志
* TABLE: ICLEARIMP.T_BIZ_CE_INFO
* TABLE: iclconnect.T_BIZ_CE_INFO
*/
@SensitiveEntity
public class CeInfo implements Serializable {
......
......@@ -94,6 +94,11 @@ public class PushOb implements Serializable {
*/
private String modifyUserName;
/**
* 用户上传记录表ID
*/
private Long uploadRecordId;
private static final long serialVersionUID = 1L;
public Long getId() {
......@@ -232,6 +237,14 @@ public class PushOb implements Serializable {
this.modifyUserName = modifyUserName == null ? null : modifyUserName.trim();
}
public Long getUploadRecordId() {
return uploadRecordId;
}
public void setUploadRecordId(Long uploadRecordId) {
this.uploadRecordId = uploadRecordId;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
......@@ -255,6 +268,7 @@ public class PushOb implements Serializable {
sb.append(", modifyTime=").append(modifyTime);
sb.append(", modifyUserId=").append(modifyUserId);
sb.append(", modifyUserName=").append(modifyUserName);
sb.append(", uploadRecordId=").append(uploadRecordId);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
......
......@@ -35,12 +35,12 @@ public class PushObDetail implements Serializable {
private String statusName;
/**
* 推送文件类型字典CODE,关联数据字典表。指定字典目录CODE:PUSH_OB_FILE_TYPE
* 推送文件类型字典CODE,关联数据字典表。指定字典目录CODE:ATTACHMENT_BIZ_TYPE,取值Ext1 字段值
*/
private String fileTypeCode;
/**
* 推送文件类型名称(XXX、XXX
* 推送文件类型名称(AWB、INV、PKL、OTH
*/
private String fileType;
......
......@@ -1234,6 +1234,66 @@ public class PushObExample {
addCriterion("MODIFY_USER_NAME not between", value1, value2, "modifyUserName");
return (Criteria) this;
}
public Criteria andUploadRecordIdIsNull() {
addCriterion("UPLOAD_RECORD_ID is null");
return (Criteria) this;
}
public Criteria andUploadRecordIdIsNotNull() {
addCriterion("UPLOAD_RECORD_ID is not null");
return (Criteria) this;
}
public Criteria andUploadRecordIdEqualTo(Long value) {
addCriterion("UPLOAD_RECORD_ID =", value, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdNotEqualTo(Long value) {
addCriterion("UPLOAD_RECORD_ID <>", value, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdGreaterThan(Long value) {
addCriterion("UPLOAD_RECORD_ID >", value, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdGreaterThanOrEqualTo(Long value) {
addCriterion("UPLOAD_RECORD_ID >=", value, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdLessThan(Long value) {
addCriterion("UPLOAD_RECORD_ID <", value, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdLessThanOrEqualTo(Long value) {
addCriterion("UPLOAD_RECORD_ID <=", value, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdIn(List<Long> values) {
addCriterion("UPLOAD_RECORD_ID in", values, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdNotIn(List<Long> values) {
addCriterion("UPLOAD_RECORD_ID not in", values, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdBetween(Long value1, Long value2) {
addCriterion("UPLOAD_RECORD_ID between", value1, value2, "uploadRecordId");
return (Criteria) this;
}
public Criteria andUploadRecordIdNotBetween(Long value1, Long value2) {
addCriterion("UPLOAD_RECORD_ID not between", value1, value2, "uploadRecordId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
......
......@@ -5,7 +5,7 @@ import java.util.Date;
/**
* DESC: 用户运单关系映射表
* TABLE: ICLEARIMP.T_BIZ_USER_CONSIGNMENT_MAPPING
* TABLE: iclconnect.T_BIZ_USER_CONSIGNMENT_MAPPING
*/
public class UserConsignmentMapping implements Serializable {
/**
......@@ -63,6 +63,11 @@ public class UserConsignmentMapping implements Serializable {
*/
private String consignmentCode;
/**
* 是否使用CE数据标志(0“非501数据,1:501数据)
*/
private Long ceFlag;
private static final long serialVersionUID = 1L;
public Long getId() {
......@@ -153,6 +158,18 @@ public class UserConsignmentMapping implements Serializable {
this.consignmentCode = consignmentCode == null ? null : consignmentCode.trim();
}
public Long getCeFlag() {
return ceFlag;
}
public void setCeFlag(Long ceFlag) {
this.ceFlag = ceFlag;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
......
......@@ -61,7 +61,7 @@ public class EmailHistory implements Serializable {
/**
* 发送次数(0-3次)
*/
private Long sendNum;
private int sendNum;
/**
* 邮件发送时间
......@@ -190,11 +190,11 @@ public class EmailHistory implements Serializable {
this.statusName = statusName == null ? null : statusName.trim();
}
public Long getSendNum() {
public int getSendNum() {
return sendNum;
}
public void setSendNum(Long sendNum) {
public void setSendNum(int sendNum) {
this.sendNum = sendNum;
}
......
......@@ -5,7 +5,7 @@ import java.util.Date;
/**
* DESC: 操作日志
* TABLE: ICLEARIMP.T_LOG_OPERATION
* TABLE: iclconnect.T_LOG_OPERATION
*/
public class Operation implements Serializable {
/**
......@@ -44,21 +44,6 @@ public class Operation implements Serializable {
private String url;
/**
* 请求参数
*/
private String requestParameters;
/**
* 操作结果
*/
private String result;
/**
* 状态(0:展示、1:不展示)
*/
private Long status;
/**
* 创建时间
*/
private Date createTime;
......@@ -104,9 +89,9 @@ public class Operation implements Serializable {
private Long exceuteConsume;
/**
* 备注
* 状态(0:展示、1:不展示)
*/
private String remark;
private Long status;
private static final long serialVersionUID = 1L;
......@@ -166,30 +151,6 @@ public class Operation implements Serializable {
this.url = url == null ? null : url.trim();
}
public String getRequestParameters() {
return requestParameters;
}
public void setRequestParameters(String requestParameters) {
this.requestParameters = requestParameters == null ? null : requestParameters.trim();
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result == null ? null : result.trim();
}
public Long getStatus() {
return status;
}
public void setStatus(Long status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
......@@ -262,12 +223,12 @@ public class Operation implements Serializable {
this.exceuteConsume = exceuteConsume;
}
public String getRemark() {
return remark;
public Long getStatus() {
return status;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
public void setStatus(Long status) {
this.status = status;
}
@Override
......@@ -283,9 +244,6 @@ public class Operation implements Serializable {
sb.append(", module=").append(module);
sb.append(", describe=").append(describe);
sb.append(", url=").append(url);
sb.append(", requestParameters=").append(requestParameters);
sb.append(", result=").append(result);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", createUserId=").append(createUserId);
sb.append(", createUserName=").append(createUserName);
......@@ -295,7 +253,7 @@ public class Operation implements Serializable {
sb.append(", requestTime=").append(requestTime);
sb.append(", responseTime=").append(responseTime);
sb.append(", exceuteConsume=").append(exceuteConsume);
sb.append(", remark=").append(remark);
sb.append(", status=").append(status);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
......
......@@ -595,206 +595,6 @@ public class OperationExample {
return (Criteria) this;
}
public Criteria andRequestParametersIsNull() {
addCriterion("REQUEST_PARAMETERS is null");
return (Criteria) this;
}
public Criteria andRequestParametersIsNotNull() {
addCriterion("REQUEST_PARAMETERS is not null");
return (Criteria) this;
}
public Criteria andRequestParametersEqualTo(String value) {
addCriterion("REQUEST_PARAMETERS =", value, "requestParameters");
return (Criteria) this;
}
public Criteria andRequestParametersNotEqualTo(String value) {
addCriterion("REQUEST_PARAMETERS <>", value, "requestParameters");
return (Criteria) this;
}
public Criteria andRequestParametersGreaterThan(String value) {
addCriterion("REQUEST_PARAMETERS >", value, "requestParameters");
return (Criteria) this;
}
public Criteria andRequestParametersGreaterThanOrEqualTo(String value) {
addCriterion("REQUEST_PARAMETERS >=", value, "requestParameters");
return (Criteria) this;
}
public Criteria andRequestParametersLessThan(String value) {
addCriterion("REQUEST_PARAMETERS <", value, "requestParameters");
return (Criteria) this;
}
public Criteria andRequestParametersLessThanOrEqualTo(String value) {
addCriterion("REQUEST_PARAMETERS <=", value, "requestParameters");
return (Criteria) this;
}
public Criteria andRequestParametersLike(String value) {
addCriterion("REQUEST_PARAMETERS like", value, "requestParameters");
return (Criteria) this;
}
public Criteria andRequestParametersNotLike(String value) {
addCriterion("REQUEST_PARAMETERS not like", value, "requestParameters");
return (Criteria) this;
}
public Criteria andRequestParametersIn(List<String> values) {
addCriterion("REQUEST_PARAMETERS in", values, "requestParameters");
return (Criteria) this;
}
public Criteria andRequestParametersNotIn(List<String> values) {
addCriterion("REQUEST_PARAMETERS not in", values, "requestParameters");
return (Criteria) this;
}
public Criteria andRequestParametersBetween(String value1, String value2) {
addCriterion("REQUEST_PARAMETERS between", value1, value2, "requestParameters");
return (Criteria) this;
}
public Criteria andRequestParametersNotBetween(String value1, String value2) {
addCriterion("REQUEST_PARAMETERS not between", value1, value2, "requestParameters");
return (Criteria) this;
}
public Criteria andResultIsNull() {
addCriterion("RESULT is null");
return (Criteria) this;
}
public Criteria andResultIsNotNull() {
addCriterion("RESULT is not null");
return (Criteria) this;
}
public Criteria andResultEqualTo(String value) {
addCriterion("RESULT =", value, "result");
return (Criteria) this;
}
public Criteria andResultNotEqualTo(String value) {
addCriterion("RESULT <>", value, "result");
return (Criteria) this;
}
public Criteria andResultGreaterThan(String value) {
addCriterion("RESULT >", value, "result");
return (Criteria) this;
}
public Criteria andResultGreaterThanOrEqualTo(String value) {
addCriterion("RESULT >=", value, "result");
return (Criteria) this;
}
public Criteria andResultLessThan(String value) {
addCriterion("RESULT <", value, "result");
return (Criteria) this;
}
public Criteria andResultLessThanOrEqualTo(String value) {
addCriterion("RESULT <=", value, "result");
return (Criteria) this;
}
public Criteria andResultLike(String value) {
addCriterion("RESULT like", value, "result");
return (Criteria) this;
}
public Criteria andResultNotLike(String value) {
addCriterion("RESULT not like", value, "result");
return (Criteria) this;
}
public Criteria andResultIn(List<String> values) {
addCriterion("RESULT in", values, "result");
return (Criteria) this;
}
public Criteria andResultNotIn(List<String> values) {
addCriterion("RESULT not in", values, "result");
return (Criteria) this;
}
public Criteria andResultBetween(String value1, String value2) {
addCriterion("RESULT between", value1, value2, "result");
return (Criteria) this;
}
public Criteria andResultNotBetween(String value1, String value2) {
addCriterion("RESULT not between", value1, value2, "result");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("STATUS is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("STATUS is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Long value) {
addCriterion("STATUS =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Long value) {
addCriterion("STATUS <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Long value) {
addCriterion("STATUS >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Long value) {
addCriterion("STATUS >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Long value) {
addCriterion("STATUS <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Long value) {
addCriterion("STATUS <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Long> values) {
addCriterion("STATUS in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Long> values) {
addCriterion("STATUS not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Long value1, Long value2) {
addCriterion("STATUS between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Long value1, Long value2) {
addCriterion("STATUS not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("CREATE_TIME is null");
return (Criteria) this;
......@@ -1354,6 +1154,66 @@ public class OperationExample {
addCriterion("EXCEUTE_CONSUME not between", value1, value2, "exceuteConsume");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("STATUS is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("STATUS is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Long value) {
addCriterion("STATUS =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Long value) {
addCriterion("STATUS <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Long value) {
addCriterion("STATUS >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Long value) {
addCriterion("STATUS >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Long value) {
addCriterion("STATUS <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Long value) {
addCriterion("STATUS <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Long> values) {
addCriterion("STATUS in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Long> values) {
addCriterion("STATUS not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Long value1, Long value2) {
addCriterion("STATUS between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Long value1, Long value2) {
addCriterion("STATUS not between", value1, value2, "status");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
......
package com.fedex.connect.common.model.log;
import java.io.Serializable;
/**
* DESC: 操作日志
* TABLE: iclconnect.T_LOG_OPERATION
*/
public class OperationWithBLOBs extends Operation implements Serializable {
/**
* 备注
*/
private String remark;
/**
* 请求参数
*/
private String requestParameters;
/**
* 请求结果
*/
private String result;
private static final long serialVersionUID = 1L;
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public String getRequestParameters() {
return requestParameters;
}
public void setRequestParameters(String requestParameters) {
this.requestParameters = requestParameters == null ? null : requestParameters.trim();
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result == null ? null : result.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", remark=").append(remark);
sb.append(", requestParameters=").append(requestParameters);
sb.append(", result=").append(result);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
......@@ -5,7 +5,7 @@ import java.util.Date;
/**
* DESC: KAFKA数据历史表
* TABLE: ICLEARIMP.T_SYS_KAFKA_STORAGE_HISTORY
* TABLE: iclconnect.T_SYS_KAFKA_STORAGE_HISTORY
*/
public class KafkaStorageHistory implements Serializable {
/**
......
......@@ -5,7 +5,7 @@ import java.util.Date;
/**
* DESC: KAFKA临时表
* TABLE: ICLEARIMP.T_SYS_KAFKA_TEMPORARY_STORAGE
* TABLE: iclconnect.T_SYS_KAFKA_TEMPORARY_STORAGE
*/
public class KafkaTemporaryStorage implements Serializable {
/**
......
......@@ -5,7 +5,7 @@ import java.util.Date;
/**
* DESC: 系统参数配置表
* TABLE: ICLEARIMP.T_SYS_PARAM_CONFIG
* TABLE: iclconnect.T_SYS_PARAM_CONFIG
*/
public class ParamConfig implements Serializable {
/**
......
......@@ -8,7 +8,7 @@ import java.util.Date;
/**
* DESC: 用户表
* TABLE: ICLEARIMP.T_SYS_USER
* TABLE: iclconnect.T_SYS_USER
*/
@SensitiveEntity
public class User implements Serializable {
......
......@@ -5,7 +5,7 @@ import java.util.Date;
/**
* DESC: 用户角色表
* TABLE: ICLEARIMP.T_SYS_USER_ROLE
* TABLE: iclconnect.T_SYS_USER_ROLE
*/
public class UserRole implements Serializable {
/**
......
......@@ -40,7 +40,7 @@
sys:系统 系统相关表,例如kafka表
log: 日志 日志记录表,例如邮件发送日志表
-->
<javaModelGenerator targetPackage="com.fedex.connect.common.model.sys" targetProject="src/main/java">
<javaModelGenerator targetPackage="com.fedex.connect.common.model.biz" targetProject="src/main/java">
<!---enableSubPackages:如果true,MBG会根据catalog和schema来生成子包。如果false就会直接用targetPackage属性-->
<property name="enableSubPackages" value="false"/>
<!--该属性只对MyBatis3有效,如果true就会使用构造方法入参,如果false就会使用setter方式。默认为false-->
......@@ -52,13 +52,13 @@
</javaModelGenerator>
<!-- 生成映射文件*.xml的位置-->
<sqlMapGenerator targetPackage="mapper.sys" targetProject="src/main/java/com/fedex/connect/common">
<sqlMapGenerator targetPackage="mapper.biz" targetProject="src/main/java/com/fedex/connect/common">
<!--如果true,MBG会根据catalog和schema来生成子包。如果false就会直接用targetPackage属性。默认为false-->
<property name="enableSubPackages" value="false"/>
</sqlMapGenerator>
<!-- 生成DAO的包名和位置 -->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.fedex.connect.common.dao.sys" targetProject="src/main/java">
<javaClientGenerator type="XMLMAPPER" targetPackage="com.fedex.connect.common.dao.biz" targetProject="src/main/java">
<!--如果true,MBG会根据catalog和schema来生成子包。如果false就会直接用targetPackage属性。默认为false-->
<property name="enableSubPackages" value="false"/>
</javaClientGenerator>
......@@ -135,14 +135,12 @@
<!-- selectByExampleQueryId="true">-->
<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_PUSH_OB.NEXTVAL FROM DUAL" />-->
<!-- </table>-->
<!-- <table tableName="T_BIZ_PUSH_OB_DETAIL" domainObjectName="PushObDetail"-->
<!-- enableCountByExample="true" enableUpdateByExample="true"-->
<!-- enableDeleteByExample="true" enableSelectByExample="true"-->
<!-- selectByExampleQueryId="true">-->
<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_PUSH_OB_DETAIL.NEXTVAL FROM DUAL" />-->
<!-- </table>-->
<table tableName="T_BIZ_PUSH_OB_DETAIL" domainObjectName="PushObDetail"
enableCountByExample="true" enableUpdateByExample="true"
enableDeleteByExample="true" enableSelectByExample="true"
selectByExampleQueryId="true">
<generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_PUSH_OB_DETAIL.NEXTVAL FROM DUAL" />
</table>
<!-- <table tableName="T_BI_PORTCLEAR_EMAIL_MAPPING" domainObjectName="PortclearEmailMapping"-->
<!-- enableCountByExample="true" enableUpdateByExample="true"-->
......@@ -169,12 +167,12 @@
<!-- selectByExampleQueryId="true">-->
<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_SYS_KAFKA_TEMPORARY_STORAGE.NEXTVAL FROM DUAL" />-->
<!-- </table>-->
<table schema="ICLEARIMP" tableName="T_SYS_PARAM_CONFIG" domainObjectName="ParamConfig"
enableCountByExample="true" enableUpdateByExample="true"
enableDeleteByExample="true" enableSelectByExample="true"
selectByExampleQueryId="true">
<generatedKey column="ID" sqlStatement="SELECT SEQ_T_SYS_PARAM_CONFIG.NEXTVAL FROM DUAL" />
</table>
<!-- <table schema="ICLEARIMP" tableName="T_SYS_PARAM_CONFIG" domainObjectName="ParamConfig"-->
<!-- enableCountByExample="true" enableUpdateByExample="true"-->
<!-- enableDeleteByExample="true" enableSelectByExample="true"-->
<!-- selectByExampleQueryId="true">-->
<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_SYS_PARAM_CONFIG.NEXTVAL FROM DUAL" />-->
<!-- </table>-->
<!-- <table tableName="T_SYS_PRIVILEGE" domainObjectName="Privilege"-->
<!-- enableCountByExample="true" enableUpdateByExample="true"-->
<!-- enableDeleteByExample="true" enableSelectByExample="true"-->
......@@ -193,12 +191,12 @@
<!-- selectByExampleQueryId="true">-->
<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_SYS_ROLE_PRIVILEGE.NEXTVAL FROM DUAL" />-->
<!-- </table>-->
<table schema="ICLEARIMP" tableName="T_SYS_USER" domainObjectName="User"
enableCountByExample="true" enableUpdateByExample="true"
enableDeleteByExample="true" enableSelectByExample="true"
selectByExampleQueryId="true">
<generatedKey column="ID" sqlStatement="SELECT SEQ_T_SYS_USER.NEXTVAL FROM DUAL" />
</table>
<!-- <table schema="ICLEARIMP" tableName="T_SYS_USER" domainObjectName="User"-->
<!-- enableCountByExample="true" enableUpdateByExample="true"-->
<!-- enableDeleteByExample="true" enableSelectByExample="true"-->
<!-- selectByExampleQueryId="true">-->
<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_SYS_USER.NEXTVAL FROM DUAL" />-->
<!-- </table>-->
<!-- <table schema="ICLEARIMP" tableName="T_SYS_USER_ROLE" domainObjectName="UserRole"-->
<!-- enableCountByExample="true" enableUpdateByExample="true"-->
<!-- enableDeleteByExample="true" enableSelectByExample="true"-->
......
......@@ -2,6 +2,8 @@ package com.fedex.connect.common.dependencies.aspect;
import com.fedex.connect.common.dependencies.annotation.OperationMethodLog;
import com.fedex.connect.common.dependencies.contants.AnnotationConstants;
import com.fedex.connect.common.dependencies.contants.BaseConstants;
import com.fedex.connect.common.dependencies.contants.SystemDefaultUserConstants;
import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.common.dependencies.enums.BaseResponseCode;
import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil;
......@@ -10,6 +12,7 @@ import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.common.dependencies.util.CurrentUserInfo;
import com.fedex.connect.common.dependencies.util.JsonUtils;
import com.fedex.connect.common.model.log.Operation;
import com.fedex.connect.common.model.log.OperationWithBLOBs;
import com.fedex.connect.common.model.sys.User;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
......@@ -119,7 +122,7 @@ public class OperationLogAspect {
String describe = localeMessageUtil.getMessage(operationMethodLog.describe());
String method = request.getMethod();
Operation log = new Operation();
OperationWithBLOBs log = new OperationWithBLOBs();
log.setRequestParameters(requestParameters);
log.setUrl(url);
log.setDescribe(describe);
......@@ -128,6 +131,7 @@ public class OperationLogAspect {
//获取用户信息。 login,logout,oss登录特殊处理
User user = CurrentUserInfo.getUser();
log.setLoginName(user.getLoginName());
log.setUserId(user.getId());
log.setUserName(user.getUserName());
//请求时间
......@@ -172,7 +176,12 @@ public class OperationLogAspect {
log.setResult(resultJson);
}
//基础字段赋值
AssignmentFieldUtils.assignmentTableBaseField(log);
log.setCreateTime(new Date());
log.setCreateUserId(SystemDefaultUserConstants.SYSTEM_USER_KEYS.ID);
log.setCreateUserName(SystemDefaultUserConstants.SYSTEM_USER_KEYS.USER_NAME);
log.setModifyTime(new Date());
log.setModifyUserId(SystemDefaultUserConstants.SYSTEM_USER_KEYS.ID);
log.setModifyUserName(SystemDefaultUserConstants.SYSTEM_USER_KEYS.USER_NAME);
// 日志插入数据库
logger.info("插入日志:" + JsonUtils.objectToJson(log));
operationRepository.insert(log);
......
......@@ -129,7 +129,7 @@ public class JwtAuthorizationFilter extends BasicAuthenticationFilter {
response.setHeader("Token", newToken);*/
} catch (ExpiredJwtException ee) {
//已经过期了,直接踢
logger.error("CODE : {} requestURL:{},reason:{}",BaseResponseCode.MESSAGE_CODE_10004.getCode() , request.getRequestURL(),"ExpiredJwtException ",ee);
logger.error("CODE : {} requestURL:{},reason:{}",BaseResponseCode.MESSAGE_CODE_10005.getCode() , request.getRequestURL(),"ExpiredJwtException ",ee);
Claims claims = ee.getClaims();
String id = claims.getId();
Map<String, Object> result = new HashMap<>();
......
......@@ -20,7 +20,7 @@ public class BasicController {
throw new OpErrorException(BaseResponseCode.MESSAGE_CODE_10003.getCode(),localeMessageUtil.getMessage(BaseResponseCode.MESSAGE_CODE_10003.getMsg()),e);
}
if (user == null) {
throw new OpErrorException(BaseResponseCode.MESSAGE_CODE_10006.getCode(),localeMessageUtil.getMessage(BaseResponseCode.MESSAGE_CODE_10006.getMsg()));
throw new OpErrorException(BaseResponseCode.MESSAGE_CODE_10005.getCode(),localeMessageUtil.getMessage(BaseResponseCode.MESSAGE_CODE_10005.getMsg()));
}
return user;
}
......
......@@ -3,16 +3,19 @@ package com.fedex.connect.common.dependencies.config;
import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.common.dependencies.exception.BaseException;
import com.fedex.connect.common.dependencies.exception.OpErrorException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@Slf4j
@ConditionalOnProperty(prefix = "common.exception-advice-webconfig", name = "enable", havingValue = "true")
@RestControllerAdvice
public class ControllerExceptionAdvice {
@ExceptionHandler(Exception.class)
public ResponseVo exceptionHandler(Exception ex) {
log.error(ex.getMessage(),ex);
ResponseVo res = new ResponseVo();
res.setSuccess(false);
res.setCode(599);
......@@ -22,6 +25,7 @@ public class ControllerExceptionAdvice {
@ExceptionHandler(BaseException.class)
public ResponseVo baseExceptionHandler(BaseException ex) {
log.error(ex.getMessage(),ex);
ResponseVo res = new ResponseVo();
res.setSuccess(false);
res.setCode(ex.getCode().intValue());
......@@ -31,6 +35,7 @@ public class ControllerExceptionAdvice {
@ExceptionHandler(OpErrorException.class)
public ResponseVo opErrorExceptionHandler(OpErrorException ex) {
log.error(ex.getMessage(),ex);
ResponseVo res = new ResponseVo();
res.setSuccess(false);
res.setCode(ex.getCode());
......
......@@ -70,7 +70,7 @@ public interface BaseSeparatorConstants {
String SEPARATOR_ASTERISK = "*";
/**
* @Description 星号
* @Description 反斜杠
* @Author mt
* @Date 2024-11-11
*/
......
package com.fedex.connect.common.dependencies.data.bo;
import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.common.dependencies.util.DateUtil;
import com.fedex.connect.common.model.sys.RedisSlab;
......@@ -13,11 +14,17 @@ public class RedisSlabBo {
dao.setRedisMsg(value);
dao.setValidDuration(validDuration != 0 ? Long.valueOf(validDuration) : 0L);
dao.setDisTime(DateUtil.getHoursAgoTime(validDuration));
dao.setCreateTime(new Date());
try {
/**
* 初始化表基础字段
*/
AssignmentFieldUtils.assignmentTableBaseField(dao);
}catch(Exception ex){
ex.printStackTrace();
}
return dao;
}
/**
* ID自增
*/
......
......@@ -12,7 +12,6 @@ public enum BaseResponseCode {
MESSAGE_CODE_10003(10003,"system_exception_10003"),
MESSAGE_CODE_10004(10004,"system_exception_10004"),
MESSAGE_CODE_10005(10005,"system_exception_10005"),
MESSAGE_CODE_10006(10006,"system_exception_10006"),
;
private Integer code;
private String msg;
......
......@@ -65,4 +65,14 @@ public enum AttachmentBizTypeEnum {
}
return null; // 如果没有找到匹配的 code,返回 null
}
public static String getCodeByExt1(String ext1) {
for (AttachmentBizTypeEnum type : AttachmentBizTypeEnum.values()) {
if (type.getExt1().equals(ext1)) {
return type.getCode();
}
}
return null; // 如果没有找到匹配的 ext1,返回 null
}
}
......
......@@ -12,6 +12,7 @@ public enum EmailTypeEnum {
PUSH_CON_FILE("emailType_01","Push Pre-Customs Clearance Files","推送预清关文件"),
NOTIFICATION_SENDER("emailType_02","Remind Sender","提醒发件人"),
SEND_FAILED_EMAIL("emailType_03", "Error Email Alert","错误邮件预警"),
SEND_OB("ob", "ob","推送ob"),
;
......@@ -31,10 +32,10 @@ public enum EmailTypeEnum {
}
// 获取 enMsg 根据 code
public static String getEnMsgByCode(String code) {
public static String getMsgByCode(String code) {
for (EmailTypeEnum emailType : EmailTypeEnum.values()) {
if (emailType.code.equals(code)) {
return emailType.enMsg;
return emailType.msg;
}
}
return null; // 如果找不到对应的 code,返回 null
......
......@@ -2,7 +2,7 @@ package com.fedex.connect.common.dependencies.enums.sys;
public enum UserTypeEnum {
LOCAL("userType_01","LOCAL","本地账号"),
FCL("userType_02","FCL","FCL账号");
FCL("userType_02","fedex.com User Account","FCL账号");
private String code;
private String enMsg;
......
......@@ -2,14 +2,13 @@ package com.fedex.connect.common.dependencies.repository.base;
import com.fedex.connect.common.dao.bi.DictionaryEntriesMapper;
import com.fedex.connect.common.dao.log.OperationMapper;
import com.fedex.connect.common.dao.sys.ParamConfigMapper;
import com.fedex.connect.common.dao.sys.RedisSlabMapper;
import com.fedex.connect.common.dependencies.repository.dao.UserMapperExt;
import com.fedex.connect.common.dependencies.repository.dao.UserBaseMapper;
import org.springframework.beans.factory.annotation.Autowired;
public class BaseDao {
@Autowired
protected UserMapperExt userMapperExt;
protected UserBaseMapper userBaseMapper;
@Autowired
protected RedisSlabMapper redisSlabMapper;
@Autowired
......
......@@ -6,7 +6,7 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface UserMapperExt {
public interface UserBaseMapper {
@Select( "<script>" +
"select * from T_SYS_USER where ID = #{id} AND STATUS = 1 " +
"</script>")
......
......@@ -5,6 +5,6 @@ import com.fedex.connect.common.model.bi.DictionaryEntriesExample;
import java.util.List;
public interface IDictionaryEntriesRepository {
public interface IDictionaryEntriesBaseRepository {
List<DictionaryEntries> findAll(DictionaryEntriesExample example);
}
......
......@@ -2,7 +2,7 @@ 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.dependencies.repository.repo.bi.IDictionaryEntriesBaseRepository;
import com.fedex.connect.common.model.bi.DictionaryEntries;
import com.fedex.connect.common.model.bi.DictionaryEntriesExample;
import org.springframework.stereotype.Repository;
......@@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class DictionaryEntriesImpl extends BaseDao implements IDictionaryEntriesRepository {
public class DictionaryEntriesBaseImpl extends BaseDao implements IDictionaryEntriesBaseRepository {
@Override
public List<DictionaryEntries> findAll(DictionaryEntriesExample example) {
......
package com.fedex.connect.common.dependencies.repository.repo.log;
import com.fedex.connect.common.model.log.Operation;
import com.fedex.connect.common.model.log.OperationWithBLOBs;
/**
* @Author mt
......@@ -8,5 +8,5 @@ import com.fedex.connect.common.model.log.Operation;
* @Date 2024/11/6
*/
public interface IOperationRepository {
void insert(Operation record);
void insert(OperationWithBLOBs record);
}
......
......@@ -2,7 +2,7 @@ package com.fedex.connect.common.dependencies.repository.repo.log.impl;
import com.fedex.connect.common.dependencies.repository.base.BaseDao;
import com.fedex.connect.common.dependencies.repository.repo.log.IOperationRepository;
import com.fedex.connect.common.model.log.Operation;
import com.fedex.connect.common.model.log.OperationWithBLOBs;
import org.springframework.stereotype.Repository;
/**
......@@ -12,7 +12,7 @@ import org.springframework.stereotype.Repository;
*/
@Repository
public class OperationRepositoryImpl extends BaseDao implements IOperationRepository {
public void insert(Operation record){
public void insert(OperationWithBLOBs record){
operationMapper.insert(record);
}
}
......
......@@ -5,7 +5,7 @@ import com.fedex.connect.common.model.sys.RedisSlabExample;
import java.util.List;
public interface IRedisSlabRepository {
public interface IRedisSlabBaseRepository {
int insert(RedisSlab record);
List<RedisSlab> selectByExample(RedisSlabExample example);
......
......@@ -2,6 +2,6 @@ package com.fedex.connect.common.dependencies.repository.repo.sys;
import com.fedex.connect.common.model.sys.User;
public interface IUserRepository {
public interface IUserBaseRepository {
User findOne(Long id);
}
\ No newline at end of file
......
package com.fedex.connect.common.dependencies.repository.repo.sys.impl;
import com.fedex.connect.common.dependencies.repository.base.BaseDao;
import com.fedex.connect.common.dependencies.repository.repo.sys.IRedisSlabRepository;
import com.fedex.connect.common.dependencies.repository.repo.sys.IRedisSlabBaseRepository;
import com.fedex.connect.common.model.sys.RedisSlab;
import com.fedex.connect.common.model.sys.RedisSlabExample;
import org.springframework.stereotype.Repository;
......@@ -9,7 +9,7 @@ import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class RedisSlabRepositoryImpl extends BaseDao implements IRedisSlabRepository {
public class RedisSlabBaseRepositoryImpl extends BaseDao implements IRedisSlabBaseRepository {
@Override
public int insert(RedisSlab record) {
......
package com.fedex.connect.common.dependencies.repository.repo.sys.impl;
import com.fedex.connect.common.dependencies.repository.base.BaseDao;
import com.fedex.connect.common.dependencies.repository.repo.sys.IUserRepository;
import com.fedex.connect.common.dependencies.repository.repo.sys.IUserBaseRepository;
import com.fedex.connect.common.model.sys.User;
import org.springframework.stereotype.Repository;
@Repository
public class UserRepositoryImpl extends BaseDao implements IUserRepository {
public class UserBaseRepositoryImpl extends BaseDao implements IUserBaseRepository {
@Override
public User findOne(Long id){
return this.userMapperExt.findOne(id);
return this.userBaseMapper.findOne(id);
}
}
......
package com.fedex.connect.common.dependencies.service.base;
import com.fedex.connect.common.dependencies.repository.repo.sys.IRedisSlabRepository;
import com.fedex.connect.common.dependencies.repository.repo.bi.IDictionaryEntriesRepository;
import com.fedex.connect.common.dependencies.repository.repo.sys.IRedisSlabBaseRepository;
import com.fedex.connect.common.dependencies.repository.repo.bi.IDictionaryEntriesBaseRepository;
import org.springframework.beans.factory.annotation.Autowired;
/**
......@@ -11,7 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
*/
public class BaseService {
@Autowired
protected IRedisSlabRepository redisSlabRepository;
protected IRedisSlabBaseRepository redisSlabRepository;
@Autowired
protected IDictionaryEntriesRepository dictionaryEntriesRepository;
protected IDictionaryEntriesBaseRepository dictionaryEntriesRepository;
}
\ No newline at end of file
......
......@@ -28,17 +28,18 @@ public class DuplicateEmailTemplate implements EmailTemplate {
}
interface CLEARANCE_TITLE{
String TITLE = "Sender Reminder:";
String TITLE = "Notification: declaration documents submitted ({0})";
}
interface CLEARANCE_BODY{
String DESCRIPTION = "<p>Sender Reminder: The task will poll every {0} minutes after the system starts.</p>\n";
String DESCRIPTION = "<p>This email is a reminder email, please do not reply!</p>\n";
String BODY = "<div><div style='margin-left:4%;'>" +
"<p align='center'><img src='{0}'></p>" +
"<p align='center'><img src='{1}'></p>" +
"<p>Import Pre-Clearance System Notification:</p>" +
"<p>&nbsp;&nbsp;&nbsp;&nbsp;{2}The consignment has been created and uploaded by another user.</p>" +
"</font><br/><br/>";
"<p>FedEx iClear Connect System Notification:</p>" +
"<p>&nbsp;&nbsp;&nbsp;&nbsp;Please note that the declaration documents of waybill with tracking number {0} has been submitted by someone else!</p>" +
"</font><br/><br/>" +
"<div style=color:#808080;font-style:Arial;font-size:14px;margin: auto;margin-bottom: 5px;>" +
"{1}\n" +
"</div>";
}
}
......
......@@ -32,28 +32,27 @@ public class SendFailedEmailTemplate implements EmailTemplate {
interface FAILED_EMAIL_TITLE{
String TITLE = "Failure Alert";
String TITLE = "接口调用失败详情";
}
interface FAILED_EMAIL_BODY{
String DESCRIPTION = "<p>1.[File Push] Task: The system performs a polling every {0} minutes after startup.</p>\n" +
" <p>2.[Push Pre-Clearance File] Task: The system performs a polling every {1} minutes after startup.</p>\n" +
" <p>3.[Remind Sender] Task: The system performs a polling every {2} minutes after startup.</p>\n" +
" <p>Note: Email Sending Mechanism:</p>\n" +
" <p>This alert email task is executed every {3} minutes after the system starts. If any of the three scheduled tasks mentioned above have a final determination of failed records exceeding {4} for the day, an email notification will be automatically sent to FedEx IT. Each interface will display the latest {5} failed tracking numbers, the total number of calls made during the day, and the total number of failed calls for the day.</p>\n" +
" <p style=\"font-size:10px;\">(Note: All task-related numbers can be adjusted in the system configuration interface.)</p>";
String DESCRIPTION = "<p>1.【文件推送】任务,系统启动后每{0}分钟轮巡一次。</p>\n" +
" <p>2.【推送预清关文件】任务,系统启动后每{1}分钟轮巡一次。</p>\n" +
" <p>3.【提醒发件人】任务,系统启动后每{2}分钟轮巡一次。</p>\n" +
" <p>备注:邮件发送机制:</p>\n" +
" <p>该预警邮件任务,系统启动后每30分钟执行一次,当日上述3个定时任务,有任何一个任务的最终判定为失败的记录数量大于5,则自动发送邮件通知FedEX IT,每个接口显示最新10条失败运单号、当日调用总次数、当日调用失败总次数。</p>\n" ;
String TABLE = "<table style=\"width: 100%;table-layout: fixed;padding: 20px;width: 100%;border-collapse: collapse;\">\n" +
"<tr>\n" +
"<td style=\"border: 0px;text-align: left;padding: 8px;\">\n" +
"<div style=\"margin: auto;padding: 20px;\">\n" +
"<h2 style=\"text-align: center;\">Task Push Failure Details</h2>\n" +
"<h2 style=\"text-align: center;\">接口调用失败详情</h2>\n" +
"<table style=\"width: 100%;border-collapse: collapse;\">\n" +
"<tr>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">Task Name</th>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">Failed Tracking Number</th>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">Total Number</th>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">Failure Count</th>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">任务名称</th>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">失败的运单号</th>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">总数</th>\n" +
"<th style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #593BB7;color: white;\">失败数量</th>\n" +
"</tr>\n" +
"{0}\n" +
"</table>\n" +
......
package com.fedex.connect.common.dependencies.util;
import com.fedex.connect.common.dependencies.annotation.BaseNotBlank;
import com.fedex.connect.common.dependencies.exception.OpErrorException;
import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -54,8 +55,10 @@ public class BaseValidateUtils {
if(errorList.size() > 0){
responseUtils.fail(codeEnum,errorList);
}
}catch(OpErrorException ex){
throw ex;
}catch(Exception ex){
responseUtils.fail(codeEnum);
responseUtils.fail(codeEnum,ex);
}
}
}
\ No newline at end of file
......
......@@ -24,6 +24,7 @@ public class DateUtil {
public static final String PATTERN_DATE_TIME_ORACLE = "yyyy-MM-dd hh:mi:ss";
public static final String PATTERN_DATE_TIME_MS = "yyyy-mm-dd hh24:mi:ss";
public static final String PATTERN_yyyyMMddHHmmss = "yyyyMMddHHmmss";
public static final String YYYYMMDDHH24MMSSSSS = "yyyyMMddHHmmssSSS";
private static SimpleDateFormat dateFormat = new SimpleDateFormat();
......@@ -47,6 +48,19 @@ public class DateUtil {
dateFormat.applyPattern(PATTERN_DATE_TIME);
return dateFormat.format(date);
}
/**
* 用默认格式格式化日期
*
* @param date
* @return
*/
public static String yyyyMMddHH24mmssSSS(Date date) {
SimpleDateFormat dateFormat = new SimpleDateFormat();
dateFormat.applyPattern(YYYYMMDDHH24MMSSSSS);
return dateFormat.format(date);
}
/**
* 用指定格式格式化日期
*
......
package com.fedex.connect.common.dependencies.util;
import org.apache.poi.util.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StreamUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
//import org.junit.platform.commons.util.StringUtils;
/**
* Created by liyang on 2017/4/22.
*/
public class FileUtil {
private static Logger log= LoggerFactory.getLogger(FileUtil.class);
private static final int BUFFER_SIZE = 16 * 1024;
public static final String SIGN = "/";
private static final SimpleDateFormat DATE_FORMAT_YYYYMM = new SimpleDateFormat("yyyyMM");
private static final SimpleDateFormat DATE_FORMAT_YYYYMMDDHHMMSSSSS = new SimpleDateFormat("yyyyMMdd_HHmmss_SSS");
public static String getContentType(String fileName) {
// 使用 URLConnection 根据文件名获取 MIME 类型
String contentType = URLConnection.guessContentTypeFromName(fileName);
if (contentType == null) {
// 如果无法推测出 MIME 类型,则默认为 "application/octet-stream"
contentType = "application/octet-stream";
}
return contentType;
}
/**
* 文件上传到服务器
*
* @param file
* @param updatePath
* @param entityName
* @return
* @throws IOException
*/
public static File fileUpload(MultipartFile file, String updatePath,
String entityName) throws IOException {
byte[] bytes = file.getBytes();
if (bytes == null || bytes.length == 0) {
return null;
}
if (updatePath.endsWith(SIGN)){
updatePath = updatePath.substring(0, updatePath.lastIndexOf("SIGN"));
}
String finalTargetFolder = updatePath + SIGN + DATE_FORMAT_YYYYMM.format(new Date());
File rootFolder = new File(finalTargetFolder);
// 文件夹不存在,则创建文件夹
if (!rootFolder.exists()) {
rootFolder.mkdirs();
}
// 生成文件名
String[] nameSplit = file.getOriginalFilename().split("\\.");
File finalFile = new File(finalTargetFolder + SIGN + entityName + "_"
+ DATE_FORMAT_YYYYMMDDHHMMSSSSS.format(new Date()) + "."
+ nameSplit[nameSplit.length - 1]);
// 写文件
if (!file.isEmpty()) {
file.transferTo(finalFile);
}
return finalFile;
}
/**
* 文件上传到服务器
*
* @param file
* @param updatePath
* @param entityName
* @param superAddition 追加目录
* @return
* @throws IOException
*/
public static File fileUpload(MultipartFile file, String updatePath,
String entityName, String superAddition) throws IOException {
/* byte[] bytes = file.getBytes();
if (bytes == null || bytes.length == 0) {
return null;
}*/
if (updatePath.endsWith(SIGN)){
updatePath = updatePath.substring(0, updatePath.lastIndexOf(SIGN));
}
String finalTargetFolder = updatePath + SIGN + DATE_FORMAT_YYYYMM.format(new Date()) + SIGN + superAddition;
log.info(finalTargetFolder);
File rootFolder = new File(finalTargetFolder);
// 文件夹不存在,则创建文件夹
if (!rootFolder.exists()) {
rootFolder.mkdirs();
}
// 生成文件名
String[] nameSplit = file.getOriginalFilename().split("\\.");
File finalFile = new File(finalTargetFolder + SIGN + entityName + "_"
+ DATE_FORMAT_YYYYMMDDHHMMSSSSS.format(new Date()) + "."
+ nameSplit[nameSplit.length - 1]);
log.info(Arrays.toString(nameSplit));
// 写文件
//if (!file.isEmpty()) {
/*import org.apache.commons.io.FileUtils;
FileUtils.copyInputStreamToFile(file.getInputStream(), finalFile);*/
//具体参考:https://blog.csdn.net/canduecho/article/details/131598461
try (OutputStream outputStream = new FileOutputStream(finalFile)) {
StreamUtils.copy(file.getInputStream(), outputStream);
}
//}
return finalFile;
}
/**
* 下载
*
* @param request
* @param response
* @param storeName
* @param contentType
* @throws Exception
*/
public static void download(HttpServletRequest request,
HttpServletResponse response, String folder,
String storeName, String contentType)
throws Exception {
response.setContentType("text/html;charset=UTF-8");
request.setCharacterEncoding("UTF-8");
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
String downLoadPath = folder + storeName;
long fileLength = new File(downLoadPath).length();
response.setContentType(contentType);
response.setHeader("Content-Length", String.valueOf(fileLength));
bis = new BufferedInputStream(new FileInputStream(downLoadPath));
bos = new BufferedOutputStream(response.getOutputStream());
byte[] buff = new byte[2048];
int bytesRead;
while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
bos.write(buff, 0, bytesRead);
}
bis.close();
bos.close();
}
/**
* 下载
*
* @param request
* @param response
* @param storeName
* @param contentType
* @param realName
* @throws Exception
*/
public static void download(HttpServletRequest request,
HttpServletResponse response, String folder,
String storeName, String contentType, String realName)
throws Exception {
response.setContentType("text/html;charset=UTF-8");
request.setCharacterEncoding("UTF-8");
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
// String ctxPath = uploadFolder + SIGN;
String downLoadPath = folder + storeName;
long fileLength = new File(downLoadPath).length();
response.setContentType(contentType);
response.setHeader("Content-disposition", "attachment; filename=\""
+ new String(realName.getBytes("GBK"), "ISO8859-1") + "\"");
response.setHeader("Content-Length", String.valueOf(fileLength));
bis = new BufferedInputStream(new FileInputStream(downLoadPath));
bos = new BufferedOutputStream(response.getOutputStream());
byte[] buff = new byte[2048];
int bytesRead;
while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
bos.write(buff, 0, bytesRead);
}
bis.close();
bos.close();
}
/**
* copy文件
*
* @param oldLoad 需要下载文件路径
* @param newLoad 需要copy路径
*/
public static void copyFile(String oldLoad, String newLoad, String fileNme) {
InputStream inputStream = null;
OutputStream outputStream = null;
try {
File rootFolder = new File(newLoad);
//文件夹不存在,则创建文件夹
if (!rootFolder.exists()) {
rootFolder.mkdirs();
}
//图片下载
URL url = new URL(oldLoad);
URLConnection conn = url.openConnection();
inputStream = conn.getInputStream();
outputStream = new FileOutputStream(new File(newLoad + "//" + fileNme));
IOUtils.copy(inputStream, outputStream);
} catch (IOException e) {
System.err.println(e);
} finally {
IOUtils.closeQuietly(inputStream);
IOUtils.closeQuietly(outputStream);
}
}
/**
* 创建文件
*
* @param filepath
* @throws IOException
*/
public static void createFile(String filepath) throws IOException {
File file = new File(filepath);
if (!file.exists()) {
file.createNewFile();
}
}
public static void copyAndRenameFile(String sourceFile, String targetPath, String newFileName) {
File in = new File(sourceFile);
File out = new File(targetPath); // 目标文件夹
try {
Files.copy(in.toPath(), out.toPath().resolve(newFileName), StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
e.printStackTrace();
}
}
public static void createFolder(String folderPath){
try{
File file = new File(folderPath);
file.mkdirs();
}catch (Exception e){
e.printStackTrace();
log.error("createFolder() error:{}",e);
}
}
public static boolean deleteAllFile(String dir) {
File dirFile = new File(dir);
if ((!dirFile.exists()) || (!dirFile.isDirectory())) {
log.info("删除文件夹失败:{} 不存在!",dir);
return false;
}
boolean flag = true;
// 删除文件夹中的所有文件包括子文件夹
File[] files = dirFile.listFiles();
for (int i = 0; i < files.length; i++) {
// 删除子文件
if (files[i].isFile()) {
flag = FileUtil.deleteFile(files[i].getAbsolutePath());
if (!flag){
break;
}
// 删除子文件夹
}else if (files[i].isDirectory()) {
flag = FileUtil.deleteAllFile(files[i].getAbsolutePath());
if (!flag){
break;
}
}
}
if (!flag) {
log.info("删除文件夹{}失败!",dir);
return false;
}
// 删除当前文件夹
if (dirFile.delete()) {
log.info("删除文件夹" + dir + "成功!");
return true;
} else {
return false;
}
}
public static boolean deleteFile(String fileName) {
try{
File file = new File(fileName);
if (file.exists() && file.isFile()) {
if (file.delete()) {
log.info("删除文件" + fileName + "成功!");
return true;
} else {
log.info("删除文件" + fileName + "失败!");
return false;
}
} else {
log.info(fileName + "不存在!");
return false;
}
}catch (Exception e){
log.error("deleteFile() fileName:{} error:{},",fileName,e);
}
return false;
}
public static String getFileNameWithoutSuffix(String fileName){
return fileName.substring(0, fileName.lastIndexOf("."));
}
public static void copyFiles(String sourceFolder, String targetFolder) throws IOException {
Path sourcePath = Paths.get(sourceFolder);
Path targetPath = Paths.get(targetFolder);
if (!Files.exists(targetPath)) {
Files.createDirectories(targetPath);
}
Files.walkFileTree(sourcePath, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Path destination = targetPath.resolve(sourcePath.relativize(file));
Files.copy(file, destination, StandardCopyOption.REPLACE_EXISTING);
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
return FileVisitResult.CONTINUE;
}
});
}
}
......@@ -85,7 +85,7 @@ public class JsonToJava {
*/
public static boolean createJsonFile(String jsonString, String filePath, String fileName) {
boolean flag = true;
String fullPath = filePath + File.separator + fileName + ".json";
String fullPath = filePath + File.separator + fileName;
// 生成json格式文件
try {
......
......@@ -3,7 +3,7 @@ package com.fedex.connect.common.dependencies.util;
import com.fedex.connect.common.dependencies.authentication.SecurityConstants;
import com.fedex.connect.common.dependencies.contants.RedisConstants;
import com.fedex.connect.common.dependencies.date.dto.SecurityUserDetails;
import com.fedex.connect.common.dependencies.repository.repo.sys.IUserRepository;
import com.fedex.connect.common.dependencies.repository.repo.sys.IUserBaseRepository;
import com.fedex.connect.common.model.sys.User;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
......@@ -26,7 +26,7 @@ import java.util.stream.Collectors;
*/
public class JwtTokenUtils {
private static final IUserRepository userRepository = SpringBeanUtil.getBean(IUserRepository.class);
private static final IUserBaseRepository userRepository = SpringBeanUtil.getBean(IUserBaseRepository.class);
/**
* 生成足够的安全随机密钥,以适合符合规范的签名
......
......@@ -262,4 +262,43 @@ public class NIOFileUtils {
}
return false;
}
/**
* @Author mt
* @Description 移动文件
* @Date 2024/5/30
* @param sourcePath
* @param targetPath
* @return void
*/
public void moveFile(String sourcePath,String targetPath) throws Exception{
//覆盖方式移动
Files.move(Paths.get(sourcePath),Paths.get(targetPath),StandardCopyOption.REPLACE_EXISTING);
}
/**
* @Author mt
* @Description 判断文件是否存在
* @Date 2024/9/10
* @param filePath
* @return boolean
*/
public boolean fileExists(String filePath){
return new File(filePath).exists();
}
/**
* @Author mt
* @Description 如果文件夹不存在则创建文件夹
* @Date 2024/5/29
* @param targetFolder
* @return void
*/
public void mkdirs(String targetFolder){
File folder = new File(targetFolder);
// 文件夹不存在,则创建文件夹
if (!folder.exists()) {
folder.mkdirs();
}
}
}
......
......@@ -82,12 +82,17 @@ public class ResponseUtils {
public <T> ResponseVo success(Object codeEnum,T data) {
ResponseCodeBo responseCodeBo = this.ref(codeEnum);
return new ResponseVo<>(responseCodeBo.getCode(),responseCodeBo.getErrMsg(),data);
return new ResponseVo<>(200,responseCodeBo.getErrMsg(),data);
}
public <T> ResponseVo success(T data) {
if (data instanceof Enum) {
ResponseCodeBo responseCodeBo = this.ref(data);
return new ResponseVo<>(200, responseCodeBo.getErrMsg(), null);
} else {
return new ResponseVo<>(data);
}
}
public String msg(String msg){
String message = localeMessageUtil.getMessage(msg);
......
......@@ -497,7 +497,7 @@ public class StringExtUtil {
* @param val ID值
* @return
*/
public static String idLeftPadStr(Long val){
public static String idLeftPadStr(Long val, Integer len){
if (val == null){
return null;
}
......@@ -505,9 +505,8 @@ public class StringExtUtil {
return "0";
}
String valStr = val.toString();
int len = valStr.length();
if (valStr.length() <= 10){
return StringUtils.leftPad(valStr,10,"0");
if (valStr.length() <= len){
return StringUtils.leftPad(valStr,len,"0");
} else {
return valStr;
}
......@@ -554,4 +553,10 @@ public class StringExtUtil {
}
}
public static void main(String[] args){
String fileName = "202410271_20241027113156.pdf";
String f = fileName.substring(fileName.lastIndexOf("."));
System.out.println(f);
}
}
......
......@@ -47,6 +47,8 @@ public interface Constant {
String TW = "TW";
//收件人国家
String CN = "CN";
//DM501消息的UUID为空,赋值默认值
String UUID_DEFAULT = "10000";
}
//ceInfo转换为consignment忽略字段
interface CE_CONSIGNMENT_COPY_IGNORE_PROP_KEYS{
......@@ -54,6 +56,7 @@ public interface Constant {
BaseConstants.CONSIGNMENT_TABLE_COLUMN_KEYS.USER_INPUT_SHIPPER_ACCOUNT,
BaseConstants.CONSIGNMENT_TABLE_COLUMN_KEYS.USER_INPUT_ORIGIN_COUNTRY_CODE,
BaseConstants.CONSIGNMENT_TABLE_COLUMN_KEYS.USER_INPUT_ORIGIN_COUNTRY,
BaseConstants.BASE_TABLE_COLUMN_KEYS.ID,
BaseConstants.BASE_TABLE_COLUMN_KEYS.CREATE_TIME,
BaseConstants.BASE_TABLE_COLUMN_KEYS.CREATE_USER_ID,
BaseConstants.BASE_TABLE_COLUMN_KEYS.CREATE_USER_NAME,
......
......@@ -52,7 +52,7 @@ public class Dm501Consignments implements Serializable {
//扫描状态日期
Date scanDate;
//用户uuid
String uuid;
String userId;
//发件人邮箱
String shipperEmail;
......
......@@ -2,10 +2,13 @@ package com.fedex.connect.kafka.repository.base;
import com.fedex.connect.common.dao.biz.CeInfoMapper;
import com.fedex.connect.common.dao.biz.ConsignmentMapper;
import com.fedex.connect.common.dao.biz.EmailMapper;
import com.fedex.connect.common.dao.sys.KafkaStorageHistoryMapper;
import com.fedex.connect.common.dao.sys.KafkaTemporaryStorageMapper;
import com.fedex.connect.kafka.repository.dao.CeInfoMapperExt;
import com.fedex.connect.kafka.repository.dao.KafkaTemporaryStorageMapperExt;
import com.fedex.connect.kafka.repository.dao.UserConsignmentMappingMapperExt;
import com.fedex.connect.kafka.repository.dao.UserMapperExt;
import org.springframework.beans.factory.annotation.Autowired;
public class BaseRepository {
......@@ -21,4 +24,10 @@ public class BaseRepository {
protected CeInfoMapperExt ceInfoMapperExt;
@Autowired
protected KafkaTemporaryStorageMapperExt kafkaTemporaryStorageMapperExt;
@Autowired
protected UserMapperExt userMapperExt;
@Autowired
protected EmailMapper emailMapper;
@Autowired
protected UserConsignmentMappingMapperExt userConsignmentMappingMapperExt;
}
\ No newline at end of file
......
package com.fedex.connect.kafka.repository.dao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
@Mapper
public interface UserConsignmentMappingMapperExt {
@Update( "<script>" +
"UPDATE T_BIZ_USER_CONSIGNMENT_MAPPING SET CE_FLAG = 1 WHERE ID IN( " +
"SELECT CM.ID FROM T_BIZ_USER_CONSIGNMENT_MAPPING CM INNER JOIN T_SYS_USER SU ON(CM.USER_ID = SU.ID) WHERE SU.ACCOUNT_NO = #{shipperAccount} OR SU.USER_UUID = #{uuid})" +
"</script>")
void updateUserChmMappingByAnUuId(@Param("shipperAccount") String shipperAccount,@Param("uuid") String uuid);
}
\ No newline at end of file
package com.fedex.connect.kafka.repository.dao;
import com.fedex.connect.common.model.sys.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* @Author mt
* @Description CE数据Mapper
* @Date 2024/4/22
*/
@Mapper
public interface UserMapperExt {
/**
* 获取创建时间为1个月内CE数据
* @return
*/
@Select( "<script>" +
"SELECT * FROM T_SYS_USER WHERE USER_UUID = #{uuid} AND ROWNUM &lt;= 1" +
"</script>")
User findUserByUUid(@Param("uuid") String uuid);
@Select( "<script>" +
"SELECT * FROM T_SYS_USER WHERE ID = #{id}" +
"</script>")
User selectUserById(@Param("id") Long id);
}
\ No newline at end of file
package com.fedex.connect.kafka.repository.repo;
import com.fedex.connect.common.model.biz.Email;
public interface IEmailRepository {
void save(Email entity);
}
package com.fedex.connect.kafka.repository.repo;
public interface IUserConsignmentMappingRepository {
void updateUserChmMappingByAnUuId(String shipperAccount, String uuid);
}
package com.fedex.connect.kafka.repository.repo;
import com.fedex.connect.common.model.sys.User;
public interface IUserRepository {
User findUserByUUid(String uuid);
User selectUserById(Long id);
}
package com.fedex.connect.kafka.repository.repo.impl;
import com.fedex.connect.common.model.biz.Email;
import com.fedex.connect.kafka.repository.base.BaseRepository;
import com.fedex.connect.kafka.repository.repo.IEmailRepository;
import org.springframework.stereotype.Repository;
@Repository
public class EmailRepositoryImpl extends BaseRepository implements IEmailRepository {
public void save(Email entity){
if(entity != null) {
if (entity.getId() == null || entity.getId() <= 0) {
emailMapper.insertSelective(entity);
} else if (entity.getId() != null && entity.getId() > 0){
emailMapper.updateByPrimaryKeySelective(entity);
}
}
}
}
package com.fedex.connect.kafka.repository.repo.impl;
import com.fedex.connect.kafka.repository.base.BaseRepository;
import com.fedex.connect.kafka.repository.repo.IUserConsignmentMappingRepository;
import org.springframework.stereotype.Repository;
/**
* @Author mt
* @Description 用户运单映射
* @Date 2025/1/2
*/
@Repository
public class UserConsignmentMappingRepositoryImpl extends BaseRepository implements IUserConsignmentMappingRepository {
/**
* @Author mt
* @Description 根据shipperAccount、uuid更新用户运单映射表ce标志
* @Date 2025/1/2
* @param shipperAccount
* @param uuid
* @return void
*/
public void updateUserChmMappingByAnUuId(String shipperAccount, String uuid){
userConsignmentMappingMapperExt.updateUserChmMappingByAnUuId(shipperAccount,uuid);
}
}
\ No newline at end of file
package com.fedex.connect.kafka.repository.repo.impl;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.kafka.repository.base.BaseRepository;
import com.fedex.connect.kafka.repository.repo.IUserRepository;
import org.springframework.stereotype.Repository;
/**
* @Author mt
* @Description 用户信息repository
* @Date 2024/12/19
*/
@Repository
public class UserRepositoryImpl extends BaseRepository implements IUserRepository {
/**
* @Author mt
* @Description 根据uuid查找用户信息
* @Date 2024/12/19
* @param uuid
* @return com.fedex.connect.common.model.sys.User
*/
@Override
public User findUserByUUid(String uuid) {
return userMapperExt.findUserByUUid(uuid);
}
@Override
public User selectUserById(Long id){
return userMapperExt.selectUserById(id);
}
}
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.fedex.connect.common.dependencies.util.Utils;
import com.fedex.connect.common.model.biz.CeInfo;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.biz.Email;
import com.fedex.connect.common.model.sys.KafkaTemporaryStorage;
import com.fedex.connect.kafka.data.dto.DmProcessResults;
import com.fedex.connect.kafka.data.dto.dm.dm501.Dm501Consignments;
......@@ -14,7 +15,6 @@ import com.fedex.connect.kafka.util.Dm501Util;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
......@@ -53,10 +53,17 @@ public class Dm501ServiceImpl extends BaseService implements IDm501Service {
processResults.setConsignmentCode(consignment501.getTrackingNumber());
//该运单号不存在创建时间为1个月内CE数据
if (Objects.isNull(bizCeInfo)) {
CeInfo ceInfo = dm501Util.generateCeInfo(consignment501,kafKaTemporaryStorage.getSendTime());
CeInfo ceInfo = dm501Util.generateCeInfo(consignment501,kafKaTemporaryStorage.getSendTime(),processResults);
//ce信息为空,则不记录运单表
if(Objects.nonNull(ceInfo)){
//ce数据解析正常,进行后续操作
Consignment consignment = dm501Util.generateConsignment(ceInfo);
this.saveCeInfoAndConsignment(ceInfo,consignment);
Email email = new Email();
Consignment consignment = dm501Util.generateConsignment(ceInfo,email);
/**
* 保存ce信息、以及运单表信息
*/
dm501Util.saveCeInfoAndConsignment(ceInfo,consignment,email);
}
}
}catch(Exception ex){
log.error("DM501消息处理异常:{}", ex.getMessage(),ex);
......@@ -64,20 +71,4 @@ public class Dm501ServiceImpl extends BaseService implements IDm501Service {
});
return processResults;
}
/**
* @Author mt
* @Description 保存ce信息、以及运单表信息
* @Date 2024/11/1
* @param ceInfo
* @param consignment
* @return void
*/
@Transactional(rollbackFor = Exception.class)
public void saveCeInfoAndConsignment(CeInfo ceInfo, Consignment consignment){
ceInfoRepository.save(ceInfo);
//绑定ceInfo表Id
consignment.setCeInfoId(ceInfo.getId());
consignmentRepository.save(consignment);
}
}
\ No newline at end of file
......
......@@ -3,12 +3,14 @@ package com.fedex.connect.kafka.service.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fedex.connect.common.dependencies.enums.sys.KafkaStatusEnum;
import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.common.model.sys.KafkaStorageHistory;
import com.fedex.connect.common.model.sys.KafkaTemporaryStorage;
import com.fedex.connect.kafka.data.dto.DmProcessResults;
import com.fedex.connect.kafka.listener.DmListenerInterface;
import com.fedex.connect.kafka.service.IKafkaDmService;
import com.fedex.connect.kafka.service.base.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
......@@ -27,6 +29,7 @@ import java.util.Map;
* mt
* 2022年11月3日16:09:48
*/
@Slf4j
@Service
public class KafkaDmServiceImpl extends BaseService implements ApplicationContextAware, IKafkaDmService {
private Logger logger = LoggerFactory.getLogger(KafkaDmServiceImpl.class);
......@@ -39,6 +42,16 @@ public class KafkaDmServiceImpl extends BaseService implements ApplicationContex
*/
@Override
public List<KafkaTemporaryStorage> saveKafkaTemporaryStorageAll(List<KafkaTemporaryStorage> kafkaTemporaryStorageList){
kafkaTemporaryStorageList.stream().forEach(p -> {
try {
/**
* 初始化表基础字段
*/
AssignmentFieldUtils.assignmentTableBaseField(p);
}catch(Exception ex){
log.error("记录kafka历史表保存基础信息失败:",ex);
}
});
return kafkaTemporaryStorageRepository.saveAll(kafkaTemporaryStorageList);
}
......@@ -48,6 +61,14 @@ public class KafkaDmServiceImpl extends BaseService implements ApplicationContex
*/
@Override
public KafkaStorageHistory saveKafkaStorageHistory(KafkaStorageHistory kafkaStorageHistory){
try {
/**
* 初始化表基础字段
*/
AssignmentFieldUtils.assignmentTableBaseField(kafkaStorageHistory);
}catch(Exception ex){
log.error("记录kafka历史表保存基础信息失败:",ex);
}
return kafkaStorageHistoryRepository.save(kafkaStorageHistory);
}
......@@ -123,6 +144,8 @@ public class KafkaDmServiceImpl extends BaseService implements ApplicationContex
kafkaStorageHistory.setStatusName(KafkaStatusEnum.PROCESSED.getName());
//设置运单号
kafkaStorageHistory.setConsignmentCode(processResults.getConsignmentCode());
//记录报文处理备注
kafkaStorageHistory.setRemark(processResults.getResult());
//保存至kafka历史表
this.saveKafkaStorageHistory(kafkaStorageHistory);
}else{
......
package com.fedex.connect.kafka.util;
import com.fedex.connect.common.dependencies.cache.CacheSystem;
import com.fedex.connect.common.dependencies.enums.biz.ConsignmentStatusEnum;
import com.fedex.connect.common.dependencies.enums.biz.EmailStatusEnum;
import com.fedex.connect.common.dependencies.enums.biz.EmailTypeEnum;
import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.common.dependencies.util.DateUtil;
import com.fedex.connect.common.model.bi.DictionaryEntries;
import com.fedex.connect.common.model.biz.CeInfo;
import com.fedex.connect.common.model.biz.Consignment;
import com.fedex.connect.common.model.biz.Email;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.kafka.constants.Constant;
import com.fedex.connect.kafka.data.dto.DmProcessResults;
import com.fedex.connect.kafka.data.dto.dm.dm501.Dm501ConAddresses;
import com.fedex.connect.kafka.data.dto.dm.dm501.Dm501Consignments;
import com.fedex.connect.kafka.repository.repo.IConsignmentRepository;
import com.fedex.connect.kafka.repository.repo.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
@Component
public class Dm501Util {
......@@ -28,6 +34,14 @@ public class Dm501Util {
CacheSystem cacheSystem;
@Autowired
IConsignmentRepository consignmentRepository;
@Autowired
ICeInfoRepository ceInfoRepository;
@Autowired
IUserRepository userRepository;
@Autowired
IEmailRepository emailRepository;
@Autowired
IUserConsignmentMappingRepository userConsignmentMappingRepository;
/**
* @Author mt
......@@ -36,12 +50,13 @@ public class Dm501Util {
* @param dm501Consignment
* @return com.fedex.connect.common.model.biz.CeInfo
*/
public CeInfo generateCeInfo(Dm501Consignments dm501Consignment,Date sendTime) throws Exception{
public CeInfo generateCeInfo(Dm501Consignments dm501Consignment, Date sendTime, DmProcessResults processResults) throws Exception{
CeInfo ceInfo = new CeInfo();
//地址信息
List<Dm501ConAddresses> addressList = dm501Consignment.getAddresses();
//没有地址信息,不需要处理,不进CE业务表
if(addressList == null){
processResults.setResult("缺失address信息");
return null;
}
//发件人
......@@ -50,6 +65,7 @@ public class Dm501Util {
Dm501ConAddresses recipientAddress = this.queryDM501Addresses(addressList, Constant.CE_INFO_ADDRESS_KEYS.RECIPIENT);
//没有收发件人地址信息,不需要处理,不进CE业务表
if(shipperAddress == null || recipientAddress == null){
processResults.setResult("缺失收发件人address信息");
return null;
}
......@@ -57,6 +73,12 @@ public class Dm501Util {
String recipientCountry = recipientAddress.getCountry();
//收件人国家不为CN,不需要处理,不进CE业务表
if(StringUtils.isEmpty(recipientCountry) || !recipientCountry.trim().equals(Constant.CE_INFO_KEYS.CN)){
processResults.setResult("收件人国家不为CN");
return null;
}
//uuid与shipperAccount都为空,则不进行才做
if(StringUtils.isEmpty(dm501Consignment.getUserId()) && StringUtils.isEmpty(shipperAddress.getAccount())){
processResults.setResult("uuid与shipperAccount都为空");
return null;
}
/**
......@@ -107,8 +129,15 @@ public class Dm501Util {
}
//重量单位
ceInfo.setWeightunit(dm501Consignment.getWeightUnit());
//用户uuid
ceInfo.setUserUuid(dm501Consignment.getUuid());
/**
* 用户uuid
* 如果后端判断下来确实有DM501存在,需要显示所有运单数据,但是UUID又为空。是不是可以给这种运单赋值一个特殊的UUID比如1000。保存的时候,如果是1000这种特殊UUID,那么就置空保存。
*/
if(StringUtils.isBlank(dm501Consignment.getUserId())){
ceInfo.setUserUuid(Constant.CE_INFO_KEYS.UUID_DEFAULT);
}else{
ceInfo.setUserUuid(dm501Consignment.getUserId());
}
//发件人邮箱
ceInfo.setShipperEmail(dm501Consignment.getShipperEmail());
//参考信息
......@@ -190,29 +219,39 @@ public class Dm501Util {
* @param ceInfo
* @return com.fedex.connect.common.model.biz.Consignment
*/
public Consignment generateConsignment(CeInfo ceInfo) throws Exception{
public Consignment generateConsignment(CeInfo ceInfo,Email email) throws Exception{
Consignment rsConsignment;
/**
* 根据运单号查找30天之内运单
*/
Consignment consignment = consignmentRepository.findThirtyDaysAgoConByCode(ceInfo.getConsignmentCode());
if(Objects.isNull(consignment)){
//如果运单第一次获取,则不需要发送邮件
email = null;
Consignment resultConsignment = new Consignment();
BeanUtils.copyProperties(ceInfo,resultConsignment);
//运单状态赋值为"待上传"
// DictionaryEntries consignmentDicEntries = cacheSystem.getDicConsignmentStatus(ConsignmentStatusEnum.CONSIGNMENT_STATUS_01.getCode());
// resultConsignment.setStatusCode(consignmentDicEntries.getCode());
// resultConsignment.setStatusName(consignmentDicEntries.getEnglishName());
/**
* 初始化运单表原产国、目的国
*/
this.initOriginCountryDestinationCountry(ceInfo,resultConsignment);
/**
* 根据uuid查找运单信息
*/
User user = userRepository.findUserByUUid(resultConsignment.getUserUuid());
if(Objects.nonNull(user)){
resultConsignment.setCreateUserId(user.getId());
resultConsignment.setCreateUserName(user.getUserName());
}
/**
* 初始化表基础字段
*/
AssignmentFieldUtils.assignmentTableBaseField(resultConsignment);
rsConsignment = resultConsignment;
}else{
/**
* 初始化提醒邮件
*/
this.initNotificationEmail(email,consignment,ceInfo);
//ceInfo转换为consignment忽略字段
String[] ignoreProperties = Constant.CE_CONSIGNMENT_COPY_IGNORE_PROP_KEYS.IGNORE_PROPERTIES;
//字段拷贝
......@@ -226,6 +265,31 @@ public class Dm501Util {
return rsConsignment;
}
private void initNotificationEmail(Email email,Consignment consignment,CeInfo ceInfo) throws Exception{
/**
* 初始化提醒发件人邮件
*/
User userOld = userRepository.selectUserById(consignment.getSubmitterId());
if (StringUtils.isEmpty(consignment.getUserUuid()) && !userOld.getUserUuid().equals(ceInfo.getUserUuid())){
/**
* 初始化Email对象
*/
email.setBizId(consignment.getId());
email.setBizCode(consignment.getConsignmentCode());
String emailAddress = Optional.ofNullable(ceInfo.getUserUuid())
.map(userRepository::findUserByUUid)
.map(user -> StringUtils.defaultIfEmpty(user.getEmail(), ceInfo.getShipperEmail()))
.orElse(consignment.getShipperEmail());
email.setToAddress(emailAddress);
email.setSubject("");
email.setTypeName(EmailTypeEnum.NOTIFICATION_SENDER.getMsg());
email.setTypeCode(EmailTypeEnum.NOTIFICATION_SENDER.getCode());
email.setStatusName(EmailStatusEnum.PENDING.getMsg());
email.setStatusCode(EmailStatusEnum.PENDING.getCode());
AssignmentFieldUtils.assignmentTableBaseField(email);
}
}
/**
* @Author mt
* @Description 初始化运单表原产国、目的国
......@@ -272,4 +336,28 @@ public class Dm501Util {
}
return address;
}
/**
* @Author mt
* @Description 保存ce信息、以及运单表信息
* @Date 2024/11/1
* @param ceInfo
* @param consignment
* @return void
*/
@Transactional(rollbackFor = Exception.class)
public void saveCeInfoAndConsignment(CeInfo ceInfo, Consignment consignment,Email email){
ceInfoRepository.save(ceInfo);
//绑定ceInfo表Id
consignment.setCeInfoId(ceInfo.getId());
consignmentRepository.save(consignment);
//根据shipperAccount、uuid更新用户运单映射表ce标志
userConsignmentMappingRepository.updateUserChmMappingByAnUuId(consignment.getShipperAccount(),consignment.getUserUuid());
/**
* 保存入库
*/
if (email != null){
emailRepository.save(email);
}
}
}
\ No newline at end of file
......
......@@ -12,8 +12,8 @@ spring:
# 指定kafka server的地址,集群配多个,中间,逗号隔开
bootstrap-servers: 47.103.140.98:9092
#验证文件地址
iclear-kerberos-jaasPath: /opt/fedex/iclearConnect/conf/app_3537251_iclear_jaas.conf
iclear-kerberos-krb5: /opt/fedex/iclearConnect/conf/krb5.conf
iclear-kerberos-jaasPath: /opt/fedex/iclconnect/conf/app_3537251_iclear_jaas.conf
iclear-kerberos-krb5: /opt/fedex/iclconnect/conf/krb5.conf
#=============== provider =======================
producer:
#可以设置的值为:all, -1, 0, 1
......@@ -37,7 +37,7 @@ spring:
#topic-name
topic-name: fdx.apac.cn.shipment.import.cdm.iclear
# 指定默认消费者group id --> 由于在kafka中,同一组中的consumer不会读取到同一个消息,依靠groud.id设置组名
group-id: imp-exp-tw-dev
group-id: imp-exp-iclconnect-dev
# smallest和largest才有效,如果smallest重新0开始读取,如果是largest从logfile的offset读取。一般情况下我们都是设置smallest
auto-offset-reset: earliest
# enable.auto.commit:true --> 设置自动提交offset
......
spring:
datasource:
jndi-name: jdbc/iclearConnectDS
jndi-name: jdbc/iclconnectDS
profiles:
#系统环境
env: prod
......@@ -9,8 +9,8 @@ spring:
# 指定kafka server的地址,集群配多个,中间,逗号隔开
bootstrap-servers: papc0014.cndczmd.apac.fedex.com:52094,papc0015.cndczmd.apac.fedex.com:52094,papc0016.cndczmd.apac.fedex.com:52094,papc0017.cndczmd.apac.fedex.com:52094,papc0018.cndczmd.apac.fedex.com:52094,papc0019.cndczmd.apac.fedex.com:52094
#验证文件地址
iclear-kerberos-jaasPath: /opt/fedex/iclearConnect/conf/app_3537251_iclear_jaas.conf
iclear-kerberos-krb5: /opt/fedex/iclearConnect/conf/krb5.conf
iclear-kerberos-jaasPath: /opt/fedex/iclconnect/conf/app_3537251_iclear_jaas.conf
iclear-kerberos-krb5: /opt/fedex/iclconnect/conf/krb5.conf
#=============== provider =======================
producer:
#可以设置的值为:all, -1, 0, 1
......@@ -34,7 +34,7 @@ spring:
#topic-name
topic-name: fdx.apac.cn.shipment.import.cdm.iclear
# 指定默认消费者group id --> 由于在kafka中,同一组中的consumer不会读取到同一个消息,依靠groud.id设置组名
group-id: imp-exp-tw-prod
group-id: imp-exp-iclconnect-prod
# smallest和largest才有效,如果smallest重新0开始读取,如果是largest从logfile的offset读取。一般情况下我们都是设置smallest
auto-offset-reset: earliest
# enable.auto.commit:true --> 设置自动提交offset
......
spring:
datasource:
jndi-name: jdbc/iclearConnectDS
jndi-name: jdbc/iclconnectDS
profiles:
#系统环境
env: test
......@@ -9,8 +9,8 @@ spring:
# 指定kafka server的地址,集群配多个,中间,逗号隔开
bootstrap-servers: 47.103.140.98:9092
#验证文件地址
iclear-kerberos-jaasPath: /opt/fedex/iclearConnect/conf/app_3537251_iclear_jaas.conf
iclear-kerberos-krb5: /opt/fedex/iclearConnect/conf/krb5.conf
iclear-kerberos-jaasPath: /opt/fedex/iclconnect/conf/app_3537251_iclear_jaas.conf
iclear-kerberos-krb5: /opt/fedex/iclconnect/conf/krb5.conf
#=============== provider =======================
producer:
#可以设置的值为:all, -1, 0, 1
......@@ -34,7 +34,7 @@ spring:
#topic-name
topic-name: fdx.apac.cn.shipment.import.cdm.iclear
# 指定默认消费者group id --> 由于在kafka中,同一组中的consumer不会读取到同一个消息,依靠groud.id设置组名
group-id: imp-exp-tw-test
group-id: imp-exp-iclconnect-test
# smallest和largest才有效,如果smallest重新0开始读取,如果是largest从logfile的offset读取。一般情况下我们都是设置smallest
auto-offset-reset: earliest
# enable.auto.commit:true --> 设置自动提交offset
......
spring:
datasource:
jndi-name: jdbc/iclearConnectDS
jndi-name: jdbc/iclconnectDS
profiles:
#系统环境
env: uat
......@@ -9,8 +9,8 @@ spring:
# 指定kafka server的地址,集群配多个,中间,逗号隔开
bootstrap-servers: uapc0004.cndczmd.apac.fedex.com:52094,uapc0005.cndczmd.apac.fedex.com:52094,uapc0006.cndczmd.apac.fedex.com:52094,uapc0007.cndczmd.apac.fedex.com:52094,uapc0008.cndczmd.apac.fedex.com:52094,uapc0009.cndczmd.apac.fedex.com:52094
#验证文件地址
iclear-kerberos-jaasPath: /opt/fedex/iclearConnect/conf/app_3537251_iclear_jaas.conf
iclear-kerberos-krb5: /opt/fedex/iclearConnect/conf/krb5.conf
iclear-kerberos-jaasPath: /opt/fedex/iclconnect/conf/app_3537251_iclear_jaas.conf
iclear-kerberos-krb5: /opt/fedex/iclconnect/conf/krb5.conf
#=============== provider =======================
producer:
#可以设置的值为:all, -1, 0, 1
......@@ -34,7 +34,7 @@ spring:
#topic-name
topic-name: fdx.apac.cn.shipment.import.cdm.iclear
# 指定默认消费者group id --> 由于在kafka中,同一组中的consumer不会读取到同一个消息,依靠groud.id设置组名
group-id: imp-exp-tw-uat
group-id: imp-exp-iclconnect-uat
# smallest和largest才有效,如果smallest重新0开始读取,如果是largest从logfile的offset读取。一般情况下我们都是设置smallest
auto-offset-reset: earliest
# enable.auto.commit:true --> 设置自动提交offset
......
......@@ -37,3 +37,7 @@ mybatis:
#开启驼峰与下划线转换
map-underscore-to-camel-case: true
call-setters-on-nulls: true
#全局异常拦截是否生效
common:
exception-advice-webconfig:
enable: true
\ No newline at end of file
......
......@@ -2,7 +2,7 @@
<configuration>
<springProfile name="dev,uat,prod">
<!-- 日志存放路径 -->
<property name="log.path" value="/var/fedex/iclearConnect/weblogic/iclearConnect/kafka-cndc-server"></property>
<property name="log.path" value="/var/fedex/iclconnect/weblogic/kafka-cndc-server"></property>
</springProfile>
<springProfile name="test">
<!-- 日志存放路径 -->
......@@ -61,7 +61,7 @@
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/tw-kafka-log-info.%d{yyyy-MM-dd}.%i.log
<fileNamePattern>${log.path}/kafka-log-info.%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<!-- 日志最大的历史 30天 -->
<maxHistory>${log.maxHistory}</maxHistory>
......@@ -82,12 +82,12 @@
<appender name="file_error"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/tw-kafka-log-error.log</file>
<file>${log.path}/kafka-log-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/tw-kafka-log-error.%d{yyyy-MM-dd}.%i.log
<fileNamePattern>${log.path}/kafka-log-error.%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<!-- 日志最大的历史 30天 -->
<maxHistory>${log.maxHistory}</maxHistory>
......
#******************鉴权相关提示,需要做国际化******************
#authentication包
#没有访问权限
system_exception_10001=No access rights.
#没有通过权限认证
system_exception_10002=Failed to pass the authentication.
#登录身份异常
system_exception_10003=Login identity is abnormal.
#登录超过8小时,请重新登录
system_exception_10004=Login has exceeded 8 hours, please log in again.
#登录已过期,请重新登录
system_exception_10005=Login has expired, please log in again.
\ No newline at end of file
......
#******************鉴权相关提示,需要做国际化******************
#authentication包
system_exception_10001=没有访问权限
system_exception_10002=没有通过权限认证
system_exception_10003=登录身份异常
system_exception_10004=登录超过8小时,请重新登录
system_exception_10005=登录已过期
system_exception_10006=登录身份异常
system_exception_10007=登录已过期,请重新登录
\ No newline at end of file
#没有访问权限
system_exception_10001=No access rights.
#没有通过权限认证
system_exception_10002=Failed to pass the authentication.
#登录身份异常
system_exception_10003=Login identity is abnormal.
#登录超过8小时,请重新登录
system_exception_10004=Login has exceeded 8 hours, please log in again.
#登录已过期,请重新登录
system_exception_10005=Login has expired, please log in again.
\ No newline at end of file
......
#******************鉴权相关提示,需要做国际化******************
#authentication包
system_exception_10001=没有访问权限
system_exception_10002=没有通过权限认证
system_exception_10003=登录身份异常
system_exception_10004=登录超过8小时,请重新登录
system_exception_10005=登录已过期
system_exception_10006=登录身份异常
system_exception_10007=登录已过期,请重新登录
\ No newline at end of file
##******************鉴权相关提示,需要做国际化******************
##authentication包
#system_exception_10001=没有访问权限
#system_exception_10002=没有通过权限认证
#system_exception_10003=登录身份异常
#system_exception_10004=登录超过8小时,请重新登录
#system_exception_10005=登录已过期,请重新登录
\ No newline at end of file
......
......@@ -10,6 +10,7 @@ public enum FCLSessionInfoEnum {
FDX_LOGIN("fdx_login","FCL登录SESSION信息"),
FCL_UUID("fcl_uuid","FCL-UUID信息"),
FCL_OAUTH("ab45335bc623e59","FCL-oauth信息"),
FCL_CONTACTNAME("fcl_contactname","FCL联系人信息");
FCLSessionInfoEnum(String code, String name){
......
......@@ -7,15 +7,43 @@ import org.springframework.context.annotation.Configuration;
@Data
@Configuration
public class PropertiesConfig {
@Value("${fcl.interface.fedex_api_address}")
private String fedexApiAddress;
@Value("${fcl.login.url}")
private String fclLoginUrl;
@Value("${fcl.twidx.url}")
private String twIdxUrl;
@Value("${fcl.preClearIndex.url}")
private String preClearIndexUrl;
@Value("${fcl.interface.userinfo.url}")
private String userInfoUrl;
@Value("${fcl.interface.account.url}")
private String userAccountUrl;
@Value("${fcl.interface.shippingaccounts.url}")
private String userShippingaccountsUrl;
@Value("${fcl.login.redjrectLogin}")
private String redjrectLogin;
@Value("${spring.profiles.env}")
private String env;
@Value("${fcl.interface.token.url}")
private String fclTokenUrl;
@Value("${fcl.interface.token.grant_type}")
private String fclGrantType;
@Value("${fcl.interface.token.client_id}")
private String fclClientId;
@Value("${fcl.interface.token.client_secret}")
private String fclClientSecret;
@Value("${fcl.interface.token.scope}")
private String fclScope;
}
......
......@@ -7,6 +7,7 @@ import com.fedex.connect.common.dependencies.contants.ParamConfigConstants;
import com.fedex.connect.common.dependencies.contants.RedisConstants;
import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import com.fedex.connect.common.dependencies.enums.sys.UserLoginTypeEnum;
import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.common.dependencies.util.GsonUtils;
import com.fedex.connect.common.dependencies.util.JwtTokenUtils;
import com.fedex.connect.common.dependencies.util.StringExtUtil;
......@@ -15,9 +16,12 @@ import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.manager.common.enums.FCLSessionInfoEnum;
import com.fedex.connect.manager.controller.base.BaseController;
import com.fedex.connect.manager.controller.sys.ISysAuthController;
import com.fedex.connect.manager.data.dto.FclInfoDto;
import com.fedex.connect.manager.data.dto.LogLoginDto;
import com.fedex.connect.manager.data.dto.LoginRequest;
import com.fedex.connect.manager.data.dto.SysUserDto;
import com.fedex.connect.manager.enums.ResponseCode;
import com.fedex.connect.manager.util.LoginControllerUtils;
import com.fedex.connect.manager.util.ParamConfigUtil;
import com.google.gson.JsonObject;
import io.jsonwebtoken.Claims;
......@@ -56,6 +60,9 @@ public class SysAuthController extends BaseController implements ISysAuthControl
@Autowired
private ParamConfigUtil paramConfigUtil;
@Autowired
private LoginControllerUtils loginControllerUtils;
@Value("${fcl.interface.logurl}")
private String fclIndexLoginUrl;
......@@ -86,17 +93,18 @@ public class SysAuthController extends BaseController implements ISysAuthControl
List<String> cookiesList = new ArrayList();
List<String> saveKeyList = FCLSessionInfoEnum.getCodeList();
sysUserService.getFclData(request,cookiesList,saveKeyList);
log.info("cookiesList.size():{},saveKeyList:{}",cookiesList.size(),saveKeyList.size());
if (cookiesList.size() > 0 && cookiesList.size() == saveKeyList.size()){
JsonObject jsonObject = GsonUtils.stringToBean("{"+String.join(",",cookiesList)+"}",JsonObject.class);
ResponseVo tokenResult = sysAuthService.createFclToken(jsonObject);
if (tokenResult.isSuccess()){
String fcl_token_key = String.valueOf(tokenResult.getData());
String redirectUrl = String.format("%s?token=%s", paramConfigUtil.getParamValue(ParamConfigConstants.FCL_PARAM_KEYS.FCL_LOGIN_URL), fcl_token_key);
System.out.println(redirectUrl);
log.info("redirectUrl :{}",redirectUrl);
res.sendRedirect(redirectUrl);
}
}else {
res.sendRedirect(propertiesConfig.getTwIdxUrl());
res.sendRedirect(propertiesConfig.getPreClearIndexUrl());
}
} catch (IOException e) {
......@@ -121,14 +129,27 @@ public class SysAuthController extends BaseController implements ISysAuthControl
if (StringUtils.isBlank(fcl_token_key)){
return;
}
JsonObject jsonObject = sysAuthService.getFclToken(fcl_token_key);
String fcl_uuid = jsonObject.get(FCLSessionInfoEnum.FCL_UUID.getCode()).getAsString();
String fcl_contactname = jsonObject.get(FCLSessionInfoEnum.FCL_CONTACTNAME.getCode()).getAsString().replaceAll("\"","");
JsonObject tokenInfo = sysAuthService.getFclToken(fcl_token_key);
/**
* 获取fcl相关信息
*/
FclInfoDto fclInfoDto = loginControllerUtils.getFclInfo(tokenInfo);
String fcl_uuid = fclInfoDto.getFclUuid();
String fcl_contactname = fclInfoDto.getFclContactname();
User loginUser = sysUserService.findUserByFcl(fcl_uuid);
if (loginUser == null){
//如果用户不存在,则创建FCL用户信息
SysUserDto dto = new SysUserDto(fcl_uuid, fcl_contactname);
sysUserService.initUserInfo(fclInfoDto,dto);
try {
/**
* 初始化表基础字段
*/
AssignmentFieldUtils.assignmentTableBaseField(dto);
}catch(Exception ex){
log.error("用户登录初始化账号基础信息失败:",ex);
}
loginUser = sysUserService.save(dto);
} else {
//首先对用户中的姓名进行解密
......@@ -139,7 +160,6 @@ public class SysAuthController extends BaseController implements ISysAuthControl
}
}
//如果名称和原来不一样,则更新
if(StringUtils.isNotBlank(fcl_contactname) && !fcl_contactname.equals(loginUser.getUserName())){
String encode_fcl_contactname = StringUtils.trimToEmpty(fcl_contactname);
if (StringUtils.isNotBlank(encode_fcl_contactname)){
......@@ -147,7 +167,15 @@ public class SysAuthController extends BaseController implements ISysAuthControl
} else {
loginUser.setUserName(StringUtils.trimToEmpty(fcl_contactname));
}
loginUser.setModifyTime(new Date());
try {
/**
* 初始化表基础字段
*/
AssignmentFieldUtils.assignmentTableBaseField(loginUser);
}catch(Exception ex){
log.error("用户登录初始化账号基础信息失败:",ex);
}
sysUserService.initUserInfo(fclInfoDto,loginUser);
sysUserService.update(loginUser);
}
}
......@@ -157,20 +185,18 @@ public class SysAuthController extends BaseController implements ISysAuthControl
loginRequest.setRememberMe(true);
ResponseVo tokenResult = sysAuthService.createAccessToken(loginRequest, loginUser);
DictionaryEntries dicUserLoginType = cacheSystem.getDicUserLoginType(UserLoginTypeEnum.FCLLOGINREGISTRATION.getCode());
//记录日志
LogLoginDto dto = new LogLoginDto(loginUser.getId(), dicUserLoginType.getId(),
LogLoginDto dto = new LogLoginDto(loginUser.getId(), dicUserLoginType.getCode(),
UserLoginTypeEnum.LOGIN.getMsg());
logLoginService.saveLoginLog(dto);
try{
if (tokenResult.isSuccess()){
String redirectUrl = String.format("%s?token=%s&uid=%s", propertiesConfig.getRedjrectLogin(), tokenResult.getData(), loginUser.getId());
res.sendRedirect(redirectUrl);
log.info("wlgnLogin____________________finish:"+redirectUrl);
}else {
res.sendRedirect(propertiesConfig.getTwIdxUrl());
res.sendRedirect(propertiesConfig.getPreClearIndexUrl());
}
} catch (IOException e) {
log.error("FCL客户登录初始化 | 发生异常 | 异常如下:",e);
......@@ -243,7 +269,7 @@ public class SysAuthController extends BaseController implements ISysAuthControl
new SecurityContextLogoutHandler().logout(request, response, auth);
}
resultRS.setCode(HttpServletResponse.SC_OK);
resultRS.setMsg(localeMessageUtil.getMessage("system_exception_40007"));
resultRS.setMsg(localeMessageUtil.getMessage(ResponseCode.MESSAGE_CODE_40005.getMsg()));
//清理redis中token
String token = request.getHeader(SecurityConstants.TOKEN_HEADER);
......@@ -264,7 +290,7 @@ public class SysAuthController extends BaseController implements ISysAuthControl
return resultRS;
} catch (Exception e) {
log.error("登出3失败",e);
resultRS.setMsg(localeMessageUtil.getMessage("system_exception_40008"));
resultRS.setMsg(localeMessageUtil.getMessage(ResponseCode.MESSAGE_CODE_40006.getMsg()));
resultRS.setCode(HttpServletResponse.SC_BAD_REQUEST);
} finally {
if (!org.springframework.util.StringUtils.isEmpty(id)){
......@@ -272,7 +298,7 @@ public class SysAuthController extends BaseController implements ISysAuthControl
//插入日志
User sysUser = sysUserService.findById(Long.parseLong(id));
DictionaryEntries dicUserLoginType = cacheSystem.getDicUserLoginType(UserLoginTypeEnum.EXIT.getCode());
LogLoginDto dto = new LogLoginDto(sysUser.getId(), dicUserLoginType.getId(),
LogLoginDto dto = new LogLoginDto(sysUser.getId(), dicUserLoginType.getCode(),
UserLoginTypeEnum.EXIT.getMsg());
logLoginService.saveLoginLog(dto);
}
......
......@@ -30,13 +30,13 @@ public class SysUserController extends BaseController implements ISysUserControl
}
if (sysUser.getId() == null || sysUser.getId() == 0){
responseUtils.fail(ResponseCode.MESSAGE_CODE_40005);
responseUtils.fail(ResponseCode.MESSAGE_CODE_40001);
}
//返回用户信息
return responseUtils.success(sysUser);
} catch (Exception e){
log.error("获取用户信息失败",e);
responseUtils.fail(ResponseCode.MESSAGE_CODE_40006);
responseUtils.fail(ResponseCode.MESSAGE_CODE_40001);
}
return success;
}
......@@ -56,7 +56,7 @@ public class SysUserController extends BaseController implements ISysUserControl
return responseUtils.success(sysUser);
} catch (Exception e){
log.error("获取用户信息失败",e);
responseUtils.fail(ResponseCode.MESSAGE_CODE_40006);
responseUtils.fail(ResponseCode.MESSAGE_CODE_40001);
}
return success;
}
......
package com.fedex.connect.manager.data.dto;
import lombok.Data;
/**
* @Author mt
* @Description fcl登录信息
* @Date 2025/5/26
*/
@Data
public class FclInfoDto {
//fcl身份认证oauth
String oAuthSecret;
//fdxLogin信息
String fdxLogin;
//用户uuid
String fclUuid;
//用户名称
String fclContactname;
//用户登录账号
String userId;
//用户邮箱
String emailAddress;
//用户计费账号
String shipperAccounts;
}
package com.fedex.connect.manager.data.dto;
import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.common.model.log.UserLoginInfo;
import lombok.Data;
import java.net.InetAddress;
import java.net.UnknownHostException;
......@@ -12,12 +14,13 @@ import java.util.Date;
* 不建议反射:数据量上来反射copy很慢。set最快
* dao 转dto 看业务是否需要了。
*/
@Data
public class LogLoginDto {
/**
* 重载构造函数
*/
public LogLoginDto(Long userId, Long operType, String operDesc){
public LogLoginDto(Long userId, String operType, String operDesc){
this.userId = userId;
this.operTime = new Date();
this.operType = operType;
......@@ -42,9 +45,19 @@ public class LogLoginDto {
if (dto.getId() != null && dto.getId() != 0){
log.setId(dto.getId());
}
log.setOperTypeCode(dto.getOperType());
log.setOperTypeName(dto.getOperDesc());
log.setUserId(dto.getUserId());
log.setOperDesc(dto.getOperDesc());
log.setIp(dto.getIp());
try {
/**
* 初始化表基础字段
*/
AssignmentFieldUtils.assignmentTableBaseField(log);
}catch(Exception ex){
ex.printStackTrace();
}
return log;
}
......@@ -66,9 +79,14 @@ public class LogLoginDto {
/**
* 操作类型
1:登录 2:退出 3:修改密码4:FCL登录注册
userLoginType_01 登录
userLoginType_02 退出
userLoginType_03 修改密码
userLoginType_04 FCL登录注册
userLoginType_05 停用
userLoginType_06 启用
*/
private Long operType;
private String operType;
/**
* 操作描述
......@@ -79,64 +97,4 @@ public class LogLoginDto {
* IP
*/
private String ip;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Date getOperTime() {
return operTime;
}
public void setOperTime(Date operTime) {
this.operTime = operTime;
}
public Long getOperType() {
return operType;
}
public void setOperType(Long operType) {
this.operType = operType;
}
public String getOperDesc() {
return operDesc;
}
public void setOperDesc(String operDesc) {
this.operDesc = operDesc;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public LogLoginDto() {
}
public LogLoginDto(Long id, Long userId, Date operTime, Long operType, String operDesc, String ip) {
this.id = id;
this.userId = userId;
this.operTime = operTime;
this.operType = operType;
this.operDesc = operDesc;
this.ip = ip;
}
}
......
......@@ -46,6 +46,8 @@ public class SysUserDto {
user.setTypeCode(dto.getTypeCode());
user.setUserUuid(dto.getUserUuid());
user.setTypeName(dto.getTypeName());
user.setAddflag1(dto.getAddflag1());
user.setAddflag2(dto.getAddflag2());
return user;
}
......@@ -60,7 +62,7 @@ public class SysUserDto {
this.userName = fcl_acc_no;
}
this.typeCode = UserTypeEnum.FCL.getCode();
this.typeName = UserTypeEnum.FCL.getMsg();
this.typeName = UserTypeEnum.FCL.getEnMsg();
this.password = fcl_pwd;
this.loginName = uuid;
this.email = null;
......@@ -69,6 +71,8 @@ public class SysUserDto {
this.unifiedBusinessNum = null;
this.customsSerialNum = null;
this.userUuid = uuid;
this.addflag1 = 1;
this.addflag2 = 1;
}
/**
......@@ -167,5 +171,15 @@ public class SysUserDto {
@JsonIgnore
private String remark;
/**
* ADD时弹出提示1
*/
private Integer addflag1;
/**
* ADD时弹出提示2
*/
private Integer addflag2;
}
......
package com.fedex.connect.manager.data.vo;
import lombok.Data;
@Data
public class EanTwoVo {
private String defaultEanInfo;
private String accountNumberInfo;
}
package com.fedex.connect.manager.data.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author mt
* @Description FCL接口获取用户信息-响应数据对象
* @Date 2025/5/27
*/
@Data
public class FCLAccountsResponseVo implements Serializable {
private String transactionId;
private OutPut output;
@Data
public static class OutPut implements Serializable{
List<FCLCustomerAccount> customerAccountList;
}
@Data
public static class FCLCustomerAccount implements Serializable{
private Account account;
private List<ActiveAppRoleInfo> activeAppRoleInfos;
}
/**
* 账号信息
*/
@Data
public static class Account implements Serializable{
private AccountIdentifier accountIdentifier;
}
@Data
public static class ActiveAppRoleInfo implements Serializable{
private String appName;
private String roleCode;
private Integer roleLevelCode;
}
@Data
public static class AccountIdentifier implements Serializable{
/**
* 账号对应EAN信息
*/
private AccountNumber accountNumber;
private String accountNickname;
private String displayName;
private Boolean meterNumberAvailable;
}
@Data
public static class AccountNumber implements Serializable{
private String value;
private String key;
}
}
package com.fedex.connect.manager.data.vo;
import lombok.Data;
/**
* @Author mt
* @Description FCL接口获取token响应对象
* @Date 2025/5/27
*/
@Data
public class FCLTokenResponseVo {
private String access_token;
private String token_type;
private Long expires_in;
private String scope;
public String getAuthorization(){
return this.toString(this.token_type) + " " + this.toString(this.access_token);
}
private String toString(String str) {
return str == null ? "" : str;
}
}
package com.fedex.connect.manager.data.vo;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author mt
* @Description FCL接口获取用户信息-响应数据对象
* @Date 2025/5/26
*/
@Data
public class FCLUserInfoResponseVo implements Serializable {
private String transactionId;
private OutPut output;
@Data
public static class OutPut implements Serializable{
UserProfile userProfile;
}
@Data
public static class UserProfile implements Serializable{
private Boolean profileLocked;
private LoginInformation loginInformation;
private UserProfileAddress userProfileAddress;
private String lastProfileModifiedDate;
private String uuid;
}
@Data
public static class LoginInformation implements Serializable{
/**
* 用户账号信息
*/
private String userId;
private Boolean emailAsUserId;
private SecretQuestion secretQuestion;
}
@Data
public static class SecretQuestion implements Serializable{
private String code;
private String text;
}
@Data
public static class UserProfileAddress implements Serializable{
private Contact contact;
private ContactAncillaryDetail contactAncillaryDetail;
private Address address;
}
@Data
public static class Contact implements Serializable{
private PersonName personName;
private String companyName;
private String phoneNumber;
private String faxNumber;
private String emailAddress;
}
@Data
public static class PersonName implements Serializable{
private String firstName;
private String middleName;
private String lastName;
}
@Data
public static class ContactAncillaryDetail implements Serializable{
private List<PhoneNumberDetails> phoneNumberDetails;
}
@Data
public static class PhoneNumberDetails implements Serializable{
private String type;
private Number number;
private JSONObject permissions;
}
@Data
public static class Number implements Serializable{
private String countryCode;
private String localNumber;
}
@Data
public static class Address implements Serializable{
private List<String> streetLines;
private String city;
private String stateOrProvinceCode;
private String postalCode;
private String countryCode;
private Boolean residential;
}
}
package com.fedex.connect.manager.data.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class FclEanTwoResponseVo implements Serializable{
private String transactionId;
private Output output;
@Data
public static class Output implements Serializable {
private Boolean success;
private List<AccountInfoVO> accountInfoVOs;
}
@Data
public static class AccountInfoVO implements Serializable {
private DefaultAccount defaultAccount;
private List<AssociatedAccount> associatedAccountList;
}
@Data
public static class DefaultAccount implements Serializable {
private String value;
private String key;
}
@Data
public static class AssociatedAccount implements Serializable {
private AccountNumber accountNumber;
private String accountNickname;
private String accountDisplayName;
}
@Data
public static class AccountNumber implements Serializable {
private String value;
private String key;
}
}
package com.fedex.connect.manager.data.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author mt
* @Description 调取用户信息返回VO
* @Date 2025/5/26
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserDataApiVo {
private String userId;
private String emailAddress;
private String uuid;
private String userName;
}
......@@ -13,7 +13,6 @@ public enum ResponseCode {
MESSAGE_CODE_40004(40004,"system_exception_40004"),
MESSAGE_CODE_40005(40005,"system_exception_40005"),
MESSAGE_CODE_40006(40006,"system_exception_40006"),
MESSAGE_CODE_40007(40007,"system_exception_40007"),
;
private Integer code;
private String msg;
......
......@@ -11,8 +11,8 @@ import java.util.List;
public interface PrivilegeExtMapper {
@Select({
"<script>",
"SELECT * FROM T_SYS_PRIVILEGE",
"WHERE ID IN",
"SELECT * FROM T_SYS_PRIVILEGE ",
"WHERE ID IN ",
"<foreach collection='ids' item='id' open='(' separator=',' close=')'>",
"#{id}",
"</foreach>",
......
......@@ -9,7 +9,7 @@ import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class RedisSlabExtImpl extends AbstractDaoRepository implements IRedisSlabRepository {
public class RedisSlabRepositoryImpl extends AbstractDaoRepository implements IRedisSlabRepository {
@Override
public int insert(RedisSlab record) {
......
......@@ -9,7 +9,7 @@ import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class UserExtRepositoryImpl extends AbstractDaoRepository implements IUserRepository {
public class UserRepositoryImpl extends AbstractDaoRepository implements IUserRepository {
@Override
public List<User> selectByExample(UserExample example) {
......
package com.fedex.connect.manager.service.log.impl;
import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.manager.data.dto.LogLoginDto;
import com.fedex.connect.manager.data.model.LogShowModel;
import com.fedex.connect.manager.service.base.BaseService;
......
......@@ -2,6 +2,7 @@ package com.fedex.connect.manager.service.sys;
import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.manager.data.bo.AddFlagBo;
import com.fedex.connect.manager.data.dto.FclInfoDto;
import com.fedex.connect.manager.data.dto.SysUserDto;
import javax.servlet.http.HttpServletRequest;
......@@ -19,4 +20,24 @@ public interface ISysUserService {
User findById(Long id);
void updateAddFlag(User user, AddFlagBo bo);
/**
* @Author mt
* @Description 构造用户信息
* @Date 2025/5/27
* @param fclInfoDto
* @param loginUser
* @return void
*/
void initUserInfo(FclInfoDto fclInfoDto,SysUserDto loginUser);
/**
* @Author mt
* @Description 构造用户信息
* @Date 2025/5/27
* @param fclInfoDto
* @param loginUser
* @return void
*/
void initUserInfo(FclInfoDto fclInfoDto, User loginUser);
}
......
package com.fedex.connect.manager.service.sys.impl;
import com.fedex.connect.common.dependencies.contants.DatabaseConstants;
import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.common.model.sys.UserRole;
import com.fedex.connect.manager.data.model.LogShowModel;
import com.fedex.connect.manager.service.base.BaseService;
......@@ -34,8 +35,14 @@ public class SysUserRoleServiceImpl extends BaseService implements ISysUserRoleS
userRole.setUserId(userId);
userRole.setRoleId(roleId);
userRole.setStatus(DatabaseConstants.GLOBAL_STATUS_VALID);
userRole.setCreateTime(new Date());
userRole.setModifyTime(new Date());
try {
/**
* 初始化表基础字段
*/
AssignmentFieldUtils.assignmentTableBaseField(userRole);
}catch(Exception ex){
ex.printStackTrace();
}
return userRoleRepository.insert(userRole);
} catch (Exception e){
log.error(LogShowModel.showException("Exception",e));
......
......@@ -5,6 +5,7 @@ import com.fedex.connect.common.dependencies.authentication.EncryptProvider;
import com.fedex.connect.common.dependencies.cache.CacheSystem;
import com.fedex.connect.common.dependencies.contants.DatabaseConstants;
import com.fedex.connect.common.dependencies.enums.sys.RoleEnum;
import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.common.dependencies.util.Utils;
import com.fedex.connect.common.model.bi.DictionaryEntries;
import com.fedex.connect.common.model.sys.Role;
......@@ -12,6 +13,7 @@ import com.fedex.connect.common.model.sys.User;
import com.fedex.connect.common.model.sys.UserExample;
import com.fedex.connect.manager.config.PropertiesConfig;
import com.fedex.connect.manager.data.bo.AddFlagBo;
import com.fedex.connect.manager.data.dto.FclInfoDto;
import com.fedex.connect.manager.data.dto.SysUserDto;
import com.fedex.connect.manager.data.model.LogShowModel;
import com.fedex.connect.manager.service.base.BaseService;
......@@ -70,7 +72,7 @@ public class SysUserServiceImpl extends BaseService implements ISysUserService {
UserExample example = new UserExample();
UserExample.Criteria criteria = example.createCriteria();
criteria.andStatusEqualTo(DatabaseConstants.GLOBAL_STATUS_VALID);
criteria.andLoginNameEqualTo(fclUuid);
criteria.andUserUuidEqualTo(fclUuid);
//criteria.andFedexAccNoEqualTo(fclUuid);
example.setOrderByClause("ID DESC");
......@@ -83,7 +85,7 @@ public class SysUserServiceImpl extends BaseService implements ISysUserService {
//返回匹配出来第一个账户信息
return Utils.first(resultUserList);
} catch (Exception e){
log.error(LogShowModel.showException("Exception",e));
log.error("findUserByFcl error : ",e);
return null;
}
}
......@@ -131,6 +133,14 @@ public class SysUserServiceImpl extends BaseService implements ISysUserService {
@Transactional(rollbackFor = Exception.class)
public int saveSysUser(User user){
try{
try {
/**
* 初始化表基础字段
*/
AssignmentFieldUtils.assignmentTableBaseField(user);
}catch(Exception ex){
log.error("记录用户信息基础信息失败:",ex);
}
return userRepository.insert(user);
} catch (Exception e){
log.error(LogShowModel.showException("Exception",e));
......@@ -165,8 +175,7 @@ public class SysUserServiceImpl extends BaseService implements ISysUserService {
@Override
public void getFclData(HttpServletRequest request,List<String> cookiesList,List<String> saveKeyList) {
if (!propertiesConfig.getEnv().equalsIgnoreCase("dev")
&& !propertiesConfig.getEnv().equalsIgnoreCase("test")
&& !propertiesConfig.getEnv().equalsIgnoreCase("uat")) {
&& !propertiesConfig.getEnv().equalsIgnoreCase("test")) {
Cookie[] cookies = request.getCookies();
if (Utils.isEmpty(cookies)){
return;
......@@ -217,5 +226,43 @@ public class SysUserServiceImpl extends BaseService implements ISysUserService {
userRepository.updateByPrimaryKeySelective(user);
}
/**
* @Author mt
* @Description 构造用户信息
* @Date 2025/5/27
* @param fclInfoDto
* @param loginUser
* @return void
*/
public void initUserInfo(FclInfoDto fclInfoDto,SysUserDto loginUser){
if (StringUtils.isNotEmpty(fclInfoDto.getUserId())){
loginUser.setLoginName(fclInfoDto.getUserId());
}
if(StringUtils.isNotEmpty(fclInfoDto.getEmailAddress())){
loginUser.setEmail(fclInfoDto.getEmailAddress());
}
if(StringUtils.isNotEmpty(fclInfoDto.getShipperAccounts())){
loginUser.setAccountNo(fclInfoDto.getShipperAccounts());
}
}
/**
* @Author mt
* @Description 构造用户信息
* @Date 2025/5/27
* @param fclInfoDto
* @param loginUser
* @return void
*/
public void initUserInfo(FclInfoDto fclInfoDto,User loginUser){
if (StringUtils.isNotEmpty(fclInfoDto.getUserId())){
loginUser.setLoginName(fclInfoDto.getUserId());
}
if(StringUtils.isNotEmpty(fclInfoDto.getEmailAddress())){
loginUser.setEmail(fclInfoDto.getEmailAddress());
}
if(StringUtils.isNotEmpty(fclInfoDto.getShipperAccounts())){
loginUser.setAccountNo(fclInfoDto.getShipperAccounts());
}
}
}
......
package com.fedex.connect.manager.util;
import com.alibaba.fastjson.JSON;
import com.fedex.connect.manager.common.enums.FCLSessionInfoEnum;
import com.fedex.connect.manager.config.PropertiesConfig;
import com.fedex.connect.manager.data.dto.FclInfoDto;
import com.fedex.connect.manager.data.vo.*;
import com.google.gson.JsonObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.net.URLDecoder;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
* @Author mt
* @Description 登录相关util
* @Date 2025/5/26
*/
@Slf4j
@Component
public class LoginControllerUtils {
/**
* 普通访问
*/
@Autowired
private RestTemplate restTemplate;
@Autowired
private PropertiesConfig propertiesConfig;
private HttpEntity<String> initHeader(String secretValue,String fdxLogin){
FCLTokenResponseVo fclInterfaceToken = this.getFclInterfaceToken();
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", fclInterfaceToken.getAuthorization());
List<String> cookieList = new ArrayList<>();
if (StringUtils.isNotBlank(fdxLogin)) {
cookieList.add("fdx_login=" + fdxLogin);
}
if (StringUtils.isNotBlank(secretValue)){
cookieList.add(secretValue);
}
headers.set("Cookie", StringUtils.join(cookieList, ";"));
HttpEntity<String> entity = new HttpEntity("", headers);
log.info("apiExchange | entity: {}", JSON.toJSONString(entity));
return entity;
}
public FclInfoDto getFclInfo(JsonObject tokenInfo){
FclInfoDto fclInfoDto = new FclInfoDto();
String secretValue;
String fdxLogin;
HttpEntity<String> entity = null;
try {
/**
* 获取认证oauth
*/
secretValue = this.getOauthSecret(tokenInfo);
/**
* 获取fdxInfo信息
*/
fdxLogin = this.getFdxLogin(tokenInfo);
/**
* 构造请求头
*/
entity = this.initHeader(secretValue,fdxLogin);
ResponseEntity<String> resp = restTemplate.exchange(propertiesConfig.getUserInfoUrl(), HttpMethod.GET, entity, String.class);
log.info("apiExchange | resp: {}", JSON.toJSONString(resp));
String body = resp.getBody();
FCLUserInfoResponseVo fclUserInfoResponse = JSON.parseObject(body, FCLUserInfoResponseVo.class);
//获取email和userId
UserDataApiVo userDataApiVo = this.createUserDataApiVo(fclUserInfoResponse);
fclInfoDto.setFclContactname(userDataApiVo.getUserName());
String fcl_uuid = this.getUuid(tokenInfo,userDataApiVo.getUuid());
//去除多余双引号
Pattern pattern = Pattern.compile("\"");
fcl_uuid = pattern.matcher(fcl_uuid).replaceAll("");
/**
* 对用户名进行解码处理
*/
String fcl_contactname = this.decodeMultiLevelUrl(this.getFclContactName(tokenInfo,userDataApiVo.getUserName()));
fclInfoDto.setFclUuid(fcl_uuid);
fclInfoDto.setFclContactname(fcl_contactname);
fclInfoDto.setOAuthSecret(secretValue);
fclInfoDto.setFdxLogin(fdxLogin);
fclInfoDto.setUserId(userDataApiVo.getUserId());
fclInfoDto.setEmailAddress(userDataApiVo.getEmailAddress());
}catch(Exception ex){
String errorInfo = String.format("getFclInfo | fdxLogin: %s, secretValue: %s url: %s, userId: %s ",
fclInfoDto.getFdxLogin(), fclInfoDto.getOAuthSecret(), propertiesConfig.getUserInfoUrl(),fclInfoDto.getUserId());
log.error(errorInfo, ex);
}finally{
/**
* 获取用户计费账号
*/
String shipperAccount = this.getShipperAccount(entity,fclInfoDto);
fclInfoDto.setShipperAccounts(shipperAccount);
}
return fclInfoDto;
}
/**
* @Author mt
* @Description 调用接口获取用户计费账号
* @Date 2025/5/27
* @param entity
* @param fclInfoDto
* @return java.lang.String
*/
private String getShipperAccount(HttpEntity<String> entity,FclInfoDto fclInfoDto){
if(Objects.isNull(entity)){
return "";
}
/**
* 将连个接口的EAN拆分后去重再合并
*/
String shipperAccountApi1 = null;
String shipperAccountApi2 = null;
/**
* 获取shipperAccount接口1: /administration/v1/users/shippingaccounts
*/
try{
ResponseEntity<String> resp = restTemplate.exchange(propertiesConfig.getUserShippingaccountsUrl(), HttpMethod.GET, entity, String.class);
log.info("apiExchange | resp: {}", JSON.toJSONString(resp));
FclEanTwoResponseVo fclAccountsResponse = JSON.parseObject(resp.getBody(), FclEanTwoResponseVo.class);
EanTwoVo eanInfo = this.getEanByEanTwoApi(fclAccountsResponse);
String ext1 = eanInfo.getDefaultEanInfo();
String ext2 = eanInfo.getAccountNumberInfo();
shipperAccountApi1 = (StringUtils.isNotEmpty(ext1) && StringUtils.isNotEmpty(ext2)) ? ext1 + "," + ext2 :
(StringUtils.isNotEmpty(ext1) ? ext1 : (StringUtils.isNotEmpty(ext2) ? ext2 : ""));
log.info("shipperAccountApi1 - getShipperAccount : {}",shipperAccountApi1);
}catch(Exception ex){
String errorInfo = String.format("getShipperAccount api1 | fdxLogin: %s, secretValue: %s url: %s, userId: %s",
fclInfoDto.getFdxLogin(), fclInfoDto.getOAuthSecret(), propertiesConfig.getUserInfoUrl(),fclInfoDto.getUserId());
log.error(errorInfo, ex);
}
/**
* 补偿shipperAccount
* 获取shipperAccount接口2:/user/v2/accounts
*/
try{
ResponseEntity<String> resp = restTemplate.exchange(propertiesConfig.getUserAccountUrl(), HttpMethod.GET, entity, String.class);
log.info("apiExchange | resp: {}", JSON.toJSONString(resp));
FCLAccountsResponseVo fclAccountsResponseVo = JSON.parseObject(resp.getBody(), FCLAccountsResponseVo.class);
shipperAccountApi2 = this.getEANInfo(fclAccountsResponseVo);
log.info("shipperAccountApi2 - getShipperAccount : {}",shipperAccountApi2);
}catch(Exception ex){
String errorInfo = String.format("getShipperAccount api2 | fdxLogin: %s, secretValue: %s url: %s, userId: %s",
fclInfoDto.getFdxLogin(), fclInfoDto.getOAuthSecret(), propertiesConfig.getUserInfoUrl(),fclInfoDto.getUserId());
log.error(errorInfo, ex);
}
/**
* 将连个接口的EAN拆分后去重再合并
*/
String userEANNumber = this.getUniqueStr(shipperAccountApi1,shipperAccountApi2);
return userEANNumber;
}
/**
* @Author mt
* @Description 将拼接好的两个EAN结果分割后去重再拼接
* @Date 2025/5/27
* @param eanOneExt1
* @param eanTwoExt1
* @return java.lang.String
*/
public String getUniqueStr(String eanOneExt1,String eanTwoExt1){
String userEANNumber = null;
try {
// 创建一个Set用于去重
Set<String> uniqueElements = new HashSet<>();
// 将eanOneExt1按逗号分割并添加到Set中
if (StringUtils.isNotEmpty(eanOneExt1)) {
String[] eanOneElements = eanOneExt1.split(",");
for (String element : eanOneElements) {
uniqueElements.add(element.trim());
}
}
// 将eanTwoExt1按逗号分割并添加到Set中
if (StringUtils.isNotEmpty(eanTwoExt1)) {
String[] eanTwoElements = eanTwoExt1.split(",");
for (String element : eanTwoElements) {
uniqueElements.add(element.trim());
}
}
// 将List中的元素用逗号分隔符拼接成一个字符串
userEANNumber = String.join(",", uniqueElements);
}catch (Exception e){
String errorInfo = String.format("getUniqueStr | eanOneExt1 : %s | eanTwoExt1 : %s",eanOneExt1, eanTwoExt1);
log.error(errorInfo, e);
}
return userEANNumber;
}
/**
* @Author mt
* @Description 获取用户EAN信息-合并返回
* @Date 2025/5/27
* @param fclAccountsResponseVo
* @return java.lang.String
*/
private String getEANInfo(FCLAccountsResponseVo fclAccountsResponseVo){
List<String> eanNumberList = new ArrayList();
FCLAccountsResponseVo.OutPut output = fclAccountsResponseVo.getOutput();
List<FCLAccountsResponseVo.FCLCustomerAccount> customerAccountList = output.getCustomerAccountList();
for (int i = 0, maxi = customerAccountList.size(); i < maxi; i++) {
FCLAccountsResponseVo.FCLCustomerAccount fclCustomerAccount = customerAccountList.get(i);
String eanNumber = fclCustomerAccount.getAccount().getAccountIdentifier().getAccountNumber().getValue();
if(StringUtils.isNotEmpty(eanNumber)){
eanNumberList.add(eanNumber);
}
}
return StringUtils.join(eanNumberList, ",");
}
/**
* @Author mt
* @Description 根据EAN2号接口返回值获取EAN number
* @Date 2025/5/27
* @param body
* @return EanTwoVo
*/
public EanTwoVo getEanByEanTwoApi(FclEanTwoResponseVo body) {
EanTwoVo eanTwoVo = new EanTwoVo();
String defaultEanInfo = null;
String accountNumberInfo = null;
FclEanTwoResponseVo.Output output = body != null ? body.getOutput() : null;
if (output != null) {
List<FclEanTwoResponseVo.AccountInfoVO> accountInfoVOs = output.getAccountInfoVOs();
if (accountInfoVOs != null && !accountInfoVOs.isEmpty()) {
FclEanTwoResponseVo.AccountInfoVO accountInfoVO = accountInfoVOs.get(0);
//defaultEanInfo
FclEanTwoResponseVo.DefaultAccount defaultAccount = accountInfoVO.getDefaultAccount();
if (defaultAccount != null) {
defaultEanInfo = defaultAccount.getValue();
}
//accountNumberInfo
List<FclEanTwoResponseVo.AssociatedAccount> associatedAccountList = accountInfoVO.getAssociatedAccountList();
if (associatedAccountList != null && !associatedAccountList.isEmpty()) {
accountNumberInfo = associatedAccountList.stream()
.map(FclEanTwoResponseVo.AssociatedAccount::getAccountNumber)
.filter(Objects::nonNull)
.map(FclEanTwoResponseVo.AccountNumber::getValue)
.filter(value -> StringUtils.isNotEmpty(value))
.collect(Collectors.joining(","));
}
}
}
eanTwoVo.setDefaultEanInfo(defaultEanInfo);
eanTwoVo.setAccountNumberInfo(accountNumberInfo);
return eanTwoVo;
}
/**
* @Author mt
* @Description 构建获取用户信息Vo
* @Date 2025/5/26
* @param fclUserInfoResponse
* @return com.fedex.connect.manager.data.vo.UserDataApiVo
*/
public UserDataApiVo createUserDataApiVo(FCLUserInfoResponseVo fclUserInfoResponse) {
FCLUserInfoResponseVo.UserProfile userProfile = fclUserInfoResponse.getOutput().getUserProfile();
Optional<String> userId = Optional.ofNullable(userProfile)
.map(FCLUserInfoResponseVo.UserProfile::getLoginInformation)
.map(FCLUserInfoResponseVo.LoginInformation::getUserId);
Optional<String> emailAddress = Optional.ofNullable(userProfile)
.map(FCLUserInfoResponseVo.UserProfile::getUserProfileAddress)
.map(FCLUserInfoResponseVo.UserProfileAddress::getContact)
.map(FCLUserInfoResponseVo.Contact::getEmailAddress)
.filter(email -> !email.isEmpty());
Optional<String> uuid = Optional.ofNullable(userProfile)
.map(FCLUserInfoResponseVo.UserProfile :: getUuid);
Optional<String> firstNameOpt = Optional.ofNullable(userProfile)
.map(FCLUserInfoResponseVo.UserProfile::getUserProfileAddress)
.map(FCLUserInfoResponseVo.UserProfileAddress::getContact)
.map(FCLUserInfoResponseVo.Contact::getPersonName)
.map(personName -> personName.getFirstName());
Optional<String> lastNameOpt = Optional.ofNullable(userProfile)
.map(FCLUserInfoResponseVo.UserProfile::getUserProfileAddress)
.map(FCLUserInfoResponseVo.UserProfileAddress::getContact)
.map(FCLUserInfoResponseVo.Contact::getPersonName)
.map(personName -> personName.getLastName());
String userName = null;
if (firstNameOpt.isPresent() && lastNameOpt.isPresent()){
userName = firstNameOpt.get() + "+" + lastNameOpt.get();
}else if (firstNameOpt.isPresent()){
userName = firstNameOpt.get();
}if (lastNameOpt.isPresent()){
userName = lastNameOpt.get();
}
return new UserDataApiVo(userId.orElse(null), emailAddress.orElse(null),uuid.orElse(null),userName);
}
public FCLTokenResponseVo getFclInterfaceToken(){
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
MultiValueMap<String,String> postParameters = new LinkedMultiValueMap<>();
postParameters.put("client_id", Collections.singletonList(propertiesConfig.getFclClientId()));
postParameters.put("client_secret", Collections.singletonList(propertiesConfig.getFclClientSecret()));
postParameters.put("scope", Collections.singletonList(propertiesConfig.getFclScope()));
postParameters.put("grant_type", Collections.singletonList(propertiesConfig.getFclGrantType()));
HttpEntity<String> entity = new HttpEntity(postParameters,headers);
String fclTokenUrl = propertiesConfig.getFclTokenUrl();
ResponseEntity<FCLTokenResponseVo> resp = restTemplate.exchange(fclTokenUrl, HttpMethod.POST, entity, FCLTokenResponseVo.class);
return resp.getBody();
}
/**
* @Author mt
* @Description 获取fdxLogin
* @Date 2025/5/26
* @param tokenInfo
* @return java.lang.String
*/
private String getFdxLogin(JsonObject tokenInfo) {
if (tokenInfo == null) {
return "";
}
/**
* 先获取fdx_login
*/
return Optional.ofNullable(tokenInfo.get(FCLSessionInfoEnum.FDX_LOGIN.getCode()))
.map(Object::toString)
.orElse("");
}
/**
* @Author mt
* @Description 获取oauthSecret
* @Date 2025/5/26
* @param tokenInfo
* @return java.lang.String
*/
private String getOauthSecret(JsonObject tokenInfo){
Object secretValue = tokenInfo.get(FCLSessionInfoEnum.FCL_OAUTH.getCode());
if (secretValue != null) {
return FCLSessionInfoEnum.FCL_OAUTH.getCode() + "=" + secretValue.toString();
}
return "";
}
/**
* @Author mt
* @Description 安全获取用户名
* @Date 2025/5/26
* @param tokenInfo
* @param userName
* @return java.lang.String
*/
private String getFclContactName(JsonObject tokenInfo,String userName){
String fcl_contactname = "";
if (tokenInfo != null) {
Object contactObj = tokenInfo.get(FCLSessionInfoEnum.FCL_CONTACTNAME.getCode());
if (contactObj != null) {
fcl_contactname = contactObj.toString().replace("\"", "");
}
}
if (StringUtils.isBlank(fcl_contactname) && StringUtils.isNotBlank(userName)){
fcl_contactname = userName;
}
return fcl_contactname;
}
/**
* @Author mt
* @Description 获取uuid
* @Date 2025/5/26
* @param tokenInfo
* @param uuidApi
* @return java.lang.String
*/
private String getUuid(JsonObject tokenInfo, String uuidApi) {
return Optional.ofNullable(tokenInfo)
.map(info -> info.get(FCLSessionInfoEnum.FCL_UUID.getCode()))
.map(Objects::toString)
.orElseGet(() -> Optional.ofNullable(uuidApi)
.orElse(""));
}
/**
* @Author mt
* @Description 对用户名进行解码处理
* @Date 2025/5/26
* @param encodedStr
* @return java.lang.String
*/
private String decodeMultiLevelUrl(String encodedStr) {
if (StringUtils.isBlank(encodedStr)){
return "";
}
String current = encodedStr;
String previous;
do {
previous = current;
try {
current = URLDecoder.decode(current, "UTF-8");
} catch (Exception e) {
return current;
}
} while (!current.equals(previous));
return current;
}
}
......@@ -8,23 +8,7 @@ spring:
#系统环境
env: dev
export:
jwt:
securityKey: C*F-JaNdRgUkXn2r5u8x/A?D(G+KbPeShVmYq3s6v9y$B&E)H@McQfTjWnZr4u7w
urlWhiteList:
- /icleartw/auth
- /icleartw/monitor/ok
- /icleartw/sysUser/logout
- /icleartw/swagger-resources
- /icleartw/webjars
uriWhiteList:
- /icleartw/swagger-ui.html
- /icleartw/swagger-ui/*
- /icleartw/v2/api-docs
- /icleartw/login.html
expire_1H: 7200
expire_1D: 604800
mail:
smtp:
host: smtp.qiye.aliyun.com
......@@ -43,34 +27,27 @@ export:
language: zh_TW
emailActiveTime: 60
upload:
path:
declare: E:/var/fedex/exportTw/upload/declareFile
image: E:/var/fedex/exportTw/upload/brandImage
url:
loginIndex: http://47.103.140.98:8086/icleartw
twIdx: http://47.103.140.98/IcTw/
twIdxImg: https://declarationuat.fedex.com.cn/Exp/manager-server/
#fcl
fcl:
login:
url: http://exportdeclarationuat-tw.dmz.apac.fedex.com/icleartw/auth/wlgnLogin
redjrectLogin: https://exportdeclarationuat-tw.dmz.apac.fedex.com/IcTw/#/redjrectLogin
twidx:
url: http://exportdeclarationuat-tw.apac.fedex.com
url:
http://127.0.0.1:8083/manager-server/auth/wlgnLogin
redjrectLogin: http://127.0.0.1/ipc/#/redjrectLogin
preClearIndex:
url: http://127.0.0.1:8083/ipc
interface:
logurl: https://www.fedex.com/secure-login/zh-tw/#/login-credentials?redirectUrl=http://exportdeclarationuat-tw.dmz.apac.fedex.com/icleartw/auth/wlgnForward
fedex_api_address: https://api.fedex.com
logurl: https://www.fedex.com/secure-login/en-us/#/login-credentials?redirectUrl=http://iclear-connectuat.apac.fedex.com/manager-server/auth/wlgnForward
fedex_api_address: https://api.fedex.com.cn
proxy_url: cn2-proxy.apac.fedex.com:3128
token:
url: /auth/oauth/v2/token
url: ${fcl.interface.fedex_api_address}/auth/oauth/v2/token
grant_type : client_credentials
client_id: l7c13f958213e04d1280f807789bd783a3
client_secret: 3d43932198b6467a8e20d024bfa82e1c
scope: oob
account:
url: /user/v2/accounts
url: ${fcl.interface.fedex_api_address}/user/v2/accounts
shippingaccounts:
url: ${fcl.interface.fedex_api_address}/administration/v1/users/shippingaccounts
userinfo:
url: /user/v2/users/userinfo
\ No newline at end of file
url: ${fcl.interface.fedex_api_address}/user/v2/users/userinfo
\ No newline at end of file
......
spring:
datasource:
jndi-name: jdbc/iclearConnectDS
jndi-name: jdbc/iclconnectDS
profiles:
#系统环境
env: prod
export:
jwt:
securityKey: C*F-JaNdRgUkXn2r5u8x/A?D(G+KbPeShVmYq3s6v9y$B&E)H@McQfTjWnZr4u7w
urlWhiteList:
- /icleartw/auth
- /icleartw/monitor/ok
- /icleartw/sysUser/logout
- /icleartw/swagger-resources
- /icleartw/webjars
uriWhiteList:
- /icleartw/swagger-ui.html
- /icleartw/swagger-ui/*
- /icleartw/v2/api-docs
- /icleartw/login.html
expire_1H: 7200
expire_1D: 604800
mail:
smtp:
host: mapper.gslb.fedex.com
......@@ -36,34 +21,26 @@ export:
language: zh_TW
emailActiveTime: 60
upload:
path:
declare: /var/share/icleartw/upload/declareFile
image: /var/share/icleartw/upload/brandImage
url:
loginIndex: https://exportdeclaration-tw.apac.fedex.com/IcTw/
twIdx: https://exportdeclaration-tw.apac.fedex.com/IcTw/
twIdxImg: https://declaration.fedex.com.cn/Exp/manager-server/
#fcl
fcl:
login:
url: https://exportdeclaration-tw.apac.fedex.com/icleartw/auth/wlgnLogin
redjrectLogin: https://exportdeclaration-tw.apac.fedex.com/IcTw/#/redjrectLogin
twidx:
preClearIndex:
url: https://exportdeclaration-tw.apac.fedex.com
interface:
logurl: https://www.fedex.com/secure-login/zh-tw/#/login-credentials?redirectUrl=https://exportdeclaration-tw.apac.fedex.com/icleartw/auth/wlgnForward
fedex_api_address: https://api.fedex.com
fedex_api_address: https://api.fedex.com.cn
proxy_url: cn2-proxy.apac.fedex.com:3128
token:
url: /auth/oauth/v2/token
url: ${fcl.interface.fedex_api_address}/auth/oauth/v2/token
grant_type : client_credentials
client_id: l7c13f958213e04d1280f807789bd783a3
client_secret: 3d43932198b6467a8e20d024bfa82e1c
scope: oob
account:
url: /user/v2/accounts
url: ${fcl.interface.fedex_api_address}/user/v2/accounts
shippingaccounts:
url: ${fcl.interface.fedex_api_address}/administration/v1/users/shippingaccounts
userinfo:
url: /user/v2/users/userinfo
\ No newline at end of file
url: ${fcl.interface.fedex_api_address}/user/v2/users/userinfo
\ No newline at end of file
......
spring:
datasource:
jndi-name: jdbc/iclearConnectDS
jndi-name: jdbc/iclconnectDS
profiles:
#系统环境
env: test
export:
jwt:
securityKey: C*F-JaNdRgUkXn2r5u8x/A?D(G+KbPeShVmYq3s6v9y$B&E)H@McQfTjWnZr4u7w
urlWhiteList:
- /icleartw/auth
- /icleartw/monitor/ok
- /icleartw/sysUser/logout
- /icleartw/swagger-resources
- /icleartw/webjars
uriWhiteList:
- /icleartw/swagger-ui.html
- /icleartw/swagger-ui/*
- /icleartw/v2/api-docs
- /icleartw/login.html
expire_1H: 7200
expire_1D: 604800
mail:
smtp:
host: smtp.qiye.aliyun.com
......@@ -36,34 +21,27 @@ export:
language: zh_TW
emailActiveTime: 60
upload:
path:
declare: /app/Oracle/Middleware/user_projects/domains/base_domain/exportTw/upload/declareFile
image: /app/Oracle/Middleware/user_projects/domains/base_domain/exportTw/upload/brandImage
url:
loginIndex: http://47.103.140.98:8086/icleartw
twIdx: http://47.103.140.98/IcTw/
twIdxImg: https://declarationuat.fedex.com.cn/Exp/manager-server/
#fcl
fcl:
login:
url: http://exportdeclarationuat-tw.dmz.apac.fedex.com/icleartw/auth/wlgnLogin
redjrectLogin: http://192.168.1.251/time.html
twidx:
url: http://exportdeclarationuat-tw.apac.fedex.com
url:
http://47.103.140.98:7010/manager-server/auth/wlgnLogin
redjrectLogin: http://192.168.1.251/ipc/#/redjrectLogin
preClearIndex:
url: http://192.168.1.251/ipc
interface:
logurl: https://www.fedex.com/secure-login/zh-tw/#/login-credentials?redirectUrl=http://exportdeclarationuat-tw.dmz.apac.fedex.com/icleartw/auth/wlgnForward
fedex_api_address: https://api.fedex.com
logurl: https://www.fedex.com/secure-login/en-us/#/login-credentials?redirectUrl=http://iclear-connectuat.apac.fedex.com/manager-server/auth/wlgnForward
fedex_api_address: https://api.fedex.com.cn
proxy_url: cn2-proxy.apac.fedex.com:3128
token:
url: /auth/oauth/v2/token
url: ${fcl.interface.fedex_api_address}/auth/oauth/v2/token
grant_type : client_credentials
client_id: l7c13f958213e04d1280f807789bd783a3
client_secret: 3d43932198b6467a8e20d024bfa82e1c
scope: oob
account:
url: /user/v2/accounts
url: ${fcl.interface.fedex_api_address}/user/v2/accounts
shippingaccounts:
url: ${fcl.interface.fedex_api_address}/administration/v1/users/shippingaccounts
userinfo:
url: /user/v2/users/userinfo
\ No newline at end of file
url: ${fcl.interface.fedex_api_address}/user/v2/users/userinfo
\ No newline at end of file
......
spring:
datasource:
jndi-name: jdbc/iclearConnectDS
jndi-name: jdbc/iclconnectDS
profiles:
#系统环境
env: uat
export:
jwt:
securityKey: C*F-JaNdRgUkXn2r5u8x/A?D(G+KbPeShVmYq3s6v9y$B&E)H@McQfTjWnZr4u7w
urlWhiteList:
- /icleartw/auth
- /icleartw/monitor/ok
- /icleartw/sysUser/logout
- /icleartw/swagger-resources
- /icleartw/webjars
uriWhiteList:
- /icleartw/swagger-ui.html
- /icleartw/swagger-ui/*
- /icleartw/v2/api-docs
- /icleartw/login.html
expire_1H: 7200
expire_1D: 604800
mail:
smtp:
host: mapper.gslb.fedex.com
......@@ -36,33 +21,26 @@ export:
language: zh_TW
emailActiveTime: 60
upload:
path:
declare: /var/share/icleartw/upload/declareFile
image: /var/share/icleartw/upload/brandImage
url:
loginIndex: http://exportdeclarationuat-tw.dmz.apac.fedex.com/icleartw
twIdx: http://exportdeclarationuat-tw.apac.fedex.com/IcTw/
twIdxImg: https://declarationuat.fedex.com.cn/Exp/manager-server/
fcl:
login:
url: http://exportdeclarationuat-tw.apac.fedex.com/icleartw/auth/wlgnLogin
redjrectLogin: https://exportdeclarationuat-tw.dmz.apac.fedex.com/IcTw/#/redjrectLogin
twidx:
url: http://exportdeclarationuat-tw.apac.fedex.com
url:
https://iclear-connectuat.apac.fedex.com/manager-server/auth/wlgnLogin
redjrectLogin: https://iclear-connectuat.apac.fedex.com/ipc/#/redjrectLogin
preClearIndex:
url: https://iclear-connectuat.apac.fedex.com/ipc
interface:
logurl: https://www.fedex.com/secure-login/zh-tw/#/login-credentials?redirectUrl=http://exportdeclarationuat-tw.dmz.apac.fedex.com/icleartw/auth/wlgnForward
fedex_api_address: https://api.fedex.com
logurl: https://www.fedex.com/secure-login/en-us/#/login-credentials?redirectUrl=http://iclear-connectuat.apac.fedex.com/manager-server/auth/wlgnForward
fedex_api_address: https://api.fedex.com.cn
proxy_url: cn2-proxy.apac.fedex.com:3128
token:
url: /auth/oauth/v2/token
url: ${fcl.interface.fedex_api_address}/auth/oauth/v2/token
grant_type : client_credentials
client_id: l7c13f958213e04d1280f807789bd783a3
client_secret: 3d43932198b6467a8e20d024bfa82e1c
scope: oob
account:
url: /user/v2/accounts
url: ${fcl.interface.fedex_api_address}/user/v2/accounts
shippingaccounts:
url: ${fcl.interface.fedex_api_address}/administration/v1/users/shippingaccounts
userinfo:
url: /user/v2/users/userinfo
\ No newline at end of file
url: ${fcl.interface.fedex_api_address}/user/v2/users/userinfo
\ No newline at end of file
......
......@@ -29,6 +29,7 @@ import:
- /manager-server/user/logout
- /manager-server/swagger-resources
- /manager-server/webjars
- /manager-server/csrf
uriWhiteList:
- /manager-server/swagger-ui.html
- /manager-server/swagger-ui/*
......@@ -44,3 +45,7 @@ mybatis:
#开启驼峰与下划线转换
map-underscore-to-camel-case: true
call-setters-on-nulls: true
#全局异常拦截是否生效
common:
exception-advice-webconfig:
enable: true
\ No newline at end of file
......
......@@ -2,7 +2,7 @@
<configuration>
<springProfile name="dev,uat,prod">
<!-- 日志存放路径 -->
<property name="log.path" value="/var/fedex/iclearConnect/weblogic/iclearConnect/manager-server" />
<property name="log.path" value="/var/fedex/iclconnect/weblogic/manager-server" />
</springProfile>
<springProfile name="test">
<!-- 日志存放路径 -->
......
#******************鉴权相关提示,需要做国际化******************
#authentication包
#没有访问权限
system_exception_10001=No access rights.
#没有通过权限认证
system_exception_10002=Failed to pass the authentication.
#登录身份异常
system_exception_10003=Login identity is abnormal.
#登录超过8小时,请重新登录
system_exception_10004=Login has exceeded 8 hours, please log in again.
#登录已过期,请重新登录
system_exception_10005=Login has expired, please log in again.
#******************业务相关、需要做国际化******************
#系统异常:登录失败,请稍后重试!
business_exception_40001=System abnormality: Login failed, please try again later!
#暂时没用,预留
business_log_40002=用户登录
#系统异常,请稍后重试!
system_exception_40003=System abnormal, please try again later!
#单次登录已过有效期,请重新登录!
system_exception_40004=Please log in again!
#退出成功
system_exception_40005=Logout successful
#退出失败
system_exception_40006=Logout failed
\ No newline at end of file
......
#******************鉴权相关提示,需要做国际化******************
#authentication包
system_exception_10001=没有访问权限
system_exception_10002=没有通过权限认证
system_exception_10003=登录身份异常
system_exception_10004=登录超过8小时,请重新登录
system_exception_10005=登录已过期
system_exception_10006=登录身份异常
system_exception_10007=登录已过期,请重新登录
#没有访问权限
system_exception_10001=No access rights.
#没有通过权限认证
system_exception_10002=Failed to pass the authentication.
#登录身份异常
system_exception_10003=Login identity is abnormal.
#登录超过8小时,请重新登录
system_exception_10004=Login has exceeded 8 hours, please log in again.
#登录已过期,请重新登录
system_exception_10005=Login has expired, please log in again.
#******************业务相关、需要做国际化******************
business_exception_40001=存入token失败
#系统异常:登录失败,请稍后重试!
business_exception_40001=System abnormality: Login failed, please try again later!
#暂时没用,预留
business_log_40002=用户登录
system_exception_40003=系统异常,请联系清关部门
system_exception_40004=登录已过期,请重新登录
system_exception_40005=用戶不存在
system_exception_40006=登录已过期
system_exception_40007=退出成功
system_exception_40008=退出失败
\ No newline at end of file
#系统异常,请稍后重试!
system_exception_40003=System abnormal, please try again later!
#单次登录已过有效期,请重新登录!
system_exception_40004=Please log in again!
#退出成功
system_exception_40005=Logout successful
#退出失败
system_exception_40006=Logout failed
\ No newline at end of file
......
#******************鉴权相关提示,需要做国际化******************
#authentication包
system_exception_10001=没有访问权限
system_exception_10002=没有通过权限认证
system_exception_10003=登录身份异常
system_exception_10004=登录超过8小时,请重新登录
system_exception_10005=登录已过期
system_exception_10006=登录身份异常
system_exception_10007=登录已过期,请重新登录
#******************业务相关、需要做国际化******************
business_exception_40001=存入token失败
business_log_40002=用户登录
system_exception_40003=系统异常,请联系清关部门
system_exception_40004=登录已过期,请重新登录
system_exception_40005=用戶不存在
system_exception_40006=登录已过期
system_exception_40007=退出成功
system_exception_40008=退出失败
\ No newline at end of file
##******************鉴权相关提示,需要做国际化******************
##authentication包
#system_exception_10001=没有访问权限
#system_exception_10002=没有通过权限认证
#system_exception_10003=登录身份异常
#system_exception_10004=登录超过8小时,请重新登录
#system_exception_10005=登录已过期,请重新登录
#
##******************业务相关、需要做国际化******************
#business_exception_40001=系统异常:登录失败,请稍后重试!
#business_log_40002=用户登录
#system_exception_40003=系统异常,请稍后重试!
#system_exception_40004=单次登录已过有效期,请重新登录!
#system_exception_40005=退出成功
#system_exception_40006=退出失败
\ No newline at end of file
......
......@@ -9,4 +9,8 @@
<library-name>lib4iClearConnect</library-name>
<specification-version>1.0</specification-version>
</wls:library-ref>
<wls:virtual-directory-mapping>
<wls:local-path>/app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect</wls:local-path>
<wls:url-pattern>/*</wls:url-pattern>
</wls:virtual-directory-mapping>
</wls:weblogic-web-app>
\ No newline at end of file
......
......@@ -61,18 +61,31 @@ public class PropertiesConfig {
@Value("${export.mail.mailAccountFlag}")
private String mailAccountFlag;
@Value("${url.baseUrl}")
String baseUrl;
@Value("${url.fedex}")
String fedex;
@Value("${url.line}")
String line;
@Value("${export.mail.sendEmail.account}")
String emailAccount;
@Value("${export.mail.sendEmail.password}")
String emailPassword;
//基础路径
@Value("${imp001.path.work}")
String imp001PathWork;
//zip输出目录
@Value("${imp001.path.final}")
String imp001PathFinal;
//文件备份目录
@Value("${imp001.path.bak}")
String imp001PathBak;
//文件异常文件存放目录
@Value("${imp001.path.error}")
String imp001PathError;
@Value("${upload.path.zip}")
private String zipPath;
@Value("${upload.path.zipFinal}")
private String zipFinalPath;
@Value("${upload.path.zipTemp}")
private String zipTempPath;
}
\ No newline at end of file
......
......@@ -6,7 +6,11 @@ package com.fedex.connect.task.constants;
* @Date 2024/4/18
*/
public interface Constant {
//TW001表头信息
/**
* @Author mt
* @Description IMP001表头信息
* @Date 2024/12/18
*/
interface IMP001_HEAD_KEYS{
/**
* 消息代码:IMP001报文标志
......@@ -15,14 +19,18 @@ public interface Constant {
/**
* 发送程序ID:TWEXP
*/
String SENDER_ID = "TWEXP";
String SENDER_ID = "PreCLR";
/**
* 接受程序ID:IMP
*/
String RECEIVER_ID = "IMP";
}
//文件后缀字符串keys
/**
* @Author mt
* @Description 文件后缀字符串keys
* @Date 2024/12/18
*/
interface FILE_SUFFIX_KEYS{
/**
* json字符串
......
package com.fedex.connect.task.data.bo;
import lombok.Data;
import java.util.Date;
/**
* @Author mt
* @Description 类说明 文件信息bo
* @Date 2024/5/30
*/
@Data
public class Imp001FileInfoBo {
//文件类型id
Long fileTypeId;
//文件类型名称
String fileTypeName;
//文件名称
String fileName;
//生成时间
Date pushTime;
}
package com.fedex.connect.task.data.bo;
import com.fedex.connect.common.model.bi.DictionaryEntries;
import com.fedex.connect.task.data.dto.imp001.Imp001Files;
import com.fedex.connect.task.data.dto.imp001.Imp001RootJsonDto;
import lombok.Data;
import java.util.Dictionary;
import java.util.List;
/**
* @Author mt
* @Description 类说明 tw001生成bo
* @Description 类说明 imp001生成bo
* @Date 2024/5/24
*/
@Data
public class Imp001GenerateBo {
//tw001报文对象
//运单号
String consignmentCode;
//运单ID
Long consignmentId;
//imp001报文对象
Imp001RootJsonDto imp001RootJsonDto;
//tw001临时文件夹目录
//imp001临时文件夹目录
String workFilePath;
//需要打包压缩包文件信息名称
List<Imp001FileInfoBo> fileInfoList;
//json Dir对象
DictionaryEntries jsonDictionary;
Imp001Files[] fileInfos;
//zip文件名称
String zipFileName;
//zip推送目标目录
......
......@@ -9,4 +9,7 @@ public class PortFileDto {
private String shipperContactName;
private String shipperEmail;
private String shipperPhone;
private String shipperAccount;
private String originCountry;
private String fileName;
}
......
package com.fedex.connect.task.data.dto;
import com.fedex.connect.common.annotation.SensitiveEntity;
import com.fedex.connect.common.annotation.SensitiveField;
import lombok.Data;
@Data
@SensitiveEntity
public class PushZipEmailDto {
private String destIataCode;
private String filePath;
@SensitiveField
private String shipperContactName;
private String shipperEmail;
private String shipperPhone;
private String shipperAccount;
private String originCountry;
private String fileName;
private String userInputShipperAccount;
private String userInputOriginCountry;
private Long ceFlag;
}
......
......@@ -13,15 +13,14 @@ import java.io.Serializable;
public class Imp001Consignment implements Serializable {
/**
* @Author mt
* @Description 提单号码
* 12位数字,提单号码,可以重复
* @Date 2024/5/23
* @Description 每个报文只有一个12位运单号
* @Date 2024年12月18日
*/
private String deliveryNo;
/**
* @Author mt
* @Description 联络人
* @Date 2024/5/23
* @Description 运单附带文件数量
* @Date 2024年12月18日
*/
private Integer attachedFilesCount;
}
\ No newline at end of file
......
......@@ -25,11 +25,11 @@ public class EmailJob {
* @param
* @return void
*/
//@ProcessingInterval(paramCode = ParamConfigConstants.TASK_PARAM_KEYS.NOTIFICATION_SENDER_EMAIL_INTERVAL)
//@Scheduled(cron = "${export.task.allocation.sendOb}")
//public void notificationSenderTask() {
// duplicateConsignmentEmailService.duplicateConsignmentEmail();
//}
@ProcessingInterval(paramCode = ParamConfigConstants.TASK_PARAM_KEYS.NOTIFICATION_SENDER_EMAIL_INTERVAL)
@Scheduled(cron = "${export.task.allocation.sendOb}")
public void notificationSenderTask() {
duplicateConsignmentEmailService.duplicateConsignmentEmail();
}
/**
* @Author Szl
......@@ -47,11 +47,11 @@ public class EmailJob {
/**
* 发送失败邮件提醒
*/
//@ProcessingInterval(paramCode = ParamConfigConstants.TASK_PARAM_KEYS.SEND_FAIL_ALERT_INTERVAL)
//@Scheduled(cron = "${export.task.allocation.sendOb}")
//public void sendingFailedEmailAlert() {
// sendWarningEmail.sendFailedEmail();
//}
@ProcessingInterval(paramCode = ParamConfigConstants.TASK_PARAM_KEYS.SEND_FAIL_ALERT_INTERVAL)
@Scheduled(cron = "${export.task.allocation.sendOb}")
public void sendingFailedEmailAlert() {
sendWarningEmail.sendFailedEmail();
}
}
......
......@@ -24,7 +24,7 @@ public class Imp001Job {
@ProcessingInterval(paramCode = ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_INTERVAL)
@Scheduled(cron = "${export.task.allocation.sendOb}")
public void sendObTask() {
//sendObService.sendOb();
sendObService.sendOb();
}
/**
......@@ -33,6 +33,6 @@ public class Imp001Job {
@ProcessingInterval
@Scheduled(cron = "${export.task.allocation.sendObRetry}")
public void sendObRetryTask() {
//sendObService.sendObRetry();
sendObService.sendObRetry();
}
}
......
package com.fedex.connect.task.repository.base;
import com.fedex.connect.common.dao.biz.AttachmentMapper;
import com.fedex.connect.common.dao.biz.ConsignmentMapper;
import com.fedex.connect.common.dao.biz.EmailMapper;
import com.fedex.connect.common.dao.biz.PushObMapper;
import com.fedex.connect.common.dao.biz.*;
import com.fedex.connect.common.dao.log.EmailHistoryMapper;
import com.fedex.connect.common.dao.sys.KafkaStorageHistoryMapper;
import com.fedex.connect.common.dao.sys.KafkaTemporaryStorageMapper;
......@@ -23,6 +20,8 @@ public class AbstractDaoRepository {
@Autowired
protected PushObMapper pushObMapper;
@Autowired
protected PushObDetailMapper pushObDetailMapper;
@Autowired
protected KafkaTemporaryStorageMapperExt kafkaTemporaryStorageMapperExt;
@Autowired
protected RedisSlabMapperExt redisSlabMapperExt;
......
......@@ -9,16 +9,28 @@ import java.util.List;
@Mapper
public interface AttachmentExtMapper {
@Select("SELECT a.FILE_PATH, c.DEST_IATA_CODE, c.CONSIGNMENT_CODE, c.SHIPPER_CONTACT_NAME, c.SHIPPER_EMAIL, c.SHIPPER_PHONE " +
@Select("SELECT a.FILE_PATH, " +
" c.DEST_IATA_CODE, " +
" c.CONSIGNMENT_CODE, " +
" c.SHIPPER_CONTACT_NAME, " +
" c.SHIPPER_EMAIL, " +
" c.SHIPPER_PHONE, " +
" c.SHIPPER_ACCOUNT, " +
" c.ORIGIN_COUNTRY, " +
" a.FILE_NAME, " +
" c.USER_INPUT_SHIPPER_ACCOUNT, " +
" c.USER_INPUT_ORIGIN_COUNTRY, " +
" ucm.CE_FLAG " +
"FROM T_BIZ_ATTACHMENT a " +
"JOIN T_BIZ_CONSIGNMENT c ON a.BIZ_ID = c.ID " +
"WHERE a.BIZ_ID = #{bizId}")
"JOIN T_BIZ_UPLOAD_RECORD ur ON a.UPLOAD_RECORD_ID = ur.ID " +
"JOIN T_BIZ_CONSIGNMENT c ON ur.CONSIGNMENT_ID = c.ID " +
"JOIN T_BIZ_USER_CONSIGNMENT_MAPPING ucm ON ucm.CONSIGNMENT_ID = c.ID " +
"WHERE a.UPLOAD_RECORD_ID = #{bizId,jdbcType=NUMERIC} " +
" AND ucm.USER_ID = ur.CREATE_USER_ID")
List<PushZipEmailDto> findAttachmentDetailsByBizId(@Param("bizId") Long bizId);
@Select("SELECT * FROM T_BIZ_ATTACHMENT WHERE UPLOAD_RECORD_ID = " +
"(SELECT MAX(ID) FROM T_BIZ_UPLOAD_RECORD WHERE " +
" CONSIGNMENT_ID = #{consignmentId}) AND STATUS = 1")
List<Attachment> queryAttachmentInfo(@Param("consignmentId") Long consignmentId);
@Select("SELECT * FROM T_BIZ_ATTACHMENT WHERE UPLOAD_RECORD_ID = #{uploadRecordId,jdbcType=NUMERIC} AND BIZ_ID = #{consignmentId,jdbcType=NUMERIC} AND STATUS = 1")
List<Attachment> queryAttachmentInfo(@Param("uploadRecordId") Long uploadRecordId,@Param("consignmentId") Long consignmentId);
/**
* 根据修改日期查询数据
......
......@@ -7,7 +7,7 @@ import org.apache.ibatis.annotations.Select;
@Mapper
public interface PortclearEmailMappingExtMapper {
@Select("SELECT EMAIL FROM T_BI_PORTCLEAR_EMAIL_MAPPING WHERE PORT_CODE = #{portCode}")
@Select("SELECT EMAIL FROM T_BI_PORTCLEAR_EMAIL_MAPPING WHERE PORT_CODE = #{portCode} AND STATUS = 1")
String findEmailByPortCode(@Param("portCode") String portCode);
}
......
......@@ -10,7 +10,7 @@ public interface IAttachmentRepository {
List<PushZipEmailDto> findAttachmentDetailsByBizId(@Param("bizId") Long bizId);
List<Attachment> queryAttachmentInfo(Long consignmentId);
List<Attachment> queryAttachmentInfo(Long uploadRecordId,Long consignmentId);
List<Attachment> findAttachmentsOlderThan(String date);
......
package com.fedex.connect.task.repository.repo.biz;
import com.fedex.connect.common.model.biz.PushObDetail;
import java.util.List;
public interface IPushObDetailRepository {
/**
* @Author mt
* @Description 功能说明 批量插入
* @Date 2024/5/30
* @param record
* @return void
*/
void batchInsert(List<PushObDetail> record);
}
......@@ -17,8 +17,8 @@ public class AttachmentRepositoryImpl extends AbstractDaoRepository implements I
}
@Override
public List<Attachment> queryAttachmentInfo(Long consignmentId){
return attachmentExtMapper.queryAttachmentInfo(consignmentId);
public List<Attachment> queryAttachmentInfo(Long uploadRecordId,Long consignmentId){
return attachmentExtMapper.queryAttachmentInfo(uploadRecordId,consignmentId);
}
@Override
......
package com.fedex.connect.task.repository.repo.biz.impl;
import com.fedex.connect.common.dependencies.util.Utils;
import com.fedex.connect.common.model.biz.PushObDetail;
import com.fedex.connect.task.repository.base.AbstractDaoRepository;
import com.fedex.connect.task.repository.repo.biz.IPushObDetailRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Objects;
/**
* @Author mt
* @Description 推送明细日志repository
* @Date 2024/5/30
*/
@Repository
public class PushObDetailRepository extends AbstractDaoRepository implements IPushObDetailRepository {
/**
* @Author mt
* @Description 功能说明 批量插入
* @Date 2024/5/30
* @param record
* @return void
*/
public void batchInsert(List<PushObDetail> record){
Utils.listOf(record).stream().filter(Objects::nonNull).forEach(r->{
pushObDetailMapper.insert(r);
});
}
}
package com.fedex.connect.task.service.base;
import com.fedex.connect.common.dependencies.repository.repo.sys.IRedisSlabRepository;
import com.fedex.connect.common.dependencies.repository.repo.sys.IRedisSlabBaseRepository;
import com.fedex.connect.task.repository.repo.biz.IAttachmentRepository;
import com.fedex.connect.task.repository.repo.biz.IEmailRepository;
import com.fedex.connect.task.repository.repo.biz.IPushObDetailRepository;
import com.fedex.connect.task.repository.repo.biz.IPushObRepository;
import com.fedex.connect.task.repository.repo.sys.IKafkaStorageHistoryRepository;
import com.fedex.connect.task.repository.repo.sys.IKafkaTemporaryStorageRepository;
......@@ -21,7 +22,7 @@ public class BaseService {
@Autowired
protected IKafkaStorageHistoryRepository kafkaStorageHistoryRepository;
@Autowired
protected IRedisSlabRepository redisSlabRepository;
protected IRedisSlabBaseRepository redisSlabRepository;
@Autowired
protected IRedisSlabExtRepository redisRepository;
@Autowired
......@@ -31,5 +32,7 @@ public class BaseService {
@Autowired
protected IPushObRepository pushObRepository;
@Autowired
protected IPushObDetailRepository pushObDetailRepository;
@Autowired
protected IParamConfigRepository paramConfigRepository;
}
\ No newline at end of file
......
package com.fedex.connect.task.service.biz;
import com.fedex.connect.common.model.biz.PushObDetail;
import java.util.List;
public interface IPushObDetailService {
/**
* @Author mt
* @Description 功能说明 批量插入
* @Date 2024/5/30
* @param record
* @return void
*/
void batchInsert(List<PushObDetail> record);
}
package com.fedex.connect.task.service.biz;
public interface IPushObService {
///**
// * @Author mt
// * @Description 推送Imp001报文数据zip包文件
// * @Date 2024/8/2
// * @param
// * @return void
// */
//void sendOb();
///**
// * @Author mt
// * @Description 推送Imp001文件错误重试
// * @Date 2024/8/2
// * @param
// * @return void
// */
//void sendObRetry();
/**
* @Author mt
* @Description 推送Imp001报文数据zip包文件
* @Date 2024/8/2
* @param
* @return void
*/
void sendOb();
/**
* @Author mt
* @Description 推送Imp001文件错误重试
* @Date 2024/8/2
* @param
* @return void
*/
void sendObRetry();
}
\ No newline at end of file
......
......@@ -10,6 +10,7 @@ import com.fedex.connect.task.service.base.BaseService;
import com.fedex.connect.task.service.biz.IDuplicateConsignmentEmailService;
import com.fedex.connect.task.utils.sys.DuplicateEmailUtil;
import com.fedex.connect.task.utils.sys.EmailUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -51,11 +52,14 @@ public class DuplicateConsignmentEmailServiceImpl extends BaseService implements
/**
* 发送邮件
*/
boolean result = emailUtil.sendMail(mailConfigDto);
boolean result = false;
if (StringUtils.isNotEmpty(mailConfigDto.getTo())){
result = emailUtil.sendMail(mailConfigDto);
}
/**
* 更新邮件实体
*/
duplicateEmailUtil.updateEmail(result,email,cacheSystem);
duplicateEmailUtil.updateEmail(result,email,cacheSystem,mailConfigDto);
/**
* 更新数据库
*/
......
......@@ -7,6 +7,7 @@ import com.fedex.connect.common.dependencies.enums.biz.EmailTypeEnum;
import com.fedex.connect.common.dependencies.util.NIOFileUtils;
import com.fedex.connect.common.dependencies.util.ZipUtils;
import com.fedex.connect.common.model.biz.Email;
import com.fedex.connect.task.config.PropertiesConfig;
import com.fedex.connect.task.data.dto.MailConfigDto;
import com.fedex.connect.task.data.dto.PortFileDto;
import com.fedex.connect.task.data.dto.PushZipEmailDto;
......@@ -18,6 +19,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.File;
import java.util.List;
/**
......@@ -44,6 +46,9 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush
@Autowired
private NIOFileUtils nioFileUtils;
@Autowired
private PropertiesConfig propertiesConfig;
/**
* @Author Szl
* @Description 功能说明 推送清关文件
......@@ -53,30 +58,41 @@ public class PushConsignmentFileServiceImpl extends BaseService implements IPush
*/
@Override
public void pushConsignmentFileTask(){
String tempPath = "";
String finalPath = "";
String tempPath = propertiesConfig.getZipTempPath();
String finalPath = propertiesConfig.getZipFinalPath();
// 检查并创建临时目录
File tempDir = new File(tempPath);
if (!tempDir.exists()) {
tempDir.mkdirs();
}
// 检查并创建最终目录
File finalDir = new File(finalPath);
if (!finalDir.exists()) {
finalDir.mkdirs();
}
//查询需要发送的数据
List<Email> conPushEmails = iEmailExtRepository.findEmailsByDic(cacheSystem.getDicEmailType(EmailTypeEnum.PUSH_CON_FILE.getCode()).getCode(),
cacheSystem.getDicEmailStatus(EmailStatusEnum.PENDING.getCode()).getCode(),ParamConfigConstants.TASK_PARAM_KEYS.PUSH_CON_NUMBER);
for (Email conPushEmail : conPushEmails) {
boolean result = true;
String filePath = null;
MailConfigDto mailMessageReqDto = new MailConfigDto();
try {
//获取待发送的文件并打zip包
PortFileDto portFileDto = new PortFileDto();
List<PushZipEmailDto> attachmentDetailsByBizId = attachmentExtRepository.findAttachmentDetailsByBizId(conPushEmail.getBizId());
portFileDto = conFileEmailUtil.getPortZipMap(portFileDto, attachmentDetailsByBizId, tempPath, finalPath, zipUtils);
portFileDto = conFileEmailUtil.getPortZipMap(portFileDto, attachmentDetailsByBizId, tempPath, finalPath, zipUtils,conPushEmail.getBizCode());
//发送邮件
MailConfigDto mailMessageReqDto = new MailConfigDto();
result = conFileEmailUtil.sendEmail(portFileDto, emailUtil,mailMessageReqDto,conPushEmail);
//根据是否成功发送邮件对文件进行备份
String filePath = conFileEmailUtil.backFile(portFileDto.getZipPath(), nioFileUtils,result);
//更新邮件记录表
conFileEmailUtil.createEmail(cacheSystem,conPushEmail,mailMessageReqDto,result,filePath);
filePath = conFileEmailUtil.backFile(portFileDto.getZipPath(), nioFileUtils, conPushEmail);
}catch (Exception e){
log.error("推送清关文件邮件异常",e);
result = false;
}
//更新邮件记录表
conFileEmailUtil.createEmail(cacheSystem,conPushEmail,mailMessageReqDto,result,filePath);
//保存入库
conFileEmailUtil.saveEmail(conPushEmail,result);
}
......
package com.fedex.connect.task.service.biz.impl;
import com.fedex.connect.common.model.biz.PushObDetail;
import com.fedex.connect.task.service.base.BaseService;
import com.fedex.connect.task.service.biz.IPushObDetailService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author mt
* @Description 类说明 推送明细日志
* @Date 2024/5/30
*/
@Service
public class PushObDetailServiceImpl extends BaseService implements IPushObDetailService {
/**
* @Author mt
* @Description 功能说明 批量插入
* @Date 2024/5/30
* @param record
* @return void
*/
public void batchInsert(List<PushObDetail> record){
pushObDetailRepository.batchInsert(record);
}
}
package com.fedex.connect.task.service.biz.impl;
import com.fedex.connect.common.dependencies.cache.CacheSystem;
import com.fedex.connect.common.dependencies.contants.ParamConfigConstants;
import com.fedex.connect.common.dependencies.enums.biz.PushObStatusEnum;
import com.fedex.connect.common.dependencies.util.Utils;
import com.fedex.connect.common.model.bi.DictionaryEntries;
import com.fedex.connect.common.model.biz.PushOb;
import com.fedex.connect.common.model.sys.ParamConfig;
import com.fedex.connect.task.data.bo.Imp001GenerateBo;
import com.fedex.connect.task.service.base.BaseService;
import com.fedex.connect.task.service.biz.IPushObService;
import com.fedex.connect.task.utils.biz.imp001.Imp001GenerateUtil;
import com.fedex.connect.task.utils.biz.imp001.Imp001PushUtil;
import com.fedex.connect.task.utils.biz.imp001.Imp001RecordLogUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -20,92 +25,102 @@ import java.util.Objects;
/**
* @Author mt
* @Description 发送Imp001到进口组
* @Date 2024/5/24
* @Date 2024年12月18日
*/
@Slf4j
@Service
public class PushObServiceImpl extends BaseService implements IPushObService {
//@Autowired
//Imp001GenerateUtil imp001GenerateUtil;
//@Autowired
//Imp001PushUtil imp001PushUtil;
//@Autowired
//Imp001RecordLogUtil imp001RecordLogUtil;
//
///**
// * 推送OB报文数据zip包文件
// */
//@Override
//public void sendOb() {
// //获取每次处理数据量量参数
// ParamConfig paramConfig = paramConfigRepository.findValueByCode(ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_NUMBER);
// Long rownum = Long.parseLong(paramConfig.getValue());
// //获取需要处理的记录
// List<PushOb> pushObList = pushObRepository.findPushOb(PushObStatusEnum.TO_BE_SENT.getCode(),rownum);
// //推送imp001数据
// this.pushOb(pushObList);
//}
//
///**
// * 推送OB文件错误重试
// */
//@Override
//public void sendObRetry() {
// //获取每次处理数据量量参数
// Map<String,ParamConfig> paramConfig = paramConfigRepository.findValueByCodes(ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_NUMBER,
// ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_RETRY_NUMBER);
// //推送IMP001重试处理数量
// ParamConfig retryNumConfig = paramConfig.get(ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_RETRY_NUMBER);
// Long retryNum = Long.parseLong(retryNumConfig.getCode());
// //推送IMP001定时任务处理数量
// ParamConfig rownumConfig = paramConfig.get(ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_NUMBER);
// Long rownum = Long.parseLong(rownumConfig.getCode());
// //获取需要重新处理的记录:处理4次以下,并且推送失败的
// List<PushOb> errPushObLog = pushObRepository.findErrPushOb(retryNum, PushObStatusEnum.PUSH_FAILED.getCode(),rownum);
// if (errPushObLog!=null && !errPushObLog.isEmpty()){
// log.info("sendObRetryTask : sendObRetry size: "+errPushObLog.size());
// //重新推送tw001数据
// this.pushOb(errPushObLog);
// }else{
// log.info("sendObRetryTask : No data found for sendObRetry!");
// }
//}
//
///**
// * @Author mt
// * @Description 推送tw001数据
// * @Date 2024/5/29
// * @param pushObList
// * @return void
// */
//private void pushOb(List<PushOb> pushObList){
// Utils.listOf(pushObList).stream().filter(Objects::nonNull).forEach(ob ->{
// boolean flag = false;
// String errorMsg = "";
// Imp001GenerateBo imp001GenerateBo = null;
// try {
// //生成tw001 json对象dto
// imp001GenerateBo = imp001GenerateUtil.generateImp001Json(ob);
// //根据tw001 json对象生成并且推送zip包
// imp001PushUtil.pushImp001(imp001GenerateBo);
// flag = true;
// }catch(Exception ex){
// log.error("pushOb error : ",ex);
// errorMsg = ex.getMessage();
// flag = false;
// }finally{
// /**
// * 如果生成失败,推送失败,则不会记录推送日志明细,更新推送日志表。
// * 记录日志,并且备份
// */
// if(flag){
// //推送成功
// imp001RecordLogUtil.pushSuccessRecordLog(imp001GenerateBo, ob);
// }else{
// //推送失败
// imp001RecordLogUtil.pushFailRecordLog(imp001GenerateBo, ob, errorMsg);
// }
// }
// });
//}
@Autowired
Imp001GenerateUtil imp001GenerateUtil;
@Autowired
Imp001PushUtil imp001PushUtil;
@Autowired
Imp001RecordLogUtil imp001RecordLogUtil;
@Autowired
CacheSystem cacheSystem;
/**
* 推送OB报文数据zip包文件
*/
@Override
public void sendOb() {
//获取每次处理数据量量参数
ParamConfig paramConfig = paramConfigRepository.findValueByCode(ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_NUMBER);
Long rownum = Long.parseLong(paramConfig.getValue());
//获取需要处理的记录
List<PushOb> pushObList = pushObRepository.findPushOb(PushObStatusEnum.TO_BE_SENT.getCode(),rownum);
//推送imp001数据
this.pushOb(pushObList);
}
/**
* 推送OB文件错误重试
*/
@Override
public void sendObRetry() {
//获取每次处理数据量量参数
Map<String,ParamConfig> paramConfig = paramConfigRepository.findValueByCodes(ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_NUMBER,
ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_RETRY_NUMBER);
//推送IMP001重试处理数量
ParamConfig retryNumConfig = paramConfig.get(ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_RETRY_NUMBER);
Long retryNum = Long.parseLong(retryNumConfig.getValue());
//推送IMP001定时任务处理数量
ParamConfig rownumConfig = paramConfig.get(ParamConfigConstants.TASK_PARAM_KEYS.PUSH_IMP001_NUMBER);
Long rownum = Long.parseLong(rownumConfig.getValue());
//获取需要重新处理的记录:处理4次以下,并且推送失败的
List<PushOb> errPushObLog = pushObRepository.findErrPushOb(retryNum, PushObStatusEnum.PUSH_FAILED.getCode(),rownum);
if (errPushObLog!=null && !errPushObLog.isEmpty()){
log.info("sendObRetryTask : sendObRetry size: "+errPushObLog.size());
//重新推送tw001数据
this.pushOb(errPushObLog);
}else{
log.info("sendObRetryTask : No data found for sendObRetry!");
}
}
/**
* @Author mt
* @Description 推送imp001数据
* @Date 2024/5/29
* @param pushObList
* @return void
*/
private void pushOb(List<PushOb> pushObList){
/**
* 推送成功状态字典
*/
DictionaryEntries pushSuccessEntries = cacheSystem.getDicPushObStatus(PushObStatusEnum.PUSH_SUCCESSFUL.getCode());
/**
* 推送失败状态字典
*/
DictionaryEntries pushFailedEntries = cacheSystem.getDicPushObStatus(PushObStatusEnum.PUSH_FAILED.getCode());
Utils.listOf(pushObList).stream().filter(Objects::nonNull).forEach(ob ->{
boolean flag = false;
String errorMsg = "";
Imp001GenerateBo imp001GenerateBo = null;
try {
//生成imp001 json对象dto
imp001GenerateBo = imp001GenerateUtil.generateImp001Json(ob);
//根据imp001 json对象生成并且推送zip包
imp001PushUtil.pushImp001(imp001GenerateBo);
flag = true;
}catch(Exception ex){
log.error("pushOb error : ",ex);
errorMsg = ex.getMessage();
flag = false;
}finally{
/**
* 如果生成失败,推送失败,则不会记录推送日志明细,更新推送日志表。
* 记录日志,并且备份
*/
if(flag){
//推送成功
imp001RecordLogUtil.pushSuccessRecordLog(imp001GenerateBo, ob, pushSuccessEntries);
}else{
//推送失败
imp001RecordLogUtil.pushFailRecordLog(imp001GenerateBo, ob, pushFailedEntries, errorMsg);
}
}
});
}
}
\ No newline at end of file
......
......@@ -59,6 +59,14 @@ public class SendFailedEmailAlertServiceImpl extends BaseService implements ISen
*/
List<SendFailedEmailDto> sendFailedEmailDto = sendFailedEmailUtil.createSendFailedEmailDto(emails,obs,paramConfigMap);
/**
* 无错误邮件不发送邮件
*/
boolean dataFlag = sendFailedEmailDto.stream()
.anyMatch(failedEmailDto -> failedEmailDto.getStatusCodeCount() > 5);
if (!dataFlag) {
return;
}
/**
* 构建邮件内容
*/
String emailBody = sendFailedEmailUtil.createEmailBody(sendFailedEmailDto,paramConfigMap);
......
//package com.fedex.connect.task.utils.biz.imp001;
//
//import com.fedex.connect.common.dependencies.cache.CacheSystem;
//import com.fedex.connect.common.dependencies.util.NIOFileUtils;
//import com.fedex.connect.common.model.bi.DictionaryEntries;
//import com.fedex.connect.common.model.biz.Attachment;
//import com.fedex.connect.common.model.biz.Consignment;
//import com.fedex.connect.common.model.biz.PushOb;
//import com.fedex.connect.task.config.PropertiesConfig;
//import com.fedex.connect.task.data.bo.Imp001FileInfoBo;
//import com.fedex.connect.task.data.bo.Imp001GenerateBo;
//import com.fedex.connect.task.data.dto.imp001.*;
//import com.fedex.connect.task.repository.repo.biz.IAttachmentRepository;
//import com.fedex.connect.task.repository.repo.biz.IConsignmentRepository;
//import com.fedex.export.common.util.DateUtil;
//import com.fedex.export.common.util.NioFileUtils;
//import com.fedex.export.common.util.StringExtUtil;
//import com.fedex.export.common.util.Utils;
//import com.fedex.export.config.PropertiesConfig;
//import com.fedex.export.constants.Constant;
//import com.fedex.export.data.bo.Imp001FileInfoBo;
//import com.fedex.export.data.bo.Imp001GenerateBo;
//import com.fedex.export.data.dto.tw001.*;
//import com.fedex.export.repository.entity.*;
//import com.fedex.export.repository.entity.log.PushObLog;
//import com.fedex.export.service.business.IDeclareCheckInfoService;
//import com.fedex.export.service.business.IDeclareCustomsFileService;
//import com.fedex.export.service.business.IDeclareInfoService;
//import com.fedex.export.service.business.IUploadFileService;
//import com.fedex.export.service.system.ISysDictionaryService;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//import java.util.*;
//
///**
// * @Author mt
// * @Description imp001报文生成json,util
// * @Date 2024/5/24
// */
//@Slf4j
//@Component
//public class Imp001GenerateUtil {
// @Autowired
// CacheSystem cacheSystem;
// @Autowired
// private IAttachmentRepository attachmentRepository;
// @Autowired
// private NIOFileUtils nioFileUtils;
// @Autowired
// private PropertiesConfig propertiesConfig;
//
// /**
// * @Author mt
// * @Description 生成imp001报文json对象
// * @Date 2024/11/21
// * @param pushOb
// * @return Imp001GenerateBo
// */
// public Imp001GenerateBo generateImp001Json(PushOb pushOb) throws IOException{
// Imp001RootJsonDto tw001RootJsonDto = new Imp001RootJsonDto();
// List<Attachment> attachmentList = attachmentRepository.queryAttachmentInfo(pushOb.getConsignmentId());
// //生成IMP001报文数据
// Imp001Data imp001Data = new Imp001Data();
// Imp001Consignments[] consignments = new Imp001Consignments[1];
// Imp001Consignments imp001Consignments = new Imp001Consignments();
// //生成运单数据
// Imp001Consignment imp001Consignment = new Imp001Consignment();
// //运单号
// imp001Consignment.setDeliveryNo(pushOb.getConsignmentCode());
// //附件个数
// imp001Consignment.setAttachedFilesCount(attachmentList.size());
// //生成文件列表数据
// Imp001Files[] files = this.generateFiles(attachmentList);
// /***************设置对象赋值***************/
// imp001Consignments.setConsignment(imp001Consignment);
// imp001Consignments.setFiles(files);
// consignments[0] = imp001Consignments;
// imp001Data.setConsignments(consignments);
// //初始化TW001表头信息
// this.initImp001Head(tw001RootJsonDto);
// tw001RootJsonDto.setData(imp001Data);
// //返回对象
// Imp001GenerateBo tw001GenerateBo = new Imp001GenerateBo();
// tw001GenerateBo.setDeclareInfo(declareInfo);
// tw001GenerateBo.setImp001RootJsonDto(tw001RootJsonDto);
// //获取生成tw001临时文件夹目录
// String workFilePath = this.generateWorkPath(declareInfo.getDeliveryNo(),declareInfo.getDeclareId());
// tw001GenerateBo.setWorkFilePath(workFilePath);
// List<Imp001FileInfoBo> fileInfoLists = new ArrayList<Imp001FileInfoBo>();
// //存在图案商标则添加
// if(checkInfo != null && checkInfo.getBrandImage() != null){
// //初始化图案商标文件对象
// Imp001FileInfoBo fileInfoBo = this.initFileInfo(pushFileTypeMap,Constant.SEND_TW001_KEYS.PUSH_FILE_TYPE_KEYS.PUSH_STATUS_OB_5,checkInfo.getBrandImage());
// fileInfoLists.add(fileInfoBo);
// }
// if(files != null){
// for (Imp001Files file : files) {
// //获取文件类型 1:系统生成的的“聯絡方式與特殊交待事項”。2:系统生成的“出口報關檢核表”。3:用户上传的文件
// String fileTypeCode = this.getfileType(file.getSource());
// //初始化文件对象:1:系统生成的的“聯絡方式與特殊交待事項”。2:系统生成的“出口報關檢核表”。3:用户上传的文件
// Imp001FileInfoBo fileInfoBo = this.initFileInfo(pushFileTypeMap,fileTypeCode,file.getName());
// fileInfoLists.add(fileInfoBo);
// }
// }
// //设置文件信息
// tw001GenerateBo.setFileInfoList(fileInfoLists);
// //设置jsonDic
// tw001GenerateBo.setJsonDictionary(pushFileTypeMap.get(Constant.SEND_TW001_KEYS.PUSH_FILE_TYPE_KEYS.PUSH_STATUS_OB_4));
// return tw001GenerateBo;
// }
//
// /**
// * @Author mt
// * @Description 初始化TW001表头信息
// * @Date 2024/11/21
// * @param imp001RootJsonDto
// * @return void
// */
// private void initImp001Head(Imp001RootJsonDto imp001RootJsonDto){
// String UUIDStr=String.valueOf(UUID.randomUUID());
// //消息代码/类型
// imp001RootJsonDto.setMessageId(UUIDStr);
// //消息代码/类型
// imp001RootJsonDto.setMessageCode(Constant.SEND_TW001_KEYS.TW001_HEAD_KEYS.MESSAGE_CODE);
// //发送程序ID
// imp001RootJsonDto.setSenderId(Constant.SEND_TW001_KEYS.TW001_HEAD_KEYS.SENDER_ID);
// //接受程序ID
// imp001RootJsonDto.setReceiverId(Constant.SEND_TW001_KEYS.TW001_HEAD_KEYS.RECEIVER_ID);
// String sendTime = String.valueOf(System.currentTimeMillis());
// //发送时间,时间戳
// imp001RootJsonDto.setSendTime(sendTime);
// }
//
// /**
// * @Author mt
// * @Description 功能说明
// * @Date 2024/5/30
// * @param source 1:系统生成的的“聯絡方式與特殊交待事項”。2:系统生成的“出口報關檢核表”。3:用户上传的文件
// * @return java.lang.String
// */
// private String getfileType(Integer source){
// if(source.equals(Constant.SEND_TW001_KEYS.TW001_FILE_SOURCE_1)){
// return Constant.SEND_TW001_KEYS.PUSH_FILE_TYPE_KEYS.PUSH_STATUS_OB_1;
// }else if(source.equals(Constant.SEND_TW001_KEYS.TW001_FILE_SOURCE_2)){
// return Constant.SEND_TW001_KEYS.PUSH_FILE_TYPE_KEYS.PUSH_STATUS_OB_2;
// }else if(source.equals(Constant.SEND_TW001_KEYS.TW001_FILE_SOURCE_3)){
// return Constant.SEND_TW001_KEYS.PUSH_FILE_TYPE_KEYS.PUSH_STATUS_OB_3;
// }
// return null;
// }
//
// /**
// * @Author mt
// * @Description 功能说明 初始化fileInfo
// * @Date 2024/5/30
// * @param pushFileTypeMap
// * @param fileTypeCode
// * @param fileName
// * @return com.fedex.export.data.bo.Imp001FileInfoBo
// */
// private Imp001FileInfoBo initFileInfo(Map<String,SysDictionary> pushFileTypeMap, String fileTypeCode, String fileName){
// Imp001FileInfoBo fileInfoBo = new Imp001FileInfoBo();
// //类型编码不为空则初始化文件id,文件类型
// if(StringUtils.isNotEmpty(fileTypeCode)) {
// SysDictionary fileTypeDic = pushFileTypeMap.get(fileTypeCode);
// if (fileTypeDic != null) {
// fileInfoBo.setFileTypeId(fileTypeDic.getId());
// fileInfoBo.setFileTypeName(fileTypeDic.getChineseName());
// }
// }
// fileInfoBo.setPushTime(new Date());
// fileInfoBo.setFileName(fileName);
// return fileInfoBo;
// }
//
// /**
// * @Author mt
// * @Description 生成文件对象集合vo,并且将文件复制到指定目录
// * @Date 2024/11/21
// * @param attachmentList
// * @return com.fedex.connect.task.data.dto.imp001.Imp001Files[]
// */
// private Imp001Files[] generateFiles(List<Attachment> attachmentList) throws IOException{
// if(attachmentList == null || attachmentList.size() == 0){
// return null;
// }
// Imp001Files[] tw001Files = new Imp001Files[attachmentList.size()];
// for(int i = 0 ; i < attachmentList.size() ; i ++){
// Attachment attachment = attachmentList.get(i);
// Imp001Files file = new Imp001Files();
// //获取附件业务类型
// DictionaryEntries attBizType = cacheSystem.getDicAttachmentBizType(attachment.getBizTypeCode());
// //运单、发票、箱单、其他
// String bizTypeCode = attBizType.getExt1();
// if(StringUtils.isEmpty(bizTypeCode)){
// continue;
// }
// //重置文件名称,并且复制源文件到指定目录
// String fileName = this.generateFileName(uploadFile, deliveryNo, declareId);
// if(fileName == null){
// continue;
// }
// //文件名称
// file.setName(fileName);
// //文件来源
// file.setSource(source);
// //文件后缀转换为小写
// String suffix = uploadFile.getType();
// if(suffix != null){
// suffix = suffix.toLowerCase();
// }
// //文件名后缀
// file.setSuffix(suffix);
// //文件大小
// file.setFileSizeByte(uploadFile.getFileSizeByte() == null ? null : uploadFile.getFileSizeByte().intValue());
// tw001Files[i] = file;
// }
// return tw001Files;
// }
//
// /**
// * @Author mt
// * @Description 重置文件名称,并且复制源文件到指定目录
// * @Date 2024/5/29
// * @param uploadFile
// * @param deliveryNo
// * @param declareId
// * @return java.lang.String
// */
// private String generateFileName(UploadFile uploadFile,String deliveryNo,Long declareId) throws IOException{
// String generateFileName = null;
// if(!Utils.isEmpty(uploadFile.getName())){
// generateFileName = deliveryNo
// + Constant.COMMON_KEYS.UNDER_LINE + StringExtUtil.idLeftPadStr(uploadFile.getId())
// + Constant.COMMON_KEYS.UNDER_LINE + uploadFile.getName()
// + Constant.COMMON_KEYS.UNDER_LINE + DateUtil.yyyyMMddHH24mmssSSS(new Date()) + uploadFile.getType();
// }
// //获取源文件目录 实际文件路径:/var/share/icleartw/upload/declareFile/202401/476/出口報關申請表_20240116_132402_827.pdf
// String sourceFilePath = uploadFile.getServerPath() + Constant.COMMON_KEYS.BACK_SLASH + uploadFile.getServerName();
// //获取复制目标目录
// String targetFilePath = this.generateWorkPath(deliveryNo,declareId) + generateFileName;
// //原始文件存在则复制文件
// if(nioFileUtils.fileExists(sourceFilePath)){
// //复制文件到指定目录
// nioFileUtils.copyFile(sourceFilePath,targetFilePath);
// return generateFileName;
// }else{
// return null;
// }
// }
//
// /**
// * @Author mt
// * @Description 生成文件夹目录 /var/share/icleartw/TWIMPORT/work/yyyy-MM-dd/运单号_运单ID/
// * @Date 2024/5/29
// * @param deliveryNo
// * @param declareId
// * @return java.lang.String
// */
// private String generateWorkPath(String deliveryNo,Long declareId){
// String yyyyMMdd = DateUtil.format(new Date());
// String fileDir = propertiesConfig.getTw001PathWork() + Constant.COMMON_KEYS.BACK_SLASH +
// yyyyMMdd + Constant.COMMON_KEYS.BACK_SLASH +
// deliveryNo + Constant.COMMON_KEYS.UNDER_LINE + declareId + Constant.COMMON_KEYS.BACK_SLASH;
// //如果目录不存在则创建完整目录
// nioFileUtils.mkdirs(fileDir);
// return fileDir;
// }
//}
\ No newline at end of file
package com.fedex.connect.task.utils.biz.imp001;
import com.fedex.connect.common.dependencies.cache.CacheSystem;
import com.fedex.connect.common.dependencies.contants.BaseSeparatorConstants;
import com.fedex.connect.common.dependencies.contants.DigitConstants;
import com.fedex.connect.common.dependencies.util.DateUtil;
import com.fedex.connect.common.dependencies.util.NIOFileUtils;
import com.fedex.connect.common.dependencies.util.StringExtUtil;
import com.fedex.connect.common.dependencies.util.Utils;
import com.fedex.connect.common.model.bi.DictionaryEntries;
import com.fedex.connect.common.model.biz.Attachment;
import com.fedex.connect.common.model.biz.PushOb;
import com.fedex.connect.task.config.PropertiesConfig;
import com.fedex.connect.task.constants.Constant;
import com.fedex.connect.task.data.bo.Imp001GenerateBo;
import com.fedex.connect.task.data.dto.imp001.*;
import com.fedex.connect.task.repository.repo.biz.IAttachmentRepository;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* @Author mt
* @Description imp001报文生成json,util
* @Date 2024/5/24
*/
@Slf4j
@Component
public class Imp001GenerateUtil {
@Autowired
CacheSystem cacheSystem;
@Autowired
private IAttachmentRepository attachmentRepository;
@Autowired
private NIOFileUtils nioFileUtils;
@Autowired
private PropertiesConfig propertiesConfig;
/**
* @Author mt
* @Description 生成imp001报文json对象
* @Date 2024/11/21
* @param pushOb
* @return Imp001GenerateBo
*/
public Imp001GenerateBo generateImp001Json(PushOb pushOb) throws IOException{
Imp001RootJsonDto imp001RootJsonDto = new Imp001RootJsonDto();
List<Attachment> attachmentList = attachmentRepository.queryAttachmentInfo(pushOb.getUploadRecordId(),pushOb.getConsignmentId());
//生成IMP001报文数据
Imp001Data imp001Data = new Imp001Data();
Imp001Consignments[] consignments = new Imp001Consignments[1];
Imp001Consignments imp001Consignments = new Imp001Consignments();
//生成运单数据
Imp001Consignment imp001Consignment = new Imp001Consignment();
//运单号
imp001Consignment.setDeliveryNo(pushOb.getConsignmentCode());
//附件个数
imp001Consignment.setAttachedFilesCount(attachmentList.size());
//生成文件列表数据
Imp001Files[] files = this.generateFiles(attachmentList,pushOb.getConsignmentCode(),pushOb.getConsignmentId());
/***************设置对象赋值***************/
imp001Consignments.setConsignment(imp001Consignment);
imp001Consignments.setFiles(files);
consignments[0] = imp001Consignments;
imp001Data.setConsignments(consignments);
//初始化IMP001表头信息
this.initImp001Head(imp001RootJsonDto);
imp001RootJsonDto.setData(imp001Data);
//返回对象
Imp001GenerateBo imp001GenerateBo = new Imp001GenerateBo();
imp001GenerateBo.setImp001RootJsonDto(imp001RootJsonDto);
//获取生成imp001临时文件夹目录
String workFilePath = this.generateWorkPath(pushOb.getConsignmentCode(),pushOb.getConsignmentId());
imp001GenerateBo.setWorkFilePath(workFilePath);
//设置文件信息
imp001GenerateBo.setFileInfos(files);
//设置运单号
imp001GenerateBo.setConsignmentCode(pushOb.getConsignmentCode());
//设置运单ID
imp001GenerateBo.setConsignmentId(pushOb.getConsignmentId());
return imp001GenerateBo;
}
/**
* @Author mt
* @Description 初始化imp001表头信息
* @Date 2024/11/21
* @param imp001RootJsonDto
* @return void
*/
private void initImp001Head(Imp001RootJsonDto imp001RootJsonDto){
String UUIDStr=String.valueOf(UUID.randomUUID());
//消息代码/类型
imp001RootJsonDto.setMessageId(UUIDStr);
//消息代码/类型
imp001RootJsonDto.setMessageCode(Constant.IMP001_HEAD_KEYS.MESSAGE_CODE);
//发送程序ID
imp001RootJsonDto.setSenderId(Constant.IMP001_HEAD_KEYS.SENDER_ID);
//接受程序ID
imp001RootJsonDto.setReceiverId(Constant.IMP001_HEAD_KEYS.RECEIVER_ID);
String sendTime = String.valueOf(System.currentTimeMillis());
//发送时间,时间戳
imp001RootJsonDto.setSendTime(sendTime);
}
/**
* @Author mt
* @Description 生成文件对象集合vo,并且将文件复制到指定目录
* @Date 2024/11/21
* @param attachmentList
* @return com.fedex.connect.task.data.dto.imp001.Imp001Files[]
*/
private Imp001Files[] generateFiles(List<Attachment> attachmentList,String consignmentCode,Long consignmentId) throws IOException{
if(attachmentList == null || attachmentList.size() == 0){
return null;
}
Imp001Files[] imp001Files = new Imp001Files[attachmentList.size()];
for(int i = 0 ; i < attachmentList.size() ; i ++){
Attachment attachment = attachmentList.get(i);
Imp001Files file = new Imp001Files();
//获取附件业务类型
DictionaryEntries attBizType = cacheSystem.getDicAttachmentBizType(attachment.getBizTypeCode());
//运单、发票、箱单、其他
String bizTypeCode = attBizType.getExt1();
if(StringUtils.isEmpty(bizTypeCode)){
continue;
}
//重置文件名称,并且复制源文件到指定目录
String fileName = this.generateFileName(attachment, (i+1),bizTypeCode, consignmentCode, consignmentId);
if(fileName == null){
continue;
}
//文件名称
file.setName(fileName);
//文件来源
file.setContentType(bizTypeCode);
//获取文件后缀,文件后缀转换为小写
String suffix = fileName.substring(fileName.lastIndexOf(BaseSeparatorConstants.SEPARATOR_POINT));
if(suffix != null){
suffix = suffix.toLowerCase();
}
//文件名后缀
file.setSuffix(suffix);
//文件大小
file.setFileSizeByte(attachment.getFileSize() == null ? null : attachment.getFileSize().intValue());
imp001Files[i] = file;
}
return imp001Files;
}
/**
* @Author mt
* @Description 重置文件名称,并且复制源文件到指定目录
* @Date 2024/12/18
* @param attachment
* @param consignmentCode
* @param consignmentId
* @return java.lang.String
*/
private String generateFileName(Attachment attachment,
Integer index,
String bizTypeCode,
String consignmentCode,
Long consignmentId) throws IOException{
String generateFileName = null;
String fileName = attachment.getFileName();
if(!Utils.isEmpty(fileName)){
//获取文件后缀
String fileSuffix = fileName.substring(fileName.lastIndexOf(BaseSeparatorConstants.SEPARATOR_POINT));
/**
* AWB_12位运单号_10位运单ID_三位文件顺序号_yyyyMMddHHmmssSSS
*/
generateFileName = bizTypeCode + BaseSeparatorConstants.SEPARATOR_UNDERLINE + consignmentCode
+ BaseSeparatorConstants.SEPARATOR_UNDERLINE + StringExtUtil.idLeftPadStr(attachment.getId(), DigitConstants.DIGIT_TEN)
+ BaseSeparatorConstants.SEPARATOR_UNDERLINE + StringExtUtil.idLeftPadStr(index.longValue(), DigitConstants.DIGIT_THREE)
+ BaseSeparatorConstants.SEPARATOR_UNDERLINE + DateUtil.yyyyMMddHH24mmssSSS(new Date()) + fileSuffix;
}
//获取源文件目录 实际文件路径:/var/share/iclearConnect/upload/attachment/2024-12-18/313913426666/AWB_202412161_20241218131852_001.pdf
String sourceFilePath = attachment.getFilePath() + BaseSeparatorConstants.SEPARATOR_SLASH + attachment.getFileName();
//获取复制目标目录
String targetFilePath = this.generateWorkPath(consignmentCode,consignmentId) + generateFileName;
//原始文件存在则复制文件
if(nioFileUtils.fileExists(sourceFilePath)){
//复制文件到指定目录
nioFileUtils.copyFile(sourceFilePath,targetFilePath);
return generateFileName;
}else{
return null;
}
}
/**
* @Author mt
* @Description 生成文件夹目录 /var/share/iClearPreCLR/ToIMPORT/work/yyyy-MM-dd/运单号_运单ID/
* @Date 2024/12/18
* @param consignmentCode
* @param consignmentId
* @return java.lang.String
*/
private String generateWorkPath(String consignmentCode,Long consignmentId){
String yyyyMMdd = DateUtil.format(new Date());
String fileDir = propertiesConfig.getImp001PathWork() + yyyyMMdd + BaseSeparatorConstants.SEPARATOR_SLASH +
consignmentCode + BaseSeparatorConstants.SEPARATOR_UNDERLINE + consignmentId + BaseSeparatorConstants.SEPARATOR_SLASH;
//如果目录不存在则创建完整目录
nioFileUtils.mkdirs(fileDir);
return fileDir;
}
}
\ No newline at end of file
......
//package com.fedex.connect.task.utils.biz.imp001;
//
//import com.fedex.connect.task.config.PropertiesConfig;
//import com.fedex.connect.task.data.bo.Imp001GenerateBo;
//import com.fedex.export.common.util.*;
//import com.fedex.export.config.PropertiesConfig;
//import com.fedex.export.constants.Constant;
//import com.fedex.export.data.bo.Imp001FileInfoBo;
//import com.fedex.export.data.bo.Imp001GenerateBo;
//import com.fedex.export.repository.entity.DeclareInfo;
//import com.fedex.export.repository.entity.SysDictionary;
//import lombok.extern.slf4j.Slf4j;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.io.File;
//import java.io.FileOutputStream;
//import java.util.ArrayList;
//import java.util.Date;
//import java.util.List;
//import java.util.Objects;
//
///**
// * @Author mt
// * @Description tw001报文推送,util
// * @Date 2024/5/29
// */
//@Slf4j
//@Component
//public class Imp001PushUtil {
// @Autowired
// PropertiesConfig propertiesConfig;
// @Autowired
// ZipUtils zipUtils;
// @Autowired
// NioFileUtils nioFileUtils;
//
// /**
// * @Author mt
// * @Description 推送imp001
// * @Date 2024/11/21
// * @param imp001GenerateBo
// * @return void
// */
// public void pushImp001(Imp001GenerateBo imp001GenerateBo) throws Exception{
// long start = System.currentTimeMillis();
// //生成zip临时文件到指定临时目录
// String zipFileName = this.toZips(imp001GenerateBo);
// //zip原始临时目录,zip为临时文件
// String zipSourceTempFilePath = imp001GenerateBo.getWorkFilePath() + zipFileName + Constant.FILE_SUFFIX_KEYS.TEMP;
// //推送zip文件最终目录
// String zipTargetFilePath = propertiesConfig.getTw001PathFinal() + zipFileName;
// //记录zip文件名称
// tw001GenerateBo.setZipFileName(zipFileName);
// //记录zip文件目标路径
// tw001GenerateBo.setZipFileTargetPath(zipTargetFilePath);
// //如果目录不存在则创建完整目录
// nioFileUtils.mkdirs(propertiesConfig.getTw001PathFinal());
// //推送zip临时文件到指定目标目录,复制文件到指定目录,采用
// String zipTargetTempFilePath = zipTargetFilePath + Constant.FILE_SUFFIX_KEYS.TEMP;
// //复制文件至目标目录,为临时文件
// nioFileUtils.copyFile(zipSourceTempFilePath,zipTargetTempFilePath);
// log.info("复制到目标目录完成 sourceTempFilePath : {} , targetTempFilePath : {} ",zipSourceTempFilePath,zipTargetTempFilePath);
// //重命名为正式文件
// nioFileUtils.moveFile(zipTargetTempFilePath,zipTargetFilePath);
// log.info("重命名为正式文件成功 zipTargetTempFilePath : {} , zipTargetFilePath : {} ",zipTargetTempFilePath,zipTargetFilePath);
// long end = System.currentTimeMillis();
// log.info("运单号TW001:{} 推送完成,总计耗时:{} ms",tw001GenerateBo.getDeclareInfo().getDeliveryNo() ,(end - start));
// }
//
// /**
// * @Author mt
// * @Description 功能说明 生成zip临时文件到指定临时目录
// * @Date 2024/5/30
// * @param tw001GenerateBo
// * @return java.lang.String
// */
// private String toZips(Imp001GenerateBo tw001GenerateBo) throws Exception{
// /******************初始化需要压缩文件列表****************/
// List<File> filesList = new ArrayList<File>();
// //生成json文件名称
// String jsonFileName = this.generateJsonFileName(tw001GenerateBo,"", Constant.FILE_SUFFIX_KEYS.JSON);
// //生成json文件
// JsonToJava.createJsonFile(JsonToJava.toJson(tw001GenerateBo.getTw001RootJsonDto()),
// tw001GenerateBo.getWorkFilePath(), jsonFileName);
// //获取json完整路径
// String jsonFilePath = tw001GenerateBo.getWorkFilePath() + jsonFileName;
// filesList.add(new File(jsonFilePath));
// //文件名称
// Utils.listOf(tw001GenerateBo.getFileInfoList()).stream().filter(Objects::nonNull).forEach(fileInfo ->{
// //文件如果存在则添加到文件集合中
// File file = new File(tw001GenerateBo.getWorkFilePath() + fileInfo.getFileName());
// if(file.exists()){
// filesList.add(file);
// }
// });
// //初始化json文件对象,并添加到文件集合中
// this.initJsonFileInfo(tw001GenerateBo,jsonFileName);
// //生成zip文件名称 .zip
// String zipFileName = this.generateJsonFileName(tw001GenerateBo, Constant.SEND_TW001_KEYS.TW001_HEAD_KEYS.MESSAGE_CODE, Constant.FILE_SUFFIX_KEYS.ZIP);
// //生成zip临时文件名称 .temp
// String zipTempFileName = zipFileName + Constant.FILE_SUFFIX_KEYS.TEMP;
// FileOutputStream fos = null;
// try{
// //完整zip临时文件名称
// File zipTemp = new File(tw001GenerateBo.getWorkFilePath() + zipTempFileName);
// fos = new FileOutputStream(zipTemp);
// zipUtils.toZip(filesList, fos);
// }catch(Exception ex){
// log.error("生成压缩包错误:{}",ex.getMessage(),ex);
// throw ex;
// }finally{
// try {
// if (fos != null) {
// fos.close();
// fos = null;
// }
// } catch (Exception e) {
// log.error(e.getMessage(),e);
// throw e;
// }
// }
// return zipFileName;
// }
//
// /**
// * @Author mt
// * @Description 功能说明 初始化json文件对象
// * @Date 2024/5/30
// * @param tw001GenerateBo
// * @param jsonFileName
// * @return void
// */
// private void initJsonFileInfo(Imp001GenerateBo tw001GenerateBo,String jsonFileName){
// SysDictionary jsonDic = tw001GenerateBo.getJsonDictionary();
// Imp001FileInfoBo fileInfoBo = new Imp001FileInfoBo();
// fileInfoBo.setFileName(jsonFileName);
// fileInfoBo.setFileTypeId(jsonDic.getId());
// fileInfoBo.setFileTypeName(jsonDic.getChineseName());
// fileInfoBo.setPushTime(new Date());
// tw001GenerateBo.getFileInfoList().add(fileInfoBo);
// }
//
// /**
// * @Author mt
// * @Description 功能说明 生成文件名称
// * @Date 2024/5/30
// * @param tw001GenerateBo
// * @param prefix 前缀
// * @param suffix 后缀
// * @return java.lang.String
// */
// private String generateJsonFileName(Imp001GenerateBo tw001GenerateBo,String prefix,String suffix){
// DeclareInfo declareInfo = tw001GenerateBo.getDeclareInfo();
// String fileName = prefix + declareInfo.getDeliveryNo() + Constant.COMMON_KEYS.UNDER_LINE
// + StringExtUtil.idLeftPadStr(declareInfo.getDeclareId()) + Constant.COMMON_KEYS.UNDER_LINE +
// DateUtil.yyyyMMddHH24mmssSSS(new Date()) + suffix;
// return fileName;
// }
//}
\ No newline at end of file
package com.fedex.connect.task.utils.biz.imp001;
import com.fedex.connect.common.dependencies.contants.BaseSeparatorConstants;
import com.fedex.connect.common.dependencies.contants.DigitConstants;
import com.fedex.connect.common.dependencies.util.*;
import com.fedex.connect.task.config.PropertiesConfig;
import com.fedex.connect.task.constants.Constant;
import com.fedex.connect.task.data.bo.Imp001GenerateBo;
import com.fedex.connect.task.data.dto.imp001.Imp001Files;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @Author mt
* @Description imp001报文推送,util
* @Date 2024/5/29
*/
@Slf4j
@Component
public class Imp001PushUtil {
@Autowired
PropertiesConfig propertiesConfig;
@Autowired
ZipUtils zipUtils;
@Autowired
NIOFileUtils nioFileUtils;
/**
* @Author mt
* @Description 推送imp001
* @Date 2024/11/21
* @param imp001GenerateBo
* @return void
*/
public void pushImp001(Imp001GenerateBo imp001GenerateBo) throws Exception{
long start = System.currentTimeMillis();
//生成zip临时文件到指定临时目录
String zipFileName = this.toZips(imp001GenerateBo);
//zip原始临时目录,zip为临时文件
String zipSourceTempFilePath = imp001GenerateBo.getWorkFilePath() + zipFileName + Constant.FILE_SUFFIX_KEYS.TEMP;
//推送zip文件最终目录
String zipTargetFilePath = propertiesConfig.getImp001PathFinal() + zipFileName;
//记录zip文件名称
imp001GenerateBo.setZipFileName(zipFileName);
//记录zip文件目标路径
imp001GenerateBo.setZipFileTargetPath(zipTargetFilePath);
//如果目录不存在则创建完整目录
nioFileUtils.mkdirs(propertiesConfig.getImp001PathFinal());
//推送zip临时文件到指定目标目录,复制文件到指定目录,采用
String zipTargetTempFilePath = zipTargetFilePath + Constant.FILE_SUFFIX_KEYS.TEMP;
//复制文件至目标目录,为临时文件
nioFileUtils.copyFile(zipSourceTempFilePath,zipTargetTempFilePath);
log.info("复制到目标目录完成 sourceTempFilePath : {} , targetTempFilePath : {} ",zipSourceTempFilePath,zipTargetTempFilePath);
//重命名为正式文件
nioFileUtils.moveFile(zipTargetTempFilePath,zipTargetFilePath);
log.info("重命名为正式文件成功 zipTargetTempFilePath : {} , zipTargetFilePath : {} ",zipTargetTempFilePath,zipTargetFilePath);
long end = System.currentTimeMillis();
log.info("运单号IMP001:{} 推送完成,总计耗时:{} ms",imp001GenerateBo.getConsignmentCode() ,(end - start));
}
/**
* @Author mt
* @Description 功能说明 生成zip临时文件到指定临时目录,将用户上传,以及生成的json文件打包进zip文件中
* @Date 2024/5/30
* @param imp001GenerateBo
* @return java.lang.String
*/
private String toZips(Imp001GenerateBo imp001GenerateBo) throws Exception{
/******************初始化需要压缩文件列表****************/
List<File> filesList = new ArrayList<File>();
//生成json文件名称
String jsonFileName = this.generateJsonFileName(imp001GenerateBo,"", Constant.FILE_SUFFIX_KEYS.JSON);
//生成json文件
JsonToJava.createJsonFile(JsonToJava.toJson(imp001GenerateBo.getImp001RootJsonDto()),
imp001GenerateBo.getWorkFilePath(), jsonFileName);
//获取json完整路径
String jsonFilePath = imp001GenerateBo.getWorkFilePath() + jsonFileName;
filesList.add(new File(jsonFilePath));
//文件名称
Imp001Files[] fileInfos = imp001GenerateBo.getFileInfos();
if(fileInfos != null && fileInfos.length > 0){
for (Imp001Files fileInfo : fileInfos) {
//文件如果存在则添加到文件集合中
File file = new File(imp001GenerateBo.getWorkFilePath() + fileInfo.getName());
if(file.exists()){
filesList.add(file);
}
}
}
//生成zip文件名称 .zip
String zipFileName = this.generateJsonFileName(imp001GenerateBo, Constant.IMP001_HEAD_KEYS.MESSAGE_CODE, Constant.FILE_SUFFIX_KEYS.ZIP);
//生成zip临时文件名称 .temp
String zipTempFileName = zipFileName + Constant.FILE_SUFFIX_KEYS.TEMP;
FileOutputStream fos = null;
try{
//完整zip临时文件名称
File zipTemp = new File(imp001GenerateBo.getWorkFilePath() + zipTempFileName);
fos = new FileOutputStream(zipTemp);
zipUtils.toZip(filesList, fos);
}catch(Exception ex){
log.error("生成压缩包错误:{}",ex.getMessage(),ex);
throw ex;
}finally{
try {
if (fos != null) {
fos.close();
fos = null;
}
} catch (Exception e) {
log.error(e.getMessage(),e);
throw e;
}
}
return zipFileName;
}
/**
* @Author mt
* @Description 功能说明 生成文件名称
* @Date 2024年12月18日
* @param imp001GenerateBo
* @param prefix 前缀
* @param suffix 后缀
* @return java.lang.String
*/
private String generateJsonFileName(Imp001GenerateBo imp001GenerateBo,String prefix,String suffix){
String fileName = prefix + imp001GenerateBo.getConsignmentCode() + BaseSeparatorConstants.SEPARATOR_UNDERLINE
+ StringExtUtil.idLeftPadStr(imp001GenerateBo.getConsignmentId(), DigitConstants.DIGIT_TEN) + BaseSeparatorConstants.SEPARATOR_UNDERLINE +
DateUtil.yyyyMMddHH24mmssSSS(new Date()) + suffix;
return fileName;
}
}
\ No newline at end of file
......
//package com.fedex.connect.task.utils.biz.imp001;
//
//import com.fedex.connect.common.model.biz.PushOb;
//import com.fedex.connect.task.config.PropertiesConfig;
//import com.fedex.connect.task.data.bo.Imp001GenerateBo;
//import com.fedex.export.common.enums.PushLogEnum;
//import com.fedex.export.common.util.DateUtil;
//import com.fedex.export.common.util.NioFileUtils;
//import com.fedex.export.common.util.Utils;
//import com.fedex.export.config.PropertiesConfig;
//import com.fedex.export.constants.Constant;
//import com.fedex.export.data.bo.Imp001GenerateBo;
//import com.fedex.export.repository.entity.DeclareInfo;
//import com.fedex.export.repository.entity.log.PushObDetail;
//import com.fedex.export.repository.entity.log.PushObLog;
//import com.fedex.export.repository.repo.business.IPushObLogRepository;
//import com.fedex.export.service.business.IPushObDetailService;
//import lombok.extern.slf4j.Slf4j;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.util.ArrayList;
//import java.util.Date;
//import java.util.List;
//import java.util.Objects;
//
///**
// * @Author mt
// * @Description 类说明 推送tw001完成,记录日志,并且备份数据
// * @Date 2024/5/30
// */
//@Slf4j
//@Component
//public class Imp001RecordLogUtil {
// @Autowired
// PropertiesConfig propertiesConfig;
// @Autowired
// IPushObLogRepository pushObLogRepository;
// @Autowired
// IPushObDetailService pushObDetailService;
// @Autowired
// NioFileUtils nioFileUtils;
//
// /**
// * @Author mt
// * @Description 推送成功记录日志
// * @Date 2024/11/21
// * @param imp001GenerateBo
// * @param obLog
// * @return void
// */
// public void pushSuccessRecordLog(Imp001GenerateBo imp001GenerateBo, PushOb obLog){
// try {
// if(Objects.nonNull(imp001GenerateBo)){
// //备份文件,并且记录日志
// String targetPath = this.recordLog(imp001GenerateBo,obLog , propertiesConfig.getTw001PathBak(),PushLogEnum.PUSHED_SUCCESS,null);
// obLog.setFileName(imp001GenerateBo.getZipFileName());
// obLog.setFilePath(imp001GenerateBo.getZipFileTargetPath());
// obLog.setFileBackPath(targetPath);
// }
// obLog.setPushNum(obLog.getPushNum() + 1);
// obLog.setPushStatus(PushLogEnum.PUSHED_SUCCESS.getKey());
// obLog.setPushStatusDescribe(PushLogEnum.PUSHED_SUCCESS.getValue());
// obLog.setPushTime(new Date());
// obLog.setRemark("");
// //更新推送日志主表
// pushObLogRepository.updateById(obLog);
// }catch(Exception ex){
// log.error("pushSuccessRecordLog : {} " ,ex.getMessage(),ex);
// }
// }
//
// /**
// * @Author mt
// * @Description 功能说明 推送失败记录日志
// * @Date 2024/5/30
// * @param tw001GenerateBo
// * @param errorMsg
// * @return void
// */
// public void pushFailRecordLog(Imp001GenerateBo tw001GenerateBo, PushOb obLog, String errorMsg){
// try {
// if(Objects.nonNull(tw001GenerateBo)){
// //备份文件,并且记录失败日志
// String targetPath = this.recordLog(tw001GenerateBo,obLog,propertiesConfig.getTw001PathError(),PushLogEnum.PUSH_FAILED,errorMsg);
// obLog.setFileName(tw001GenerateBo.getZipFileName());
// obLog.setFilePath(tw001GenerateBo.getZipFileTargetPath());
// obLog.setFileBackPath(targetPath);
// }
// obLog.setPushNum(obLog.getPushNum() + 1);
// obLog.setPushStatus(PushLogEnum.PUSH_FAILED.getKey());
// obLog.setPushStatusDescribe(PushLogEnum.PUSH_FAILED.getValue());
// obLog.setPushTime(new Date());
// obLog.setRemark(errorMsg);
// //更新推送日志主表
// pushObLogRepository.updateById(obLog);
// }catch(Exception ex){
// log.error("pushFailRecordLog : {} " ,ex.getMessage(),ex);
// }
// }
//
// /**
// * @Author mt
// * @Description 功能说明 备份文件
// * @Date 2024/5/30
// * @param tw001GenerateBo
// * @param tarPath
// * @return 返回目标备份路径
// */
// private String recordLog(Imp001GenerateBo tw001GenerateBo,
// PushOb obLog,
// String tarPath,
// PushLogEnum pushLogEnum,
// String remark){
// String returnTargetPath = "";
// try{
// DeclareInfo declareInfo = tw001GenerateBo.getDeclareInfo();
// //文件原始路径
// String sourcePath = tw001GenerateBo.getWorkFilePath();
// //生成文件目标路径
// String targetPath = this.generateFilePath(declareInfo.getDeliveryNo(),declareInfo.getDeclareId(),tarPath);
// returnTargetPath = targetPath;
// //推送文件明细
// List<PushObDetail> pushObDetailList = new ArrayList<>();
// Utils.listOf(tw001GenerateBo.getFileInfoList()).stream().filter(Objects::nonNull).forEach(o->{
// try {
// //源文件完整路径
// String sPath = sourcePath + o.getFileName();
// //目标文件完整路径
// String tPath = targetPath + o.getFileName();
// //备份文件
// nioFileUtils.moveFile(sPath, tPath);
// //记录日志明细表
// PushObDetail pushObDetail = new PushObDetail();
// pushObDetail.setCreateTime(new Date());
// pushObDetail.setDeclareId(declareInfo.getDeclareId());
// pushObDetail.setDeliveryNo(declareInfo.getDeliveryNo());
// pushObDetail.setPushLogId(obLog.getId());
// pushObDetail.setPushStatus(pushLogEnum.getKey());
// pushObDetail.setPushStatusDescribe(pushLogEnum.getValue());
// pushObDetail.setFileTypeId(o.getFileTypeId());
// pushObDetail.setFileType(o.getFileTypeName());
// pushObDetail.setFileName(o.getFileName());
// pushObDetail.setPushTime(new Date());
// pushObDetail.setRemark(remark);
// pushObDetailList.add(pushObDetail);
// }catch(Exception ex){
// log.error("move file error : {} ",ex.getMessage(),ex);
// }
// });
// //批量插入推送日志明细
// pushObDetailService.batchInsert(pushObDetailList);
// log.info("batchInsert size : {} ",pushObDetailList.size());
// //zip包源文件完整路径
// String sPath = sourcePath + tw001GenerateBo.getZipFileName() + Constant.FILE_SUFFIX_KEYS.TEMP;
// //zip包目标文件完整路径
// String tPath = targetPath + tw001GenerateBo.getZipFileName();
// //备份zip包文件
// nioFileUtils.moveFile(sPath, tPath);
// //删除临时目录文件夹
// nioFileUtils.deleteDir(log,sourcePath,true);
// log.info("删除临时目录文件夹 sourcePath : {} ",sourcePath);
// }catch(Exception ex){
// log.error("recordLog error : {} ",ex.getMessage(),ex);
// }
// return returnTargetPath;
// }
//
// /**
// * @Author mt
// * @Description 功能说明 生成目标文件夹路径
// * @Date 2024/5/30
// * @param filePath
// * @return java.lang.String
// */
// private String generateFilePath(String deliveryNo,Long declareId,String filePath){
// String yyyyMMdd = DateUtil.format(new Date());
// String fileDir = filePath + yyyyMMdd + Constant.COMMON_KEYS.BACK_SLASH +
// deliveryNo + Constant.COMMON_KEYS.UNDER_LINE + declareId + Constant.COMMON_KEYS.BACK_SLASH;
// //如果目录不存在则创建完整目录
// nioFileUtils.mkdirs(fileDir);
// return fileDir;
// }
//}
package com.fedex.connect.task.utils.biz.imp001;
import com.fedex.connect.common.dependencies.contants.BaseSeparatorConstants;
import com.fedex.connect.common.dependencies.util.AssignmentFieldUtils;
import com.fedex.connect.common.dependencies.util.DateUtil;
import com.fedex.connect.common.dependencies.util.NIOFileUtils;
import com.fedex.connect.common.model.bi.DictionaryEntries;
import com.fedex.connect.common.model.biz.PushOb;
import com.fedex.connect.common.model.biz.PushObDetail;
import com.fedex.connect.task.config.PropertiesConfig;
import com.fedex.connect.task.constants.Constant;
import com.fedex.connect.task.data.bo.Imp001GenerateBo;
import com.fedex.connect.task.data.dto.imp001.Imp001Files;
import com.fedex.connect.task.repository.repo.biz.IPushObRepository;
import com.fedex.connect.task.service.biz.IPushObDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* @Author mt
* @Description 类说明 推送tw001完成,记录日志,并且备份数据
* @Date 2024/5/30
*/
@Slf4j
@Component
public class Imp001RecordLogUtil {
@Autowired
PropertiesConfig propertiesConfig;
@Autowired
IPushObRepository pushObLogRepository;
@Autowired
IPushObDetailService pushObDetailService;
@Autowired
NIOFileUtils nioFileUtils;
/**
* @Author mt
* @Description 推送成功记录日志
* @Date 2024/12/18
* @param imp001GenerateBo
* @param obLog
* @param pushSuccessEntries
* @return void
*/
public void pushSuccessRecordLog(Imp001GenerateBo imp001GenerateBo, PushOb obLog, DictionaryEntries pushSuccessEntries){
try {
if(Objects.nonNull(imp001GenerateBo)){
//备份文件,并且记录日志
String targetPath = this.recordLog(imp001GenerateBo,obLog , propertiesConfig.getImp001PathBak(),pushSuccessEntries,null);
obLog.setFileName(imp001GenerateBo.getZipFileName());
obLog.setFilePath(imp001GenerateBo.getZipFileTargetPath());
obLog.setFileBackPath(targetPath);
}
obLog.setPushNum(obLog.getPushNum() + 1);
obLog.setStatusCode(pushSuccessEntries.getCode());
obLog.setStatusName(pushSuccessEntries.getDescription());
obLog.setPushTime(new Date());
obLog.setRemark("");
//更新推送日志主表
pushObLogRepository.updateById(obLog);
}catch(Exception ex){
log.error("pushSuccessRecordLog : {} " ,ex.getMessage(),ex);
}
}
/**
* @Author mt
* @Description 推送失败记录日志
* @Date 2024/12/18
* @param tw001GenerateBo
* @param obLog
* @param pushFailedEntries
* @param errorMsg
* @return void
*/
public void pushFailRecordLog(Imp001GenerateBo tw001GenerateBo, PushOb obLog, DictionaryEntries pushFailedEntries, String errorMsg){
try {
if(Objects.nonNull(tw001GenerateBo)){
//备份文件,并且记录失败日志
String targetPath = this.recordLog(tw001GenerateBo,obLog,propertiesConfig.getImp001PathError(),pushFailedEntries,errorMsg);
obLog.setFileName(tw001GenerateBo.getZipFileName());
obLog.setFilePath(tw001GenerateBo.getZipFileTargetPath());
obLog.setFileBackPath(targetPath);
}
obLog.setPushNum(obLog.getPushNum() + 1);
obLog.setStatusCode(pushFailedEntries.getCode());
obLog.setStatusName(pushFailedEntries.getDescription());
obLog.setPushTime(new Date());
obLog.setRemark(errorMsg);
//更新推送日志主表
pushObLogRepository.updateById(obLog);
}catch(Exception ex){
log.error("pushFailRecordLog : {} " ,ex.getMessage(),ex);
}
}
/**
* @Author mt
* @Description 功能说明 备份文件
* @Date 2024/5/30
* @param tw001GenerateBo
* @param tarPath
* @return 返回目标备份路径
*/
private String recordLog(Imp001GenerateBo tw001GenerateBo,
PushOb obLog,
String tarPath,
DictionaryEntries pushStatusEntries,
String remark){
String returnTargetPath = "";
try{
//文件原始路径
String sourcePath = tw001GenerateBo.getWorkFilePath();
//生成文件目标路径
String targetPath = this.generateFilePath(tw001GenerateBo.getConsignmentCode(),tw001GenerateBo.getConsignmentId(),tarPath);
returnTargetPath = targetPath;
//推送文件明细
List<PushObDetail> pushObDetailList = new ArrayList<>();
Imp001Files[] fileInfos = tw001GenerateBo.getFileInfos();
for (Imp001Files fileInfo : fileInfos) {
try {
//源文件完整路径
String sPath = sourcePath + fileInfo.getName();
//目标文件完整路径
String tPath = targetPath + fileInfo.getName();
//备份文件
nioFileUtils.moveFile(sPath, tPath);
//记录日志明细表
PushObDetail pushObDetail = new PushObDetail();
pushObDetail.setConsignmentId(tw001GenerateBo.getConsignmentId());
pushObDetail.setConsignmentCode(tw001GenerateBo.getConsignmentCode());
pushObDetail.setPushObId(obLog.getId());
pushObDetail.setStatusCode(pushStatusEntries.getCode());
pushObDetail.setStatusName(pushStatusEntries.getDescription());
pushObDetail.setFileType(fileInfo.getContentType());
pushObDetail.setFileName(fileInfo.getName());
pushObDetail.setPushTime(new Date());
pushObDetail.setRemark(remark);
try {
/**
* 初始化表基础字段
*/
AssignmentFieldUtils.assignmentTableBaseField(pushObDetail);
}catch(Exception ex){
ex.printStackTrace();
}
pushObDetailList.add(pushObDetail);
}catch(Exception ex){
log.error("move file error : {} ",ex.getMessage(),ex);
}
}
//批量插入推送日志明细
pushObDetailService.batchInsert(pushObDetailList);
log.info("batchInsert size : {} ",pushObDetailList.size());
//zip包源文件完整路径
String sPath = sourcePath + tw001GenerateBo.getZipFileName() + Constant.FILE_SUFFIX_KEYS.TEMP;
//zip包目标文件完整路径
String tPath = targetPath + tw001GenerateBo.getZipFileName();
//备份zip包文件
nioFileUtils.moveFile(sPath, tPath);
//删除临时目录文件夹
nioFileUtils.deleteDir(log,sourcePath,true);
log.info("删除临时目录文件夹 sourcePath : {} ",sourcePath);
}catch(Exception ex){
log.error("recordLog error : {} ",ex.getMessage(),ex);
}
return returnTargetPath;
}
/**
* @Author mt
* @Description 功能说明 生成目标文件夹路径
* @Date 2024/5/30
* @param filePath
* @return java.lang.String
*/
private String generateFilePath(String consignmentCode,Long consignmentId,String filePath){
String yyyyMMdd = DateUtil.format(new Date());
String fileDir = filePath + yyyyMMdd + BaseSeparatorConstants.SEPARATOR_SLASH +
consignmentCode + BaseSeparatorConstants.SEPARATOR_UNDERLINE + consignmentId + BaseSeparatorConstants.SEPARATOR_SLASH;
//如果目录不存在则创建完整目录
nioFileUtils.mkdirs(fileDir);
return fileDir;
}
}
......
......@@ -3,6 +3,7 @@ package com.fedex.connect.task.utils.sys;
import com.fedex.connect.common.dependencies.cache.CacheSystem;
import com.fedex.connect.common.dependencies.contants.BaseConstants;
import com.fedex.connect.common.dependencies.contants.BaseSeparatorConstants;
import com.fedex.connect.common.dependencies.contants.DigitConstants;
import com.fedex.connect.common.dependencies.enums.biz.EmailStatusEnum;
import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil;
import com.fedex.connect.common.dependencies.template.clearanceEmail.ClearanceEmailTemplate;
......@@ -73,7 +74,7 @@ public class ConFileEmailUtil {
* @param zipUtils
* @return void
*/
public PortFileDto getPortZipMap(PortFileDto portFileDto, List<PushZipEmailDto> attachmentDetailsByBizId, String tempPath, String finalPath, ZipUtils zipUtils){
public PortFileDto getPortZipMap(PortFileDto portFileDto, List<PushZipEmailDto> attachmentDetailsByBizId, String tempPath, String finalPath, ZipUtils zipUtils,String consignmentCode) throws Exception{
List<File> filesList = new ArrayList<>();
String portCode = null;
for (PushZipEmailDto pushZipEmailDto : attachmentDetailsByBizId) {
......@@ -81,17 +82,25 @@ public class ConFileEmailUtil {
if (pushZipEmailDto.getDestIataCode() == null || pushZipEmailDto.getDestIataCode().isEmpty()) {
portCode = BaseConstants.CONSIGNMENT_TABLE_COLUMN_KEYS.DEST_IATA_CODE; // 使用 "destTataCode" 代替空口岸
}
File file = new File(pushZipEmailDto.getFilePath());
File file = new File(pushZipEmailDto.getFilePath()+File.separator+pushZipEmailDto.getFileName());
if (file.exists()) {
filesList.add(file);
}
if (pushZipEmailDto.getCeFlag().equals(DigitConstants.DIGIT_ONE_LONG)){
portFileDto.setShipperContactName(pushZipEmailDto.getShipperContactName());
portFileDto.setShipperEmail(pushZipEmailDto.getShipperEmail());
portFileDto.setShipperPhone(pushZipEmailDto.getShipperPhone());
portFileDto.setShipperAccount(pushZipEmailDto.getShipperAccount());
portFileDto.setOriginCountry(pushZipEmailDto.getOriginCountry());
}else {
portFileDto.setShipperAccount(pushZipEmailDto.getUserInputShipperAccount());
portFileDto.setOriginCountry(pushZipEmailDto.getUserInputOriginCountry());
portFileDto.setShipperEmail(pushZipEmailDto.getShipperEmail());
}
}
String date = DateUtil.yyyyMMddHHmmss(new Date());
String fileName = date + BaseSeparatorConstants.SEPARATOR_UNDERLINE + portCode + BaseConstants.FILE_SUFFIX_KEYS.ZIP;
String fileNameTemp = date + BaseSeparatorConstants.SEPARATOR_UNDERLINE + portCode + BaseConstants.FILE_SUFFIX_KEYS.ZIP + BaseConstants.FILE_SUFFIX_KEYS.TEMP;
String fileName = date + BaseSeparatorConstants.SEPARATOR_UNDERLINE + consignmentCode + BaseConstants.FILE_SUFFIX_KEYS.ZIP;
String fileNameTemp = date + BaseSeparatorConstants.SEPARATOR_UNDERLINE + consignmentCode + BaseConstants.FILE_SUFFIX_KEYS.ZIP + BaseConstants.FILE_SUFFIX_KEYS.TEMP;
FileOutputStream fos = null;
if (CollectionUtils.isEmpty(filesList)){
return portFileDto;
......@@ -110,9 +119,11 @@ public class ConFileEmailUtil {
portFileDto.setDestIataCode(portCode);
portFileDto.setZipPath(finalPath + fileName);
portFileDto.setFileName(fileName);
} catch (Exception e) {
log.error("生成压缩包错误:{}", e.getMessage(), e);
throw e;
} finally {
try {
if (fos != null) {
......@@ -145,7 +156,10 @@ public class ConFileEmailUtil {
/**
* 发送邮件
*/
boolean result = emailUtil.sendMail(mailMessageReqDto);
boolean result = false;
if (StringUtils.isNotEmpty(emailAddress)){
result = emailUtil.sendMail(mailMessageReqDto);
}
return result;
}
......@@ -167,29 +181,26 @@ public class ConFileEmailUtil {
mailConfigDto.setProxyStartFlag(propertiesConfig.getProxyStartFlag());
mailConfigDto.setProxyHost(propertiesConfig.getProxyHost());
mailConfigDto.setProxyPort(propertiesConfig.getProxyPort());
mailConfigDto.setReceiveAccount(emailAddress);
//ce接收人
mailConfigDto.setTo(emailAddress);
//设置邮件标题
mailConfigDto.setSubject(clearanceEmailTemplate.getTitle());
mailConfigDto.setSubject("推送预清关文件");
//设置邮件内容
portFileDto.setShipperEmail(emailAddress);
String body = this.generateContent("zelong.shao@erry.com", propertiesConfig.getEmailAccount(), portFileDto, conPushEmail.getBizCode());
mailConfigDto.setContent(body);
//放入文件列表
if (!StringUtils.isEmpty(portFileDto.getZipPath())){
List<MailAttachmentBo> srcFiles = new ArrayList<>();
File file = new File(portFileDto.getZipPath());
srcFiles.add(new MailAttachmentBo(file, ""));
srcFiles.add(new MailAttachmentBo(file, portFileDto.getFileName()));
mailConfigDto.setFileList(srcFiles);
}
if (propertiesConfig.getEnv().equalsIgnoreCase("dev")
|| propertiesConfig.getEnv().equalsIgnoreCase("test")
) {
//ce接收人
mailConfigDto.setTo("zelong.shao@erry.com");
mailConfigDto.setCcAccount("");
mailConfigDto.setReceiveAccount("zelong.shao@erry.com");
//发件人
mailConfigDto.setFrom(propertiesConfig.getEmailAccount());
//发件人密码
......@@ -209,21 +220,24 @@ public class ConFileEmailUtil {
StringBuilder content = new StringBuilder();
content.append("<font size=\"4\"><br/> " );
content.append("Consignment Code" + ":" + Optional.ofNullable(consignmentCode).orElse(""));
content.append("运单号" + ":" + Optional.ofNullable(consignmentCode).orElse(""));
content.append("<br/> " );
content.append("Shipper Account" + ":" + Optional.ofNullable(portFileDto.getShipperAccount()).orElse(""));
content.append("<br/> " );
content.append("原产国" + ":" + Optional.ofNullable(portFileDto.getOriginCountry()).orElse(""));
content.append("<br/> " );
content.append("Contact Person" + ":" + Optional.ofNullable(portFileDto.getShipperContactName()).orElse(""));
content.append("发件人" + ":" + Optional.ofNullable(portFileDto.getShipperContactName()).orElse(""));
content.append("<br/> " );
content.append("Contact Person's Email" + ":" + Optional.ofNullable(portFileDto.getShipperEmail()).orElse(""));
content.append("发件人邮箱" + ":" + Optional.ofNullable(portFileDto.getShipperEmail()).orElse(""));
content.append("<br/> " );
content.append("Contact Phone" + ":" + Optional.ofNullable(portFileDto.getShipperPhone()).orElse(""));
content.append("</font><br/><br/> " );
content.append("<div style=\"color:#808080;font-style:Arial;font-size:14px;\">" +
"This email was to send declaration files uploaded by customer on the FedEx online declaration platform to " +
Optional.ofNullable(to).orElse("edd@fedex.com") +
" through " +
Optional.ofNullable(from).orElse("donotreply@fedex.com") +
", please do not reply</div>");
"这封电子邮件是将客户在 FedEx iClear Connect System 平台上上传的报关文件通过" +
Optional.ofNullable(to).orElse("zelong.shao@erry.com") +
" 发送给 " +
Optional.ofNullable(from).orElse("tao.mo@erry.com") +
",请勿回复</div>");
return content.toString();
}
......@@ -267,16 +281,19 @@ public class ConFileEmailUtil {
conPushEmail.setFilePath(filePath);
//如果失败次数小于三则更新为待处理,继续处理
if (result){
conPushEmail.setTypeCode(success.getCode());
conPushEmail.setTypeName(success.getEnglishName());
conPushEmail.setStatusCode(success.getCode());
conPushEmail.setStatusName(success.getDescription());
}else {
if (conPushEmail.getSendNum()<3){
conPushEmail.setTypeCode(pending.getCode());
conPushEmail.setTypeName(pending.getEnglishName());
if (conPushEmail.getSendNum()<2 && StringUtils.isNotEmpty(mailMessageReqDto.getTo())){
conPushEmail.setStatusCode(pending.getCode());
conPushEmail.setStatusName(pending.getDescription());
conPushEmail.setSendNum(conPushEmail.getSendNum()+1);
}else {
conPushEmail.setTypeCode(failed.getCode());
conPushEmail.setTypeName(failed.getEnglishName());
conPushEmail.setStatusCode(failed.getCode());
conPushEmail.setStatusName(failed.getDescription());
if (StringUtils.isNotEmpty(mailMessageReqDto.getTo())){
conPushEmail.setSendNum(conPushEmail.getSendNum()+1);
}
}
}
}
......@@ -287,37 +304,38 @@ public class ConFileEmailUtil {
* @Date 2024/11/18
* @param filePath
* @param nioFileUtils
* @param result
* @return java.lang.String
*/
public String backFile(String filePath, NIOFileUtils nioFileUtils,boolean result){
public String backFile(String filePath, NIOFileUtils nioFileUtils,Email conPushEmail){
File file = new File(filePath);
String targetDirPath = null;
try {
// 获取文件的扩展名
String extension = filePath.substring(filePath.lastIndexOf("."));
// 生成新的文件名
String fileName = String.format("%s%s%s%s",
"",
"",
DateUtil.yyyyMMddHHmmss(new Date()),
extension
);
String basePath = "";
try {
// 构建目标文件路径
targetDirPath = String.join(File.separator,
basePath,
fileName
propertiesConfig.getZipPath(),
DateUtil.format(new Date()), // 使用提前生成的时间戳,避免重复计算
conPushEmail.getBizCode(),
file.getName()
);
// 获取目标目录,并创建目录(如果不存在)
File targetDir = new File(targetDirPath).getParentFile();
if (!targetDir.exists()){
targetDir.mkdirs();
}
// 复制文件
nioFileUtils.copyFile(file, targetDirPath);
// 删除临时文件
nioFileUtils.deleteTempFile(Paths.get(filePath));
} catch (Exception e) {
String errorMsg = String.format("文件复制失败:%s,portId:%s,fileName:%s", e.getMessage());
// 错误处理
// 记录错误信息
String errorMsg = String.format("文件复制失败: %s, filePath: %s", e.getMessage(), filePath);
log.error(errorMsg, e);
}
// 返回目标路径
return targetDirPath;
}
......@@ -336,17 +354,18 @@ public class ConFileEmailUtil {
if (result){
//成功后需要将业务表数据删除,保存至历史表
emailRepository.deleteById(conPushEmail.getId());
emailHistory.setId(null);
emailHistoryRepository.saveOrUpdate(emailHistory);
}else {
//失败则根据是否第三次,如果是第三次失败则删除,保存到历史表
if (conPushEmail.getSendNum() == 3){
if (conPushEmail.getSendNum() == 3 || StringUtils.isEmpty(conPushEmail.getToAddress())){
emailRepository.deleteById(conPushEmail.getId());
emailHistory.setId(null);
emailHistoryRepository.saveOrUpdate(emailHistory);
}else {
emailRepository.saveOrUpdate(conPushEmail);
}
}
}
}
......
package com.fedex.connect.task.utils.sys;
import com.fedex.connect.common.dependencies.cache.CacheSystem;
import com.fedex.connect.common.dependencies.contants.ParamConfigConstants;
import com.fedex.connect.common.dependencies.enums.biz.EmailStatusEnum;
import com.fedex.connect.common.dependencies.template.clearanceEmail.DuplicateEmailTemplate;
import com.fedex.connect.common.model.bi.DictionaryEntries;
import com.fedex.connect.common.model.biz.Email;
import com.fedex.connect.common.model.log.EmailHistory;
import com.fedex.connect.common.model.sys.ParamConfig;
import com.fedex.connect.task.config.PropertiesConfig;
import com.fedex.connect.task.data.dto.MailConfigDto;
import com.fedex.connect.task.repository.repo.biz.IEmailRepository;
import com.fedex.connect.task.repository.repo.log.IEmailHistoryRepository;
import com.fedex.connect.task.repository.repo.sys.IParamConfigRepository;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -35,8 +33,6 @@ public class DuplicateEmailUtil {
@Autowired
private DuplicateEmailTemplate duplicateEmailTemplate;
@Autowired
private IParamConfigRepository paramConfigRepository;
/**
* @Author Szl
......@@ -59,7 +55,7 @@ public class DuplicateEmailUtil {
mailConfigDto.setReceiveAccount(email.getToAddress());
//设置邮件标题
mailConfigDto.setSubject(duplicateEmailTemplate.getTitle());
mailConfigDto.setSubject(duplicateEmailTemplate.getTitle(email.getBizCode()));
String emailBody = this.createEmailBody(email.getBizCode());
mailConfigDto.setContent(emailBody);
......@@ -89,14 +85,11 @@ public class DuplicateEmailUtil {
* 邮件备注
*/
StringBuffer remarks = new StringBuffer();
ParamConfig paramConfig = paramConfigRepository.findValueByCode(ParamConfigConstants.TASK_PARAM_KEYS.NOTIFICATION_SENDER_EMAIL_INTERVAL);
this.buildBottom(remarks,paramConfig.getValue());
this.buildBottom(remarks);
/**
* 添加模板
*/
return duplicateEmailTemplate.getBody(propertiesConfig.getBaseUrl()+propertiesConfig.getLine(),
propertiesConfig.getBaseUrl()+propertiesConfig.getFedex(),
bizCode, remarks);
return duplicateEmailTemplate.getBody(bizCode, remarks);
}
......@@ -107,8 +100,8 @@ public class DuplicateEmailUtil {
* @param remarks
* @return void
*/
private void buildBottom(StringBuffer remarks, String paramConfig){
remarks.append(duplicateEmailTemplate.getDescription(paramConfig));
private void buildBottom(StringBuffer remarks){
remarks.append(duplicateEmailTemplate.getDescription());
}
/**
......@@ -120,22 +113,23 @@ public class DuplicateEmailUtil {
* @param cacheSystem
* @return com.fedex.connect.common.model.biz.Email
*/
public void updateEmail(boolean result, Email email, CacheSystem cacheSystem){
public void updateEmail(boolean result, Email email, CacheSystem cacheSystem,MailConfigDto mailConfigDto){
DictionaryEntries pending = cacheSystem.getDicEmailStatus(EmailStatusEnum.PENDING.getCode());
DictionaryEntries success = cacheSystem.getDicEmailStatus(EmailStatusEnum.SUCCESS.getCode());
DictionaryEntries failed = cacheSystem.getDicEmailStatus(EmailStatusEnum.FAILED.getCode());
email.setSendTime(new Date());
email.setBody(mailConfigDto.getContent());
if (result){
email.setStatusCode(success.getCode());
email.setStatusName(success.getEnglishName());
email.setStatusName(success.getDescription());
}else {
if (email.getSendNum()<3){
if (email.getSendNum()<3 && StringUtils.isNotEmpty(mailConfigDto.getTo())){
email.setStatusCode(pending.getCode());
email.setStatusName(pending.getEnglishName());
email.setStatusName(pending.getDescription());
email.setSendNum(email.getSendNum()+1);
}else {
email.setStatusCode(failed.getCode());
email.setStatusName(failed.getEnglishName());
email.setStatusName(failed.getDescription());
}
}
}
......@@ -149,11 +143,12 @@ public class DuplicateEmailUtil {
*/
@Transactional
public void saveEmail(Email email){
if (EmailStatusEnum.PENDING.getCode().equals(email.getTypeCode())){
if (EmailStatusEnum.PENDING.getCode().equals(email.getStatusCode())){
emailRepository.saveOrUpdate(email);
}else {
EmailHistory emailHistory = new EmailHistory();
BeanUtils.copyProperties(email, emailHistory);
emailHistory.setId(null);
emailRepository.deleteById(email.getId());
emailHistoryRepository.saveOrUpdate(emailHistory);
}
......
......@@ -82,11 +82,12 @@ public class SendFailedEmailUtil {
.filter(pushOb -> PushObStatusEnum.PUSH_FAILED.getCode().equals(pushOb.getStatusCode()))
.count();
// 获取前 10 条 CONSIGNMENT_CODE
// 2. 获取 STATUS_CODE 为 PUSH_FAILED 且 MODIFY_TIME 最晚的指定数量的 CONSIGNMENT_CODE
List<String> latestConsignmentCodes = obs.stream()
.filter(pushOb -> PushObStatusEnum.PUSH_FAILED.getCode().equals(pushOb.getStatusCode())) // 筛选 STATUS_CODE 为 PUSH_FAILED
.sorted(Comparator.comparing(PushOb::getModifyTime).reversed()) // 按 MODIFY_TIME 降序排序
.limit(Long.parseLong(size)) // 取前 10 条
.map(PushOb::getConsignmentCode) // 获取 CONSIGNMENT_CODE
.limit(Long.parseLong(size)) // 获取指定数量
.map(PushOb::getConsignmentCode) // 提取 CONSIGNMENT_CODE
.collect(Collectors.toList());
return new SendFailedEmailDto("ob",statusCodeCount,latestConsignmentCodes,totalCount);
}
......@@ -111,22 +112,26 @@ public class SendFailedEmailUtil {
.map(typeCode -> {
List<EmailHistory> emailList = groupedEmails.getOrDefault(typeCode, Collections.emptyList());
// 1. 统计 STATUS_CODE 为 FAILED 的数量
// 1. 统计 STATUS_CODE 为 FAILED 且 sendNum 等于 3 的数量
long statusCodeCount = emailList.stream()
.filter(email -> EmailStatusEnum.FAILED.getCode().equals(email.getStatusCode()))
.filter(email -> EmailStatusEnum.FAILED.getCode().equals(email.getStatusCode())) // 筛选 STATUS_CODE 为 FAILED
.filter(email -> email.getSendNum() >1) // 筛选 sendNum 等于 3
.count();
// 2. 获取 MODIFY_TIME 最晚的 10 个 BIZ_CODE
List<String> latestBizCodes = emailList.stream()
.sorted(Comparator.comparing(EmailHistory::getModifyTime).reversed())
.limit(Long.parseLong(size))
.map(EmailHistory::getBizCode)
// 2. 获取 STATUS_CODE 为 FAILED 且 sendNum 等于 3 且 MODIFY_TIME 最晚的指定数量的 BIZ_CODE
List<String> latestFailedBizCodes = emailList.stream()
.filter(email -> EmailStatusEnum.FAILED.getCode().equals(email.getStatusCode())) // 筛选 STATUS_CODE 为 FAILED
.filter(email -> email.getSendNum() >1) // 筛选 sendNum 等于 3
.sorted(Comparator.comparing(EmailHistory::getModifyTime).reversed()) // 按 MODIFY_TIME 降序排序
.limit(Long.parseLong(size)) // 获取最晚的指定数量
.map(EmailHistory::getBizCode) // 提取 BIZ_CODE
.collect(Collectors.toList());
// 3. 统计 TYPE_CODE 的总数量
long totalCount = emailList.size();
return new SendFailedEmailDto(typeCode, statusCodeCount, latestBizCodes, totalCount);
return new SendFailedEmailDto(typeCode, statusCodeCount, latestFailedBizCodes, totalCount);
})
.collect(Collectors.toList());
return results;
......@@ -173,7 +178,7 @@ public class SendFailedEmailUtil {
.map(String::trim) // 去除每个元素的前后空格
.collect(Collectors.joining(","));
tableRows.append("<tr>" +
"<td style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;\">"+EmailTypeEnum.getEnMsgByCode(failedEmailDto.getTypeCode())+"</td>" +
"<td style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;\">"+EmailTypeEnum.getMsgByCode(failedEmailDto.getTypeCode())+"</td>" +
"<td style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;\">"+ bizCodesStr +"</td>" +
"<td style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;\">"+ failedEmailDto.getTotalCount() +"</td>" +
"<td style=\"border: 1px solid #dddddd;text-align: left;padding: 8px;\">"+ failedEmailDto.getStatusCodeCount() +"</td>" +
......@@ -228,9 +233,9 @@ public class SendFailedEmailUtil {
|| propertiesConfig.getEnv().equalsIgnoreCase("test")
) {
//ce接收人
mailConfigDto.setTo("zelong.shao@erry.com");
mailConfigDto.setTo("zelong.shao@erry.com,jialiang.song@erry.com");
mailConfigDto.setCcAccount("");
mailConfigDto.setReceiveAccount("zelong.shao@erry.com");
mailConfigDto.setReceiveAccount("zelong.shao@erry.com,jialiang.song@erry.com");
//发件人
mailConfigDto.setFrom(propertiesConfig.getEmailAccount());
//发件人密码
......@@ -265,7 +270,7 @@ public class SendFailedEmailUtil {
email.setStatusCode(EmailStatusEnum.FAILED.getCode());
email.setStatusName(EmailStatusEnum.FAILED.getEnMsg());
}
email.setSendNum(DigitConstants.DIGIT_ONE_LONG);
email.setSendNum(DigitConstants.DIGIT_ONE);
email.setSendTime(new Date());
AssignmentFieldUtils.assignmentTableBaseField(email);
......
......@@ -41,20 +41,21 @@ rpc:
rpcKafkaReceive1: http://localhost:8082/kafka-cndc-server/rpcKafka/rpcKafkaReceive
rpcKafkaReceive2: http://localhost:8082/kafka-cndc-server/rpcKafka/rpcKafkaReceive
tw001:
imp001:
path:
#基础路径
basePath: /var/share/icleartw/TWIMPORT/
basePath: /var/share/iClearPreCLR/ToIMPORT/
#json生成路径
work: ${tw001.path.basePath}work/
work: ${imp001.path.basePath}work/
#zip输出目录
final: ${tw001.path.basePath}sftp/Final/
final: ${imp001.path.basePath}sftp/Final/
#备份目录
bak: ${tw001.path.basePath}BAK/
bak: ${imp001.path.basePath}BAK/
#异常目录
error: ${tw001.path.basePath}ERROR/
error: ${imp001.path.basePath}ERROR/
url:
baseUrl: http://localhost:8084/ImpPer/
fedex: fedex.png
line: line.png
\ No newline at end of file
upload:
path:
zip: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zip
zipTemp: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipTemp/
zipFinal: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipFinal/
\ No newline at end of file
......
spring:
datasource:
jndi-name: jdbc/iclearConnectDS
jndi-name: jdbc/iclconnectDS
profiles:
#系统环境
env: prod
......@@ -16,20 +16,40 @@ export:
sendObRetry: 0 0/3 * * * ?
#发送邮件到预清关组
pushConFile: 0 0/5 * * * ?
#文件清理任务
fileClean: 0 1 * * *
mail:
smtp:
host: mapper.gslb.fedex.com
port: 25
needauth: true
proxy:
startFlag: true
host: sg2-proxy.apac.fedex.com
port: 3128
mailAccountFlag: false
sendEmail:
account:
password:
rpc:
url:
rpcKafkaReceive1: https://pjea0179.prod.apac.fedex.com:9002/icleartwkafka/rpcKafka/rpcKafkaReceive
rpcKafkaReceive2: https://pjea0180.prod.apac.fedex.com:9002/icleartwkafka/rpcKafka/rpcKafkaReceive
rpcKafkaReceive1: https://pjea0179.prod.apac.fedex.com:9002/kafka-cndc-server/rpcKafka/rpcKafkaReceive
rpcKafkaReceive2: https://pjea0180.prod.apac.fedex.com:9002/kafka-cndc-server/rpcKafka/rpcKafkaReceive
tw001:
imp001:
path:
#基础路径
basePath: /var/share/icleartw/TWIMPORT/
basePath: /var/share/iClearPreCLR/ToIMPORT/
#json生成路径
work: ${tw001.path.basePath}work/
work: ${imp001.path.basePath}work/
#zip输出目录
final: ${tw001.path.basePath}sftp/Final/
final: ${imp001.path.basePath}sftp/Final/
#备份目录
bak: ${tw001.path.basePath}BAK/
bak: ${imp001.path.basePath}BAK/
#异常目录
error: ${tw001.path.basePath}ERROR/
\ No newline at end of file
error: ${imp001.path.basePath}ERROR/
upload:
path:
zip: /var/share/iClearPreCLR/upload/zip
zipTemp: /var/share/iClearPreCLR/upload/zipTemp/
zipFinal: /var/share/iClearPreCLR/upload/zipFinal/
\ No newline at end of file
......
spring:
datasource:
jndi-name: jdbc/iclearConnectDS
jndi-name: jdbc/iclconnectDS
profiles:
#系统环境
env: test
......@@ -16,20 +16,42 @@ export:
sendObRetry: 0 0/1 * * * ?
#发送邮件到预清关组
pushConFile: 0 0/1 * * * ?
#文件清理任务
fileClean: 0 1 * * *
mail:
smtp:
host: smtp.qiye.aliyun.com
port: 25
needauth: true
proxy:
startFlag: false
host: sin-proxy.apac.fedex.com
port: 3128
mailAccountFlag: true
sendEmail:
account: tao.mo@erry.com
password: xiaozhen!1
rpc:
url:
rpcKafkaReceive1: http://47.103.140.98:7010/icleartwkafka/rpcKafka/rpcKafkaReceive
rpcKafkaReceive2: http://47.103.140.98:7010/icleartwkafka/rpcKafka/rpcKafkaReceive
rpcKafkaReceive1: http://47.103.140.98:7010/kafka-cndc-server/rpcKafka/rpcKafkaReceive
rpcKafkaReceive2: http://47.103.140.98:7010/kafka-cndc-server/rpcKafka/rpcKafkaReceive
tw001:
imp001:
path:
#基础路径
basePath: /app/Oracle/Middleware/user_projects/domains/base_domain/exportTw/TWIMPORT/
basePath: /app/Oracle/Middleware/user_projects/domains/base_domain/iClearPreCLR/ToIMPORT/
#json生成路径
work: ${tw001.path.basePath}work/
work: ${imp001.path.basePath}work/
#zip输出目录
final: ${tw001.path.basePath}sftp/Final/
final: ${imp001.path.basePath}sftp/Final/
#备份目录
bak: ${tw001.path.basePath}BAK/
bak: ${imp001.path.basePath}BAK/
#异常目录
error: ${tw001.path.basePath}ERROR/
\ No newline at end of file
error: ${imp001.path.basePath}ERROR/
upload:
path:
zip: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zip
zipTemp: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipTemp/
zipFinal: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/zipFinal/
\ No newline at end of file
......
spring:
datasource:
jndi-name: jdbc/iclearConnectDS
jndi-name: jdbc/iclconnectDS
profiles:
#系统环境
env: uat
......@@ -16,20 +16,41 @@ export:
sendObRetry: 0 0/3 * * * ?
#发送邮件到预清关组
pushConFile: 0 0/5 * * * ?
#文件清理任务
fileClean: 0 1 * * *
mail:
smtp:
host: mapper.gslb.fedex.com
port: 25
needauth: true
proxy:
startFlag: true
host: sg2-proxy.apac.fedex.com
port: 3128
mailAccountFlag: false
sendEmail:
account:
password:
rpc:
url:
rpcKafkaReceive1: http://ujea0145.nonprod.apac.fedex.com:9001/icleartwkafka/rpcKafka/rpcKafkaReceive
rpcKafkaReceive2: http://ujea0146.nonprod.apac.fedex.com:9001/icleartwkafka/rpcKafka/rpcKafkaReceive
rpcKafkaReceive1: http://ujea0145.nonprod.apac.fedex.com:9001/kafka-cndc-server/rpcKafka/rpcKafkaReceive
rpcKafkaReceive2: http://ujea0146.nonprod.apac.fedex.com:9001/kafka-cndc-server/rpcKafka/rpcKafkaReceive
tw001:
imp001:
path:
#基础路径
basePath: /var/share/icleartw/TWIMPORT/
basePath: /var/share/iClearPreCLR/ToIMPORT/
#json生成路径
work: ${tw001.path.basePath}work/
work: ${imp001.path.basePath}work/
#zip输出目录
final: ${tw001.path.basePath}sftp/Final/
final: ${imp001.path.basePath}sftp/Final/
#备份目录
bak: ${tw001.path.basePath}BAK/
bak: ${imp001.path.basePath}BAK/
#异常目录
error: ${tw001.path.basePath}ERROR/
\ No newline at end of file
error: ${imp001.path.basePath}ERROR/
upload:
path:
zip: /var/share/iClearPreCLR/upload/zip
zipTemp: /var/share/iClearPreCLR/upload/zipTemp/
zipFinal: /var/share/iClearPreCLR/upload/zipFinal/
\ No newline at end of file
......
......@@ -19,3 +19,7 @@ mybatis:
#开启驼峰与下划线转换
map-underscore-to-camel-case: true
call-setters-on-nulls: true
#全局异常拦截是否生效
common:
exception-advice-webconfig:
enable: true
\ No newline at end of file
......
......@@ -2,7 +2,7 @@
<configuration>
<springProfile name="dev,uat,prod">
<!-- 日志存放路径 -->
<property name="log.path" value="/var/fedex/iclearConnect/weblogic/iclearConnect/task-schedule" />
<property name="log.path" value="/var/fedex/iclconnect/weblogic/task-schedule" />
</springProfile>
<springProfile name="test">
<!-- 日志存放路径 -->
......@@ -30,12 +30,12 @@
<!-- 系统日志输出 -->
<appender name="file_debug"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/tw-task-log-debug.log</file>
<file>${log.path}/task-log-debug.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/tw-task-log-debug.%d{yyyy-MM-dd}.%i.log
<fileNamePattern>${log.path}/task-log-debug.%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<!-- 日志最大的历史 30天 -->
<maxHistory>${log.maxHistory}</maxHistory>
......@@ -56,12 +56,12 @@
<appender name="file_info"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/tw-task-log-info.log</file>
<file>${log.path}/task-log-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/tw-task-log-info.%d{yyyy-MM-dd}.%i.log
<fileNamePattern>${log.path}/task-log-info.%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<!-- 日志最大的历史 30天 -->
<maxHistory>${log.maxHistory}</maxHistory>
......@@ -82,12 +82,12 @@
<appender name="file_error"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/tw-task-log-error.log</file>
<file>${log.path}/task-log-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/tw-task-log-error.%d{yyyy-MM-dd}.%i.log
<fileNamePattern>${log.path}/task-log-error.%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<!-- 日志最大的历史 30天 -->
<maxHistory>${log.maxHistory}</maxHistory>
......
#******************鉴权相关提示,需要做国际化******************
#authentication包
#没有访问权限
system_exception_10001=No access rights.
#没有通过权限认证
system_exception_10002=Failed to pass the authentication.
#登录身份异常
system_exception_10003=Login identity is abnormal.
#登录超过8小时,请重新登录
system_exception_10004=Login has exceeded 8 hours, please log in again.
#登录已过期,请重新登录
system_exception_10005=Login has expired, please log in again.
\ No newline at end of file
......
#******************系统操作日志记录,中文展示******************
business_log_20001=添加运单
business_log_20002=提交运单
business_log_20003=运单查询
business_log_20004=运单详细信息查询
business_log_20005=根据运单ID查询用户上传记录
business_log_20006=运单历史上传记录查询
system_exception_20003=提示信息过长,未保存成功
#******************鉴权相关提示,需要做国际化******************
#authentication包
system_exception_10001=没有访问权限
system_exception_10002=没有通过权限认证
system_exception_10003=登录身份异常
system_exception_10004=登录超过8小时,请重新登录
system_exception_10005=登录已过期
system_exception_10006=登录已过期,请重新登录
#******************业务相关、需要做国际化******************
#*********用于字段描述使用,不单独使用**********
business_field_31001=发货人计费账号
business_field_31002=运单ID
business_field_31003=运单号
business_field_31004=原产国编码
business_field_31005=原产国名称
business_field_31006=目的国编码
business_field_31007=目的国全称
business_field_31008=文件业务类型
business_field_31009=Consignment Code
business_field_31010=Contact Person
business_field_31011=Contact Person's Email
business_field_31012=Contact Phone
#*********具体响应到前端**********
business_exception_30001=#{0}必填字段未填写
business_exception_30002=单次最多可查询1000个运单号码
business_exception_30003=#{0}不正确,请重新输入
business_exception_30004=The waybill you entered is generated by another user, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
business_exception_30005=The waybill you entered is generated by another account, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
business_exception_30006=附件上传不符合标准
business_exception_30007=所有上传文件数量不超过#{0}个文件
business_exception_30008=所有上传文件总大小不超过#{0}M
business_exception_30009=运单或发票未上传
business_exception_30010=文件类型不在:运单、发票、箱单、其他
business_exception_30011=该运单已被其他人创建,不可以重复创建
business_exception_30012=UUID不一致
business_exception_30013=文件名为:#{0},上传失败,请检查后重试
business_exception_30014=运单信息加载失败,请稍后重试
business_success_30015=提交成功
business_exception_30016=运单提交失败
\ No newline at end of file
#没有访问权限
system_exception_10001=No access rights.
#没有通过权限认证
system_exception_10002=Failed to pass the authentication.
#登录身份异常
system_exception_10003=Login identity is abnormal.
#登录超过8小时,请重新登录
system_exception_10004=Login has exceeded 8 hours, please log in again.
#登录已过期,请重新登录
system_exception_10005=Login has expired, please log in again.
\ No newline at end of file
......
#******************系统操作日志记录,中文展示******************
business_log_20001=添加运单
business_log_20002=提交运单
business_log_20003=运单查询
business_log_20004=运单详细信息查询
business_log_20005=根据运单ID查询用户上传记录
business_log_20006=运单历史上传记录查询
system_exception_20003=提示信息过长,未保存成功
#******************鉴权相关提示,需要做国际化******************
#authentication包
system_exception_10001=没有访问权限
system_exception_10002=没有通过权限认证
system_exception_10003=登录身份异常
system_exception_10004=登录超过8小时,请重新登录
system_exception_10005=登录已过期
system_exception_10006=登录已过期,请重新登录
#******************业务相关、需要做国际化******************
#*********用于字段描述使用,不单独使用**********
business_field_31001=发货人计费账号
business_field_31002=运单ID
business_field_31003=运单号
business_field_31004=原产国编码
business_field_31005=原产国名称
business_field_31006=目的国编码
business_field_31007=目的国全称
business_field_31008=文件业务类型
business_field_31009=Consignment Code
business_field_31010=Contact Person
business_field_31011=Contact Person's Email
business_field_31012=Contact Phone
#*********具体响应到前端**********
business_exception_30001=${0}必填字段未填写
business_exception_30002=单次最多可查询1000个运单号码
business_exception_30003=${0}不正确,请重新输入
business_exception_30004=The waybill you entered is generated by another user, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
business_exception_30005=The waybill you entered is generated by another account, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
business_exception_30006=附件上传不符合标准
business_exception_30007=所有上传文件数量不超过50个文件
business_exception_30008=所有上传文件总大小不超过50M
business_exception_30009=运单或发票未上传
business_exception_30010=文件类型不在:运单、发票、箱单、其他
business_exception_30011=该运单已被其他人创建,不可以重复创建
business_exception_30012=UUID不一致
business_exception_30013=文件名为:#{0},上传失败,请检查后重试
business_exception_30014=运单信息加载失败,请稍后重试
business_success_30015=提交成功
business_exception_30016=运单提交失败
\ No newline at end of file
##******************鉴权相关提示,需要做国际化******************
##authentication包
#system_exception_10001=没有访问权限
#system_exception_10002=没有通过权限认证
#system_exception_10003=登录身份异常
#system_exception_10004=登录超过8小时,请重新登录
#system_exception_10005=登录已过期,请重新登录
\ No newline at end of file
......