| | |
| | | checkTemplateMapper.updateCheckTemplate(checkTemplate); |
| | | return i; |
| | | } |
| | | |
| | | public static BigDecimal safeConvert(String str) { |
| | | // 处理空值/空字符串 |
| | | if (str == null || str.trim().isEmpty()) { |
| | | return BigDecimal.ZERO; |
| | | } |
| | | try { |
| | | return new BigDecimal(str.trim()); |
| | | } catch (NumberFormatException e) { |
| | | System.out.println("字符串格式非法,无法转为BigDecimal:" + str); |
| | | return BigDecimal.ZERO; |
| | | } |
| | | } |
| | | /** |
| | | * 修改考核模板 |
| | | * |
| | |
| | | public AjaxResult updateCheckTemplate(CheckTemplateQuery checkTemplateDTO) throws SchedulerException, TaskException { |
| | | CheckTemplate checkTemplate = new CheckTemplate(); |
| | | BeanUtils.copyProperties(checkTemplateDTO, checkTemplate); |
| | | BigDecimal bigDecimal = safeConvert(checkTemplateDTO.getAlarmScore()); |
| | | checkTemplate.setAlarmScore(bigDecimal); |
| | | checkTemplate.setUpdateUserName(SecurityUtils.getUsername()); |
| | | List<Integer> deptId = checkTemplateDTO.getDeptId(); |
| | | Collections.sort(deptId); |