Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/webserviceModel/attrmap/xxx.json
@@ -3,133 +3,57 @@ "classifys": { "classify": [ { "classCode": "010301", "classCode": "020201", "fullclsfNamePath": "", "library": "EqpLib", "library": "wupin", "sections": { "section": [ { "name": "固定码段2", "value": "" }, { "name": "分类码段父", "value": "001" }, { "name": "分类码段子", "value": "0012" }, { "name": "可变码段", "value": "" }, { "name": "test", "value": "7E1C92A2-9B6F-4DB3-48C7-F42D1304E36B" }, { "name": "流水码段", "value": "" } ] }, "objects": { "object": [ { "code": "", "creator": "weidy", "id": "20", "id": "111111112222222233333333", "status": "Released", "operate": "create", "prop": [ { "key": "fpNo", "text": "设备型号", "value": "11sdsa22" }, { "key": "fpName", "text": "设备名称", "value": "顶顶顶顶12" }, { "key": "manufacturer", "text": "生产厂家", "value": "呜呜呜呜2" }, { "key": "belongSystem", "text": "所属系统", "value": "呜呜呜呜2" }, { "key": "responsibilityInfo", "text": "责任人信息", "value": "文呃呃呃2" }, { "key": "fpWeight", "text": "重量(KG)", "value": "12" }, { "key": "gravityX", "text": "重心X", "value": "22" }, { "key": "gravityY", "text": "重心Y", "value": "32" }, { "key": "gravityZ", "text": "重心Z", "value": "42" }, { "key": "inertiaX", "text": "转动惯量X", "value": "52" }, { "key": "inertiaY", "text": "转动惯量Y", "value": "62" }, { "key": "inertiaZ", "text": "转动惯量Z", "value": "72" }, { "key": "inertiaXY", "text": "转动惯量XY", "value": "82" }, { "key": "inertiaYZ", "text": "转动惯量YZ", "value": "92" }, { "key": "inertiaXZ", "text": "转动惯量XZ", "value": "102" }, { "key": "operatingTemperatureLimit", "text": "工作温度限制", "value": "162" }, { "key": "equipmentPower", "text": "设备功率(供电功率、辐射功率)", "value": "172" }, { "key": "electricModel", "text": "电连接器型号", "value": "182" }, { "key": "fpAgreement", "text": "成品协议书", "value": "192" } ], "status": "Released" } ] }, "sections": { "section": [ { "name": "层级码段", "value": "010301" "creator": "weidy", "prop": [] } ] } } ] }, "systemId": "RLM", "systemId": "MPM", "user": { "ip": "0:0:0:0:0:0:0:1", "trueName": "weidy", "userName": "weidy" "ip": "192.168.0.1", "trueName": "llz", "userName": "llz" } } } } Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClient.java
@@ -17,6 +17,8 @@ package com.vci.ubcs.system.feign; import com.vci.ubcs.system.entity.*; import com.vci.ubcs.system.vo.DeptVO; import com.vci.ubcs.system.vo.RoleVO; import org.springblade.core.launch.constant.AppConstant; import org.springblade.core.tool.api.R; import org.springframework.cloud.openfeign.FeignClient; @@ -42,7 +44,9 @@ String MENU = API_PREFIX + "/menu"; String MENU_BUTTON = API_PREFIX + "/menu-button"; String DEPT = API_PREFIX + "/dept"; String TREE = API_PREFIX + "/tree"; String DEPT_IDS = API_PREFIX + "/dept-ids"; String DEPT_LIST = API_PREFIX + "/dept-list"; String DEPT_IDS_FUZZY = API_PREFIX + "/dept-ids-fuzzy"; String DEPT_NAME = API_PREFIX + "/dept-name"; String DEPT_NAMES = API_PREFIX + "/dept-names"; @@ -53,6 +57,8 @@ String POST_NAME = API_PREFIX + "/post-name"; String POST_NAMES = API_PREFIX + "/post-names"; String ROLE = API_PREFIX + "/role"; String ROLE_TREE = API_PREFIX + "/role-tree"; String ROLE_LIST = API_PREFIX + "/role-list"; String ROLE_IDS = API_PREFIX + "/role-ids"; String ROLE_NAME = API_PREFIX + "/role-name"; String ROLE_NAMES = API_PREFIX + "/role-names"; @@ -97,6 +103,24 @@ */ @GetMapping(DEPT) R<Dept> getDept(@RequestParam("id") Long id); /** * 获取部门 * * @param tenantId 主键 * @return List<Dept></Dept> */ @GetMapping(TREE) public R<List<DeptVO>> tree(@RequestParam("tenantId")String tenantId); /** * 获取部门 * * @param tenantId 主键 * @return List<Dept></Dept> */ @GetMapping(DEPT_LIST) public R<List<DeptVO>> deptList(@RequestParam("tenantId")String tenantId); /** * 获取部门id @@ -211,6 +235,22 @@ @GetMapping(ROLE_IDS) R<String> getRoleIds(@RequestParam("tenantId") String tenantId, @RequestParam("roleNames") String roleNames); /*** * 获取角色 * @param tenantId 租户id * @return 角色 */ @GetMapping(ROLE_TREE) R<List<RoleVO>> roleTree(@RequestParam("tenantId") String tenantId); /*** * 获取角色 * @param tenantId 租户id * @return 角色 */ @GetMapping(ROLE_LIST) R<List<RoleVO>> roleList(@RequestParam("tenantId") String tenantId); /** * 获取角色名 * Source/UBCS/ubcs-service-api/ubcs-system-api/src/main/java/com/vci/ubcs/system/feign/ISysClientFallback.java
@@ -17,6 +17,8 @@ package com.vci.ubcs.system.feign; import com.vci.ubcs.system.entity.*; import com.vci.ubcs.system.vo.DeptVO; import com.vci.ubcs.system.vo.RoleVO; import org.springblade.core.tool.api.R; import org.springframework.stereotype.Component; @@ -44,6 +46,12 @@ public R<Dept> getDept(Long id) { return R.fail("获取数据失败"); } @Override public R<List<DeptVO>> tree(String tenantId) {return R.fail("获取数据失败");} @Override public R<List<DeptVO>> deptList(String tenantId) {return R.fail("获取数据失败");} @Override public R<String> getDeptIds(String tenantId, String deptNames) { @@ -106,6 +114,12 @@ } @Override public R<List<RoleVO>> roleTree(String tenantId) {return R.fail("获取数据失败");} @Override public R<List<RoleVO>> roleList(String tenantId) {return R.fail("获取数据失败");} @Override public R<String> getRoleName(Long id) { return R.fail("获取数据失败"); } Source/UBCS/ubcs-service-api/ubcs-user-api/src/main/java/com/vci/ubcs/system/user/feign/IUserClient.java
@@ -42,6 +42,7 @@ String API_PREFIX = "/client"; String USER_INFO = API_PREFIX + "/user-info"; String USER_ALL = API_PREFIX + "/user-all"; String USER_INFO_BY_TYPE = API_PREFIX + "/user-info-by-type"; String USER_INFO_BY_ID = API_PREFIX + "/user-info-by-id"; String USER_INFO_BY_ACCOUNT = API_PREFIX + "/user-info-by-account"; @@ -82,6 +83,13 @@ R<UserInfo> userInfo(@RequestParam("tenantId") String tenantId, @RequestParam("account") String account); /** * 获取所有用户 * @return */ @GetMapping(USER_ALL) R<List<User>> selectAllUser(); /** * 获取用户信息 * * @param tenantId 租户ID Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeBasicSecServiceImpl.java
@@ -309,7 +309,7 @@ List<TableColVO> uiTableFieldVOs = new ArrayList<>(); // 快速查询列 List<TableColVO> queryColumns = new ArrayList<>(); if(!codeReferConfig.getCodeShowFieldConfigVOS().isEmpty()){ if(!CollectionUtils.isEmpty(codeReferConfig.getCodeShowFieldConfigVOS())){ codeReferConfig.getCodeShowFieldConfigVOS().stream().forEach(showField ->{ TableColVO tableColVO = new TableColVO(); BeanUtil.copy(showField,tableColVO); Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
@@ -1884,7 +1884,7 @@ //如果是编码生成失败,则直接就失败了,其他的判断出来有错误的我们都统一返回到excel里面 engineService.batchSaveSelectChar(templateVO, dataCBOList); // if(!isProcess){ needSaveCboList.stream().forEach(needSaveCbo->{ dataCBOList.stream().forEach(needSaveCbo->{ XMLResultDataObjectDetailDO resultDataObjectDetailDO=new XMLResultDataObjectDetailDO(); resultDataObjectDetailDO.setCode(needSaveCbo.getId()); String oid=needSaveCbo.getOid(); Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java
@@ -3,15 +3,18 @@ import com.alibaba.nacos.common.utils.StringUtils; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.BeanUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.vci.ubcs.code.bo.CodeClassifyFullInfoBO; import com.vci.ubcs.code.dto.CodeOrderSecDTO; import com.vci.ubcs.code.entity.CodeAllCode; import com.vci.ubcs.code.entity.CodeClassifyValue; import com.vci.ubcs.code.entity.CodeSerialValue; import com.vci.ubcs.code.enumpack.CodeCutTypeEnum; import com.vci.ubcs.code.enumpack.CodeGetValueTypeEnum; import com.vci.ubcs.code.enumpack.CodeLevelTypeEnum; import com.vci.ubcs.code.enumpack.CodeSecTypeEnum; import com.vci.ubcs.code.lifecycle.CodeAllCodeLC; import com.vci.ubcs.code.mapper.CodeClassifyValueMapper; import com.vci.ubcs.code.mapper.CodeSerialValueMapper; import com.vci.ubcs.code.service.ICodeWupinService; import com.vci.ubcs.code.service.MdmEngineService; @@ -49,6 +52,12 @@ */ @Resource private CodeSerialValueMapper serialValueMapper; /** * 流水号的相关的信息 */ @Resource private CodeClassifyValueMapper codeClassifyValueMapper; /** * 所有的编码的内容 @@ -506,6 +515,10 @@ break; case CODE_CLASSIFY_SEC: //分类码段的,也是从前端选择了码值即可,不论码值的长度是多少 CodeClassifyValue codeClassifyValueDO= codeClassifyValueMapper.selectById(secValue); if(codeClassifyValueDO!=null) { secValue = codeClassifyValueDO.getId(); } break; case CODE_LEVEL_SEC: //层级码段,需要从分类上获取相应的信息 Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/UniversalInterfaceImpl.java
@@ -43,6 +43,11 @@ import com.vci.ubcs.starter.web.pagemodel.SessionInfo; import com.vci.ubcs.starter.web.util.BeanUtilForVCI; import com.vci.ubcs.starter.web.util.VciBaseUtil; import com.vci.ubcs.system.feign.ISysClient; import com.vci.ubcs.system.user.entity.User; import com.vci.ubcs.system.user.feign.IUserClient; import com.vci.ubcs.system.vo.DeptVO; import com.vci.ubcs.system.vo.RoleVO; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.api.R; import org.springframework.beans.factory.annotation.Autowired; @@ -85,6 +90,18 @@ */ @Autowired private IBtmTypeClient btmTypeClient; /** * 人员服务 */ @Autowired private ISysClient sysClient; /** * 人员服务 */ @Autowired private IUserClient userClient; /** * 通用查询 @@ -955,44 +972,159 @@ coderefersecSearchVO = JSONObject.toJavaObject(JSONObject.parseObject(referConfig), CoderefersecSearchVO.class); } String buildSqlwhere=""; if(coderefersecSearchVO!=null){ Map<String,Object> condtionMap=new HashMap<>(); List<CodeSrchCondConfigVO> codeSrchCondConfigVOList=coderefersecSearchVO.getCodeSrchCondConfigVOS(); if(coderefersecSearchVO!=null) { if (coderefersecSearchVO.getType().equals(CodeReferConfigTypeEnum.DEFAULT.getValue()) || coderefersecSearchVO.getType().equals(CodeReferConfigTypeEnum.GRID.getValue())) {//默认样式/列表 Map<String, Object> condtionMap = new HashMap<>(); List<CodeSrchCondConfigVO> codeSrchCondConfigVOList = coderefersecSearchVO.getCodeSrchCondConfigVOS(); if(!CollectionUtils.isEmpty(codeSrchCondConfigVOList)) { codeSrchCondConfigVOList.stream().forEach(codeSrchCondConfigVO -> { condtionMap.put(codeSrchCondConfigVO.getFilterField()+codeSrchCondConfigVO.getFilterType(),codeSrchCondConfigVO.getFilterValue()); }); buildSqlwhere= UBCSSqlKeyword.buildSqlwhere(condtionMap); if (!CollectionUtils.isEmpty(codeSrchCondConfigVOList)) { codeSrchCondConfigVOList.stream().forEach(codeSrchCondConfigVO -> { condtionMap.put(codeSrchCondConfigVO.getFilterField() + codeSrchCondConfigVO.getFilterType(), codeSrchCondConfigVO.getFilterValue()); }); buildSqlwhere = UBCSSqlKeyword.buildSqlwhere(condtionMap); } //使用传入的业务类型查询表 R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referBtmId)); if (!listR.isSuccess() || listR.getData().size() == 0) { throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); } String referTable = listR.getData().get(0).getTableName(); StringBuffer sb = new StringBuffer(); sb.append(" select * from "); sb.append(referTable); sb.append(" where 1=1 "); if (StringUtils.isNotBlank(buildSqlwhere)) { sb.append(buildSqlwhere); } List<Map> ListMap = commonsMapper.selectBySql(sb.toString()); String valueField = coderefersecSearchVO.getValueField(); String textField = coderefersecSearchVO.getTextField(); final int[] num = {0}; if (!CollectionUtils.isEmpty(ListMap)) { ListMap.stream().forEach(map -> { num[0]++; String id = map.getOrDefault("OID".toUpperCase(Locale.ROOT), "").toString(); String value = map.getOrDefault(valueField.toUpperCase(Locale.ROOT), "").toString(); String text = map.getOrDefault(textField.toUpperCase(Locale.ROOT), "").toString(); String description = map.getOrDefault("description".toUpperCase(Locale.ROOT), "").toString(); CodeSectionValueVO sectionValueVO = new CodeSectionValueVO(id, num[0] + "", value, text, "", description); codeSectionValueVOList.add(sectionValueVO); }); } } else if (coderefersecSearchVO.getType().equals(CodeReferConfigTypeEnum.TREE.getValue())) {//树形 /* Map<String, Object> condtionMap = new HashMap<>(); List<CodeSrchCondConfigVO> codeSrchCondConfigVOList = coderefersecSearchVO.getCodeSrchCondConfigVOS(); List<CodeShowFieldConfigVO> codeShowFieldConfigVOS=coderefersecSearchVO.getCodeShowFieldConfigVOS(); if (!CollectionUtils.isEmpty(codeSrchCondConfigVOList)) { codeSrchCondConfigVOList.stream().forEach(codeSrchCondConfigVO -> { condtionMap.put(codeSrchCondConfigVO.getFilterField() + codeSrchCondConfigVO.getFilterType(), codeSrchCondConfigVO.getFilterValue()); }); buildSqlwhere = UBCSSqlKeyword.buildSqlwhere(condtionMap); } //使用传入的业务类型查询表 R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referBtmId)); if (!listR.isSuccess() || listR.getData().size() == 0) { throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); } String referTable = listR.getData().get(0).getTableName(); StringBuffer sb = new StringBuffer(); sb.append(" select * from "); sb.append(referTable); sb.append(" where 1=1 "); if (StringUtils.isNotBlank(buildSqlwhere)) { sb.append(buildSqlwhere); } List<Map> ListMap = commonsMapper.selectBySql(sb.toString()); String valueField = coderefersecSearchVO.getValueField(); String textField = coderefersecSearchVO.getTextField(); final int[] num = {0}; if (!CollectionUtils.isEmpty(ListMap)) { ListMap.stream().forEach(map -> { num[0]++; String id = map.getOrDefault("OID".toUpperCase(Locale.ROOT), "").toString(); String value = map.getOrDefault(valueField.toUpperCase(Locale.ROOT), "").toString(); String text = map.getOrDefault(textField.toUpperCase(Locale.ROOT), "").toString(); String description = map.getOrDefault("description".toUpperCase(Locale.ROOT), "").toString(); CodeSectionValueVO sectionValueVO = new CodeSectionValueVO(id, num[0] + "", value, text, "", description); codeSectionValueVOList.add(sectionValueVO); }); } */ } else if (coderefersecSearchVO.getType().equals(CodeReferConfigTypeEnum.ORGDEPARTMENTGRIDREFERS.getValue()) ||////部门列表 coderefersecSearchVO.getType().equals(CodeReferConfigTypeEnum.ORGDEPARTMENTREFER.getValue())//部门树 ) { R<List<DeptVO>> r = sysClient.deptList(""); if (r.isSuccess()) { List<DeptVO> deptVOList = r.getData(); if (!CollectionUtils.isEmpty(deptVOList)) { deptVOList.stream().forEach(deptVO -> { String id = String.valueOf(deptVO.getId()); int num = deptVO.getSort(); String value = String.valueOf(deptVO.getId()); String text = deptVO.getDeptName(); String description = deptVO.getRemark(); String pid = deptVO.getParentId() + ""; CodeSectionValueVO sectionValueVO = new CodeSectionValueVO(id, num + "", value, text, pid, description); codeSectionValueVOList.add(sectionValueVO); }); } } } else if (coderefersecSearchVO.getType().equals(CodeReferConfigTypeEnum.SMUSERREFER.getValue())//用户 || coderefersecSearchVO.getType().equals(CodeReferConfigTypeEnum.SMUSERGRIDREFER.getValue())//用户列表 ) { R<List<User>> r=userClient.selectAllUser(); if (r.isSuccess()) { List<User> userList = r.getData(); if (!CollectionUtils.isEmpty(userList)) { final int[] num = {0}; userList.stream().forEach(user -> { String value=StringUtils.isBlank(user.getAccount())?"":user.getAccount(); //String value= String.valueOf(StringUtils.isBlank(user.getCode())?"":user.getCode()); String text=StringUtils.isBlank(user.getName())?"":user.getName(); String pid=user.getDeptId(); num[0]++; String description=""; String id= String.valueOf(user.getId()); CodeSectionValueVO sectionValueVO = new CodeSectionValueVO(id, num[0] + "", value, text, pid, description); codeSectionValueVOList.add(sectionValueVO); }); } } } else if (coderefersecSearchVO.getType().equals(CodeReferConfigTypeEnum.SMROLEREFER.getValue())) {//角色列表 R<List<RoleVO>> r = sysClient.roleTree(""); if (r.isSuccess()) { List<RoleVO> roleVOList = r.getData(); if (!CollectionUtils.isEmpty(roleVOList)) { roleVOList.stream().forEach(roleVO -> { String id = String.valueOf(roleVO.getId()); int num = roleVO.getSort(); String value = String.valueOf(roleVO.getId()); String text = roleVO.getRoleName(); String description = roleVO.getRoleAlias(); String pid = roleVO.getParentId() + ""; CodeSectionValueVO sectionValueVO = new CodeSectionValueVO(id, num + "", value, text, pid, description); codeSectionValueVOList.add(sectionValueVO); }); } } } else if (coderefersecSearchVO.getType().equals(CodeReferConfigTypeEnum.ORGDUTYREFER.getValue())) {//职务 } else if (coderefersecSearchVO.getType().equals(CodeReferConfigTypeEnum.SMWORKTYPEREFER.getValue())) {//工种 } else if (coderefersecSearchVO.getType().equals(CodeReferConfigTypeEnum.WFPROCESSTEMPLATEREFER.getValue())) {//流程模板 } } //使用传入的业务类型查询表 R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referBtmId)); if (!listR.isSuccess() || listR.getData().size() == 0) { throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); } String referTable = listR.getData().get(0).getTableName(); StringBuffer sb=new StringBuffer(); sb.append(" select * from "); sb.append(referTable); sb.append(" where 1=1 "); if(StringUtils.isNotBlank(buildSqlwhere)){ sb.append( buildSqlwhere ); } List<Map> ListMap= commonsMapper.selectBySql(sb.toString()); String valueField=coderefersecSearchVO.getValueField(); String textField=coderefersecSearchVO.getTextField(); final int[] num = {0}; if(!CollectionUtils.isEmpty(ListMap)){ ListMap.stream().forEach(map->{ num[0]++; String id= map.getOrDefault("OID".toUpperCase(Locale.ROOT),"").toString(); String value= map.getOrDefault(valueField.toUpperCase(Locale.ROOT),"").toString(); String text=map.getOrDefault(textField.toUpperCase(Locale.ROOT),"").toString(); String description=map.getOrDefault("description".toUpperCase(Locale.ROOT),"").toString(); CodeSectionValueVO sectionValueVO=new CodeSectionValueVO(id, num[0]+"",value,text,"",description); codeSectionValueVOList.add(sectionValueVO); }); } log.info(libId); }else if(secType.equals("codelevelsec")) {//层级码段 @@ -1157,9 +1289,11 @@ }); Map<String,CodeClassifyVO> codeClassifyVOMap= classifyFullInfo.getParentClassifyVOs().stream().collect(Collectors.toMap(s -> s.getId(), t -> t,(o1, o2)->o2)); List<CodeOrderSecDTO> codeOrderSecDTOList=new ArrayList<>(); Map<String,String> errorMap=new HashMap<>(); for(CodeBasicSecVO codeBasicSecVO: codeBasicSecVOS) { String sectype = codeBasicSecVO.getSecType(); String classifySecOid= codeBasicSecVO.getOid(); String message=""; if (!sectype.equals(CodeSecTypeEnum.CODE_SERIAL_SEC.getValue())) { String name = codeBasicSecVO.getName(); String sectypeText = codeBasicSecVO.getSecTypeText(); @@ -1181,19 +1315,28 @@ CodeClassifyValue codeClassifyValue= codeClassifyValueDOMap.get(sectypeValue); sectypeValue=codeClassifyValue.getOid(); }else { objerrorCode = "101"; throw new Throwable("传入的分类码段:【" + name + " 值:" + sectypeValue + "】,不符合当前分类层级代号"); //throw new Throwable("传入的分类码段:【" + name + " 值:" + sectypeValue + "】,不符合当前分类层级代号"); message="传入的分类码段:【" + name + " 值:" + sectypeValue + "】,不符合当前分类层级代号"; errorMap.put("error",errorMap.getOrDefault("error","")+";"+message); } } } if(StringUtils.isBlank(sectypeValue)){ message="传入的分类码段:【" + name + " 】的值不允许为空"; errorMap.put("error",errorMap.getOrDefault("error","")+";"+message); } CodeOrderSecDTO.setSecValue(sectypeValue); codeOrderSecDTOList.add(CodeOrderSecDTO); } else { objerrorCode="101"; throw new Throwable("传入的码段规则缺少" + name + "码段"); message="传入的码段规则缺少" + name + "码段"; errorMap.put("error",errorMap.getOrDefault("error","")+";"+message); } } } if(errorMap.size()>0){ objerrorCode="101"; throw new Throwable(errorMap.getOrDefault("error","")); } return codeOrderSecDTOList; } /*** Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/tt.xml
@@ -1,20 +1,45 @@ <?xml version="1.0" encoding="utf-8"?> <data systemId="DMS"> <user userName="1" trueName="测试[1]" ip="172.16.0.30"/> <classifys> <classify classCode="ECOLib" library="ECOLib" fullclsfNamePath=""> <sections> <section name="产品代号" value="CH4-0000"/> <section name="固定码段" value="-"/> <section name="固定码段" value="GG"/> <section name="日期码段" value="2023"/> <section name="固定码段" value="-"/> </sections> <objects> <object code="" id="474EDA77-E498-44B8-8D4A-21EAC0B5643C" status="Editing" operate="create" creator="1"> <prop key="name" text="名称" value=""/> </object> </objects> <?xml version="1.0" encoding="UTF-8" ?> <data> <errorid>0</errorid> <msg>成功!</msg> <library id="wupin" name=""> <classify id="46B5DB5E-F783-DFE9-B48A-C4A367D02AC0" name="锁" pid="0C600A6A-6398-FC30-D13E-121201FDA908" classCode="020201" description="锁" fullPathName="" lcStatus="Enabled" isLeaf="false"> <codeRule id="1673234841140858880" ruleCode="csfjl" num="" name="csfjl" description=""> <codeSection id="1673235191453323264" sectionCode="gdmd" num="1" name="固定码段2" description="" secType="codefixedsec" secTypeText="固定码段" pkCodeRule="1673234841140858880" codeSecLengthType="code_sec_length_variable" codeSecLength="10" parentClassifySecOid="" codeDateFormatStr=""> <sectionValue> <sectionValue id="1673235273523269632" num="2" name="" value="002" pid="" description=""/> <sectionValue id="1673235247598276608" num="1" name="" value="001" pid="" description=""/> </sectionValue> </codeSection> <codeSection id="1673235394948370432" sectionCode="flmdf" num="2" name="分类码段父" description="" secType="codeclassifysec" secTypeText="分类码段" pkCodeRule="1673234841140858880" codeSecLengthType="code_sec_length_variable" codeSecLength="10" parentClassifySecOid="" codeDateFormatStr=""> <sectionValue> <sectionValue id="1673235471532167168" num="1" name="二" value="001" pid="" description=""/> <sectionValue id="1673235449524654080" num="1" name="一" value="001" pid="" description=""/> </sectionValue> </codeSection> <codeSection id="1673235616541839360" sectionCode="flmdz" num="3" name="分类码段子" description="" secType="codeclassifysec" secTypeText="分类码段" pkCodeRule="1673234841140858880" codeSecLengthType="code_sec_length_variable" codeSecLength="10" parentClassifySecOid="1673235394948370432" codeDateFormatStr=""> <sectionValue> <sectionValue id="1673235791276544000" num="1" name="小二" value="0012" pid="1673235471532167168" description=""/> <sectionValue id="1673235759584382976" num="1" name="小一" value="0011" pid="1673235449524654080" description=""/> </sectionValue> </codeSection> <codeSection id="1673235886290112512" sectionCode="kbmd" num="4" name="可变码段" description="" secType="codevariablesec" secTypeText="可变码段" pkCodeRule="1673234841140858880" codeSecLengthType="code_sec_length_variable" codeSecLength="10" parentClassifySecOid="" codeDateFormatStr=""> <sectionValue/> </codeSection> <codeSection id="1673988942388662272" sectionCode="test" num="5" name="test" description="test" secType="coderefersec" secTypeText="引用码段" pkCodeRule="1673234841140858880" codeSecLengthType="code_sec_length_variable" codeSecLength="" parentClassifySecOid="" codeDateFormatStr=""> <sectionValue> <sectionValue id="1639320528018317313" num="2" name="test" value="1639320528018317313" pid="0" description=""/> <sectionValue id="1645315334091575297" num="2" name="测试" value="1645315334091575297" pid="0" description=""/> <sectionValue id="1669250221378990082" num="2" name="testadd" value="1669250221378990082" pid="0" description=""/> <sectionValue id="1638774609350848520" num="2" name="哈哈哈" value="1638774609350848520" pid="0" description="1"/> <sectionValue id="1679395918649556993" num="2" name="重庆" value="1679395918649556993" pid="0" description=""/> <sectionValue id="1636660930383716368" num="2" name="宏博远达" value="1636660930383716368" pid="0" description=""/> </sectionValue> </codeSection> <codeSection id="1676064343214657536" sectionCode="flow" num="6" name="流水码段" description="流水码段" secType="codeserialsec" secTypeText="流水码段" pkCodeRule="1673234841140858880" codeSecLengthType="code_sec_length_variable" codeSecLength="4" parentClassifySecOid="" codeDateFormatStr=""> <sectionValue/> </codeSection> </codeRule> </classify> </classifys> </data> </library> </data> Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/feign/SysClient.java
@@ -18,6 +18,8 @@ import com.vci.ubcs.system.entity.*; import com.vci.ubcs.system.service.*; import com.vci.ubcs.system.vo.DeptVO; import com.vci.ubcs.system.vo.RoleVO; import lombok.AllArgsConstructor; import org.springblade.core.tenant.annotation.NonDS; import org.springblade.core.tool.api.R; @@ -78,6 +80,15 @@ public R<String> getDeptIds(String tenantId, String deptNames) { return R.data(deptService.getDeptIds(tenantId, deptNames)); } @Override public R<List<DeptVO>> tree(String tenantId) { return R.data(deptService.tree(tenantId)); } @Override public R<List<DeptVO>> deptList(String tenantId) { return R.data(deptService.deptList(tenantId)); } @Override public R<String> getDeptIdsByFuzzy(String tenantId, String deptNames) { @@ -137,7 +148,14 @@ public R<String> getRoleIds(String tenantId, String roleNames) { return R.data(roleService.getRoleIds(tenantId, roleNames)); } @Override public R<List<RoleVO>> roleTree(String tenantId) { return R.data(roleService.tree(tenantId)); } @Override public R<List<RoleVO>> roleList(String tenantId) { return R.data(roleService.roleList(tenantId)); } @Override @GetMapping(ROLE_NAME) public R<String> getRoleName(Long id) { Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/DeptMapper.java
@@ -65,5 +65,11 @@ * @return */ List<String> getDeptNames(Long[] ids); /** * 获取树形节点 * * @param tenantId * @return */ List<DeptVO> deptList(String tenantId); } Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/mapper/RoleMapper.java
@@ -49,6 +49,15 @@ List<RoleVO> tree(String tenantId, String excludeRole); /** * 获取树形节点 * * @param tenantId * @param excludeRole * @return */ List<RoleVO> roleList(String tenantId); /** * 获取角色名 * * @param ids Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IDeptService.java
@@ -20,7 +20,9 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.vci.ubcs.system.entity.Dept; import com.vci.ubcs.system.vo.DeptVO; import com.vci.ubcs.system.vo.RoleVO; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import java.util.List; import java.util.Map; @@ -42,7 +44,7 @@ */ IPage<DeptVO> lazyList(String tenantId, Long parentId, Map<String, Object> param, Query query); /** /** * 树形结构 * * @param tenantId @@ -118,4 +120,11 @@ */ List<DeptVO> search(String deptName, Long parentId); /** * 树形结构 * * @param tenantId * @return */ List<DeptVO> deptList(String tenantId); } Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/IRoleService.java
@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.vci.ubcs.system.entity.Role; import com.vci.ubcs.system.vo.RoleVO; import org.springblade.core.tool.api.R; import javax.validation.constraints.NotEmpty; import java.util.List; @@ -49,6 +50,13 @@ List<RoleVO> tree(String tenantId); /** * 加载角色列表 * @param tenantId * @return */ List<RoleVO> roleList(String tenantId); /** * 权限配置 * * @param roleIds 角色id集合 Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/DeptServiceImpl.java
@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.vci.ubcs.system.vo.RoleVO; import org.springblade.core.log.exception.ServiceException; import com.vci.ubcs.system.cache.SysCache; import com.vci.ubcs.system.entity.Dept; @@ -30,6 +31,7 @@ import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.node.ForestNodeMerger; import org.springblade.core.tool.utils.Func; @@ -86,6 +88,15 @@ return baseMapper.lazyList(tenantId, parentId, param, Condition.getPage(query)); } @Override public List<DeptVO> deptList(String tenantId) { // 这里判断我们自己配置的管理组租户,可以查询所有 List<DeptVO> tree = baseMapper.deptList(tenantId.equals(this.tenantId) ? "":tenantId); return tree; } @Override public List<DeptVO> tree(String tenantId) { // 这里判断我们自己配置的管理组租户,可以查询所有 Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/RoleServiceImpl.java
@@ -24,10 +24,12 @@ import com.vci.ubcs.system.service.IRoleMenuService; import com.vci.ubcs.system.service.IRoleScopeService; import com.vci.ubcs.system.service.IRoleService; import com.vci.ubcs.system.vo.DeptVO; import com.vci.ubcs.system.wrapper.RoleWrapper; import lombok.AllArgsConstructor; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.constant.RoleConstant; import org.springblade.core.tool.node.ForestNodeMerger; @@ -79,6 +81,13 @@ } @Override public List<RoleVO> roleList(String tenantId) { // 这里判断我们自己配置的管理组租户,可以查询所有 List<RoleVO> tree = baseMapper.roleList(tenantId.equals(tenantId) ? "":tenantId); return tree; } @Override @Transactional(rollbackFor = Exception.class) public boolean grant(@NotEmpty List<Long> roleIds, List<Long> menuIds, List<Long> dataScopeIds, List<Long> apiScopeIds) { return grantRoleMenu(roleIds, menuIds) && grantDataScope(roleIds, dataScopeIds) && grantApiScope(roleIds, apiScopeIds); Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/DeptMapper.xml
@@ -111,5 +111,23 @@ </foreach> and is_deleted = 0 </select> <select id="deptList" resultMap="deptVOResultMap"> SELECT dept.* , ( SELECT CASE WHEN count(1) > 0 THEN 1 ELSE 0 END FROM pl_org_dept WHERE parent_id = dept.id and is_deleted = 0 ) AS "has_children" FROM pl_org_dept dept WHERE dept.is_deleted = 0 <if test="_parameter!=null and _parameter!=''"> and tenant_id = #{_parameter} </if> ORDER BY sort </select> </mapper> Source/UBCS/ubcs-service/ubcs-system/src/main/resources/mapper/RoleMapper.xml
@@ -24,6 +24,14 @@ select * from pl_org_role where is_deleted = 0 </select> <select id="roleList" resultMap="roleResultMap"> select * from pl_org_role WHERE is_deleted = 0 <if test="_parameter!=null and _parameter!=''"> and tenant_id = #{_parameter} </if> </select> <select id="tree" resultMap="treeNodeResultMap"> select id, parent_id, role_name as title, id as "value", id as "key" from pl_org_role where is_deleted = 0 <if test="param1!=null"> Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/feign/UserClient.java
@@ -65,6 +65,11 @@ public R<UserInfo> userInfo(String tenantId, String account, String userType) { return R.data(service.userInfo(tenantId, account, UserEnum.of(userType))); } @Override @GetMapping(USER_ALL) public R<List<User>> selectAllUser() { return R.data(service.selectAllUser()); } @Override @PostMapping(USER_AUTH_INFO) Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/IUserSearchService.java
@@ -37,7 +37,12 @@ */ List<User> listByUser(List<Long> userId); /** /*** * 查询所有用户 * @return */ public List<User> listAllUser(); /** * 根据部门ID查询用户列表 * * @param deptId 部门ID Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/IUserService.java
@@ -90,6 +90,14 @@ * @return */ List<User> selectAllUser(User user, Long deptId); /** * 获取所有 * * @param user * @param deptId * @return */ List<User> selectAllUser(); /** * 自定义分页 Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserSearchServiceImpl.java
@@ -43,6 +43,11 @@ } @Override public List<User> listAllUser() { return this.list(); } @Override public List<User> listByDept(List<Long> deptId) { LambdaQueryWrapper<User> queryWrapper = Wrappers.lambdaQuery(); deptId.forEach(id -> queryWrapper.like(User::getDeptId, id).or()); Source/UBCS/ubcs-service/ubcs-user/src/main/java/com/vci/ubcs/system/user/service/impl/UserServiceImpl.java
@@ -173,6 +173,13 @@ List<User> users = baseMapper.selectUserPage(user, deptIdList, (AuthUtil.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : AuthUtil.getTenantId())); return users; } @Override public List<User> selectAllUser(){ LambdaQueryWrapper<User> wrapper= Wrappers.lambdaQuery(); wrapper.eq(User::getIsDeleted,0); List<User> users = baseMapper.selectList(wrapper); return users; } @Override public IPage<UserVO> selectUserSearch(UserVO user, Query query) {