|
|
|
@ -85,14 +85,27 @@ public class UdiTraceController extends BaseController {
|
|
|
|
|
traceRecordLogEntity.setFromType(traceRecordRequest.getFromType());
|
|
|
|
|
traceRecordLogEntity.setTraceType(traceRecordRequest.getTraceType());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//4.创建查询详情记录,若存在相同查询记录则直接获取
|
|
|
|
|
TraceProductDetailEntity traceProductDetailEntity = null;
|
|
|
|
|
if (traceRecordRequest.getTraceType() == 1) {//按UDI码查询
|
|
|
|
|
TraceProductDetailEntity traceProductDetailEntity = traceProductDetailService.findUniqueByCode(1, traceRecordRequest.getUdiCode());
|
|
|
|
|
traceProductDetailEntity = traceProductDetailService.findUniqueByCode(1, traceRecordRequest.getUdiCode());
|
|
|
|
|
if (traceProductDetailEntity == null) {
|
|
|
|
|
|
|
|
|
|
traceProductDetailEntity.setId(IdUtil.getSnowflakeNextId());
|
|
|
|
|
traceProductDetailEntity.setTraceSource(1);
|
|
|
|
|
traceProductDetailEntity.setTraceType(traceRecordRequest.getTraceType());
|
|
|
|
|
traceProductDetailEntity.setUdiCode(traceRecordRequest.getUdiCode());
|
|
|
|
|
traceProductDetailEntity.setYlqxzcrbarmc(basicUdiRelResponse.getYlqxzcrbarmc());
|
|
|
|
|
traceProductDetailEntity.setCreditNum(basicUdiRelResponse.getTyshxydm());
|
|
|
|
|
traceProductDetailEntity.setCpmctymc(basicUdiRelResponse.getCpmctymc());
|
|
|
|
|
traceProductDetailEntity.setGgxh(basicUdiRelResponse.getGgxh());
|
|
|
|
|
traceProductDetailEntity.setNameCode(basicUdiRelResponse.getNameCode());
|
|
|
|
|
traceProductDetailEntity.setBatchNo(udiEntity.getBatchNo());
|
|
|
|
|
traceProductDetailEntity.setProduceDate(udiEntity.getProduceDate());
|
|
|
|
|
traceProductDetailEntity.setExpireDate(udiEntity.getExpireDate());
|
|
|
|
|
traceProductDetailEntity.setSerialNo(udiEntity.getSerialNo());
|
|
|
|
|
traceProductDetailEntity.setStatus(1);
|
|
|
|
|
traceProductDetailService.save(traceProductDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else { //按批次号查询
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|