diff --git a/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java b/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java index a6adef0c..ebf3e13b 100644 --- a/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java +++ b/src/main/java/com/glxp/api/controller/basic/UdiRlSupController.java @@ -94,10 +94,10 @@ public class UdiRlSupController extends BaseController { companyProductRelevanceRequest.setCustomerId(null); } } - if (ObjectUtil.isNotNull(companyProductRelevanceRequest.getUserFlag())){ + if (ObjectUtil.isNotNull(companyProductRelevanceRequest.getUserFlag())) { Integer userFlag = companyProductRelevanceRequest.getUserFlag(); //获取 供应商状态为 userFlag 的 customerIds列表 - List customerIds = customerInfoService.selectCustomerIdListByUserFlag(userFlag); + List customerIds = customerInfoService.selectCustomerIdListByUserFlag(userFlag); companyProductRelevanceRequest.setCustomerIds(customerIds); } @@ -124,10 +124,10 @@ public class UdiRlSupController extends BaseController { companyProductRelevanceRequest.setDiType(1); } //包装采购类型校验 - if (StrUtil.isNotEmpty(companyProductRelevanceRequest.getAction())){ + if (StrUtil.isNotEmpty(companyProductRelevanceRequest.getAction())) { BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(companyProductRelevanceRequest.getAction()); //是否校验产品采购类型 :1:校验;2.无需校验 - if(IntUtil.value(bussinessTypeEntity.getVailProductAttributes()) == 1){ + if (IntUtil.value(bussinessTypeEntity.getVailProductAttributes()) == 1) { companyProductRelevanceRequest.setPurType(IntUtil.value(bussinessTypeEntity.getActionType())); } } @@ -304,7 +304,7 @@ public class UdiRlSupController extends BaseController { @AuthRuleAnnotation("") @PostMapping("/sale/info/company/product/relevance/copyCustomerId") public BaseResponse copyCustomerId(@RequestBody @Valid CopyCustomerIdRequest copyCustomerIdRequest, - BindingResult bindingResult) { + BindingResult bindingResult) { if (bindingResult.hasErrors()) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } diff --git a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java index 3216e696..19226c41 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java @@ -429,6 +429,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(); //三期校验 diff --git a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java index 94a91335..461efcac 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoOrderDetailBizController.java @@ -168,10 +168,10 @@ public class IoOrderDetailBizController extends BaseController { BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction()); //是否校验产品采购类型 :1:校验;2.无需校验 - if(IntUtil.value(bussinessTypeEntity.getVailProductAttributes()) == 1){ + if (IntUtil.value(bussinessTypeEntity.getVailProductAttributes()) == 1) { Integer purType = IntUtil.value(udiRelevanceResponse.getPurType()); //1:普通入账产品;2.预验收产品。3:寄售产品 int actionType = IntUtil.value(bussinessTypeEntity.getActionType()); //1:带票(正常);2.预验收。3:寄售 - if (purType != actionType){ + if (purType != actionType) { //包装友好提示 String msg = ""; switch (actionType) { @@ -197,7 +197,18 @@ public class IoOrderDetailBizController extends BaseController { msg2 = "寄售产品"; break; } - return ResultVOUtils.error(500, "单据只允许录入" + msg +",当前录入产品为"+msg2+",请检查后重试!"); + return ResultVOUtils.error(500, "单据只允许录入" + msg + ",当前录入产品为" + msg2 + ",请检查后重试!"); + } + } + + //是否校验耗材材质 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, "单据只允许录入普通耗材" + ",请检查后重试!"); } } diff --git a/src/main/java/com/glxp/api/entity/basic/BasicBussinessTypeEntity.java b/src/main/java/com/glxp/api/entity/basic/BasicBussinessTypeEntity.java index 2b60daff..7cc9d90a 100644 --- a/src/main/java/com/glxp/api/entity/basic/BasicBussinessTypeEntity.java +++ b/src/main/java/com/glxp/api/entity/basic/BasicBussinessTypeEntity.java @@ -453,4 +453,12 @@ public class BasicBussinessTypeEntity { @TableField(value = "vailProductAttributes") private Integer vailProductAttributes; + + /** + * 校验耗材类型 :0:不耗材;1:高值耗材;2:无普通耗材 + */ + @TableField(value = "vailHcType") + private Integer vailHcType; + + } diff --git a/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java b/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java index 2c3f5999..ce596882 100644 --- a/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java +++ b/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java @@ -112,28 +112,28 @@ public class UdiProductEntity { * 一级分类名称(学科,品名) */ @TableField(value = "catalogname1") - @ApiModelProperty(value="一级分类名称(学科,品名)") + @ApiModelProperty(value = "一级分类名称(学科,品名)") private String catalogname1; /** * 二级分类名称(用途、品目) */ @TableField(value = "catalogname2") - @ApiModelProperty(value="二级分类名称(用途、品目)") + @ApiModelProperty(value = "二级分类名称(用途、品目)") private String catalogname2; /** * 三级分类名称(部位、功能、品种) */ @TableField(value = "catalogname3") - @ApiModelProperty(value="三级分类名称(部位、功能、品种)") + @ApiModelProperty(value = "三级分类名称(部位、功能、品种)") private String catalogname3; /** * 耗材材质 */ @TableField(value = "matrial") - @ApiModelProperty(value="耗材材质") + @ApiModelProperty(value = "耗材材质") private String matrial; private String remark; @@ -143,20 +143,22 @@ public class UdiProductEntity { * 一级分类名称(学科,品名) */ @TableField(value = "catalogCode1") - @ApiModelProperty(value="一级分类名称(学科,品名)") + @ApiModelProperty(value = "一级分类名称(学科,品名)") private Integer catalogCode1; /** * 二级分类名称(用途、品目) */ @TableField(value = "catalogCode2") - @ApiModelProperty(value="二级分类名称(用途、品目)") + @ApiModelProperty(value = "二级分类名称(用途、品目)") private Integer catalogCode2; /** * 三级分类名称(部位、功能、品种) */ @TableField(value = "catalogCode3") - @ApiModelProperty(value="三级分类名称(部位、功能、品种)") + @ApiModelProperty(value = "三级分类名称(部位、功能、品种)") private Integer catalogCode3; + + } diff --git a/src/main/java/com/glxp/api/req/basic/BussinessTypeSaveRequest.java b/src/main/java/com/glxp/api/req/basic/BussinessTypeSaveRequest.java index 46dedc24..0ff7c6a9 100644 --- a/src/main/java/com/glxp/api/req/basic/BussinessTypeSaveRequest.java +++ b/src/main/java/com/glxp/api/req/basic/BussinessTypeSaveRequest.java @@ -311,4 +311,8 @@ public class BussinessTypeSaveRequest { private Integer inPreInBack; private Integer vailProductAttributes; + /** + * 校验耗材类型 :0:不耗材;1:高值耗材;2:无普通耗材 + */ + private Integer vailHcType; } diff --git a/src/main/java/com/glxp/api/req/basic/CompanyProductRelevanceRequest.java b/src/main/java/com/glxp/api/req/basic/CompanyProductRelevanceRequest.java index e9867152..6ac8ef3c 100644 --- a/src/main/java/com/glxp/api/req/basic/CompanyProductRelevanceRequest.java +++ b/src/main/java/com/glxp/api/req/basic/CompanyProductRelevanceRequest.java @@ -86,4 +86,11 @@ public class CompanyProductRelevanceRequest extends ListPageRequest { private List customerIds; + + /** + * 校验耗材类型 :0:不耗材;1:高值耗材;2:无普通耗材 + */ + private Integer vailHcType; + + } diff --git a/src/main/java/com/glxp/api/req/inv/FilterInvProductRequest.java b/src/main/java/com/glxp/api/req/inv/FilterInvProductRequest.java index b55946c7..6f0ce835 100644 --- a/src/main/java/com/glxp/api/req/inv/FilterInvProductRequest.java +++ b/src/main/java/com/glxp/api/req/inv/FilterInvProductRequest.java @@ -105,6 +105,6 @@ public class FilterInvProductRequest extends ListPageRequest { private Integer filterNoInv; - + private Integer highValue; } diff --git a/src/main/java/com/glxp/api/res/basic/BasicBussinessTypeResponse.java b/src/main/java/com/glxp/api/res/basic/BasicBussinessTypeResponse.java index aec347e1..b3442a78 100644 --- a/src/main/java/com/glxp/api/res/basic/BasicBussinessTypeResponse.java +++ b/src/main/java/com/glxp/api/res/basic/BasicBussinessTypeResponse.java @@ -179,5 +179,9 @@ public class BasicBussinessTypeResponse { private Integer vailProductAttributes; + /** + * 校验耗材类型 :0:不耗材;1:高值耗材;2:无普通耗材 + */ + private Integer vailHcType; } diff --git a/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml b/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml index 39fdfc11..06cf825d 100644 --- a/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml +++ b/src/main/resources/mybatis/mapper/basic/UdiProductDao.xml @@ -173,9 +173,9 @@ @@ -191,13 +191,13 @@ basicPrductRemak3, basicPrductRemak4, basicPrductRemak5, basicPrductRemak6, basicPrductRemak7, basicPrductRemak8, updateTime , sfwblztlcp, cgzmraqxgxx, sfbjwycxsy, zdcfsycs, sfwwjbz, syqsfxyjxmj, mjfs, categoryName, - catalogname1, - catalogname2, - catalogname3, - matrial, - catalogCode1, - catalogCode2, - catalogCode3) + catalogname1, + catalogname2, + catalogname3, + matrial, + catalogCode1, + catalogCode2, + catalogCode3) values (#{id}, #{uuid}, #{originUuid}, #{nameCode}, @@ -936,8 +936,8 @@ categoryName=#{categoryName}, - catalogname1=#{catalogname1}, - + catalogname1=#{catalogname1}, + catalogname2=#{catalogname2}, @@ -956,7 +956,6 @@ catalogCode3=#{catalogCode3}, - where id = #{id} diff --git a/src/main/resources/schemas/schema_v2.3.sql b/src/main/resources/schemas/schema_v2.3.sql index 39384988..5e9f62bf 100644 --- a/src/main/resources/schemas/schema_v2.3.sql +++ b/src/main/resources/schemas/schema_v2.3.sql @@ -819,8 +819,52 @@ CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'vailProductAttributes', CALL Pro_Temp_ColumnWork('auth_user', 'lastUpdatePwdTime', 'datetime', 1); -call Modify_UNIQUE_index('thr_products_add_di', '`uuid`, `customerId`', 'uniqueUuid', 'BTREE'); - +/*创建定义唯一索引函数*/ +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; +call Modify_UNIQUE_index('thr_products_add_di', '`uuid`, `customerId`', 'uniqueUuid', 'BTREE'); +CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'vailHcType', + 'tinyint NULL DEFAULT NULL COMMENT '' 校验耗材类型 :0:不耗材;1:高值耗材;2:无普通耗材''', 1);