| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import com.vci.ubcs.core.log.exception.ServiceException; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | |
| | | // 回收需要业务数据删除 |
| | | if (CodeDefaultLC.TASK_BACK.getValue().equals(baseModelDTO.getLcStatus())) { |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(baseModelDTO.getBtmname())); |
| | | commonsMapper.deleteByTaleAndOid(listR.getData().get(0).getTableName(), VciBaseUtil.toInSql(baseModelDTO.getOid())); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | commonsMapper.deleteByTaleAndOid(listR.getData().get(0).getTableName(), VciBaseUtil.toInSql(baseModelDTO.getOid())); |
| | | } else { |
| | | for (BaseModel baseModel : baseModels) { |
| | | baseModel.setLcStatus(baseModelDTO.getLcStatus()); |
| | |
| | | // final String[] sql = {"select count(*) from " + VciBaseUtil.getTableName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()) + " t where 1 = 1 "}; |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getTopClassifyVO().getBtmtypeid())); |
| | | // String referTable = VciBaseUtil.getTableName(referVO.getReferType()); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | final String[] sql = {"select count(*) from " + listR.getData().get(0).getTableName() + " t where 1 = 1 "}; |
| | | conditionMap.forEach((key, value) -> { |
| | | sql[0] += " and " + key + " = " + value; |
| | |
| | | fieldVO.setTemplet(attrVO.getTableDisplayJs()); |
| | | } |
| | | if (StringUtils.isBlank(fieldVO.getTemplet()) && VciFieldTypeEnum.VTBoolean.name().equalsIgnoreCase(attrVO.getAttributeDataType())) { |
| | | fieldVO.setTemplet("function(d){return $webUtil.formateBoolean(d." + fieldVO.getField() + ");}"); |
| | | fieldVO.setTemplet("function(row,column){return row[column.property]=='true' || row[column.property]=='1'?'是':'否'}"); |
| | | // fieldVO.setTemplet("function(d){return $webUtil.formateBoolean(d." + fieldVO.getField() + ");}"); |
| | | } |
| | | fieldVO.setOptionJsMap(eventJsMap); |
| | | fieldVO.setStyle(attrVO.getTableDisplayStyle()); |
| | |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referVO.getReferType())); |
| | | // String referTable = VciBaseUtil.getTableName(referVO.getReferType()); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | String referTable = listR.getData().get(0).getTableName(); |
| | | // String referTable = "pl_code_classify"; |
| | | String referTableNick = attrVO.getId() + "0"; |
| | |
| | | } |
| | | // String tableName = VciBaseUtil.getTableName(btmType); |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType)); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | // String referTable = VciBaseUtil.getTableName(referVO.getReferType()); |
| | | String tableName = listR.getData().get(0).getTableName(); |
| | | String sql = "select " + selectFieldList.stream().map(s -> (s.contains(".") ? s : ("t." + s))).collect(Collectors.joining(",")) |
| | |
| | | // baseMapper.deleteBatchIds(cboList); |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getCurrentClassifyVO().getBtmtypeid())); |
| | | if (listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | commonsMapper.deleteByTaleAndOid(listR.getData().get(0).getTableName(), |
| | | "'" + (StringUtils.join(cboList.stream().map(BaseModel::getOid).collect(Collectors.toSet()), "','")) + "'"); |
| | | // ); |
| | |
| | | public Integer insertBatchByType(String btmType, List<BaseModel> baseModels) { |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType)); |
| | | if (listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | //将bean转为map,mybatis统一处理 |
| | | List<Map<String, String>> maps = new ArrayList<>(); |
| | | baseModels.stream().forEach(model -> { |
| | |
| | | |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType)); |
| | | if (listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | //查询数据 |
| | | List<Map> maps = commonsMapper.selectBySql("select * from " + listR.getData().get(0).getTableName() + " where oid in (" |
| | | + VciBaseUtil.toInSql(oids.toString()) + ")"); |
| | |
| | | */ |
| | | public BaseModel createBaseModel(String boName) { |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(boName)); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | String userName = String.valueOf(AuthUtil.getUser().getUserId()); |
| | | BaseModel bo = new BaseModel(); |
| | | // bo.setOid(VciBaseUtil.getPk()); |
| | |
| | | public R updateBatchByBaseModel(String btmType, List<BaseModel> baseModels) { |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType)); |
| | | if (listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | //将bean转为map,mybatis统一处理 |
| | | List<Map<String, String>> maps = new ArrayList<>(); |
| | | |
| | |
| | | toBo.setVersionRule(fromBo.getVersionRule()); |
| | | // RevisionValueObject rvObj = this.getNextRevision(fromBo.getBtmName(), fromBo.getNameoid(), item.revRuleName, item.revInput, revisionVal); |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(fromBo.getBtmname())); |
| | | Map<String, Object> nextRevision = commonsMapper.getNextRevision(listR.getData().get(0).getTableName(), fromBo.getNameOid()); |
| | | 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()); |
| | | // VersionValueObject versionObj = this.getVersionValue(item.verRuleName); |