update 全所收入统计中合同金额变更为收入合同总金额
This commit is contained in:
+4
@@ -219,4 +219,8 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
|
|||||||
AllMoney queryPageListDepartment33(@Param("departStatisticsSearch") DepartStatisticsSearch departStatisticsSearch, @Param("idList") List<String> idList);
|
AllMoney queryPageListDepartment33(@Param("departStatisticsSearch") DepartStatisticsSearch departStatisticsSearch, @Param("idList") List<String> idList);
|
||||||
|
|
||||||
List<AllProjectStatistics> queryListAllProjectMoney(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch, @Param("idList") List<String> idList);
|
List<AllProjectStatistics> queryListAllProjectMoney(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch, @Param("idList") List<String> idList);
|
||||||
|
|
||||||
|
List<AllProjectStatistics> queryListAllMoney(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch);
|
||||||
|
|
||||||
|
AllMoney queryAllMoney33(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch);
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-1
@@ -2225,7 +2225,6 @@
|
|||||||
<!-- 全所收入统计-->
|
<!-- 全所收入统计-->
|
||||||
<select id="queryListAllProjectMoney" resultType="com.jero.statistics.entity.AllProjectStatistics">
|
<select id="queryListAllProjectMoney" resultType="com.jero.statistics.entity.AllProjectStatistics">
|
||||||
select
|
select
|
||||||
sum(allMoney) as allMoney,
|
|
||||||
sum(paidNoTaxAmount) as comeAllMoney,
|
sum(paidNoTaxAmount) as comeAllMoney,
|
||||||
sum(invoiceNoTaxAmount) as billMoney,
|
sum(invoiceNoTaxAmount) as billMoney,
|
||||||
sum(confirmNoTaxAmount) as confirmAmount,
|
sum(confirmNoTaxAmount) as confirmAmount,
|
||||||
@@ -2240,4 +2239,29 @@
|
|||||||
group by DATE_FORMAT(pcpr.payment_date,'%Y-%m')
|
group by DATE_FORMAT(pcpr.payment_date,'%Y-%m')
|
||||||
order by paymentDate
|
order by paymentDate
|
||||||
</select>
|
</select>
|
||||||
|
<!-- 全所收入统计-->
|
||||||
|
<select id="queryListAllMoney" resultType="com.jero.statistics.entity.AllProjectStatistics">
|
||||||
|
select
|
||||||
|
sum(contract_amount) as allMoney,
|
||||||
|
DATE_FORMAT(contract_date,'%Y-%m') as paymentDate
|
||||||
|
from pay_income_contract
|
||||||
|
<where>
|
||||||
|
<if test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''">
|
||||||
|
and DATE_FORMAT (contract_date,'%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
group by DATE_FORMAT(contract_date,'%Y-%m')
|
||||||
|
order by contract_date
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="queryAllMoney33" resultType="com.jero.statistics.entity.AllMoney">
|
||||||
|
select
|
||||||
|
sum(contract_amount) as allMoney
|
||||||
|
from pay_income_contract
|
||||||
|
<where>
|
||||||
|
<if test="allProjectStatisticsSearch.paymentYear != null and allProjectStatisticsSearch.paymentYear != ''">
|
||||||
|
and DATE_FORMAT (contract_date,'%Y') like concat(#{allProjectStatisticsSearch.paymentYear}, '%')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
+2
@@ -242,4 +242,6 @@ public interface IPayWorkingGroupService extends IService<PayWorkingGroup> {
|
|||||||
List<AllProjectStatistics> queryListAllProjectMoney(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList);
|
List<AllProjectStatistics> queryListAllProjectMoney(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList);
|
||||||
|
|
||||||
List<AllProjectMoneyExcel> queryListAllProjectMoneyExcel(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList);
|
List<AllProjectMoneyExcel> queryListAllProjectMoneyExcel(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList);
|
||||||
|
|
||||||
|
AllMoney queryAllMoney33(AllProjectStatisticsSearch allProjectStatisticsSearch);
|
||||||
}
|
}
|
||||||
|
|||||||
+57
-15
@@ -1,5 +1,7 @@
|
|||||||
package com.jero.project.service.impl;
|
package com.jero.project.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@@ -46,6 +48,8 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static org.jeecg.modules.jmreport.desreport.b.b.i;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: pay_working_group
|
* @Description: pay_working_group
|
||||||
@@ -635,21 +639,23 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
|
|||||||
@Override
|
@Override
|
||||||
public List<AllProjectStatistics> queryListAllProjectMoney(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) {
|
public List<AllProjectStatistics> queryListAllProjectMoney(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) {
|
||||||
List<AllProjectStatistics> list = payWorkingGroupMapper.queryListAllProjectMoney(allProjectStatisticsSearch,idList);
|
List<AllProjectStatistics> list = payWorkingGroupMapper.queryListAllProjectMoney(allProjectStatisticsSearch,idList);
|
||||||
return getAllProjectMoneyStatistics(allProjectStatisticsSearch, list);
|
List<AllProjectStatistics> allMoneyList = payWorkingGroupMapper.queryListAllMoney(allProjectStatisticsSearch);
|
||||||
|
return getAllProjectMoneyStatistics(allProjectStatisticsSearch, list,allMoneyList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AllProjectMoneyExcel> queryListAllProjectMoneyExcel(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) {
|
public List<AllProjectMoneyExcel> queryListAllProjectMoneyExcel(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) {
|
||||||
List<AllProjectStatistics> list = payWorkingGroupMapper.queryListAllProjectMoney(allProjectStatisticsSearch,idList);
|
List<AllProjectStatistics> list = payWorkingGroupMapper.queryListAllProjectMoney(allProjectStatisticsSearch,idList);
|
||||||
List<AllProjectStatistics> list2=getAllProjectMoneyStatistics(allProjectStatisticsSearch, list);
|
List<AllProjectStatistics> allMoneyList = payWorkingGroupMapper.queryListAllMoney(allProjectStatisticsSearch);
|
||||||
|
List<AllProjectStatistics> list2=getAllProjectMoneyStatistics(allProjectStatisticsSearch, list, allMoneyList);
|
||||||
AllMoney allMoney=payWorkingGroupMapper.queryPageList33(allProjectStatisticsSearch, idList);
|
AllMoney allMoney=payWorkingGroupMapper.queryPageList33(allProjectStatisticsSearch, idList);
|
||||||
|
|
||||||
List<String> comeAllMoneyList=list2.stream().map(AllProjectStatistics::getComeAllMoney).collect(Collectors.toList());
|
List<String> comeAllMoneyList=list2.stream().map(AllProjectStatistics::getComeAllMoney).collect(Collectors.toList());
|
||||||
List<String> billMoneyList=list2.stream().map(AllProjectStatistics::getBillMoney).collect(Collectors.toList());
|
List<String> billMoneyList=list2.stream().map(AllProjectStatistics::getBillMoney).collect(Collectors.toList());
|
||||||
List<String> confirmMoneyList=list2.stream().map(AllProjectStatistics::getConfirmAmount).collect(Collectors.toList());
|
List<String> confirmMoneyList=list2.stream().map(AllProjectStatistics::getConfirmAmount).collect(Collectors.toList());
|
||||||
List<String> allMoneyList=list2.stream().map(AllProjectStatistics::getComeAllMoney).collect(Collectors.toList());
|
List<String> allMoneyList1=list2.stream().map(AllProjectStatistics::getComeAllMoney).collect(Collectors.toList());
|
||||||
List<List<String>> list3 = new ArrayList<>();
|
List<List<String>> list3 = new ArrayList<>();
|
||||||
list3.add(0,allMoneyList);
|
list3.add(0,allMoneyList1);
|
||||||
list3.add(1,confirmMoneyList);
|
list3.add(1,confirmMoneyList);
|
||||||
list3.add(2,billMoneyList);
|
list3.add(2,billMoneyList);
|
||||||
list3.add(3,comeAllMoneyList);
|
list3.add(3,comeAllMoneyList);
|
||||||
@@ -683,22 +689,58 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
|
|||||||
return excelList;
|
return excelList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AllMoney queryAllMoney33(AllProjectStatisticsSearch allProjectStatisticsSearch) {
|
||||||
|
return payWorkingGroupMapper.queryAllMoney33(allProjectStatisticsSearch);
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private List<AllProjectStatistics> getAllProjectMoneyStatistics(AllProjectStatisticsSearch allProjectStatisticsSearch, List<AllProjectStatistics> list) {
|
private List<AllProjectStatistics> getAllProjectMoneyStatistics(AllProjectStatisticsSearch allProjectStatisticsSearch, List<AllProjectStatistics> list, List<AllProjectStatistics> allMoneyList) {
|
||||||
List<Integer> collect=list.stream()
|
Map<String, String> comeAllMoneyMap = list.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getComeAllMoney));
|
||||||
.map(allProjectStatistics -> Integer.valueOf(allProjectStatistics.getPaymentDate().split("-")[1]))
|
Map<String, String> billMoneyMap = list.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getBillMoney));
|
||||||
.collect(Collectors.toList());
|
Map<String, String> confirmAmountMap = list.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getConfirmAmount));
|
||||||
|
Map<String, String> allMoneyMap = allMoneyList.stream().collect(Collectors.toMap(AllProjectStatistics::getPaymentDate, AllProjectStatistics::getAllMoney));
|
||||||
|
|
||||||
String paymentYear=allProjectStatisticsSearch.getPaymentYear();
|
String paymentYear=allProjectStatisticsSearch.getPaymentYear();
|
||||||
for (int i=1; i <= 12; i++) {
|
List<String> yearMonth = getYearMonth(paymentYear);
|
||||||
if (!collect.contains(i)) {
|
List<AllProjectStatistics> returnList = new ArrayList<>(12);
|
||||||
StringBuilder stringBuilder=new StringBuilder().append(paymentYear);
|
for (String date : yearMonth) {
|
||||||
AllProjectStatistics allProjectStatistics=new AllProjectStatistics("0.00", "0.00", "0.00", "0.00", stringBuilder.append("-" + i).toString());
|
AllProjectStatistics allProjectStatistics = new AllProjectStatistics();
|
||||||
list.add(allProjectStatistics);
|
allProjectStatistics.setAllMoney("0.00");
|
||||||
|
allProjectStatistics.setConfirmAmount("0.00");
|
||||||
|
allProjectStatistics.setBillMoney("0.00");
|
||||||
|
allProjectStatistics.setComeAllMoney("0.00");
|
||||||
|
allProjectStatistics.setPaymentDate(date);
|
||||||
|
returnList.add(allProjectStatistics);
|
||||||
|
}
|
||||||
|
for (AllProjectStatistics allProjectStatistics : returnList) {
|
||||||
|
String paymentDate = allProjectStatistics.getPaymentDate();
|
||||||
|
if (comeAllMoneyMap.containsKey(paymentDate)) {
|
||||||
|
allProjectStatistics.setComeAllMoney(comeAllMoneyMap.get(paymentDate));
|
||||||
|
}
|
||||||
|
if (billMoneyMap.containsKey(paymentDate)) {
|
||||||
|
allProjectStatistics.setBillMoney(billMoneyMap.get(paymentDate));
|
||||||
|
}
|
||||||
|
if (confirmAmountMap.containsKey(paymentDate)) {
|
||||||
|
allProjectStatistics.setConfirmAmount(confirmAmountMap.get(paymentDate));
|
||||||
|
}
|
||||||
|
if (allMoneyMap.containsKey(paymentDate)) {
|
||||||
|
allProjectStatistics.setAllMoney(allMoneyMap.get(paymentDate));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
list.sort(Comparator.comparing(allProjectStatistics -> Integer.valueOf(allProjectStatistics.getPaymentDate().split("-")[1])));
|
return returnList;
|
||||||
return list;
|
}
|
||||||
|
|
||||||
|
private List<String> getYearMonth(String year){
|
||||||
|
List<String> yearMonthList = new ArrayList<>(12);
|
||||||
|
DateTime parse = DateUtil.parse(year,"yyyy");
|
||||||
|
parse = DateUtil.beginOfYear(parse);
|
||||||
|
for (int i=1; i <= 12; i++) {
|
||||||
|
String format = DateUtil.format(parse, "yyyy-MM");
|
||||||
|
yearMonthList.add(format);
|
||||||
|
parse = DateUtil.offsetMonth(parse, 1);
|
||||||
|
}
|
||||||
|
return yearMonthList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -70,7 +70,8 @@ public class AllProjectMoneyStatisticsController {
|
|||||||
|
|
||||||
HashMap<String, Object> hashMap = new HashMap<>();
|
HashMap<String, Object> hashMap = new HashMap<>();
|
||||||
AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch, null);
|
AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch, null);
|
||||||
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
|
AllMoney allMoney1 = payWorkingGroupService.queryAllMoney33(allProjectStatisticsSearch);
|
||||||
|
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney1) ? 0 : allMoney1.getAllMoney());
|
||||||
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
|
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
|
||||||
hashMap.put("sumOfBillMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getBillMoney());
|
hashMap.put("sumOfBillMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getBillMoney());
|
||||||
hashMap.put("sumOfConfirmAmount", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getConfirmAmount());
|
hashMap.put("sumOfConfirmAmount", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getConfirmAmount());
|
||||||
|
|||||||
Reference in New Issue
Block a user