update 会所收入统计

This commit is contained in:
邝凯兴
2022-07-29 11:40:01 +08:00
parent d8be00fbf2
commit e224733e9c
6 changed files with 40 additions and 16 deletions
@@ -218,5 +218,5 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
AllMoney queryPageListDepartment33(@Param("departStatisticsSearch") DepartStatisticsSearch departStatisticsSearch, @Param("idList") List<String> idList);
IPage<AllProjectStatistics> queryPageListAllProjectMoney(Page<AllProjectStatistics> page, @Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch, @Param("idList") List<String> idList);
List<AllProjectStatistics> queryListAllProjectMoney(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch, @Param("idList") List<String> idList);
}
@@ -2217,7 +2217,7 @@
</select>
<!-- 全所收入统计-->
<select id="queryPageListAllProjectMoney" resultType="com.jero.statistics.entity.AllProjectStatistics">
<select id="queryListAllProjectMoney" resultType="com.jero.statistics.entity.AllProjectStatistics">
select
sum(paidNoTaxAmount) as comeAllMoney,
sum(invoiceNoTaxAmount) as billMoney,
@@ -239,5 +239,5 @@ public interface IPayWorkingGroupService extends IService<PayWorkingGroup> {
AllMoney queryPageListDepartment33(DepartStatisticsSearch departStatisticsSearch, List<String> idList);
IPage<AllProjectStatistics> queryPageListAllProjectMoney(Page<AllProjectStatistics> page, AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList );
List<AllProjectStatistics> queryListAllProjectMoney(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList );
}
@@ -632,7 +632,21 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
}
@Override
public IPage<AllProjectStatistics> queryPageListAllProjectMoney(Page<AllProjectStatistics> page, AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) {
return payWorkingGroupMapper.queryPageListAllProjectMoney(page,allProjectStatisticsSearch,idList);
public List<AllProjectStatistics> queryListAllProjectMoney(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) {
List<AllProjectStatistics> list = payWorkingGroupMapper.queryListAllProjectMoney(allProjectStatisticsSearch,idList);
List<Integer> collect=list.stream()
.map(allProjectStatistics -> Integer.valueOf(allProjectStatistics.getPaymentDate().split("-")[1]))
.collect(Collectors.toList());
String paymentYear=allProjectStatisticsSearch.getPaymentYear();
for (int i=1; i <=12 ; i++) {
if(!collect.contains(i)){
StringBuilder stringBuilder = new StringBuilder().append(paymentYear);
AllProjectStatistics allProjectStatistics=new AllProjectStatistics("0.00","0.00","0.00",stringBuilder.append("-"+i).toString());
list.add(allProjectStatistics);
}
}
list.sort(Comparator.comparing(allProjectStatistics -> Integer.valueOf(allProjectStatistics.getPaymentDate().split("-")[1])));
return list;
}
}
@@ -12,6 +12,7 @@ import com.jero.project.service.IPayWorkingGroupService;
import com.jero.statistics.entity.AllMoney;
import com.jero.statistics.entity.AllProjectStatistics;
import com.jero.statistics.entity.AllProjectStatisticsSearch;
import com.mchange.lang.IntegerUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -25,7 +26,10 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.text.DecimalFormat;
import java.util.HashMap;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* @Description: TODO
@@ -52,26 +56,21 @@ public class AllProjectMoneyStatisticsController {
* 分页列表查询
*
* @param allProjectStatisticsSearch 全所收入统计搜索
* @param pageNo 页数
* @param pageSize 条数
*/
@ApiOperation(value = "全所收入统计搜索-分页列表查询", notes = "全所收入统计搜索-详情分页列表查询")
@GetMapping(value = "/list")
public Result<?> list(AllProjectStatisticsSearch allProjectStatisticsSearch,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
public Result<?> list(AllProjectStatisticsSearch allProjectStatisticsSearch) {
List<AllProjectStatistics> list = payWorkingGroupService.queryListAllProjectMoney(allProjectStatisticsSearch, null);
Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize);
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListAllProjectMoney(page, allProjectStatisticsSearch, null);
HashMap<String, Object> hashMap = new HashMap<>();
AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch, null);
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("sumOfBillMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getBillMoney());
hashMap.put("sumOfConfirmAmount", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getConfirmAmount());
hashMap.put("pageList", pageList);
hashMap.put("list", list);
return Result.OK(hashMap);
}
@@ -2,7 +2,9 @@ package com.jero.statistics.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.util.Date;
@@ -12,6 +14,8 @@ import java.util.Date;
* @date 2021/9/17 18:04
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AllProjectStatistics {
@ApiModelProperty(value = "项目id")
private String projectId;
@@ -67,4 +71,11 @@ public class AllProjectStatistics {
@Excel(name = "到账时间", width = 15)
@ApiModelProperty(value = "到账时间")
private String paymentDate;
public AllProjectStatistics(String confirmAmount, String billMoney, String comeAllMoney, String paymentDate) {
this.confirmAmount=confirmAmount;
this.billMoney=billMoney;
this.comeAllMoney=comeAllMoney;
this.paymentDate=paymentDate;
}
}