bug修复

cert
anthonywj 2 years ago
parent d80c5f0d53
commit 11dce35f86

@ -102,6 +102,9 @@ public class TraceOrderController extends BaseController {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
TraceTaskNoticeEntity taskNoticeEntity = traceTaskNoticeService.getById(traceOrderUploadRequest.getTaskId());
if (taskNoticeEntity == null) {
return ResultVOUtils.error(500, "任务已过期!");
}
TraceOrderEntity traceOrderEntity = new TraceOrderEntity();
BeanUtils.copyProperties(traceOrderUploadRequest, traceOrderEntity);
traceOrderEntity.setCompanyIdFk(taskNoticeEntity.getCompanyIdFk());
@ -119,16 +122,21 @@ public class TraceOrderController extends BaseController {
if (StrUtil.isNotEmpty(traceOrderEntity.getToCorpCreditNum()) &&
!traceOrderEntity.getToCorpCreditNum().equals(userCompanyEntity.getCreditNum())) {
UserCompanyEntity toUserCompanyEntity = userCompanyService.getOne(new QueryWrapper<UserCompanyEntity>().eq("creditNum", traceOrderEntity.getToCorpCreditNum()), false);
TraceTaskNoticeEntity nextNotity = traceTaskNoticeService.findTask(2, traceOrderEntity.getTraceProductIdFk(), toUserCompanyEntity.getId());
if (nextNotity == null) {
TraceProductDetailEntity traceProductDetailEntity = traceProductDetailService.getById(traceOrderEntity.getTraceProductIdFk());
nextNotity = udiTraceService.createTraceNotice(2, traceProductDetailEntity, toUserCompanyEntity.getId());
udiTraceService.pushDelayExpireTask(nextNotity);
udiTraceService.pushMq(nextNotity, toUserCompanyEntity.getId());
} else if (nextNotity.getStatus() == 4) {
//任务超时未处理,重新推送消息
udiTraceService.pushMq(nextNotity, toUserCompanyEntity.getId());
if (toUserCompanyEntity != null) {
TraceTaskNoticeEntity nextNotity = traceTaskNoticeService.findTask(2, traceOrderEntity.getTraceProductIdFk(), toUserCompanyEntity.getId());
if (nextNotity == null) {
TraceProductDetailEntity traceProductDetailEntity = traceProductDetailService.getById(traceOrderEntity.getTraceProductIdFk());
nextNotity = udiTraceService.createTraceNotice(2, traceProductDetailEntity, toUserCompanyEntity.getId());
udiTraceService.pushDelayExpireTask(nextNotity);
udiTraceService.pushMq(nextNotity, toUserCompanyEntity.getId());
} else if (nextNotity.getStatus() == 4) {
//任务超时未处理,重新推送消息
udiTraceService.pushMq(nextNotity, toUserCompanyEntity.getId());
}
} else {
log.error("未找到下一家企业");
}
}

@ -19,7 +19,7 @@ import lombok.Data;
*/
@Data
@ApiModel("任务公告表")
@TableName(value = "trace_task_notice")
@TableName(value = "trace_task_notice", autoResultMap = true)
public class TraceTaskNoticeEntity implements Serializable {
@ApiModelProperty(value = "主键")
@TableId(value = "id", type = IdType.INPUT)
@ -53,20 +53,20 @@ public class TraceTaskNoticeEntity implements Serializable {
@TableField(value = "companyIdFk")
private Long companyIdFk;
/**
*
*/
@ApiModelProperty(value = "注册企业统一社会信用号")
@TableField(value = "creditNum")
private String creditNum;
/**
*
*
*/
@ApiModelProperty(value = "医疗器械注册人")
@TableField(value = "ylqxzcrbarmc")
private String ylqxzcrbarmc;
/**
*
*/
@ApiModelProperty(value = "医疗器械注册人统一社会信用号")
@TableField(value = "creditNum")
private String creditNum;
/**
*

@ -223,6 +223,7 @@ public class UdiTraceService {
//创建任务列表
public TraceTaskNoticeEntity createTraceNotice(Integer taskType, TraceProductDetailEntity traceProductDetailEntity, Long companyId) {
UserCompanyEntity userCompanyEntity = userCompanyService.getById(companyId);
TraceTaskNoticeEntity traceTaskNoticeEntity = new TraceTaskNoticeEntity();
traceTaskNoticeEntity.setId(IdUtil.getSnowflakeNextId());
traceTaskNoticeEntity.setProdudctRecordIdFk(traceProductDetailEntity.getId());
@ -230,7 +231,7 @@ public class UdiTraceService {
traceTaskNoticeEntity.setStatus(1);
traceTaskNoticeEntity.setCompanyIdFk(companyId);
traceTaskNoticeEntity.setYlqxzcrbarmc(traceProductDetailEntity.getYlqxzcrbarmc());
traceTaskNoticeEntity.setCreditNum(traceProductDetailEntity.getCreditNum());
traceTaskNoticeEntity.setCreditNum(userCompanyEntity.getCreditNum());
traceTaskNoticeEntity.setCpmctymc(traceProductDetailEntity.getCpmctymc());
traceTaskNoticeEntity.setGgxh(traceProductDetailEntity.getGgxh());
traceTaskNoticeEntity.setBatchNo(traceProductDetailEntity.getBatchNo());

@ -1,9 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.trace.TraceTaskNoticeMapper">
<resultMap type="com.glxp.api.res.trace.TraceTaskDlResponse" id="TraceTaskDlResult">
<result column="diList" property="diList"
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
</resultMap>
<select id="queryTraceTaskList" parameterType="com.glxp.api.req.trace.TraceTaskDetailRequest"
resultType="com.glxp.api.res.trace.TraceTaskDlResponse">
resultMap="TraceTaskDlResult">
SELECT *
FROM trace_task_notice
<where>

Loading…
Cancel
Save