药品字典修改

dev_unify
yewj 5 months ago
parent 3eee851ec1
commit 404f436e7f

@ -537,6 +537,28 @@ public class IoCodeTempController extends BaseController {
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectByNameCode(udiEntity.getUdi());
//判断层级标识是否正确
if (bussinessTypeEntity.isUse()) {
if (udiRelevanceResponse.getUseMaxLevel() != null && IntUtil.value(udiRelevanceResponse.getUseMaxLevel()) < IntUtil.value(udiRelevanceResponse.getPackLevel())) {
return ResultVOUtils.error(500, "当前产品不支持采集该包装层级追溯码!");
}
if (udiRelevanceResponse.getUseMaxLevel() == null && IntUtil.value(udiRelevanceResponse.getPackLevel()) > 1) {
return ResultVOUtils.error(500, "当前产品不支持采集该包装层级追溯码!");
}
if (IntUtil.value(udiRelevanceResponse.getPackLevel()) < IntUtil.value(udiRelevanceResponse.getUseLevel())) {
return ResultVOUtils.error(500, "当前产品不支持采集该包装层级追溯码!");
}
} else {
if (udiRelevanceResponse.getDistributeMaxLevel() != null && IntUtil.value(udiRelevanceResponse.getDistributeMaxLevel()) < IntUtil.value(udiRelevanceResponse.getPackLevel())) {
return ResultVOUtils.error(500, "当前产品不支持采集该包装层级追溯码!");
}
if (IntUtil.value(udiRelevanceResponse.getPackLevel()) < IntUtil.value(udiRelevanceResponse.getDistributeLevel())) {
return ResultVOUtils.error(500, "当前产品不支持采集该包装层级追溯码!");
}
}
//近效期提醒
// SystemParamConfigEntity recentParamConfigEntity = systemParamConfigService.selectByParamKey("recent_date_tip");
long recent = 0;
@ -1042,6 +1064,35 @@ public class IoCodeTempController extends BaseController {
}
}
//判断层级标识是否正确
if (bussinessTypeEntity.isUse()) {
if (udiRelevanceResponse.getUseMaxLevel() != null && IntUtil.value(udiRelevanceResponse.getUseMaxLevel()) < IntUtil.value(udiRelevanceResponse.getPackLevel())) {
return ResultVOUtils.error(500, "当前产品不支持采集该包装层级追溯码!");
}
if (udiRelevanceResponse.getUseMaxLevel() == null && IntUtil.value(udiRelevanceResponse.getPackLevel()) > 1) {
return ResultVOUtils.error(500, "当前产品不支持采集该包装层级追溯码!");
}
if (IntUtil.value(udiRelevanceResponse.getPackLevel()) < IntUtil.value(udiRelevanceResponse.getUseLevel())) {
return ResultVOUtils.error(500, "当前产品不支持采集该包装层级追溯码!");
}
} else {
if (udiRelevanceResponse.getDistributeMaxLevel() != null && IntUtil.value(udiRelevanceResponse.getDistributeMaxLevel()) < IntUtil.value(udiRelevanceResponse.getPackLevel())) {
return ResultVOUtils.error(500, "当前产品不支持采集该包装层级追溯码!");
}
if (IntUtil.value(udiRelevanceResponse.getPackLevel()) < IntUtil.value(udiRelevanceResponse.getDistributeLevel())) {
return ResultVOUtils.error(500, "当前产品不支持采集该包装层级追溯码!");
}
}
if (IntUtil.value(udiRelevanceResponse.getPackLevel()) == 0) {
RelCodeDetailResponse relCodeDetailResponse = relCodeDetailService.findByCode(code);
if (relCodeDetailResponse == null) {
return ResultVOUtils.error(500, "请先上传关联关系!");
}
}
//先生成扫码单据
IoOrderEntity orderEntity = orderService.findByBillNo(orderId);
String inBatch = "";

@ -38,47 +38,49 @@
</sql>
<select id="selectDrugsByNameCodes" resultType="int">
SELECT count(1) FROM third_ali_drug WHERE nameCode = #{nameCode}
SELECT count(1)
FROM third_ali_drug
WHERE nameCode = #{nameCode}
</select>
<!-- 自定义saveOrUpdateBatch方法 -->
<insert id="saveOrUpdateBatch" parameterType="com.glxp.api.entity.thrsys.ThirdAliDrug" >
INSERT INTO third_ali_drug (`type`, manufacturer, cpmctymc, form, formSpec, bzgg, spmc, nameCode, packRatio,
packLevel, createTime, updateTime,erpId)
VALUES
<insert id="saveOrUpdateBatch" parameterType="com.glxp.api.entity.thrsys.ThirdAliDrug">
replace INTO third_ali_drug (`type`, manufacturer, cpmctymc, form, formSpec, bzgg, spmc, nameCode, packRatio,
packLevel, createTime, updateTime, erpId, approvalNum)
VALUES
<foreach collection="list" item="item" separator="," index="index">
(#{item.type}, #{item.manufacturer}, #{item.cpmctymc}, #{item.form}, #{item.formSpec}, #{item.bzgg}, #{item.spmc}, #{item.nameCode},
#{item.packRatio}, #{item.packLevel}, #{item.createTime}, #{item.updateTime}, #{item.erpId})
(#{item.type}, #{item.manufacturer}, #{item.cpmctymc}, #{item.form}, #{item.formSpec}, #{item.bzgg},
#{item.spmc}, #{item.nameCode},
#{item.packRatio}, #{item.packLevel}, #{item.createTime}, #{item.updateTime}, #{item.erpId},
#{item.approvalNum})
</foreach>
</insert>
<select id="filterList" parameterType="com.glxp.api.req.thrsys.ThirdAliDrugRequest" resultType="com.glxp.api.entity.thrsys.ThirdAliDrug">
select
id,
`type`,
manufacturer,
cpmctymc,
form,
formSpec,
bzgg,
spmc,
nameCode,
packRatio,
packLevel,
createTime,
erpId,
updateTime
from third_ali_drug
<where>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat('%', #{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat('%', #{nameCode}, '%')
</if>
</where>
</select>
<select id="filterList" parameterType="com.glxp.api.req.thrsys.ThirdAliDrugRequest"
resultType="com.glxp.api.entity.thrsys.ThirdAliDrug">
select id,
`type`,
manufacturer,
cpmctymc,
form,
formSpec,
bzgg,
spmc,
nameCode,
packRatio,
packLevel,
createTime,
erpId,
updateTime
from third_ali_drug
<where>
<if test="cpmctymc != '' and cpmctymc != null">
AND cpmctymc LIKE concat('%', #{cpmctymc}, '%')
</if>
<if test="nameCode != '' and nameCode != null">
AND nameCode LIKE concat('%', #{nameCode}, '%')
</if>
</where>
</select>
</mapper>

@ -1045,39 +1045,47 @@ CALL Pro_Temp_ColumnWork('io_code_temp', 'drugLink',
' tinyint NULL DEFAULT b''0''COMMENT ''药品关联关系是否存在 0不存在 1存在''',
1);
CREATE TABLE IF NOT EXISTS `rel_code_batch` (
`id` int NOT NULL AUTO_INCREMENT,
`productCode` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '产品编码',
`subTypeNo` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '类型编码',
`cascadeRatio` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '包装比例',
`packageSpec` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '包装规格',
`comment` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
`batchNo` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号',
`madeDate` datetime DEFAULT NULL COMMENT '生产日期',
`validateDate` datetime DEFAULT NULL COMMENT '失效日期',
`workShop` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产车间',
`lineName` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产线',
`lineManager` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '负责人',
`createTime` datetime DEFAULT NULL COMMENT '创建时间',
`createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
`updateTime` datetime DEFAULT NULL COMMENT '更新时间',
`updateUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '更新人',
`parentCode` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '父级码',
`uploadFlagUp` tinyint(1) DEFAULT '0' COMMENT '0 未上传 1已上传 2上传失败',
`uploadFlagDown` tinyint(1) DEFAULT '0' COMMENT '0 未上传 1已上传 2上传失败',
`erpId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商ID',
CREATE TABLE IF NOT EXISTS `rel_code_batch`
(
`id` int NOT NULL AUTO_INCREMENT,
`productCode` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '产品编码',
`subTypeNo` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '类型编码',
`cascadeRatio` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '包装比例',
`packageSpec` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '包装规格',
`comment` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '备注',
`batchNo` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '批次号',
`madeDate` datetime DEFAULT NULL COMMENT '生产日期',
`validateDate` datetime DEFAULT NULL COMMENT '失效日期',
`workShop` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产车间',
`lineName` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '生产线',
`lineManager` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '负责人',
`createTime` datetime DEFAULT NULL COMMENT '创建时间',
`createUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人',
`updateTime` datetime DEFAULT NULL COMMENT '更新时间',
`updateUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '更新人',
`parentCode` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '父级码',
`uploadFlagUp` tinyint(1) DEFAULT '0' COMMENT '0 未上传 1已上传 2上传失败',
`uploadFlagDown` tinyint(1) DEFAULT '0' COMMENT '0 未上传 1已上传 2上传失败',
`erpId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '供应商ID',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
) ENGINE = InnoDB
AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;
CREATE TABLE IF NOT EXISTS `rel_code_detail` (
`id` int NOT NULL AUTO_INCREMENT,
`curCode` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '当前条码',
`packLayer` tinyint DEFAULT NULL COMMENT '包装级别',
CREATE TABLE IF NOT EXISTS `rel_code_detail`
(
`id` int NOT NULL AUTO_INCREMENT,
`curCode` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '当前条码',
`packLayer` tinyint DEFAULT NULL COMMENT '包装级别',
`parentCode` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '父级码',
`flag` tinyint DEFAULT NULL COMMENT '状态',
`batchIdFk` int DEFAULT NULL COMMENT '产品批次ID外键',
`flag` tinyint DEFAULT NULL COMMENT '状态',
`batchIdFk` int DEFAULT NULL COMMENT '产品批次ID外键',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
) ENGINE = InnoDB
AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;
CREATE TABLE if not exists `third_ali_drug`
@ -1164,7 +1172,13 @@ CALL Pro_Temp_ColumnWork('rel_code_batch', 'threeLevelCount',
1);
CALL Pro_Temp_ColumnWork('third_ali_drug', 'erpId',
' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT ''供应商ID''',
1);
CALL Pro_Temp_ColumnWork('third_ali_drug', 'approvalNum',
' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT ''批准文号''',
1);
call Modify_index('third_ali_drug', 'approvalNum', 'approvalNum', 'BTREE');
Loading…
Cancel
Save