新增耗材类别校验

dev_kcyj
anthonywj 1 year ago
parent b20a361cf1
commit 87d3b9486f

@ -398,6 +398,18 @@ public class IoCodeTempController extends BaseController {
}
}
//是否校验耗材材质 1高值耗材2.普通耗材
if (IntUtil.value(bussinessTypeEntity.getVailHcType() == 1)) {
if (IntUtil.value(udiInfoEntity.getHcType()) != 1) {
return ResultVOUtils.error(500, "单据只允许录入高值耗材" + ",请检查后重试!");
}
} else if (IntUtil.value(bussinessTypeEntity.getVailHcType() == 2)) {
if (IntUtil.value(udiInfoEntity.getHcType()) != 2) {
return ResultVOUtils.error(500, "单据只允许录入普通耗材" + ",请检查后重试!");
}
}
String orderId = addOrderRequest.getBillNo();
//三期校验

@ -219,6 +219,17 @@ public class IoOrderDetailBizController extends BaseController {
}
}
//是否校验耗材材质 1高值耗材2.普通耗材
if (IntUtil.value(bussinessTypeEntity.getVailHcType() == 1)) {
if (IntUtil.value(udiRelevanceResponse.getHcType()) != 1) {
return ResultVOUtils.error(500, "单据只允许录入高值耗材" + ",请检查后重试!");
}
} else if (IntUtil.value(bussinessTypeEntity.getVailHcType() == 2)) {
if (IntUtil.value(udiRelevanceResponse.getHcType()) != 2) {
return ResultVOUtils.error(500, "单据只允许录入普通耗材" + ",请检查后重试!");
}
}
// todo 查询产品是否已经通过认证
// BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
// if (bussinessTypeEntity.getCheckCertExpire() == 2 && udiRelevanceResponse.isNeedCert()) {

@ -211,8 +211,6 @@ public class PurApplyController {
if (purApplyRequest.getStatus() == 3) {
purChangeService.purApplyChange(purApplyEntity);
}
// //审核通过后转换成采购计划单
// if (purApplyEntity.getStatus() == ConstantStatus.APPLY_AUDIT_ED && purApplyRequest.isAudtoPlan()) {
// PurPlanEntity purPlanEntity = new PurPlanEntity();

@ -28,6 +28,7 @@ public class ForThirdSysApiController {
/**
* B001 /
*
* @param filterInvProductRequest
* @return
*/
@ -43,6 +44,7 @@ public class ForThirdSysApiController {
/**
* B002
*
* @param filterUdiRelRequest
* @return
*/
@ -58,6 +60,7 @@ public class ForThirdSysApiController {
/**
* B003 /退
*
* @param forInvOutScanCodeRequest
* @return
*/

@ -493,6 +493,12 @@ public class BasicBussinessTypeEntity {
@TableField(value = "vailProductAttributes")
private Integer vailProductAttributes;
/**
* 0:1:2:
*/
@TableField(value = "vailHcType")
private Integer vailHcType;
/**
* 02.
*/

@ -132,4 +132,6 @@ public class UdiProductEntity {
private Integer purType;
private Integer hcType;
}

@ -323,8 +323,12 @@ public class BussinessTypeSaveRequest {
/**
* 12.
*/
@TableField(value = "vailProductAttributes")
private Integer vailProductAttributes;
/**
* 0:1:2:
*/
private Integer vailHcType;
/**
* 02.
*/

@ -133,5 +133,7 @@ public class FilterInvProductRequest extends ListPageRequest {
*/
private Integer attributeType;
private Integer highValue;
}

@ -202,8 +202,15 @@ public class BasicBussinessTypeResponse {
/**
* 12.
*/
@TableField(value = "vailProductAttributes")
private Integer vailProductAttributes;
/**
* 0:1:2:
*/
private Integer vailHcType;
/**
* 02.
*/

@ -2,9 +2,12 @@ package com.glxp.api.service.forthird.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.glxp.api.dao.inout.IoCodeDao;
import com.glxp.api.entity.basic.UdiEntity;
import com.glxp.api.entity.inout.IoCodeEntity;
import com.glxp.api.exception.JsonException;
import com.glxp.api.req.basic.FilterUdiRelRequest;
import com.glxp.api.req.forthird.ForInvOutScanCodeRequest;
@ -16,6 +19,7 @@ import com.glxp.api.res.inv.InvProductPageResponse;
import com.glxp.api.res.inv.InvProductResponse;
import com.glxp.api.service.basic.UdiRelevanceService;
import com.glxp.api.service.forthird.ForThirdSysApiService;
import com.glxp.api.service.inout.impl.IoCodeService;
import com.glxp.api.service.inv.impl.InvProductService;
import com.glxp.api.util.StringUtils;
import com.glxp.api.util.udi.FilterUdiUtils;
@ -59,13 +63,16 @@ public class ForThirdSysApiServiceImpl implements ForThirdSysApiService {
return pageResponse;
}
@Resource
IoCodeDao codeDao;
@Override
public ForInvOutScanCodeResponse invOutScanCode(ForInvOutScanCodeRequest forInvOutScanCodeRequest) {
ForInvOutScanCodeResponse forInvOutScanCodeResponse = new ForInvOutScanCodeResponse();
System.out.println(JSON.toJSONString(forInvOutScanCodeRequest));
// TODO: 2024/3/15 以获取到业务单据实体 需要对单据进行操作 成功返回 单据号
//校验UDI码是否正确,获取最新的UDI码
// codeDao.selectOne(new LambdaQueryWrapper<IoCodeEntity>().eq(IoCodeEntity::getCode, forInvOutScanCodeRequest.getIoOrderRequest().getCode()));
String billNo = "1212121";
forInvOutScanCodeResponse.setBillNo(billNo);
return forInvOutScanCodeResponse;

@ -289,6 +289,22 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService {
throw new JsonException("单据只允许录入" + msg + ",当前录入产品为" + msg2 + ",请检查后重试!");
}
}
//是否校验耗材材质 1高值耗材2.普通耗材
if (IntUtil.value(bussinessTypeEntity.getVailHcType() == 1)) {
if (IntUtil.value(udiRelevanceResponse.getHcType()) != 1) {
throw new JsonException("单据只允许录入高值耗材" + ",请检查后重试!");
}
} else if (IntUtil.value(bussinessTypeEntity.getVailHcType() == 2)) {
if (IntUtil.value(udiRelevanceResponse.getHcType()) != 2) {
throw new JsonException("单据只允许录入普通耗材\" + \",请检查后重试!");
}
}
if (udiRelevanceResponse.getPurType() == 2) {
if (StrUtil.isEmpty(item.getZczbhhzbapzbh())) {
throw new JsonException("预验收产品必须填写预验收批次号");
}
}
IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity();

@ -167,7 +167,7 @@
<select id="findByNameCode" parameterType="java.lang.String"
resultType="com.glxp.api.entity.basic.UdiProductEntity">
SELECT basic_products.*,basic_udirel.purType
SELECT basic_products.*,basic_udirel.purType,basic_udirel.hcType
FROM basic_products
LEFT JOIN basic_udirel ON basic_udirel.uuid = basic_products.uuid
WHERE (basic_products.nameCode = #{nameCode})

@ -99,3 +99,52 @@ END IF;
END;
/*创建定义普通索引函数结束*/
/*创建定义唯一索引函数*/
DROP PROCEDURE IF EXISTS Modify_UNIQUE_index;
CREATE PROCEDURE Modify_UNIQUE_index(
TableName VARCHAR(50),
ColumnNames VARCHAR(500),
idx_name VARCHAR(50),
idx_type VARCHAR(50))
BEGIN
DECLARE
Rows1 int;
DECLARE
SqlStr VARCHAR(4000);
DECLARE
target_database VARCHAR(100);
SELECT DATABASE
()
INTO target_database;
SET Rows1 = 0;
SELECT COUNT(*)
INTO Rows1
FROM information_schema.statistics
WHERE table_schema = DATABASE()
AND upper(table_name) = upper(TableName)
AND upper(index_name) = upper(idx_name);
IF Rows1 <= 0 THEN
SET SqlStr :=
CONCAT('alter table `', TableName, '` ADD UNIQUE INDEX `', idx_name, '`(`', ColumnNames, '`) USING ',
idx_type);
END IF;
IF
(SqlStr <> '') THEN
SET @SQL1 = SqlStr;
PREPARE stmt1
FROM
@SQL1;
EXECUTE stmt1;
END IF;
END;
/*创建定义唯一索引函数*/

@ -3386,9 +3386,21 @@ CALL Pro_Temp_ColumnWork('device_repair_apply_detail', 'diagnosisLivePath',
'varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''诊断照片''',
1);
INSERT IGNORE INTO basic_bustype_change(`id`, `originAction`, `originName`, `targetAction`, `type`, `enable`, `createUser`, `updateUser`, `createTime`, `updateTime`, `remark`, `auditStatus`, `busAuditStatus`, `targetBusAction`, `beforeTime`, `busBeforeTime`) VALUES (1724370174626394116, 'DECPSG', '设备产品申购', NULL, 2, 1, NULL, '1', NULL, '2023-11-14 18:14:44', NULL, 2, 3, 'DECGJH', NULL, NULL);
INSERT IGNORE INTO basic_bustype_change(`id`, `originAction`, `originName`, `targetAction`, `type`, `enable`, `createUser`, `updateUser`, `createTime`, `updateTime`, `remark`, `auditStatus`, `busAuditStatus`, `targetBusAction`, `beforeTime`, `busBeforeTime`) VALUES (1724370174626394117, 'DECGJH', '设备采购计划', NULL, 3, 1, NULL, '1', NULL, '2023-11-14 18:14:34', NULL, 2, 1, 'DECGDD', NULL, NULL);
INSERT IGNORE INTO basic_bustype_change(`id`, `originAction`, `originName`, `targetAction`, `type`, `enable`, `createUser`, `updateUser`, `createTime`, `updateTime`, `remark`, `auditStatus`, `busAuditStatus`, `targetBusAction`, `beforeTime`, `busBeforeTime`) VALUES (1724370174626394118, 'DECGDD', '设备采购订单', NULL, 5, 1, NULL, '1', NULL, '2023-11-14 18:14:22', NULL, 2, 2, NULL, NULL, NULL);
INSERT IGNORE INTO basic_bustype_change(`id`, `originAction`, `originName`, `targetAction`, `type`, `enable`,
`createUser`, `updateUser`, `createTime`, `updateTime`, `remark`, `auditStatus`,
`busAuditStatus`, `targetBusAction`, `beforeTime`, `busBeforeTime`)
VALUES (1724370174626394116, 'DECPSG', '设备产品申购', NULL, 2, 1, NULL, '1', NULL, '2023-11-14 18:14:44', NULL, 2, 3,
'DECGJH', NULL, NULL);
INSERT IGNORE INTO basic_bustype_change(`id`, `originAction`, `originName`, `targetAction`, `type`, `enable`,
`createUser`, `updateUser`, `createTime`, `updateTime`, `remark`, `auditStatus`,
`busAuditStatus`, `targetBusAction`, `beforeTime`, `busBeforeTime`)
VALUES (1724370174626394117, 'DECGJH', '设备采购计划', NULL, 3, 1, NULL, '1', NULL, '2023-11-14 18:14:34', NULL, 2, 1,
'DECGDD', NULL, NULL);
INSERT IGNORE INTO basic_bustype_change(`id`, `originAction`, `originName`, `targetAction`, `type`, `enable`,
`createUser`, `updateUser`, `createTime`, `updateTime`, `remark`, `auditStatus`,
`busAuditStatus`, `targetBusAction`, `beforeTime`, `busBeforeTime`)
VALUES (1724370174626394118, 'DECGDD', '设备采购订单', NULL, 5, 1, NULL, '1', NULL, '2023-11-14 18:14:22', NULL, 2, 2, NULL,
NULL, NULL);
CALL Pro_Temp_ColumnWork('device_repair', 'repairUserId', 'bigint DEFAULT NULL COMMENT''报修人id''', 1);
@ -3401,3 +3413,7 @@ INSERT ignore INTO `sys_pdf_template_relevance_statemen`(`id`, `templateId`, `cu
`localAction`, `remark1`, `remark2`, `remark3`, `printType`,
`modelKey`)
VALUES (6, 33, 110, 0, NULL, '科室设备报表打印', NULL, NULL, NULL, NULL, 'reportForms');
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'vailHcType',
'tinyint NULL DEFAULT NULL COMMENT '' 校验耗材类型 0:不耗材1:高值耗材2:无普通耗材''', 1);

Loading…
Cancel
Save