| | |
| | | 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.entity.CodeBasicSec; |
| | | import com.vci.ubcs.code.entity.CodeClassify; |
| | | import com.vci.ubcs.code.entity.CodeClassifyValue; |
| | | import com.vci.ubcs.code.entity.CodeFixedValue; |
| | | import com.vci.ubcs.code.entity.*; |
| | | import com.vci.ubcs.code.enumpack.*; |
| | | import com.vci.ubcs.code.lifecycle.CodeRuleLC; |
| | | import com.vci.ubcs.code.mapper.CodeBasicSecMapper; |
| | |
| | | import com.vci.ubcs.starter.util.UBCSSqlKeyword; |
| | | import com.vci.ubcs.starter.web.enumpck.NewAppConstantEnum; |
| | | import com.vci.ubcs.starter.web.enumpck.OsCodeFillTypeEnum; |
| | | import com.vci.ubcs.starter.web.pagemodel.BladeQueryObject; |
| | | import com.vci.ubcs.starter.web.pagemodel.KeyValue; |
| | | import com.vci.ubcs.starter.web.pagemodel.UIFormReferVO; |
| | | import com.vci.ubcs.starter.web.pagemodel.*; |
| | | 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.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | |
| | | //引用码段的时候,需要判断参照的信息是否正确 |
| | | if(CodeSecTypeEnum.CODE_REFER_SEC.getValue().equalsIgnoreCase(codeBasicSecDO.getSecType())){ |
| | | if(StringUtils.isBlank(codeBasicSecDO.getReferConfig())){ |
| | | throw new VciBaseException("引用码段的时候,需要填写 参照配置 的内容"); |
| | | throw new VciBaseException("引用码段的时候,需要填写 参照配置的内容"); |
| | | } |
| | | try{ |
| | | //JSONObject.parseObject(codeBasicSecDO.getReferConfig(), UIFormReferVO.class); |
| | |
| | | throw new VciBaseException("引用码段的时候,参照配置的内容的格式不正确,",new String[0],e); |
| | | } |
| | | if(codeReferConfigVO.getIsPersistence()=="true"){ |
| | | // 判断是否为引用码段,如果是应用码段的话,为了适配前端组件,这里要对表进行处理一下,按照以前的参照格式进行转换 |
| | | codeBasicSecDO.setReferValueInfo(referConfigTOUIUiTable(codeReferConfigVO)); |
| | | codeReferConfigService.insert(codeReferConfigVO); |
| | | } |
| | | } |
| | |
| | | //SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo(); |
| | | if(StringUtils.isNotBlank(codeBasicSecDO.getCodeFillSeparator())){ |
| | | DictBiz dictBiz = new DictBiz(); |
| | | dictBiz.setCode(MdmBtmTypeConstant.CODE_BASIC_SEC); |
| | | dictBiz.setDictKey("codefileseparator"); |
| | | dictBiz.setCode("codeFillSeparator"); |
| | | dictBiz.setDictKey(codeBasicSecDO.getCodeFillSeparator()); |
| | | dictBiz.setDictValue(codeBasicSecDO.getCodeFillSeparator()); |
| | | //从原来的charService(可输可选)更改为调用omd中的接口来实现 |
| | | iDictBizClient.getCheck(dictBiz); |
| | | //charService.save(MdmBtmTypeConstant.CODE_BASIC_SEC,"codefileseparator",codeBasicSecDO.getCodeFillSeparator(),sessionInfo); |
| | | } |
| | | return resBoolean; |
| | | } |
| | | |
| | | /** |
| | | * 将referconfig转换为JSON格式的UIFormReferVO |
| | | * @param codeReferConfig |
| | | * @return |
| | | */ |
| | | private String referConfigTOUIUiTable(CodeReferConfigVO codeReferConfig){ |
| | | // 拷贝为以前的老对象 |
| | | UIReferConfigFormVO uiFormReferVO = new UIReferConfigFormVO(); |
| | | BeanUtil.copy(codeReferConfig,uiFormReferVO); |
| | | |
| | | // 表格的自定义定义 |
| | | UITableConfigVO uiTableConfigVO = new UITableConfigVO(); |
| | | uiTableConfigVO.setPage(new UITablePageVO(codeReferConfig.getLimit(),1)); |
| | | // 列表的列的信息转换 |
| | | List<TableColVO> uiTableFieldVOs = new ArrayList<>(); |
| | | // 快速查询列 |
| | | List<TableColVO> queryColumns = new ArrayList<>(); |
| | | if(!codeReferConfig.getCodeShowFieldConfigVOS().isEmpty()){ |
| | | codeReferConfig.getCodeShowFieldConfigVOS().stream().forEach(showField ->{ |
| | | TableColVO tableColVO = new TableColVO(); |
| | | BeanUtil.copy(showField,tableColVO); |
| | | tableColVO.setSortField(showField.getAttrSortField()); |
| | | uiTableFieldVOs.add(tableColVO); |
| | | if(showField.getIsQuery().equals("true")){ |
| | | queryColumns.add(tableColVO); |
| | | } |
| | | }); |
| | | } |
| | | // 显示的列 |
| | | uiTableConfigVO.setCols(uiTableFieldVOs); |
| | | // 快速查询列 |
| | | uiTableConfigVO.setQueryColumns(queryColumns); |
| | | //set给表格配置属性 |
| | | uiFormReferVO.setTableConfig(uiTableConfigVO); |
| | | // 筛选条件 |
| | | HashMap<String, String> whereMap = new HashMap<>(); |
| | | if(!codeReferConfig.getCodeSrchCondConfigVOS().isEmpty()){ |
| | | codeReferConfig.getCodeSrchCondConfigVOS().stream().forEach(srch->{ |
| | | whereMap.put(srch.getFilterField()+"_"+srch.getFilterType(),srch.getFilterValue()); |
| | | }); |
| | | } |
| | | uiFormReferVO.setWhere(whereMap); |
| | | return JSONObject.toJSONString(uiFormReferVO); |
| | | } |
| | | |
| | | /** |
| | |
| | | public R deleteCodeBasicSecByPrimaryKey(String oid) throws VciBaseException { |
| | | CodeBasicSec codeBasicSecDO = selectByOid(oid); |
| | | boolean isLinked = checkIsLinked(codeBasicSecDO.getPkCodeRule(), oid); |
| | | if (isLinked) { |
| | | if (!isLinked) { |
| | | return R.fail("编码规则已被引用,不允许编辑或删除"); |
| | | } |
| | | //执行删除操作 |