bug修改

cert
anthonywj 2 years ago
parent 47c0a7277f
commit ad5e361674

@ -13,7 +13,6 @@ public class TopicRabbitConfig {
//绑定键
public final static String common = "topic.common";
public final static String common1 = "topic.common1";
public final static String trace = "topic.trace";
public final static String publicer = "topic.all";

@ -22,6 +22,8 @@ import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.auth.registComPerResponse;
import com.glxp.api.service.purchase.IEmailService;
import com.glxp.api.service.sup.*;
import com.glxp.api.service.trace.RabbitPushService;
import com.glxp.api.service.trace.RabbitQueueService;
import com.glxp.api.util.UuidUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -71,13 +73,13 @@ public class UserRegisterController extends BaseController {
@Resource
private IEmailService iEmailService;
@ApiOperation(value = "获取校验码",response = loginmobileRequest.class)
@ApiOperation(value = "获取校验码", response = loginmobileRequest.class)
@PostMapping("/admin/auth/register/getCheckcode")
public BaseResponse getCheckcode(@RequestBody loginmobileRequest params, HttpSession httpSession) {
return CaptchaUtils.getCheckcode(params, httpSession);
}
@ApiOperation(value = "校验码",response = loginmobileRequest.class)
@ApiOperation(value = "校验码", response = loginmobileRequest.class)
@PostMapping("/admin/auth/register/checkCode")
public BaseResponse checkCode(@RequestBody loginmobileRequest params) {
return CaptchaUtils.checkCode(params);
@ -88,7 +90,7 @@ public class UserRegisterController extends BaseController {
*
* @param mobile
*/
@ApiOperation(value = "根据手机号获取注册信息",response = BaseResponse.class)
@ApiOperation(value = "根据手机号获取注册信息", response = BaseResponse.class)
@GetMapping("/admin/auth/register/get/{mobile}")
public BaseResponse getInfo(@PathVariable String mobile) {
Map<String, Object> map = new HashMap<>();
@ -110,7 +112,7 @@ public class UserRegisterController extends BaseController {
return ResultVOUtils.success(map);
}
@ApiOperation(value = "保存注册人信息",response = BaseResponse.class)
@ApiOperation(value = "保存注册人信息", response = BaseResponse.class)
@PostMapping("/admin/auth/register/save")
public BaseResponse saveRegister(@RequestBody @Valid UserRegisterEntity userRegisterEntity, HttpSession httpSession,
BindingResult bindingResult) {
@ -145,7 +147,7 @@ public class UserRegisterController extends BaseController {
//第一次完善信息 插入默认数据
@ApiOperation(value = "第一次完善信息 插入默认数据",response = BaseResponse.class)
@ApiOperation(value = "第一次完善信息 插入默认数据", response = BaseResponse.class)
@GetMapping("/admin/auth/register/insertInitial")
public BaseResponse insertInitial(String mobile) {
Map<Object, Object> map = new HashMap<>();
@ -194,7 +196,7 @@ public class UserRegisterController extends BaseController {
}
@ApiOperation(value = "保存所有信息",response = BaseResponse.class)
@ApiOperation(value = "保存所有信息", response = BaseResponse.class)
@PostMapping("/admin/auth/register/saveAllInfo")
public BaseResponse saveAllInfo(@RequestBody registComPerResponse registComPerResponse) {
@ -225,7 +227,7 @@ public class UserRegisterController extends BaseController {
}
@ApiOperation(value = "查询注册人列表",response = registComPerResponse.class)
@ApiOperation(value = "查询注册人列表", response = registComPerResponse.class)
@PostMapping("/admin/auth/register/list")
public BaseResponse selectReslist(@RequestBody UserRegisterFilterRequest userRegisterFilterRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
@ -243,8 +245,10 @@ public class UserRegisterController extends BaseController {
@Resource
UserCompanyConfigService userCompanyConfigService;
@Resource
RabbitQueueService rabbitQueueService;
@ApiOperation(value = "无证明注册",response = BaseResponse.class)
@ApiOperation(value = "无证明注册", response = BaseResponse.class)
@PostMapping("/admin/auth/register/NotApproved")
public BaseResponse NotApproved(@RequestBody registComPerResponse registComPerResponse, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
@ -307,8 +311,8 @@ public class UserRegisterController extends BaseController {
userCompanyEntity.setId(Long.valueOf(registComPerResponse.getUcId()));
userCompanyEntity.setCheckStatus(registComPerResponse.getCheckStatus());
userCompanyEntity.setReason(registComPerResponse.getReason());
String queueName = "fanout_" + userCompanyEntity.getId() + "";
rabbitQueueService.createQueue(queueName);
userRegisterService.updateById(userRegisterEntity);
userCompanyService.updateById(userCompanyEntity);
userCheckService.insert(userCheckEntity);
@ -317,7 +321,7 @@ public class UserRegisterController extends BaseController {
}
//对手机 验证码进行加密/解密
@ApiOperation(value = "对手机 验证码进行加密/解密",response = MobileCaptchaRequest.class)
@ApiOperation(value = "对手机 验证码进行加密/解密", response = MobileCaptchaRequest.class)
@PostMapping("/admin/auth/register/encrypt")
public BaseResponse encrypt(@RequestBody MobileCaptchaRequest mobileCaptchaRequest) {
if (mobileCaptchaRequest == null) {

@ -6,6 +6,7 @@ import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.config.rabbit.TopicRabbitConfig;
import com.glxp.api.entity.trace.MqTraceMessage;
import com.glxp.api.service.trace.RabbitQueueService;
import com.glxp.api.util.DateUtil;
import com.glxp.api.util.udi.FilterUdiUtils;
import io.swagger.annotations.Api;
@ -29,8 +30,9 @@ import java.util.Map;
public class TestController {
@Resource
private final RabbitTemplate rabbitTemplate;
@Resource
RabbitQueueService rabbitQueueService;
@ApiOperation(value = "UDI码推送接口",response = BaseResponse.class)
@GetMapping("/sendUdi")
public BaseResponse sendUdi(String key) {
String messageId = String.valueOf(UUID.randomUUID());
@ -54,13 +56,11 @@ public class TestController {
// return ResultVOUtils.success("发送成功");
// }
@ApiOperation(value = "Mq跟踪消息推送接口",response = BaseResponse.class)
@GetMapping("/sendCommon")
public BaseResponse sendCommon(@RequestBody MqTraceMessage mqTraceMessage) {
String messageId = String.valueOf(UUID.randomUUID());
// MqTraceMessage mqTraceMessage = new MqTraceMessage();
System.out.println(mqTraceMessage);
mqTraceMessage.setMessageId(messageId);
mqTraceMessage.setMessageData(String.valueOf(mqTraceMessage));
mqTraceMessage.setCreateTime(new Date());
@ -70,7 +70,12 @@ public class TestController {
}
@GetMapping("/createCompanyQueue")
public BaseResponse createCompanyQueue(String companyId) {
String queueName = "fanout_" + companyId + "";
rabbitQueueService.createQueue(queueName);
return ResultVOUtils.success("创建成功!");
}
}

@ -1,5 +1,6 @@
package com.glxp.api.controller.trace;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -12,8 +13,10 @@ import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.trace.TraceManuOrderEntity;
import com.glxp.api.entity.trace.TraceOrderEntity;
import com.glxp.api.entity.trace.TraceRecordLogEntity;
import com.glxp.api.req.trace.TraceOrderDetailRequest;
import com.glxp.api.req.trace.TraceRecordRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.trace.TraceOrderResponse;
import com.glxp.api.res.trace.TraceRecordResponse;
import com.glxp.api.res.trace.TraceSearchReponse;
import com.glxp.api.service.trace.TraceManuOrderService;
@ -23,6 +26,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.apache.regexp.RE;
import org.bouncycastle.util.encoders.UTF8;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -68,7 +72,12 @@ public class TraceRecordController extends BaseController {
if (StrUtil.isNotEmpty(traceRecordRequest.getRecordCode())) {
TraceRecordLogEntity traceRecordLogEntity = traceRecordService.getOne(new QueryWrapper<TraceRecordLogEntity>().eq("recordCode", traceRecordRequest.getRecordCode()));
List<TraceOrderEntity> traceOrderEntities = traceOrderService.findByProductIdFk(traceRecordLogEntity.getTraceProductIdFk());
if (traceRecordLogEntity == null) {
return ResultVOUtils.error(500, "查询记录不存在!");
}
TraceOrderDetailRequest traceOrderDetailRequest = new TraceOrderDetailRequest();
traceOrderDetailRequest.setTraceProductIdFk(traceRecordLogEntity.getTraceProductIdFk());
List<TraceOrderResponse> traceOrderEntities = traceOrderService.filterJoin(traceOrderDetailRequest);
List<TraceManuOrderEntity> traceManuOrderEntities = traceManuOrderService.list(new QueryWrapper<TraceManuOrderEntity>().eq("traceProductIdFk", traceRecordLogEntity.getTraceProductIdFk()));
TraceSearchReponse traceSearchReponse = new TraceSearchReponse();
traceSearchReponse.setTraceOrderEntities(traceOrderEntities);

@ -19,4 +19,7 @@ public interface TraceOrderMapper extends BaseMapper<TraceOrderEntity> {
List<TraceOrderResponse> queryTraceOrderList(TraceOrderDetailRequest traceOrderDetailRequest);
List<TraceProductRecordResponse> filterBatchNo(TraceProductRecordRequest traceProductRecordRequest);
List<TraceOrderResponse> filterJoin(TraceOrderDetailRequest traceOrderDetailRequest);
}

@ -22,4 +22,7 @@ public class TraceOrderDetailRequest extends ListPageRequest {
private String batchNo;
@ApiModelProperty(value = "公司名称")
private String companyName;
@ApiModelProperty(value = "查询产品记录ID表")
private Long traceProductIdFk;
}

@ -147,4 +147,24 @@ public class TraceOrderResponse {
*/
@ApiModelProperty(value = "更新时间")
private Date updateTime;
//关联信息
@ApiModelProperty(value = "产品名称")
private String cpmctymc;
@ApiModelProperty(value = "DI标识")
private String nameCode;
@ApiModelProperty(value = "规格型号")
private String ggxh;
@ApiModelProperty(value = "医疗器械注册人")
private String ylqxzcrbarmc;
@ApiModelProperty(value = "批次号")
private String batchNo;
@ApiModelProperty(value = "生产日期")
private String produceDate;
@ApiModelProperty(value = "失效日期")
private String expireDate;
@ApiModelProperty(value = "序列号")
private String serialNo;
@ApiModelProperty(value = "查询UDI码")
private String udiCode;
}

@ -16,7 +16,7 @@ public class TraceSearchReponse {
@ApiModelProperty(value = "追溯日志")
TraceRecordLogEntity traceRecordLogEntity;
@ApiModelProperty(value = "追溯查询出入库单结果")
List<TraceOrderEntity> traceOrderEntities;
List<TraceOrderResponse> traceOrderEntities;
@ApiModelProperty(value = "追溯查询生产订单结果")
List<TraceManuOrderEntity> traceManuOrderEntities;

@ -11,6 +11,7 @@ import com.glxp.api.util.JsonUtils;
import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
@ -22,6 +23,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@Slf4j
@Service
@RequiredArgsConstructor
public class RabbitPushService {
@ -37,7 +39,6 @@ public class RabbitPushService {
Channel channel = rabbitTemplate.getConnectionFactory().createConnection().createChannel(true);
String queueName = "fanout_" + mqTraceMessage.getCompanyId() + "";
rabbitQueueService.createQueue(queueName);
// channel.basicPublish(FANOUT_EXCHANGE, "", null, JsonUtils.toJsonString(mqTraceMessage).getBytes());
rabbitTemplate.convertAndSend(FANOUT_EXCHANGE, null, JsonUtils.toJsonString(mqTraceMessage));
@ -45,7 +46,9 @@ public class RabbitPushService {
public BaseResponse send(MqTraceMessage mqTraceMessage) {
rabbitTemplate.convertAndSend(TopicRabbitConfig.TRACE_TOPIC_EXCHANGE, TopicRabbitConfig.trace, JsonUtils.toJsonString(mqTraceMessage));
String msg = JsonUtils.toJsonString(mqTraceMessage);
log.info("推送消息:" + msg);
rabbitTemplate.convertAndSend(TopicRabbitConfig.TRACE_TOPIC_EXCHANGE, TopicRabbitConfig.common, msg);
return ResultVOUtils.success("发送成功");
}

@ -71,4 +71,17 @@ public class TraceOrderService extends ServiceImpl<TraceOrderMapper, TraceOrderE
List<TraceProductRecordResponse> data = traceOrderMapper.filterBatchNo(traceProductRecordRequest);
return data;
}
public List<TraceOrderResponse> filterJoin(TraceOrderDetailRequest traceOrderDetailRequest) {
if (traceOrderDetailRequest == null) {
return Collections.emptyList();
}
if (traceOrderDetailRequest.getPage() != null) {
int offset = (traceOrderDetailRequest.getPage() - 1) * traceOrderDetailRequest.getLimit();
PageHelper.offsetPage(offset, traceOrderDetailRequest.getLimit());
}
return traceOrderMapper.filterJoin(traceOrderDetailRequest);
}
}

@ -138,6 +138,17 @@ public class UdiTraceService {
pushMq(traceProductDetailEntity, companyId);
}
//2.出入库生产订单关联关系
TraceTaskNoticeEntity inoutTaskNotity = traceTaskNoticeService.findTask(2, traceProductDetailEntity.getId(), companyId);
if (inoutTaskNotity == null) {
inoutTaskNotity = createTraceNotice(2, traceProductDetailEntity, companyId);
pushDelayExpireTask(inoutTaskNotity);
pushMq(traceProductDetailEntity, companyId);
} else if (inoutTaskNotity.getStatus() == 4) {
//任务超时未处理,重新推送消息
pushMq(traceProductDetailEntity, companyId);
}
//列出需要查询推送企业
List<TraceOrderEntity> traceOrderEntities = traceOrderService.findByProductIdFk(traceProductDetailEntity.getId());

@ -15,7 +15,7 @@ spring:
redis:
database: 14
host: 127.0.0.1
host: 192.168.0.166
port: 6379
# password: 123456
timeout: 300
@ -34,7 +34,7 @@ spring:
max-request-size: 500MB
rabbitmq:
host: 127.0.0.1
host: 192.168.0.166
port: 5672
username: cpt
password: 123456

@ -1,6 +1,6 @@
spring:
profiles:
active: pro
active: dev
jmx:
enabled: false
servlet:

@ -36,6 +36,48 @@
</where>
</select>
<select id="filterJoin" parameterType="com.glxp.api.req.trace.TraceOrderDetailRequest"
resultType="com.glxp.api.res.trace.TraceOrderResponse">
SELECT trace_order.*,
trace_product_record.udiCode,
trace_product_record.ylqxzcrbarmc,
trace_product_record.creditNum,
trace_product_record.cpmctymc,
trace_product_record.ggxh,
trace_product_record.nameCode,
trace_product_record.batchNo,
trace_product_record.produceDate,
trace_product_record.expireDate,
trace_product_record.serialNo
FROM trace_order
left join trace_product_record
on trace_order.traceProductIdFk = trace_product_record.id
<where>
<if test="traceProductIdFk != '' and traceProductIdFk != null">
and traceProductIdFk = #{traceProductIdFk}
</if>
<if test="udiCode != '' and udiCode != null">
and udiCode = #{udiCode}
</if>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
and ylqxzcrbarmc = #{ylqxzcrbarmc}
</if>
<if test="cpmctymc != '' and cpmctymc != null">
and cpmctymc = #{cpmctymc}
</if>
<if test="ggxh != '' and ggxh != null">
and ggxh = #{ggxh}
</if>
<if test="nameCode != '' and nameCode != null">
and nameCode = #{nameCode}
</if>
<if test="batchNo != '' and batchNo != null">
and batchNo = #{batchNo}
</if>
</where>
</select>
<select id="filterBatchNo" parameterType="com.glxp.api.req.trace.TraceProductRecordRequest"
resultType="com.glxp.api.res.trace.TraceProductRecordResponse">
SELECT batchNo

Loading…
Cancel
Save