diff --git a/src/main/java/com/glxp/api/dao/inout/IoDestinyProcessMapper.java b/src/main/java/com/glxp/api/dao/inout/IoDestinyProcessMapper.java index fc6c49cd5..e2d738aa8 100644 --- a/src/main/java/com/glxp/api/dao/inout/IoDestinyProcessMapper.java +++ b/src/main/java/com/glxp/api/dao/inout/IoDestinyProcessMapper.java @@ -6,4 +6,6 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface IoDestinyProcessMapper extends BaseMapper { -} \ No newline at end of file + + String selectMaxDestinyNo(String destinyId); +} 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 0f03aa6de..84033ea06 100644 --- a/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java +++ b/src/main/java/com/glxp/api/entity/basic/UdiProductEntity.java @@ -100,7 +100,7 @@ public class UdiProductEntity { private String updateUser; private Date createTime; private String createUser; - private String destinyType; + private Integer destinyType; /** * 一级分类名称(学科,品名) diff --git a/src/main/java/com/glxp/api/req/basic/BasicSkProjectRequest.java b/src/main/java/com/glxp/api/req/basic/BasicSkProjectRequest.java index 808a221ef..7c658b03e 100644 --- a/src/main/java/com/glxp/api/req/basic/BasicSkProjectRequest.java +++ b/src/main/java/com/glxp/api/req/basic/BasicSkProjectRequest.java @@ -55,4 +55,6 @@ public class BasicSkProjectRequest extends ListPageRequest { * 类型:1:定数包,内部使用;2:项目、组套外部关联 */ private Integer type; + + private Integer status; } diff --git a/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java b/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java index f93888fda..0439a4101 100644 --- a/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java +++ b/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java @@ -190,6 +190,13 @@ public class UdiRelevanceResponse { @ApiModelProperty(value = "耗材材质") private String matrial; + /** + * 类型:1:定数包,内部使用;2:项目、组套外部关联 + */ + @TableField(value = "destinyType") + @ApiModelProperty(value = "类型:1:定数包,内部使用;2:项目、组套外部关联") + private Integer destinyType; + public int getBhzxxsbzsl() { if (bhzxxsbzsl == null || bhzxxsbzsl == 0) { return 1; diff --git a/src/main/java/com/glxp/api/service/inout/impl/IoDestinyProcessDetailServiceImpl.java b/src/main/java/com/glxp/api/service/inout/impl/IoDestinyProcessDetailServiceImpl.java index 2c373d74e..8bc264265 100644 --- a/src/main/java/com/glxp/api/service/inout/impl/IoDestinyProcessDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inout/impl/IoDestinyProcessDetailServiceImpl.java @@ -1,13 +1,16 @@ package com.glxp.api.service.inout.impl; import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageHelper; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; +import com.glxp.api.dao.basic.BasicSkProjectMapper; import com.glxp.api.dao.inout.IoDestinyProcessCodeMapper; import com.glxp.api.dao.inout.IoDestinyProcessMapper; import com.glxp.api.entity.auth.AuthAdmin; +import com.glxp.api.entity.basic.BasicSkProjectEntity; import com.glxp.api.entity.basic.UdiEntity; import com.glxp.api.entity.inout.IoDestinyProcessCodeEntity; import com.glxp.api.entity.inout.IoDestinyProcessEntity; @@ -18,6 +21,7 @@ import com.glxp.api.res.inout.IodestinyProcessResponse; import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.basic.UdiRelevanceService; import com.glxp.api.service.basic.impl.BasicDestinyRelService; +import com.glxp.api.util.StringUtils; import com.glxp.api.util.udi.FilterUdiUtils; import com.glxp.api.util.udi.UdiCalCountUtil; import org.springframework.stereotype.Service; @@ -40,7 +44,8 @@ public class IoDestinyProcessDetailServiceImpl implements IoDestinyProcessDetail private IoDestinyProcessDetailMapper ioDestinyProcessDetailMapper; @Resource private IoDestinyProcessCodeMapper ioDestinyProcessCodeMapper; - + @Resource + private BasicSkProjectMapper basicSkProjectMapper; @Resource CustomerService customerService; @Resource @@ -81,7 +86,8 @@ public class IoDestinyProcessDetailServiceImpl implements IoDestinyProcessDetail ioDestinyProcessMapper.updateById(ioDestinyProcessEntity); }else{ ioDestinyProcessEntity.setId(IdUtil.getSnowflakeNextId()); - ioDestinyProcessEntity.setDestinyNo(filterUdiRelRequest.getDestinyNo()); + //destinyNo 处理为 destinyId + 00000001 格式 + ioDestinyProcessEntity.setDestinyNo(generateDestinyNoByDestinyId(filterUdiRelRequest.getDestinyId())); ioDestinyProcessEntity.setDestinyId(filterUdiRelRequest.getDestinyId()); ioDestinyProcessEntity.setBillNo(filterUdiRelRequest.getBillNo()); ioDestinyProcessEntity.setBillDate(filterUdiRelRequest.getBillDate()); @@ -113,6 +119,27 @@ public class IoDestinyProcessDetailServiceImpl implements IoDestinyProcessDetail return true; } + /** + * 处理 定数包模版编码####000001 + * @param destinyId + * @return + */ + private String generateDestinyNoByDestinyId(String destinyId) { + //查数据库编码的最大值 然后加1 + String maxDestinyNo = ioDestinyProcessMapper.selectMaxDestinyNo(destinyId); + BasicSkProjectEntity basicSkProjectEntity = basicSkProjectMapper.selectById(destinyId); + String code = basicSkProjectEntity.getCode(); + if (StrUtil.isNotEmpty(maxDestinyNo)){ + //解析加1 + String newString = maxDestinyNo.replace(code, ""); + long parseLong = Long.parseLong(newString); + return code+ StringUtils.padl(parseLong+1,8); + }else { + //初始化 + return code+"00000001"; + } + } + @Override public List addDestinyProcess(IodestinyProcessRequest iodestinyProcessRequest) { diff --git a/src/main/resources/mybatis/mapper/basic/BasicSkProjectMapper.xml b/src/main/resources/mybatis/mapper/basic/BasicSkProjectMapper.xml index 25f2eb975..7d70b101b 100644 --- a/src/main/resources/mybatis/mapper/basic/BasicSkProjectMapper.xml +++ b/src/main/resources/mybatis/mapper/basic/BasicSkProjectMapper.xml @@ -10,6 +10,9 @@ AND type = #{type} + + AND status = #{status} + AND name LIKE concat('%', #{name}, '%') diff --git a/src/main/resources/mybatis/mapper/inout/IoDestinyProcessMapper.xml b/src/main/resources/mybatis/mapper/inout/IoDestinyProcessMapper.xml index 7456820e1..a8a032cc4 100644 --- a/src/main/resources/mybatis/mapper/inout/IoDestinyProcessMapper.xml +++ b/src/main/resources/mybatis/mapper/inout/IoDestinyProcessMapper.xml @@ -19,7 +19,15 @@ - id, destinyId, destinyNo, billNo, billDate, invCode, remark, createTime, updateTime, + id, destinyId, destinyNo, billNo, billDate, invCode, remark, createTime, updateTime, `createUser`, updateUser, `status` - \ No newline at end of file + + + + diff --git a/src/main/resources/schemas/schema_v2.4.sql b/src/main/resources/schemas/schema_v2.4.sql index 4c54b194b..6285ac724 100644 --- a/src/main/resources/schemas/schema_v2.4.sql +++ b/src/main/resources/schemas/schema_v2.4.sql @@ -2010,7 +2010,7 @@ CALL Pro_Temp_ColumnWork('basic_sk_project', 'status', ' int(0) NULL DEFAULT NULL COMMENT '' 状态(1.草稿,2.未审核,3.已审核,4.已拒绝)''', 1); CALL Pro_Temp_ColumnWork('basic_products', 'destinyType', - ' int(0) NULL DEFAULT NULL COMMENT''1:定数包''', + ' int(0) NULL DEFAULT NULL COMMENT''类型:1:定数包,内部使用;2:项目、组套外部关联''', 1); @@ -2021,3 +2021,7 @@ CALL Pro_Temp_ColumnWork('basic_sk_sicker', 'deptName', CALL Pro_Temp_ColumnWork('basic_sk_sicker', 'deptCode', ' varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL', 1); + +INSERT IGNORE INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, + `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) + VALUES (2093, '术士套包管理', 1643, 6, 'destiny/warlockBag', 'basic/destiny/warlockBag', NULL, 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2024-04-15 14:13:39', NULL, NULL, NULL);