药品字典修改

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()); 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"); // SystemParamConfigEntity recentParamConfigEntity = systemParamConfigService.selectByParamKey("recent_date_tip");
long recent = 0; 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); IoOrderEntity orderEntity = orderService.findByBillNo(orderId);
String inBatch = ""; String inBatch = "";

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

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