| | |
| | | |
| | | @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); |
| | |
| | | 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()); |