From 32f4bb41c82ded759e7db18c9fa449b1442f15c8 Mon Sep 17 00:00:00 2001 From: fujunling <2984387807@qq.com> Date: 星期三, 21 六月 2023 16:39:12 +0800 Subject: [PATCH] Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs --- Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleServiceImpl.java | 69 ++++++++++++++++++++++++++++------ 1 files changed, 57 insertions(+), 12 deletions(-) diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleServiceImpl.java index a990d5f..7ce4a1d 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleServiceImpl.java +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleServiceImpl.java @@ -17,10 +17,13 @@ package com.vci.ubcs.code.service.impl; import com.alibaba.cloud.commons.lang.StringUtils; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.vci.ubcs.code.constant.MdmBtmTypeConstant; import com.vci.ubcs.code.dto.CodeBasicSecDTO; import com.vci.ubcs.code.dto.CodeRuleDTO; @@ -40,10 +43,15 @@ import com.vci.ubcs.starter.exception.VciBaseException; import com.vci.ubcs.starter.revision.service.RevisionModelUtil; import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; +import com.vci.ubcs.starter.util.UBCSCondition; +import com.vci.ubcs.starter.web.pagemodel.BladeQueryObject; import com.vci.ubcs.starter.web.pagemodel.KeyValue; import com.vci.ubcs.starter.web.util.BeanUtilForVCI; import com.vci.ubcs.starter.web.util.VciBaseUtil; import com.vci.ubcs.starter.web.util.WebUtil; +import org.springblade.core.log.exception.ServiceException; +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.utils.BeanUtil; @@ -96,15 +104,17 @@ @Resource private RevisionModelUtil revisionModelUtil; + /** + * 鍒嗛〉鏌ヨ + * @param query + * @param conidtionMap + * @return + */ @Override - public IPage<CodeRuleVO> gridCodeRule(IPage<CodeRuleVO> page, CodeRuleVO codeRule) { - //瀵圭敓鍛藉懆鏈熺殑鏋氫妇杩涜杞崲 - if(!StringUtils.isEmpty(codeRule.getLcStatusText())){ - codeRule.setLcStatus(CodeRuleLC.getValueByText(codeRule.getLcStatusText())); - } - List<CodeRule> codeRulePage = codeRuleMapper.selectCodeRulePage(page, codeRule); + public IPage<CodeRuleVO> gridCodeRule(Query query, Map<String,Object> conidtionMap) { + IPage<CodeRule> codeRuleIPage = this.codeRuleMapper.selectPage(Condition.getPage(query), UBCSCondition.getQueryWrapper(conidtionMap, CodeRule.class)); //do杞瑅o鍚屾椂setLcStatusText鐢熷懡鍛ㄦ湡鍊硷紝骞跺寘瑁呮垚鍒嗛〉瀵硅薄杩斿洖 - return page.setRecords(CodeRuleWrapper.build().listVO(codeRulePage)); + return CodeRuleWrapper.build().pageVO(codeRuleIPage); } /** @@ -278,7 +288,7 @@ */ @Override public Collection<CodeClassifyVO> listUseRangeInCodeClassify(String oid) { - List<CodeClassify> codeClassifies = codeClassifyServcie.selectByWrapper(Wrappers.<CodeClassify>query().eq("codeRuleOid", oid)); + List<CodeClassify> codeClassifies = codeClassifyServcie.selectByWrapper(Wrappers.<CodeClassify>query().lambda().eq(CodeClassify::getCodeRuleOid, oid)); return CodeClassifyWrapper.build().listVO(codeClassifies); } @@ -310,6 +320,21 @@ } /** + * 涓婚敭鎵归噺鑾峰彇涓绘暟鎹紪鐮佽鍒� + * + * @param oidCollections 涓婚敭闆嗗悎锛屼絾鏄彈鎬ц兘褰卞搷锛屽缓璁竴娆℃煡璇笉瓒呰繃10000涓� + * @param hasSec 鏄惁鍖呭惈鐮佹 + * @return 涓绘暟鎹紪鐮佽鍒欐樉绀哄璞� + * @throws VciBaseException 鏌ヨ鍑虹幇寮傚父鏃朵細鎶涘嚭 + */ + @Override + public Collection<CodeRuleVO> listCodeRuleByIds(Collection<String> oidCollections, boolean hasSec) throws VciBaseException { + VciBaseUtil.alertNotNull(oidCollections, "鏁版嵁瀵硅薄涓婚敭闆嗗悎"); + List<CodeRule> codeRuleDOList = listCodeRuleDOByOidCollections(oidCollections); + return codeRuleDO2VOs(codeRuleDOList, true); + } + + /** * 浣跨敤涓婚敭闆嗗悎鏌ヨ鏁版嵁瀵硅薄 * * @param oidCollections 涓婚敭鐨勯泦鍚� @@ -332,14 +357,13 @@ /** * 鍙傜収涓绘暟鎹紪鐮佽鍒欏垪琛� * - * @param codeRule 鏌ヨ鏉′欢 - * @param page 鍒嗛〉鍜屾帓搴� + * @param bladeQueryObject 鏌ヨ鏉′欢 * @return 涓绘暟鎹紪鐮佽鍒欐樉绀哄璞″垪琛紝鐢熸晥鐨勫唴瀹� * @throws VciBaseException 鏌ヨ鏉′欢鍜屽垎椤靛嚭閿欑殑鏃跺�欎細鎶涘嚭寮傚父 */ @Override - public IPage<CodeRuleVO> refDataGridCodeRule(IPage<CodeRuleVO> page, CodeRuleVO codeRule) throws VciBaseException { - return gridCodeRule(page, codeRule); + public IPage<CodeRuleVO> refDataGridCodeRule(BladeQueryObject bladeQueryObject) throws VciBaseException { + return gridCodeRule(bladeQueryObject.getQuery(), bladeQueryObject.getConditionMap()); } /** @@ -429,6 +453,27 @@ } /** + * 鎵归噺鏁版嵁瀵硅薄杞崲涓烘樉绀哄璞� + * + * @param codeRules 鏁版嵁瀵硅薄鍒楄〃 + * @param hasSec 鏄惁鍖呭惈鐮佹 + * @return 鏄剧ず瀵硅薄 + * @throws VciBaseException 鍙傛暟涓虹┖鎴栬�呬笉瀛樺湪鐨勬椂鍊欎細鎶涘嚭寮傚父 + */ + public List<CodeRuleVO> codeRuleDO2VOs(Collection<CodeRule> codeRules, boolean hasSec) throws VciBaseException { + List<CodeRuleVO> voList = new ArrayList<CodeRuleVO>(); + if (!CollectionUtils.isEmpty(codeRules)) { + for (CodeRule s : codeRules) { + CodeRuleVO vo = codeRuleDO2VO(s,true); + if (vo != null) { + voList.add(vo); + } + } + } + return voList; + } + + /** * 鏁版嵁瀵硅薄杞崲涓烘樉绀哄璞� * * @param codeRuleDO 瑙勫垯鐨勬暟鎹璞� -- Gitblit v1.9.3