| | |
| | | package com.gkhy.exam.pay.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.exam.pay.dto.rep.CateGoryTheory; |
| | | import com.gkhy.exam.pay.dto.rep.CategoryCount; |
| | | import com.gkhy.exam.pay.dto.rep.NonCategoryCount; |
| | | import com.gkhy.exam.pay.dto.req.NonCountCategoryReqDto; |
| | | import com.gkhy.exam.pay.entity.NonCoalCategory; |
| | | import com.gkhy.exam.pay.mapper.NonCoalCategoryMapper; |
| | | import com.gkhy.exam.pay.service.NonCoalCategoryService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | public int deleteNonCoalCategoryById(Long id) { |
| | | return nonCoalCategoryMapper.deleteNonCoalCategoryById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<NonCategoryCount> countCategory(NonCountCategoryReqDto countCategoryReqDto) { |
| | | // if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) { |
| | | // if (!Constants.DIS_XINJIANG_CODE.equals(SecurityUtils.getDeptDistrictCode())) { |
| | | // countCategoryReqDto.setDistrictCode(SecurityUtils.getDeptDistrictCode()); |
| | | // } |
| | | // |
| | | // } |
| | | List<NonCategoryCount> nonCategoryCounts = nonCoalCategoryMapper.selectCountCategory(countCategoryReqDto); |
| | | List<CateGoryTheory> cateGoryTheories = nonCoalCategoryMapper.selectCountTheory(countCategoryReqDto); |
| | | for (CateGoryTheory cateGoryTheory : cateGoryTheories) { |
| | | NonCategoryCount nonCategoryCount = new NonCategoryCount(); |
| | | nonCategoryCount.setCategoryType(1); |
| | | nonCategoryCount.setAmount(cateGoryTheory.getAmount()); |
| | | nonCategoryCount.setNum(cateGoryTheory.getNum()); |
| | | nonCategoryCount.setSubjectName(cateGoryTheory.getPayTypeName()); |
| | | nonCategoryCounts.add(nonCategoryCount); |
| | | } |
| | | for (NonCategoryCount categoryCount : nonCategoryCounts) { |
| | | categoryCount.setTotalMoney(categoryCount.getAmount().multiply(BigDecimal.valueOf(categoryCount.getNum()))); |
| | | if (categoryCount.getCategoryType()==1){ |
| | | categoryCount.setTurnContent(BigDecimal.valueOf(categoryCount.getNum()*6)); |
| | | categoryCount.setAutonomy(BigDecimal.valueOf(categoryCount.getNum()*8)); |
| | | categoryCount.setPrefecuture(categoryCount.getTotalMoney().subtract(categoryCount.getTurnContent().add(categoryCount.getAutonomy()))); |
| | | }else { |
| | | categoryCount.setTurnContent(BigDecimal.valueOf(categoryCount.getNum()*3)); |
| | | categoryCount.setAutonomy(BigDecimal.valueOf(categoryCount.getNum()*13)); |
| | | categoryCount.setPrefecuture(categoryCount.getTotalMoney().subtract(categoryCount.getTurnContent().add(categoryCount.getAutonomy()))); |
| | | |
| | | } |
| | | } |
| | | |
| | | return nonCategoryCounts; |
| | | } |
| | | } |