| | |
| | | itemVO.setPrefix(attrVO.getPrefixValue()); |
| | | itemVO.setSuffix(attrVO.getSuffixValue()); |
| | | itemVO.setTooltips(attrVO.getExplain()); |
| | | itemVO.setInputTip(attrVO.getInputTip()); |
| | | itemVO.setSelectLibFlag(attrVO.getLibraryIdentification()); |
| | | //看看是否有枚举 |
| | | if ((StringUtils.isNotBlank(attrVO.getEnumString()) |
| | |
| | | } |
| | | } |
| | | } |
| | | for (Object key : map.keySet()) { |
| | | map.put(key,String.valueOf(map.get(key))); |
| | | } |
| | | |
| | | ((BaseModel) obj).setData(map); |
| | | baseModels.add((BaseModel) obj); |
| | | } |
| | |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * 传入业务类型以及相关数据进行批量更新操作 |
| | | * |
| | | * @param btmType 业务类型 |
| | | * @param baseModels 处理数据 |
| | | * @return 处理状态 |
| | | */ |
| | | @Override |
| | | public R updateBatchByBaseModel(String btmType, List<BaseModel> baseModels) throws Exception { |
| | | //使用传入的业务类型查询表 |
| | | R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType)); |
| | | if(listR.getData().size() == 0){ |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | //将bean转为map,mybatis统一处理 |
| | | List<Map<String,String>> maps = new ArrayList<>(); |
| | | |
| | | baseModels.stream().forEach(model-> { |
| | | try { |
| | | maps.add(VciBaseUtil.convertBean2Map(model)); |
| | | } catch (Exception e) { |
| | | throw new VciBaseException("类型转换错误:" + e.getMessage()); |
| | | } |
| | | }); |
| | | try { |
| | | //注意此处更新成功是返回的-1 |
| | | commonsMapper.updateBatchByBaseModel(listR.getData().get(0).getTableName(), maps); |
| | | }catch (Exception e){ |
| | | return R.fail("更新失败!"+e.getMessage()); |
| | | } |
| | | |
| | | return R.success("更新成功!"); |
| | | } |
| | | } |