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

Commit 99b9eba9 authored by zhengfuxin's avatar zhengfuxin

修改bug

parent 557a00e2
...@@ -49,5 +49,5 @@ public interface KylinOrderTicketsMapper extends BaseMapper<KylinOrderTickets> { ...@@ -49,5 +49,5 @@ public interface KylinOrderTicketsMapper extends BaseMapper<KylinOrderTickets> {
List<Map> getUserSellOneDate(@Param("agentId")String agentId,@Param("performanceId")String performanceId); List<Map> getUserSellOneDate(@Param("agentId")String agentId,@Param("performanceId")String performanceId);
Map getUserSellAllDate(@Param("agentId")String agentId,@Param("performanceId")String performanceId); Map getUserSellAllDate(@Param("agentId")String agentId,@Param("performanceId")String performanceId);
List<Map> getUserSellDetail(@Param("agentId")String agentId,@Param("ticketId")String ticketId); List<Map> getUserSellDetail(@Param("agentId")String agentId,@Param("ticketId")String ticketId);
List<Map> getUserPerformance(@Param("userId")String userId); List<Map> getUserPerformance(@Param("agentId")String userId);
} }
...@@ -78,10 +78,13 @@ ...@@ -78,10 +78,13 @@
LIMIT 1 LIMIT 1
</select> </select>
<select id="getUserPerformance" parameterType="String" resultType="java.util.Map"> <select id="getUserPerformance" parameterType="String" resultType="java.util.Map">
select o.performance_title as 'title',r.performance_id as 'performanceId' ,SUM(r.agent_distributions * (o.price-o.price_refund)) as 'commiss',kp.time_end as 'timeEnd' select ss.*,kp.time_end as 'timeEnd' from (
from (select * from kylin_order_tickets where created_at>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)) as o, select o.performance_title as 'title',r.performance_id as 'performanceId' ,SUM(r.agent_distributions * (o.price-o.price_refund)) as 'commiss'
kylin_order_ticket_status as s,kylin_order_ticket_relations as r ,kylin_performances kp where o.order_tickets_id=s.order_id and o.order_tickets_id=r.order_id from (select * from kylin_order_tickets where created_at>DATE_SUB(CURDATE(), INTERVAL 6 MONTH)) as o
and r.agent_id=#{agentId} and s.pay_status='1' GROUP BY r.performance_id LEFT JOIN kylin_order_ticket_status as s on o.order_tickets_id=s.order_id
LEFT JOIN kylin_order_ticket_relations as r ON o.order_tickets_id=r.order_id
where r.agent_id=#{agentId} and s.pay_status='1' GROUP BY r.performance_id)
as ss ,kylin_performances kp where ss.performanceId=kp.performances_id
</select> </select>
<select id="getUserOrder" parameterType="String" resultType="java.util.Map"> <select id="getUserOrder" parameterType="String" resultType="java.util.Map">
select p.title as 'title',p.performances_id as 'yanchuId' from kylin_performances p ,kylin_performance_status s select p.title as 'title',p.performances_id as 'yanchuId' from kylin_performances p ,kylin_performance_status s
......
package com.liquidnet.service.platform.service.impl.smile; package com.liquidnet.service.platform.service.impl.smile;
import com.liquidnet.common.cache.redis.util.RedisSmileUtil; import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil;
import com.liquidnet.commons.lang.util.StringUtil; import com.liquidnet.commons.lang.util.StringUtil;
import com.liquidnet.service.goblin.constant.SmileRedisConst; import com.liquidnet.service.goblin.constant.SmileRedisConst;
import com.liquidnet.service.goblin.dto.vo.CommissionVO; import com.liquidnet.service.goblin.dto.vo.CommissionVO;
...@@ -20,7 +20,7 @@ import org.springframework.data.mongodb.core.query.Query; ...@@ -20,7 +20,7 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate; import java.sql.Date;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -38,7 +38,7 @@ import java.util.Map; ...@@ -38,7 +38,7 @@ import java.util.Map;
@Slf4j @Slf4j
public class SellDataInfoImpl { public class SellDataInfoImpl {
@Autowired @Autowired
RedisSmileUtil redisSmileUtil; RedisDataSourceUtil redisDataSourceUtil;
@Autowired @Autowired
SmileUserMapper smileUserMapper; SmileUserMapper smileUserMapper;
@Autowired @Autowired
...@@ -90,7 +90,7 @@ public class SellDataInfoImpl { ...@@ -90,7 +90,7 @@ public class SellDataInfoImpl {
sellDataVO.setTotalCommission(new BigDecimal(allDate.get("commiss")==null?"0":allDate.get("commiss").toString())); sellDataVO.setTotalCommission(new BigDecimal(allDate.get("commiss")==null?"0":allDate.get("commiss").toString()));
sellDataVO.setSellDataOneVO(listSellDataOneVo); sellDataVO.setSellDataOneVO(listSellDataOneVo);
//redis 里面放入 //redis 里面放入
redisSmileUtil.set(SmileRedisConst.SELL_DATA.concat(smileUser.getUid()).concat(performanceId),sellDataVO); redisDataSourceUtil.getRedisSweetUtil().set(SmileRedisConst.SELL_DATA.concat(smileUser.getUid()).concat(performanceId),sellDataVO);
if(mongoTemplate.exists(Query.query(Criteria.where("sellDataId").is(sellDataVO.getSellDataId())), SellDataVO.class, SellDataVO.class.getSimpleName())){ if(mongoTemplate.exists(Query.query(Criteria.where("sellDataId").is(sellDataVO.getSellDataId())), SellDataVO.class, SellDataVO.class.getSimpleName())){
mongoTemplate.remove(Query.query(Criteria.where("sellDataId").is(sellDataVO.getSellDataId())), SellDataVO.class, SellDataVO.class.getSimpleName()); mongoTemplate.remove(Query.query(Criteria.where("sellDataId").is(sellDataVO.getSellDataId())), SellDataVO.class, SellDataVO.class.getSimpleName());
} }
...@@ -131,13 +131,13 @@ public class SellDataInfoImpl { ...@@ -131,13 +131,13 @@ public class SellDataInfoImpl {
for(Map a: userPerformanceList){ for(Map a: userPerformanceList){
//取出id 查看是否结算 //取出id 查看是否结算
String performanceId= a.get("performanceId")==null?"":a.get("performanceId").toString(); String performanceId= a.get("performanceId")==null?"":a.get("performanceId").toString();
if(redisSmileUtil.hasKey(SmileRedisConst.SELL_SHOW_PAYMENT.concat(performanceId).concat(smileUser.getUid()))){ if(redisDataSourceUtil.getRedisSweetUtil().hasKey(SmileRedisConst.SELL_SHOW_PAYMENT.concat(performanceId).concat(smileUser.getUid()))){
//已结算(已完成) //已结算(已完成)
a.put("status","3"); a.put("status","3");
}else{ }else{
LocalDate timeEnd= (LocalDate) a.get("timeEnd"); java.sql.Timestamp timeEnd= (java.sql.Timestamp) a.get("timeEnd");
if(null!=timeEnd){ if(null!=timeEnd){
if(timeEnd.isAfter(LocalDate.now())){ if(timeEnd.after(new Date(System.currentTimeMillis()))){
//待入账(项目未结束) //待入账(项目未结束)
a.put("status","1"); a.put("status","1");
daiRuZhang=daiRuZhang.add(a.get("commiss")==null?new BigDecimal(0):new BigDecimal(a.get("commiss").toString())); daiRuZhang=daiRuZhang.add(a.get("commiss")==null?new BigDecimal(0):new BigDecimal(a.get("commiss").toString()));
...@@ -155,8 +155,8 @@ public class SellDataInfoImpl { ...@@ -155,8 +155,8 @@ public class SellDataInfoImpl {
//待入账 //待入账
commissionVO.setDaiRuZhang(daiRuZhang); commissionVO.setDaiRuZhang(daiRuZhang);
commissionVO.setKeJieSuan(keJieSuan); commissionVO.setKeJieSuan(keJieSuan);
commissionVO.setZongYingShou((BigDecimal) redisSmileUtil.get(SmileRedisConst.SELL_USER_REVENUE.concat(smileUser.getUid()))); commissionVO.setZongYingShou((BigDecimal) redisDataSourceUtil.getRedisSweetUtil().get(SmileRedisConst.SELL_USER_REVENUE.concat(smileUser.getUid())));
redisSmileUtil.set(SmileRedisConst.SELL_DATA_COMMISSION.concat(smileUser.getUid()),commissionVO); redisDataSourceUtil.getRedisSweetUtil().set(SmileRedisConst.SELL_DATA_COMMISSION.concat(smileUser.getUid()),commissionVO);
} }
} }
} }
......
...@@ -174,7 +174,8 @@ public class SmileUserController { ...@@ -174,7 +174,8 @@ public class SmileUserController {
@ApiOperation("获取佣金明细") @ApiOperation("获取佣金明细")
public ResponseDto<CommissionVO> getCommission() { public ResponseDto<CommissionVO> getCommission() {
String userId = CurrentUtil.getCurrentUid(); String userId = CurrentUtil.getCurrentUid();
CommissionVO commissionVO= (CommissionVO) redisUtil.get(SmileRedisConst.SELL_USER_REVENUE.concat(userId)); userId="953190108752281604111893";
CommissionVO commissionVO= (CommissionVO) redisUtil.get(SmileRedisConst.SELL_DATA_COMMISSION.concat(userId));
return ResponseDto.success(commissionVO); return ResponseDto.success(commissionVO);
} }
......
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