update 科室总体统计改为和首页数据一致

This commit is contained in:
lijiarao
2022-10-26 10:28:13 +08:00
parent d1dc41ef85
commit f5f5c33d39
3 changed files with 36 additions and 9 deletions
@@ -177,16 +177,20 @@ public class IndexService {
}
public List<HistogramVO> overallDepartmentStatistics() {
String year = String.valueOf(DateUtil.year(new DateTime()));
DepartStatisticsSearch departStatisticsSearch = new DepartStatisticsSearch();
departStatisticsSearch.setYear(year);
departStatisticsSearch.setColumn("allMoney");
departStatisticsSearch.setOrder("desc");
Page<DepartStatistics> page = new Page<>(-1, -1);
IPage<DepartStatistics> pageList = payWorkingGroupService.queryPageListDepartment(page, departStatisticsSearch, new ArrayList<>());
List<DepartStatistics> records = pageList.getRecords();
return convertDepartStatistics(records);
String year = String.valueOf(DateUtil.year(new DateTime()));
List<DepartStatistics> records = payWorkingGroupMapper.overallDepartmentStatistics(year);
List<DepartStatistics> all = payWorkingGroupMapper.allDepartmentStatistics(year);
for (DepartStatistics a : all) {
String departName = a.getDepartName();
for (DepartStatistics record : records) {
String departName1 = record.getDepartName();
if (departName.equals(departName1)){
a.setConfirmAmount(record.getConfirmAmount());
}
}
}
return convertDepartStatistics(all);
}
private List<HistogramVO> convertDepartStatistics(List<DepartStatistics> list){
@@ -251,4 +251,7 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
BigDecimal invoiceAmount(@Param("start") Integer start, @Param("end") Integer end, @Param("departCode") String departCode);
List<DepartStatistics> overallDepartmentStatistics(@Param("year") String year);
List<DepartStatistics> allDepartmentStatistics(@Param("year") String year);
}
@@ -2736,5 +2736,25 @@
) a
</select>
<select id="overallDepartmentStatistics" resultType="com.jero.statistics.entity.DepartStatistics">
select
sum(no_tax_amount) as confirmAmount,
v.depart as departName
from pay_confirm_payment_record pcpr left join v_statistical v on pcpr.project_id = v.projectId
<where>
DATE_FORMAT (payment_date,'%Y') like concat(#{year}, '%')
</where>
group by departCode
</select>
<select id="allDepartmentStatistics" resultType="com.jero.statistics.entity.DepartStatistics">
select
sum(allMoney) as allMoney,
v.depart as departName
from v_statistical v
<where>
year = #{year}
</where>
group by departCode
</select>
</mapper>