| | |
| | | */ |
| | | @Resource |
| | | IEnumClient enumClient; |
| | | /** |
| | | * 版本规则服务 |
| | | */ |
| | | @Resource |
| | | private IRevisionRuleClient revisionRuleClient; |
| | | |
| | | /** |
| | | * 公式的服务 |
| | |
| | | */ |
| | | @Autowired |
| | | private IBtmTypeClient btmTypeClient; |
| | | /** |
| | | * 版本规则的服务 |
| | | */ |
| | | @Resource |
| | | private IRevisionRuleClient revisionRuleClient; |
| | | // |
| | | |
| | | /** |
| | | * 通用查询 |
| | | */ |
| | |
| | | checkEnumOnOrder(templateVO, orderDTO); |
| | | //8.处理时间格式,在数据库里面不论是字符串还是日期格式,都使用相同的格式存储 |
| | | switchDateAttrOnOrder(templateVO, orderDTO); |
| | | //9.生成编码的信息 |
| | | // ClientBusinessObject cbo = boService.createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()); |
| | | BaseModel cbo = createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmTypeId()); |
| | | //9.生成编码的信息 ,初始化业务类型:缓存先取消,因为版本规则会出现变动的情况所以无法使用缓存 |
| | | // BaseModel cbo = createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmTypeId()); |
| | | BaseModel cbo = createBaseModel(classifyFullInfo.getTopClassifyVO().getBtmTypeId().trim().toLowerCase()); |
| | | //默认的属性都不用从前端拷贝 |
| | | //设置编码需要的默认属性的内容 |
| | | copyValueToCBO(classifyFullInfo, cbo, orderDTO, templateVO, false); |
| | |
| | | conditionMap.put(queryKey, QueryOptionConstant.OR + queryValue); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询编码数据的列表 |
| | |
| | | wrapperData(dataList, templateVO, sqlBO.getSelectFieldList(), true); |
| | | R<List<Map<String, String>>> result = R.data(Collections.singletonList(cbo)); |
| | | //我们要看是否不是升版的,升版的话,需要对比不相等的属性 |
| | | String copy = cbo.get("copyfromversion"); |
| | | /* String copy = cbo.get("copyfromversion"); |
| | | // if (StringUtils.isBlank(copy)) { |
| | | // copy = cbo.getAttributeValue("copyfromversion"); |
| | | // } |
| | |
| | | Map<String, String> difFieldMap = new HashMap<>(); |
| | | Map<String, String> finalOldData = oldData; |
| | | cbo.forEach((key, value) -> { |
| | | String oldValue = finalOldData.getOrDefault(key, ""); |
| | | if (value == null) { |
| | | // 这儿oldmap中的全是大写,而cbo中的全是小写所以会拿不到只,这儿直接处理成小写拿不到就用大写拿 |
| | | String oldValue = String.valueOf(finalOldData.getOrDefault(key.toUpperCase(Locale.ROOT), finalOldData.getOrDefault(key, ""))); |
| | | if (value == null || value == "null") { |
| | | value = ""; |
| | | } |
| | | if (oldValue == null) { |
| | | if (oldValue == null || oldValue == "null") { |
| | | oldValue = ""; |
| | | } |
| | | if (!value.equalsIgnoreCase(oldValue)) { |
| | |
| | | difFieldList.add(difFieldMap); |
| | | result.setData(difFieldList); |
| | | } |
| | | } |
| | | }*/ |
| | | return result; |
| | | } |
| | | |
| | |
| | | toBo.setNameOid(fromBo.getNameOid()); |
| | | toBo.setBtmname(fromBo.getBtmname()); |
| | | toBo.setLastR(String.valueOf(1)); |
| | | // 升版将FirstR修改为0 |
| | | toBo.setFirstR(String.valueOf(0)); |
| | | toBo.setFirstV(String.valueOf(1)); |
| | | toBo.setLastV(String.valueOf(1)); |
| | |
| | | toBo.setLastModifier(String.valueOf(AuthUtil.getUser().getAccount())); |
| | | toBo.setLastModifyTime(new Date()); |
| | | toBo.setRevisionRule(fromBo.getRevisionRule()); |
| | | toBo.setVersionRule(fromBo.getVersionRule());R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(fromBo.getBtmname())); |
| | | toBo.setVersionRule(fromBo.getVersionRule()); |
| | | //查询业务类型信息,可以获取到版本规则信息(revisionRuleId) |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(fromBo.getBtmname())); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | Map<String, Object> nextRevision = commonsMapper.getNextRevision(listR.getData().get(0).getTableName(), fromBo.getNameOid()); |
| | | toBo.setRevisionSeq(Integer.parseInt(nextRevision.get("REVISIONSEQ").toString())); |
| | | toBo.setRevisionValue(nextRevision.get("REVISIONVAL").toString()); |
| | | //Map<String, Object> nextRevision = commonsMapper.getNextRevision(listR.getData().get(0).getTableName(), fromBo.getNameOid()); |
| | | /* |
| | | TODO:这是一个待后期完善的功能,目前实现方式是,先查询出当前数据的大版本规则, |
| | | 然后再查询业务表使用的规则的步长是多少然后计算出该升版为多少 |
| | | */ |
| | | Map<String, Object> nextRevision = commonsMapper.getCurrentRevision(listR.getData().get(0).getTableName(), fromBo.getNameOid()); |
| | | R<RevisionRuleVO> revisionRuleVOR = revisionRuleClient.selectById(listR.getData().get(0).getRevisionRuleId()); |
| | | String revisionval = nextRevision.get("REVISIONVAL").toString(); |
| | | // 未查询到版本规则,默认直接给大版本加一 |
| | | if(!revisionRuleVOR.isSuccess() || Func.isEmpty(revisionRuleVOR.getData())){ |
| | | revisionval = String.valueOf((Integer.parseInt(revisionval)+1)); |
| | | }else { |
| | | revisionval = String.valueOf(Integer.parseInt(revisionval)+revisionRuleVOR.getData().getSerialStep()); |
| | | } |
| | | toBo.setRevisionValue(revisionval); |
| | | toBo.setRevisionSeq(Integer.parseInt(nextRevision.get("REVISIONSEQ").toString())); |
| | | toBo.setVersionSeq(Integer.valueOf(nextRevision.get("VERSIONSEQ").toString())); |
| | | toBo.setVersionValue(nextRevision.get("VERSIONVAL").toString()); |
| | | toBo.setLctid(fromBo.getLctid()); |