| | |
| | | cbo.setNameOid(VciBaseUtil.getPk()); |
| | | cbo.setCreateTime(new Date()); |
| | | cbo.setLastModifyTime(new Date()); |
| | | cbo.setCreator(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | //cbo.setCreator(String.valueOf(AuthUtil.getUser().getUserId()));、 |
| | | // 要求显示账号,所以做了更改 |
| | | cbo.setCreator(String.valueOf(AuthUtil.getUser().getAccount())); |
| | | cbo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | cbo.setTenantId(AuthUtil.getTenantId()); |
| | | if(StringUtils.isNotBlank(orderDTO.getLcStatus())||StringUtils.isNotBlank(orderDTO.getData().get("lcStatus"))){ |
| | |
| | | } |
| | | final String[] sql = {"select * from " + listR.getData().get(0).getTableName() + " t where 1 = 1 "}; |
| | | conditionMap.forEach((key, value) -> { |
| | | sql[0] += " and " + key + " = " + value; |
| | | if(StringUtils.isBlank(value)||value.equals(QueryOptionConstant.ISNULL)) { |
| | | sql[0] += " and " + key + " is null"; |
| | | }else{ |
| | | sql[0] += " and " + key + " = " + value; |
| | | } |
| | | }); |
| | | if (StringUtils.isNotBlank(orderDTO.getOid())) { |
| | | //修改的时候,需要排除自己 |
| | |
| | | uiTableConfigVO.setQueryColumns(queryColumns); |
| | | //set给表格配置属性 |
| | | uiFormReferVO.setTableConfig(uiTableConfigVO); |
| | | //字段名不一致,需要手动set |
| | | |
| | | uiFormReferVO.setMuti(StringUtils.isBlank(codeReferConfig.getIsMuti())?false:true); |
| | | uiFormReferVO.setInitSort(new UIFieldSortVO(codeReferConfig.getSortField(),codeReferConfig.getSortType())); |
| | | // 筛选条件 |
| | | HashMap<String, String> whereMap = new HashMap<>(); |
| | | if(!CollectionUtils.isEmpty(codeReferConfig.getCodeSrchCondConfigVOS())){ |
| | |
| | | //说明还是参照里面的,我们默认这种情况下都是字符串吧,因为参照的属性不一定用的平台的属性池里的,所以大部分情况下,显示的属性都是字符串吧 |
| | | return referFieldMap.get(field) + SPACE + "LIKE" + SPACE + "'%" + value + "%'" + SPACE; |
| | | } else { |
| | | return (field.contains(".") ? "" : "t.") + field + SPACE + "LIKE " + "'%" + getStringValueInWhere(field, value, attrVOMap) + "%'" + SPACE; |
| | | return (field.contains(".") ? "" : "t.") + field + SPACE + "LIKE " + "'%" + value + "%'" + SPACE; |
| | | } |
| | | } else if (key.endsWith("_notequal")) { |
| | | String field = UBCSSqlKeyword.getColumn(key, "_notequal"); |
| | |
| | | if (referFieldMap.containsKey(field)) { |
| | | return referFieldMap.get(field) + SPACE + " >= " + value + SPACE; |
| | | } else { |
| | | return (field.contains(".") ? "" : "t.") + field + SPACE + " >= " + getStringValueInWhere(value, field, attrVOMap) + SPACE; |
| | | return (field.contains(".") ? "" : "t.") + field + SPACE + " >= " + getStringValueInWhere(field, value, attrVOMap) + SPACE; |
| | | } |
| | | } else if (key.endsWith("_le")) { |
| | | //说明是<=的。我们需要先获取一下 |
| | |
| | | if (referFieldMap.containsKey(field)) { |
| | | return referFieldMap.get(field) + SPACE + "= '" + value + "'" + SPACE; |
| | | } else { |
| | | return (field.contains(".") ? "" : "t.") + field + SPACE + "= '" + getStringValueInWhere(field, value, attrVOMap) + "'" + SPACE; |
| | | return (field.contains(".") ? "" : "t.") + field + SPACE + "= " + getStringValueInWhere(field, value, attrVOMap) + "" + SPACE; |
| | | } |
| | | } else { |
| | | // if (referFieldMap.containsKey(key)) { |
| | |
| | | // cbo.getData().putAll(orderDTO.getData()); |
| | | cbo.setLastModifyTime(new Date()); |
| | | cbo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), Collections.singletonList(cbo)); |
| | | batchSaveSelectChar(templateVO, Collections.singletonList(cbo)); |
| | | R r = updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), Collections.singletonList(cbo)); |
| | | if(!r.isSuccess()){ |
| | | throw new ServiceException(r.getMsg()); |
| | | } |
| | | batchSaveSelectChar(templateVO, Collections.singletonList(cbo)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | //只能删除自己创建的数据 |
| | | String userId = String.valueOf(AuthUtil.getUser().getUserId()); |
| | | String userId = String.valueOf(AuthUtil.getUser().getAccount()); |
| | | for (BaseModel clientBusinessObject : cboList) { |
| | | String creator = clientBusinessObject.getCreator(); |
| | | if (!userId.equalsIgnoreCase(creator)) { |
| | |
| | | }); |
| | | return commonsMapper.insertByBaseModel(listR.getData().get(0).getTableName(), maps.get(0), maps); |
| | | } |
| | | /** |
| | | * 传入业务类型以及ID查询业务表数据是否重复 |
| | | * |
| | | * @param btmType 业务类型 |
| | | * @param ids 处理数据 |
| | | * @return 查询到数据的总数 |
| | | */ |
| | | @Override |
| | | public Integer selectIdsCounts(String btmType, List<String> ids) { |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType)); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | return commonsMapper.queryCountBySql("select count(*) from " + |
| | | listR.getData().get(0).getTableName() + " where id in ("+ ids.stream().map(s -> "'" + s + "'").collect(Collectors.joining(",")) +")"); |
| | | } |
| | | |
| | | /** |
| | | * 传入业务类型以及ID、OID查询业务表数据是否重复 |
| | | * |
| | | * @param btmType 业务类型 |
| | | * @param id 处理数据id |
| | | * @param oid 处理数据oid |
| | | * @return 查询到数据的总数 |
| | | */ |
| | | @Override |
| | | public Integer selectIdAndOidCounts(String btmType, String id, String oid) { |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType)); |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | return commonsMapper.queryCountBySql("select count(*) from " + |
| | | listR.getData().get(0).getTableName() + " where id ='" + id + "' and oid <> '" + oid + "'"); |
| | | } |
| | | |
| | | /** |
| | | * 传入业务类型以及相oid集合查询数据进行返回 |