| | |
| | | import com.vci.ubcs.code.wrapper.CodeBasicSecWrapper; |
| | | import com.vci.ubcs.omd.cache.EnumCache; |
| | | import com.vci.ubcs.omd.enums.EnumEnum; |
| | | import com.vci.ubcs.starter.enumpack.CodeTableNameEnum; |
| | | 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.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.util.WebUtil; |
| | | import com.vci.ubcs.system.entity.DictBiz; |
| | | import com.vci.ubcs.system.feign.IDictBizClient; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | * @throws VciBaseException 查询条件和分页出错的时候会抛出异常 |
| | | */ |
| | | @Override |
| | | public IPage<CodeBasicSecVO> gridCodeBasicSec(Query query, Map<String,Object> conditionMap) throws VciBaseException { |
| | | if(Func.isEmpty(conditionMap.get("pkCodeRule")) && Func.isEmpty(conditionMap.get("t.pkCodeRule_equal")) ){ |
| | | public IPage<CodeBasicSecVO> gridCodeBasicSec(Query query, Map<String,Object> conditionMap) throws ServiceException { |
| | | if(Func.isEmpty(Func.isEmpty(conditionMap.get(CodeTableNameEnum.PL_CODE_BASICSEC.getText()+".pkCodeRule")))){ |
| | | return null; |
| | | } |
| | | // 联表查询 |
| | | MPJLambdaWrapper<CodeBasicSec> mpjLambdaWrapper = UBCSCondition.getMPJLambdaWrapper(conditionMap, CodeBasicSec.class) |
| | | // 联表查询 ,设置表别名,表别名默认就采用表名小写,配置高级查询的时候就需要根据这个来对where条件进行配置 |
| | | MPJLambdaWrapper<CodeBasicSec> mpjLambdaWrapper = new MPJLambdaWrapper<>(CodeBasicSec.class, CodeTableNameEnum.PL_CODE_BASICSEC.getText()) |
| | | .selectAll(CodeBasicSec.class) |
| | | .selectAs(CodeClassify::getName, CodeBasicSec::getReferCodeClassifyOidName) |
| | | .leftJoin(CodeClassify.class, CodeClassify::getOid, CodeBasicSec::getReferCodeClassifyOid); |
| | | .leftJoin(CodeClassify.class,CodeTableNameEnum.PL_CODE_CLASSIFY.getText(), CodeClassify::getOid, CodeBasicSec::getReferCodeClassifyOid); |
| | | // 添加where条件 |
| | | UBCSSqlKeyword.buildCondition(conditionMap,mpjLambdaWrapper); |
| | | IPage<CodeBasicSec> codeBasicSecIPage = codeBasicSecMapper.selectPage(UBCSCondition.getPage(query), mpjLambdaWrapper); |
| | | return CodeBasicSecWrapper.build().pageVO(codeBasicSecIPage); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean batchDeleteSecByCodeRuleOid(String codeRuleOid) { |
| | | public boolean batchDeleteSecByCodeRuleOid(String codeRuleOid) throws ServiceException { |
| | | VciBaseUtil.alertNotNull(codeRuleOid,"编码规则主键"); |
| | | // 1、通过pkcoderule作为条件,先查询要删除基础码段 |
| | | List<CodeBasicSec> deleteList = this.codeBasicSecMapper.selectList(Wrappers.<CodeBasicSec>query().eq("pkcoderule", codeRuleOid)); |
| | |
| | | * @return 有空的则传key-属性名 value-字段含义,没有空的则传 key-success value-true |
| | | */ |
| | | @Override |
| | | public KeyValue checkAttrNullableBySecType(CodeBasicSecDTO codeBasicSecDTO) { |
| | | public KeyValue checkAttrNullableBySecType(CodeBasicSecDTO codeBasicSecDTO) throws ServiceException { |
| | | VciBaseUtil.alertNotNull(codeBasicSecDTO.getSecType(), "码段分类"); |
| | | String secType = codeBasicSecDTO.getSecType(); |
| | | HashMap<String, String> attrMap = JSONObject.parseObject(JSONObject.toJSONString(codeBasicSecDTO), HashMap.class); |
| | |
| | | * @param secType 码段类型 |
| | | * @return 不可为空的字段集合 |
| | | */ |
| | | private Map<String, String> getNotNullableAttr(String secType) { |
| | | private Map<String, String> getNotNullableAttr(String secType) throws ServiceException { |
| | | Map<String, String> attrMap = new HashMap<>(); |
| | | if (CodeSecTypeEnum.CODE_ATTR_SEC.getValue().equalsIgnoreCase(secType)) { |
| | | attrMap.put("name", "属性码段名称"); |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R cloneCodeBasicSec(List<String> oidList, String pkCodeRule) { |
| | | public R cloneCodeBasicSec(List<String> oidList, String pkCodeRule) throws ServiceException { |
| | | boolean isLinked = checkIsLinked(pkCodeRule,null); |
| | | if (isLinked) { |
| | | return R.fail("编码规则已被引用,不允许编辑或删除"); |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean upOrderNum(String oid) { |
| | | public boolean upOrderNum(String oid) throws ServiceException{ |
| | | CodeBasicSec secDO = selectByOid(oid); |
| | | if(secDO.getOrderNum() > 1){ |
| | | //等于1的时候不能上移了 |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean downOrderNum(String oid) { |
| | | public boolean downOrderNum(String oid) throws ServiceException { |
| | | CodeBasicSec secDO = selectByOid(oid); |
| | | Long total = codeBasicSecMapper.selectCount(Wrappers.<CodeBasicSec>query() |
| | | .lambda().eq(CodeBasicSec::getPkCodeRule,secDO.getPkCodeRule()) |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<String> getOidByCodeclassifysecOid(String codeClassifySecOid) { |
| | | public List<String> getOidByCodeclassifysecOid(String codeClassifySecOid)throws ServiceException { |
| | | return codeBasicSecMapper.getOidByCodeclassifysecOid(codeClassifySecOid.trim()); |
| | | } |
| | | |
| | |
| | | * @return 码段的内容 |
| | | */ |
| | | @Override |
| | | public List<CodeBasicSecVO> listCodeBasicSecByRuleOid(String ruleOid) { |
| | | public List<CodeBasicSecVO> listCodeBasicSecByRuleOid(String ruleOid)throws ServiceException { |
| | | if(StringUtils.isBlank(ruleOid)){ |
| | | return new ArrayList<>(); |
| | | } |