feat: 药品关联关系是否存在

dev_unify
chenhc 6 months ago
parent 998879daff
commit e3603c4e42

@ -134,5 +134,16 @@ public class RelCodeBatchController extends BaseController {
}
/**
*
* @param parentCode
* @return
*/
@GetMapping("/udiwms/relCode/updateIoCodeTempEntity")
public BaseResponse threadUpdateIoCodeTempEntity(@RequestParam("parentCode") String parentCode) {
if (StrUtil.isBlank(parentCode)) return ResultVOUtils.error(500,"层级编码格式错误!");
relCodeBatchService.threadUpdateIoCodeTempEntity(parentCode);
return ResultVOUtils.success();
}
}

@ -258,6 +258,12 @@ public class IoCodeTempController extends BaseController {
return baseResponse;
}
if (IntUtil.value(udiEntity.getProductType()) == 2) {
//药品
udiEntity.setCode(code);
return ResultVOUtils.success(udiEntity);
}
if (StrUtil.isNotEmpty(udiEntity.getBatchNo())) {
if (code.endsWith("10" + udiEntity.getBatchNo())) {
code = code + "\u001D";

@ -1,55 +1,23 @@
package com.glxp.api.entity.basic;
import lombok.Data;
/**
* @author
* @date 2020/9/22.
*/
@Data
public class UdiEntity {
private String code;
private String batchNo;
private String produceDate;
private String expireDate;
private String serialNo;
private String udi;
public String getBatchNo() {
return batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
public String getProduceDate() {
return produceDate;
}
public void setProduceDate(String produceDate) {
this.produceDate = produceDate;
}
public String getExpireDate() {
return expireDate;
}
public void setExpireDate(String expireDate) {
this.expireDate = expireDate;
}
public String getSerialNo() {
return serialNo;
}
public void setSerialNo(String serialNo) {
this.serialNo = serialNo;
}
public String getUdi() {
return udi;
}
public void setUdi(String udi) {
this.udi = udi;
}
private Integer productType;
@Override
public String toString() {

@ -1,5 +1,6 @@
package com.glxp.api.res.inout;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.util.Date;
@ -121,4 +122,10 @@ public class IoCodeTempResponse {
*/
private String supName;
/**
* 0 1
*/
@TableField(value = "drugLink")
private Integer drugLink;
}

@ -2,13 +2,18 @@ package com.glxp.api.util.udi;
import cn.hutool.core.util.StrUtil;
import com.glxp.api.constant.ConstantStatus;
import com.glxp.api.entity.basic.UdiEntity;
import com.glxp.api.entity.basic.UdiProductEntity;
import com.glxp.api.entity.inv.InvCountOrderDetailEntity;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.util.IntUtil;
import com.glxp.api.util.gs1.AI;
import com.glxp.api.util.gs1.AIs;
import com.glxp.api.util.gs1.Gs1128Decoder;
import com.glxp.api.util.gs1.Gs1128Engine;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@ -107,7 +112,6 @@ public class FilterUdiUtils {
}
public static UdiEntity getGLXPUdi(String data) {
String batchNo = "";
String produceDate = "";
@ -122,9 +126,13 @@ public class FilterUdiUtils {
batchNo = spilts[4];
if (spilts.length > 6) {
serialNo = spilts[5];
if (serialNo != null && serialNo.equals("")) {
serialNo = null;
}
}
if (StrUtil.isEmpty(batchNo)) {
batchNo = null;
}
if (StrUtil.isEmpty(serialNo)) {
serialNo = null;
}
}
@ -161,6 +169,7 @@ public class FilterUdiUtils {
return prefix;
}
public static UdiEntity getDrugInfo(String data) {
UdiEntity udiEntity = new UdiEntity();
String prefix = data.substring(0, 7);
@ -170,9 +179,11 @@ public class FilterUdiUtils {
udiEntity.setProduceDate(null);
udiEntity.setUdi(prefix);
udiEntity.setSerialNo(serialNo);
udiEntity.setProductType(2);
return udiEntity;
}
public static UdiProductEntity transUdi(UdiProductEntity data) {
UdiEntity udiEntity = getUdi(data.getCode());
if (udiEntity != null) {
@ -212,4 +223,32 @@ public class FilterUdiUtils {
+ "#" + Optional.ofNullable(warehouseEntity.getSerialNo()).orElse("") + "#" + "#";
return udiCode;
}
public static String transGlxpNoSerStr(List<UdiRelevanceResponse> udiRelevanceResponses, InvCountOrderDetailEntity invCountOrderDetail) {
UdiRelevanceResponse udiRelevanceResponse = getMinDi(udiRelevanceResponses);
String udiCode = "#" + udiRelevanceResponse.getNameCode() + "#" + StrUtil.trimToEmpty(invCountOrderDetail.getProduceDate()) + "#" + StrUtil.trimToEmpty(invCountOrderDetail.getExpireDate()) +
"#" + StrUtil.trimToEmpty(invCountOrderDetail.getBatchNo()) + "#" + "#" + "#";
return udiCode;
}
public static UdiRelevanceResponse getMinDi(List<UdiRelevanceResponse> udiRelevanceResponses) {
if (udiRelevanceResponses.size() > 1) {
for (UdiRelevanceResponse temp : udiRelevanceResponses) {
if (IntUtil.value(temp.getIsUseDy())) {
if (temp.getDiType() == ConstantStatus.DITYPE_SYDY) {
return temp;
}
} else {
if (temp.getDiType() == ConstantStatus.DITYPE_MAIN) {
return temp;
}
}
}
}
return udiRelevanceResponses.get(0);
}
}

Loading…
Cancel
Save