| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | 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.utils.StringPool; |
| | |
| | | public void changeStatus(BaseModelDTO baseModelDTO) { |
| | | VciBaseUtil.alertNotNull(baseModelDTO, "数据信息", baseModelDTO.getOid(), "主键", baseModelDTO.getBtmname(), "业务类型", baseModelDTO.getLcStatus(), "目标状态"); |
| | | List<String> oids = VciBaseUtil.str2List(baseModelDTO.getOid()); |
| | | // List<ClientBusinessObject> cboList = boService.selectCBOByOidCollection(oids, baseModelDTO.getBtmname()); |
| | | // TODO 插个点 业务类型完成后需要修改 |
| | | QueryWrapper<BtmTypeVO> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("BTMNAME",baseModelDTO.getBtmname()); |
| | | wrapper.in("OID",oids); |
| | | // TODO 待完善 |
| | | //插个点 业务类型完成后需要修改 |
| | | // QueryWrapper<BtmTypeVO> wrapper = new QueryWrapper<>(); |
| | | List<BaseModel> baseModels = new ArrayList<>(); |
| | | baseModels = selectByTypeAndOid(baseModelDTO.getBtmname(), baseModelDTO.getOid()); |
| | | if(baseModels.size() == 0){ |
| | |
| | | // 回收需要业务数据删除 |
| | | if (CodeDefaultLC.TASK_BACK.getValue().equals(baseModelDTO.getLcStatus())) { |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(baseModelDTO.getBtmname())); |
| | | // String referTable = listR.getData().get(0).getTableName(); |
| | | commonsMapper.deleteByTaleAndOid(listR.getData().get(0).getTableName(),VciBaseUtil.toInSql(baseModelDTO.getOid())); |
| | | // BatchCBO batchCBO = new BatchCBO(); |
| | | // batchCBO.getDeleteCbos().addAll(cboList); |
| | | |
| | | // TODO 待完善 |
| | | //btmTypeClient.deleteBatchIds(cboList); |
| | | |
| | | //boService.persistenceBatch(batchCBO); |
| | | } else { |
| | | for (BaseModel baseModel : baseModels) { |
| | | baseModel.setLcStatus(baseModelDTO.getLcStatus()); |
| | |
| | | } |
| | | try { |
| | | String keyPrefix = BTM_INIT_CACHE.concat(StringPool.COLON).concat(AuthUtil.getTenantId()).concat(StringPool.COLON); |
| | | // String finalBtmName = btmName; |
| | | Cache.ValueWrapper valueWrapper = CacheUtil.getCache(keyPrefix).get(keyPrefix.concat(String.valueOf(btmName))); |
| | | if(valueWrapper == null){ |
| | | CacheUtil.getCache(keyPrefix).put(keyPrefix.concat(String.valueOf(btmName)), createBaseModel(btmName)); |
| | |
| | | logger.error("创建业务类型对象",e); |
| | | throw new VciBaseException("initBtmError",new String[]{btmName}); |
| | | } |
| | | // String userName = AuthUtil.getUser().getUserName(); |
| | | // CodeWupin wupinEntity = new CodeWupin(); |
| | | // wupinEntity.setOid(VciBaseUtil.getPk()); |
| | | //// bo.setRevisionid((new ObjectUtility()).getNewObjectID36()); |
| | | //// bo.setNameoid((new ObjectUtility()).getNewObjectID36()); |
| | | // wupinEntity.setBtmname(btmName); |
| | | // wupinEntity.setLastR(String.valueOf(1)); |
| | | // wupinEntity.setFirstR(String.valueOf(1)); |
| | | // wupinEntity.setFirstV(String.valueOf(1)); |
| | | // wupinEntity.setLastV(String.valueOf(1)); |
| | | // wupinEntity.setCreator(userName); |
| | | // wupinEntity.setCreateTime(new Date()); |
| | | // wupinEntity.setLastModifier(userName); |
| | | // wupinEntity.setLastModifyTime(new Date()); |
| | | // wupinEntity.setRevisionRule("numberversionrule"); |
| | | // wupinEntity.setVersionRule("0"); |
| | | //// if(StringUtils.isNotBlank(btmTypeVO.getRevisionruleid())){ |
| | | // // |
| | | //// OsRevisionRuleVO revisionRuleVO = revisionRuleService.getRevisionRuleById(btmTypeVO.getRevisionruleid()); |
| | | // wupinEntity.setRevisionValue("1"); |
| | | //// } |
| | | // |
| | | // wupinEntity.setRevisionSeq(1); |
| | | // wupinEntity.setVersionSeq(1); |
| | | // //插个点,需要问勇哥版本问题,展示默认为1 |
| | | // wupinEntity.setVersionValue("1"); |
| | | // wupinEntity.setLctid("wupinLC"); |
| | | // wupinEntity.setLcStatus("Editing"); |
| | | // wupinEntity.setId(""); |
| | | // wupinEntity.setName(""); |
| | | // wupinEntity.setDescription(""); |
| | | // wupinEntity.setOwner(userName); |
| | | // wupinEntity.setCheckinby(userName); |
| | | // wupinEntity.setCopyFromVersion(""); |
| | | // wupinEntity.setMaterialtype(1001); |
| | | // wupinEntity.setCaigouwl("true"); |
| | | // wupinEntity.setShifoupihaoguanli("true"); |
| | | // wupinEntity.setKucunwl("true"); |
| | | // wupinEntity.setXiaoshouwl("false"); |
| | | // wupinEntity.setPassing("true"); |
| | | |
| | | // this.initTypeAttributeValue(wupinEntity,btmTypeVO); |
| | | // return wupinEntity; |
| | | |
| | | |
| | | // return cbo; |
| | | } |
| | | |
| | | /** |