| | |
| | | @Resource |
| | | private StateProjectCompensationService stateProjectCompensationService; |
| | | |
| | | /** |
| | | * 获取补偿标准列表 |
| | | * @param standardName |
| | | * @param stopFlag |
| | | * @param compensateType |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, List<StateProjectCompensateStandardVO>> getCompensateStandardMap(String standardName, Integer stopFlag, Integer compensateType) { |
| | | LambdaQueryWrapper<StateProjectCompensateStandard> queryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | } catch (IOException e) { |
| | | throw new GlobalException("读取Excel文件失败"); |
| | | } |
| | | |
| | | //TODO 导入未校验标准名称唯一 |
| | | StateProjectCompensateStandard po; |
| | | List<StateProjectCompensateStandard> poList = new ArrayList<>(); |
| | | for (StateProjectCompensateStandardVO e : dataList) { |
| | |
| | | return saveBatch(poList); |
| | | } |
| | | |
| | | /** |
| | | * 创建补偿标准 |
| | | * @param stateProjectCompensateStandard |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Boolean createCompensatesStandard(StateProjectCompensateStandard stateProjectCompensateStandard) { |
| | | String standardName = stateProjectCompensateStandard.getStandardName(); |
| | |
| | | if (isValidCompensationType(typeEnum.getCode(), categoryEnum.getCode())) { |
| | | StateProjectCompensateStandard compensation = createCompensation(typeEnum, categoryEnum, stateProjectCompensateStandard); |
| | | |
| | | // 处理特殊的组合 |
| | | // TODO 处理特殊的组合 |
| | | handleSpecialCases(typeEnum, categoryEnum, compensation, standardList); |
| | | |
| | | // 添加最终的 compensation 到标准列表 |
| | |
| | | return this.saveOrUpdateBatch(standardList); |
| | | } |
| | | |
| | | /** |
| | | * 修改补偿标准名字 |
| | | * @param stateProjectCompensateStandard |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Boolean updateName(StateProjectCompensateStandard stateProjectCompensateStandard) { |
| | | |
| | |
| | | |
| | | private void handleSpecialCases(CompensateTypeEnum typeEnum, CompensationCategoryEnum categoryEnum, |
| | | StateProjectCompensateStandard compensation, List<StateProjectCompensateStandard> standardList) { |
| | | //政策性补贴 |
| | | if (typeEnum.equals(CompensateTypeEnum.POLICY_ALLOWANCE) |
| | | //购房补贴 |
| | | && categoryEnum.equals(CompensationCategoryEnum.HOUSE_PURCHASE_SUBSIDY)) { |
| | | addCompensationWithSpecifications(compensation, standardList); |
| | | } |