Commit 3b7de943 authored by hanfeng's avatar hanfeng

总业绩统计

parent 507e3190
package com.xxfc.platform.order.pojo; package com.xxfc.platform.order.pojo;
import com.alibaba.fastjson.JSON;
import com.xxfc.platform.order.pojo.account.OrderAccountDetail;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.util.StringUtils;
import javax.persistence.Column; import javax.persistence.Column;
import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
@Data @Data
public class ReturnOrderAmount { public class ReturnOrderAmount implements Serializable {
private static final long serialVersionUID = -8445943548965154778L;
@ApiModelProperty(value = "时间") @ApiModelProperty(value = "时间")
private String time; private String time;
@ApiModelProperty(value = "订单号") @ApiModelProperty(value = "订单号")
...@@ -25,9 +30,11 @@ public class ReturnOrderAmount { ...@@ -25,9 +30,11 @@ public class ReturnOrderAmount {
private String refundInstruction; private String refundInstruction;
@ApiModelProperty(value = "退款明细") @ApiModelProperty(value = "退款明细")
private BigDecimal refundAmount=BigDecimal.ZERO; private BigDecimal refundAmount=BigDecimal.ZERO;
@ApiModelProperty("退还类型")
@Column(name = "account_type")
private Integer accountType;
public OrderAccountDetail getAccountDetailStr() {
public String getAccountDetailStr() { return StringUtils.hasText(accountDetailStr)? JSON.parseObject(accountDetailStr,OrderAccountDetail.class):new OrderAccountDetail();
return accountDetailStr;
} }
} }
...@@ -924,7 +924,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements ...@@ -924,7 +924,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
public PageInfo<Achievement> getAchievementPageInfo(QueryCriteria queryCriteria) { public PageInfo<Achievement> getAchievementPageInfo(QueryCriteria queryCriteria) {
PageHelper.startPage(queryCriteria.getPage(),queryCriteria.getLimit()); PageHelper.startPage(queryCriteria.getPage(),queryCriteria.getLimit());
List<Achievement> achievements = mapper.selectTotalStatistical(queryCriteria); List<Achievement> achievements = mapper.selectTotalStatistical(queryCriteria);
return new PageInfo<>(achievements); return PageInfo.of(achievements);
} }
......
...@@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil; ...@@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.feign.UserFeign; import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.common.biz.BaseBiz; import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.exception.BaseException; import com.github.wxiaoqi.security.common.exception.BaseException;
...@@ -652,6 +654,6 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> { ...@@ -652,6 +654,6 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
} }
public List<ReturnOrderAmount> outStatisticalData(QueryCriteria queryCriteria) { public List<ReturnOrderAmount> outStatisticalData(QueryCriteria queryCriteria) {
return mapper.outStatisticalData(queryCriteria); return mapper.outStatisticalData(queryCriteria);
} }
} }
\ No newline at end of file
...@@ -3,16 +3,19 @@ package com.xxfc.platform.order.biz; ...@@ -3,16 +3,19 @@ package com.xxfc.platform.order.biz;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.xxfc.platform.order.contant.enumerate.AccountTypeEnum;
import com.xxfc.platform.order.pojo.Achievement; import com.xxfc.platform.order.pojo.Achievement;
import com.xxfc.platform.order.pojo.QueryCriteria; import com.xxfc.platform.order.pojo.QueryCriteria;
import com.xxfc.platform.order.pojo.ReturnOrderAmount; import com.xxfc.platform.order.pojo.ReturnOrderAmount;
import com.xxfc.platform.order.pojo.TotalOrderRevenue; import com.xxfc.platform.order.pojo.TotalOrderRevenue;
import com.xxfc.platform.order.pojo.account.OrderAccountDetail;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -91,9 +94,21 @@ public class TotalPerformanceBiz { ...@@ -91,9 +94,21 @@ public class TotalPerformanceBiz {
if (CollectionUtils.isEmpty(returnOrderAmounts)) { if (CollectionUtils.isEmpty(returnOrderAmounts)) {
return Lists.newArrayList(); return Lists.newArrayList();
} }
//拆分明细
splitReturnOrderAmountList(returnOrderAmounts,queryCriteria);
} }
//拆分明细
private List<ReturnOrderAmount> splitReturnOrderAmountList(List<ReturnOrderAmount> returnOrderAmounts, QueryCriteria queryCriteria) {
ArrayList<ReturnOrderAmount> arrayList = Lists.newArrayList();
for (ReturnOrderAmount returnOrderAmount : returnOrderAmounts) {
OrderAccountDetail accountDetailStr = returnOrderAmount.getAccountDetailStr();
if (AccountTypeEnum.OUT_RESIDUE_DEPOSIT.getCode().equals(returnOrderAmount.getAccountType())) {
}
}
}
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xxfc.platform.order.mapper.OrderAccountMapper"> <mapper namespace="com.xxfc.platform.order.mapper.OrderAccountMapper">
<select id="getOrderAccountByOrderType" parameterType="com.xxfc.platform.order.pojo.Term" resultType="com.xxfc.platform.order.pojo.account.OrderAccountDTO"> <select id="getOrderAccountByOrderType" parameterType="com.xxfc.platform.order.pojo.Term"
resultType="com.xxfc.platform.order.pojo.account.OrderAccountDTO">
SELECT SELECT
<if test="subdivide !=null and subdivide ==1"> <if test="subdivide !=null and subdivide ==1">
date( FROM_UNIXTIME( a.crt_time / 1000 ) ) as oneDay, date( FROM_UNIXTIME( a.crt_time / 1000 ) ) as oneDay,
...@@ -27,7 +28,7 @@ ...@@ -27,7 +28,7 @@
AND AND
b.type = #{orderType} b.type = #{orderType}
<if test="startTime != null"> <if test="startTime != null">
AND a.crt_time <![CDATA[>= ]]> #{startTime} AND a.crt_time <![CDATA[>= ]]> #{startTime}
</if> </if>
<if test="endTime != null"> <if test="endTime != null">
AND a.crt_time &gt; endTime AND a.crt_time &gt; endTime
...@@ -51,10 +52,10 @@ ...@@ -51,10 +52,10 @@
</if> </if>
</select> </select>
<select id="outStatisticalData" resultType="com.xxfc.platform.order.pojo.ReturnOrderAmount"> <select id="outStatisticalData" resultType="com.xxfc.platform.order.pojo.ReturnOrderAmount">
select oa.crt_time as time ,oupc.no,oupc.type,oa.account_detail ,oupc.realname,oupc.username select oa.crt_time as time ,oupc.no,oupc.type,oa.account_detail,oupc.realname,oupc.username,oa.account_type
from order_account oa from order_account oa
left join order_user_position_company oupc ON oa.order_id=oupc.id left join order_user_position_company oupc ON oa.order_id=oupc.id
WHERE oa.account_type!=101 WHERE oa.account_type!=101
<if test="startDate != null"> <if test="startDate != null">
and oa.crt_time <![CDATA[>=]]> #{startDate} and oa.crt_time <![CDATA[>=]]> #{startDate}
</if> </if>
...@@ -70,6 +71,6 @@ ...@@ -70,6 +71,6 @@
<if test="orderType != null"> <if test="orderType != null">
and oupc.type = #{orderType} and oupc.type = #{orderType}
</if> </if>
order by oa.crt_time DESC order by oa.crt_time DESC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment