This commit is contained in:
ChenQiuYu 2025-05-28 09:44:30 +08:00
parent e1aab342a8
commit 49a72b25a2
2 changed files with 8 additions and 8 deletions

View File

@ -19,7 +19,7 @@ import java.util.Map;
public interface ChargeOrderMapper extends BaseMapper<ChargeOrder> {
@Select("select * from charge_order where code = #{code}")
ChargeOrder selectByCode(String code);
@Select("SELECT sale_person_id,pay_type,sum(total_price) ,count(1) FROM charge_order GROUP BY sale_person_id,pay_type")
@Select("SELECT sale_person_id,pay_type,sum(total_price) as total ,count(1) as count FROM charge_order where status = 1 GROUP BY sale_person_id,pay_type")
List<Map<String, Object>> selectSaleReport();
}

View File

@ -156,10 +156,10 @@ public class StatisticsService extends BaseService {
vo.setSalePersonName(organizationMember.getName());
}
if (map.get("sum") == null){
if (map.get("total") == null){
continue;
}
vo.setTotalIncome(vo.getTotalIncome().add((BigDecimal) map.get("sum")));
vo.setTotalIncome(vo.getTotalIncome().add((BigDecimal) map.get("total")));
vo.setCount(vo.getCount()+(Long) map.get("count"));
RetailOrderPayTypeEnum payType = RetailOrderPayTypeEnum.getByCode((Integer) map.get("pay_type"));
if (payType == null){
@ -167,19 +167,19 @@ public class StatisticsService extends BaseService {
}
switch (payType) {
case WXPAY:
vo.setWechatIncome(vo.getWechatIncome().add((BigDecimal) map.get("sum")));
vo.setWechatIncome(vo.getWechatIncome().add((BigDecimal) map.get("total")));
break;
case ALIPAY:
vo.setAliPayIncome(vo.getAliPayIncome().add((BigDecimal) map.get("sum")));
vo.setAliPayIncome(vo.getAliPayIncome().add((BigDecimal) map.get("total")));
break;
case CASH:
vo.setCashIncome(vo.getCashIncome().add((BigDecimal) map.get("sum")));
vo.setCashIncome(vo.getCashIncome().add((BigDecimal) map.get("total")));
break;
case OTHER:
vo.setOtherIncome(vo.getOtherIncome().add((BigDecimal) map.get("sum")));
vo.setOtherIncome(vo.getOtherIncome().add((BigDecimal) map.get("total")));
break;
case MEDICARE:
vo.setSocialIncome(vo.getSocialIncome().add((BigDecimal) map.get("sum")));
vo.setSocialIncome(vo.getSocialIncome().add((BigDecimal) map.get("total")));
break;
default:
break;