| | |
| | | if (CollectionUtils.isNotEmpty(records)){ |
| | | DecimalFormat df = new DecimalFormat("0.00%"); |
| | | records = records.stream().map((safetySelfInspection) -> { |
| | | if (safetySelfInspection.getStatus() == 2) { |
| | | Long id = safetySelfInspection.getId(); |
| | | SafetySelfInspectionItemQualifiedCountDO countDO = safetySelfInspectionItemMapper.countQualifiedDataById(id); |
| | | safetySelfInspection.setUnqualifiedItem(countDO.getItemSum() - countDO.getQualifiedItem()); |
| | | if (countDO != null && countDO.getItemSum() != 0 && countDO.getItemSum() != null) { |
| | | BigDecimal rate = new BigDecimal(countDO.getQualifiedItem()) |
| | | .divide(new BigDecimal(countDO.getItemSum()), 4, BigDecimal.ROUND_HALF_UP); |
| | | String qualifiedRate = df.format(rate); |
| | | safetySelfInspection.setQualifiedRate(qualifiedRate); |
| | | safetySelfInspection.setItemSum(countDO.getItemSum()); |
| | | } |
| | | Long id = safetySelfInspection.getId(); |
| | | SafetySelfInspectionItemQualifiedCountDO countDO = safetySelfInspectionItemMapper.countQualifiedDataById(id); |
| | | safetySelfInspection.setUnqualifiedItem(countDO.getItemSum() - countDO.getQualifiedItem()); |
| | | if (countDO != null && countDO.getItemSum() != 0 && countDO.getItemSum() != null) { |
| | | BigDecimal rate = new BigDecimal(countDO.getQualifiedItem()) |
| | | .divide(new BigDecimal(countDO.getItemSum()), 4, BigDecimal.ROUND_HALF_UP); |
| | | String qualifiedRate = df.format(rate); |
| | | safetySelfInspection.setQualifiedRate(qualifiedRate); |
| | | safetySelfInspection.setItemSum(countDO.getItemSum()); |
| | | } |
| | | return safetySelfInspection; |
| | | }).collect(Collectors.toList()); |
| | |
| | | if (CollectionUtils.isNotEmpty(records)){ |
| | | DecimalFormat df = new DecimalFormat("0.00%"); |
| | | records = records.stream().map((safetySelfInspection) -> { |
| | | if (safetySelfInspection.getStatus() == 2) { |
| | | Long id = safetySelfInspection.getId(); |
| | | SafetySelfInspectionItemQualifiedCountDO countDO = safetySelfInspectionItemMapper.countQualifiedDataById(id); |
| | | safetySelfInspection.setUnqualifiedItem(countDO.getItemSum() - countDO.getQualifiedItem()); |
| | | if (countDO != null && countDO.getItemSum() != 0 && countDO.getItemSum() != null) { |
| | | BigDecimal rate = new BigDecimal(countDO.getQualifiedItem()) |
| | | .divide(new BigDecimal(countDO.getItemSum()), 4, BigDecimal.ROUND_HALF_UP); |
| | | String qualifiedRate = df.format(rate); |
| | | safetySelfInspection.setQualifiedRate(qualifiedRate); |
| | | safetySelfInspection.setItemSum(countDO.getItemSum()); |
| | | } |
| | | Long id = safetySelfInspection.getId(); |
| | | SafetySelfInspectionItemQualifiedCountDO countDO = safetySelfInspectionItemMapper.countQualifiedDataById(id); |
| | | safetySelfInspection.setUnqualifiedItem(countDO.getItemSum() - countDO.getQualifiedItem()); |
| | | if (countDO != null && countDO.getItemSum() != 0 && countDO.getItemSum() != null) { |
| | | BigDecimal rate = new BigDecimal(countDO.getQualifiedItem()) |
| | | .divide(new BigDecimal(countDO.getItemSum()), 4, BigDecimal.ROUND_HALF_UP); |
| | | String qualifiedRate = df.format(rate); |
| | | safetySelfInspection.setQualifiedRate(qualifiedRate); |
| | | safetySelfInspection.setItemSum(countDO.getItemSum()); |
| | | } |
| | | return safetySelfInspection; |
| | | }).collect(Collectors.toList()); |
| | |
| | | * @param param |
| | | * @param user |
| | | */ |
| | | @Transactional |
| | | @Override |
| | | public void addSupervise(SafetySelfInspection param, UserInfo user) { |
| | | requiredSuperviseVerification(param); |
| | |
| | | /** |
| | | * @Description: 删除 |
| | | */ |
| | | @Transactional |
| | | @Override |
| | | public void delOne(Long id, UserInfo user) { |
| | | selectVerification(id); |
| | |
| | | return safetySelfInspectionItem; |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void modItemInfo(SafetySelfInspectionItem param, UserInfo user) { |
| | | |