追溯相关功能,企业信息编辑

cert
anthonywj 2 years ago
parent 8f18729614
commit beca42f6f9

@ -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 { //按批次号查询
}

@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
@Data
@ -53,10 +54,17 @@ public class BasicUdiRelEntity implements Serializable {
*/
@TableField(value = "companyType")
private Integer companyType;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@TableField(value = "agengtStartDate")
private Date agengtStartDate;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@TableField(value = "agengtEndDate")
private Date agengtEndDate;

@ -17,7 +17,6 @@ import lombok.Data;
public class TraceProductDetailEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
private Long id;
/**
* 1:2)
*/
@ -35,13 +34,6 @@ public class TraceProductDetailEntity implements Serializable {
*/
@TableField(value = "udiCode")
private String udiCode;
/**
*
*/
@TableField(value = "creditNum")
private String creditNum;
/**
*
*/
@ -49,10 +41,10 @@ public class TraceProductDetailEntity implements Serializable {
private String ylqxzcrbarmc;
/**
* DI
*
*/
@TableField(value = "nameCode")
private String nameCode;
@TableField(value = "creditNum")
private String creditNum;
/**
*
@ -66,6 +58,13 @@ public class TraceProductDetailEntity implements Serializable {
@TableField(value = "ggxh")
private String ggxh;
/**
* DI
*/
@TableField(value = "nameCode")
private String nameCode;
/**
*
*/

@ -1,6 +1,7 @@
package com.glxp.api.req.basic;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
@ -42,8 +43,9 @@ public class BasicUdiRelRequest {
*/
private Integer companyType;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date agengtStartDate;
@JsonFormat(pattern = "yyyy-MM-dd")
private Date agengtEndDate;

@ -10,5 +10,8 @@ public class UdiSelectRequest {
List<BasicUdiRelRequest> products;
private Long companyId;
private String key;
private List<String> keys;
}

@ -7,7 +7,7 @@
FROM trace_manu_order tmo
LEFT JOIN user_company uc ON uc.id = tmo.companyIdFk
LEFT JOIN (SELECT tr.recordCode,tr.createUser,tr.remark,trd.batchNo,trd.traceType
FROM trace_record tr
FROM trace_record_log tr
LEFT JOIN trace_record_detail trd ON trd.recordIdFk = tr.id) mid ON mid.recordCode = tmo.recordCode
<where>
<if test="recordCode != '' and recordCode != null">

@ -4,12 +4,13 @@
<select id="queryTraceOrderList" parameterType="com.glxp.api.req.trace.TraceOrderDetailRequest"
resultType="com.glxp.api.res.trace.TraceOrderResponse">
SELECT tor.*
,uc.companyName
, uc.companyName
FROM trace_order tor
LEFT JOIN user_company uc ON uc.id = tor.companyIdFk
LEFT JOIN (SELECT tr.recordCode,trd.*
FROM trace_record tr
LEFT JOIN trace_record_detail trd ON trd.recordIdFk = tr.id) trmid ON trmid.recordCode = tor.recordCode
LEFT JOIN user_company uc ON uc.id = tor.companyIdFk
LEFT JOIN (SELECT tr.recordCode, trd.*
FROM trace_record_log tr
LEFT JOIN trace_record_detail trd ON trd.recordIdFk = tr.id) trmid
ON trmid.recordCode = tor.recordCode
<where>
<if test="udiCode != '' and udiCode != null">
and udiCode = #{udiCode}

@ -4,7 +4,7 @@
<select id="filterTraces" parameterType="com.glxp.api.req.trace.TraceRecordRequest"
resultType="com.glxp.api.res.trace.TraceRecordResponse">
SELECT tr.recordCode, tr.remark, trd.*, mid.*
FROM trace_record tr
FROM trace_record_log tr
LEFT JOIN trace_record_detail trd ON trd.recordIdFk = tr.id
LEFT JOIN (SELECT tor.billNo, tor.fromCorp, tor.toCorp, tor.createUser, uc.companyName
FROM trace_order tor

Loading…
Cancel
Save