| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public SysGoalSettingDto create(SysGoalSetting resources) throws Exception { |
| | | public SysGoalSettingDto create(SysGoalSetting resources) { |
| | | createOrUpdateCheck(resources); |
| | | return sysGoalSettingMapper.toDto(sysGoalSettingRepository.save(resources)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(SysGoalSetting resources) throws Exception { |
| | | public void update(SysGoalSetting resources) { |
| | | SysGoalSetting sysGoalSetting = sysGoalSettingRepository.findById(resources.getId()).orElseGet(SysGoalSetting::new); |
| | | ValidationUtil.isNull( sysGoalSetting.getId(),"SysGoalSetting","id",resources.getId()); |
| | | sysGoalSetting.copy(resources); |
| | |
| | | Map<String,Object> map = new LinkedHashMap<>(); |
| | | map.put("目标年度", targetYear); |
| | | map.put("项目区分", projectDistinguish); |
| | | map.put("目标金额", sysGoalSetting.getTargetAmount()); |
| | | map.put("目标金额(全年)", sysGoalSetting.getTargetAmount()); |
| | | map.put("目标金额(一季度)", sysGoalSetting.getFirstTargetAmount()); |
| | | map.put("目标金额(二季度)", sysGoalSetting.getSecondTargetAmount()); |
| | | map.put("目标金额(三季度)", sysGoalSetting.getThirdTargetAmount()); |
| | | map.put("目标金额(四季度)", sysGoalSetting.getFourthTargetAmount()); |
| | | map.put("相关负责人", sysGoalSetting.getLeaderName()); |
| | | map.put("备注", sysGoalSetting.getRemarks()); |
| | | map.put("创建者", sysGoalSetting.getCreateBy()); |
| | | map.put("创建时间", sysGoalSetting.getCreateTime()); |
| | |
| | | FileUtil.downloadExcel(list, response); |
| | | } |
| | | |
| | | private void createOrUpdateCheck(SysGoalSetting resources) throws Exception { |
| | | private void createOrUpdateCheck(SysGoalSetting resources) { |
| | | // 日期格式化 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String targetYear = sdf.format(resources.getTargetYear()); |