记得上下班打卡 | git大法好,push需谨慎

Commit 76d1eb1d authored by zhoujianping's avatar zhoujianping

1.修改校园代理相关逻辑

parent 436982ce
......@@ -56,6 +56,8 @@
</div>
<td>总销售张数</td>
<td>总销售金额</td>
<td>实际销售金额</td>
<td>优惠券金额</td>
<td>总销售佣金</td>
<td>打款状态</td>
<td>是否黑名单</td>
......@@ -76,6 +78,8 @@
<td th:each="itemAgent : ${item.dataAgentVos}" th:text="${itemAgent.number}"></td>
<td th:text="${#aggregates.sum(item.dataAgentVos.![number])}"></td>
<td th:text="${#aggregates.sum(item.dataAgentVos.![priceReal])}"></td>
<td th:text="${#aggregates.sum(item.dataAgentVos.![realTotalPrice])}"></td>
<td th:text="${#aggregates.sum(item.dataAgentVos.![voucherPrice])}"></td>
<td th:text="${item.totalCommission}"></td>
<td th:if="${item.priceStatus!=0}" th:text="待打款"></td>
<td th:if="${item.priceStatus==0}" th:text="已打款"></td>
......
......@@ -53,6 +53,20 @@ public class UserDataAgentVo implements Serializable, Cloneable{
@ApiModelProperty(value = "提成", example = "")
private BigDecimal commission;
/**
* 实际销售金额 实际支付金额-快递费=提成基数
*/
@ApiModelProperty(value = "实际销售金额", example = "")
private BigDecimal realTotalPrice;
/**
* 优惠券金额
*/
@ApiModelProperty(value = "优惠券金额", example = "")
private BigDecimal voucherPrice;
private static final UserDataAgentVo obj = new UserDataAgentVo();
public static UserDataAgentVo getNew() {
......
......@@ -410,6 +410,8 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
userDataAgentVo.setPriceReal(new BigDecimal(showBaseVoDto.getPriceReal().stripTrailingZeros().toPlainString()));
// userDataAgentVo.setAgent(showBaseVoDto.getUse());
userDataAgentVo.setCommission(new BigDecimal(showBaseVoDto.getTotalPrice().stripTrailingZeros().toPlainString()));
userDataAgentVo.setRealTotalPrice(new BigDecimal(showBaseVoDto.getRealTotalPrice().stripTrailingZeros().toPlainString()));
userDataAgentVo.setVoucherPrice(new BigDecimal(showBaseVoDto.getVoucherPrice().stripTrailingZeros().toPlainString()));
} else {
//没有买过
userDataAgentVo.setTicketsId(smileAgent.getTicketsId());
......@@ -419,6 +421,8 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
userDataAgentVo.setPriceReal(BigDecimal.ZERO);
// userDataAgentVo.setAgent(showBaseVoDto.getType() == 1 ? tidMap.get(smileAgent.getTicketsId()).getTotalCarry() : tidMap.get(smileAgent.getTicketsId()).getOrdCarry());
userDataAgentVo.setCommission(BigDecimal.ZERO);
userDataAgentVo.setRealTotalPrice(BigDecimal.ZERO);
userDataAgentVo.setVoucherPrice(BigDecimal.ZERO);
}
totalCommission = totalCommission.add(userDataAgentVo.getCommission());
userDataAgentVos.add(userDataAgentVo);
......@@ -466,6 +470,8 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
userDataAgentVo.setNumber(BigDecimal.ZERO);
userDataAgentVo.setPrice(BigDecimal.ZERO);
userDataAgentVo.setPriceReal(BigDecimal.ZERO);
userDataAgentVo.setRealTotalPrice(BigDecimal.ZERO);
userDataAgentVo.setVoucherPrice(BigDecimal.ZERO);
userDataAgentVo.setCommission(BigDecimal.ZERO);
userDataAgentVos.add(userDataAgentVo);
}
......@@ -655,7 +661,7 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
//做表
ticketList.forEach(title -> headTitles.add(Lists.newArrayList(ticket, ticket, title)));
ArrayList<String> dataList = Lists.newArrayList("总销售张数", "总销售金额", "总销售佣金", "打款状态");
ArrayList<String> dataList = Lists.newArrayList("总销售张数", "总销售金额","实际销售金额","优惠券金额", "总销售佣金","打款状态");
//做表
dataList.forEach(dataStr -> headTitles.add(Lists.newArrayList(saleData, saleData, dataStr)));
......@@ -670,6 +676,10 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
BigDecimal num = new BigDecimal("0");
//总销售金额
BigDecimal price = new BigDecimal("0");
//实际销售金额
BigDecimal realTotalPrice=new BigDecimal("0");
//优惠券金额
BigDecimal voucherPrice=new BigDecimal("0");
ArrayList<Object> arrayList = Lists.newArrayList();
arrayList.add(userData.getUid());
......@@ -706,6 +716,8 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
if (userDataAgentVo != null) {
num = num.add(new BigDecimal(userDataAgentVo.getNumber().toString()));
price = price.add(userDataAgentVo.getPriceReal());
realTotalPrice=realTotalPrice.add(userDataAgentVo.getRealTotalPrice());
voucherPrice=voucherPrice.add(userDataAgentVo.getVoucherPrice());
arrayList.add(userDataAgentVo.getNumber());
} else {
arrayList.add(0);
......@@ -713,6 +725,8 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
}
arrayList.add(num);
arrayList.add(price);
arrayList.add(realTotalPrice);
arrayList.add(voucherPrice);
arrayList.add(userData.getTotalCommission());
arrayList.add(userData.getPriceStatus() != null && userData.getPriceStatus() == 0 ? "已打款" : "待打款");
contentList.add(arrayList);
......
......@@ -741,8 +741,8 @@ GROUP BY user_mobile,tickets_id;
LEFT JOIN (
SELECT
kk.performance_id,
sum( kot.number - kot.refund_number ) AS `open`,
sum( kot.price_actual - kot.price_refund ) AS price
sum(kot.number) AS `open`,
sum(kot.price_actual) AS price
FROM
kylin_order_tickets AS kot
LEFT JOIN (
......@@ -759,7 +759,7 @@ GROUP BY user_mobile,tickets_id;
LEFT JOIN kylin_order_ticket_status AS kots ON kotr.order_id = kots.order_id
INNER JOIN smile_user AS su ON su.uid = kotr.agent_id
WHERE
kots.STATUS IN ( 1, 6 ,3 )
kots.STATUS IN (1)
) AS kk ON kot.order_tickets_id = kk.order_id
WHERE
kk.agent_id != 0
......
......@@ -80,6 +80,15 @@ public class ShowBaseVoDto implements Serializable, Cloneable{
*/
private BigDecimal totalPrice;
/**
* 实际销售金额
*/
private BigDecimal realTotalPrice;
/**
* 优惠券金额
*/
private BigDecimal voucherPrice;
private static final ShowBaseVoDto obj = new ShowBaseVoDto();
public static ShowBaseVoDto getNew() {
......
......@@ -83,10 +83,12 @@
sukotr.state,
sukotr.agentName,
kot.price,
SUM(kot.price_actual - kot.price_refund) price_real,
SUM(kot.price_actual) price_real,
sukotr.agent_distributions AS `use`,
SUM( kot.number - kot.refund_number ) number,
SUM( ( kot.price_actual - kot.price_refund ) * sukotr.agent_distributions ) totalPrice
SUM( kot.number ) number,
SUM( (kot.price_actual - kot.price_express) * sukotr.agent_distributions ) totalPrice,
SUM( (kot.price_actual - kot.price_express) ) realTotalPrice,
SUM( kot.price_voucher ) voucherPrice
FROM
kylin_order_tickets AS kot
INNER JOIN (
......@@ -114,7 +116,7 @@
FROM kylin_order_ticket_relations as kotr
LEFT JOIN kylin_order_ticket_status AS kots ON kotr.order_id = kots.order_id
INNER JOIN smile_user AS su ON su.uid = kotr.agent_id
WHERE kots.status IN (1,6,3)
WHERE kots.status IN (1)
AND kotr.agent_id != 0
AND (kotr.agent_distributions_master !=0 or kotr.agent_distributions!=0)
AND kotr.performance_id = #{performancesId}
......@@ -122,7 +124,7 @@
)
AND kotr.performance_id = #{performancesId}
AND (kotr.agent_distributions_master !=0 or kotr.agent_distributions!=0)
AND kots.`status` IN ( 1, 6 ,3)
AND kots.`status` IN (1)
) AS sukotr ON sukotr.order_id = kot.order_tickets_id
GROUP BY
sukotr.uid,
......
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