推广部分最后修改

This commit is contained in:
liuyingfang
2023-07-27 09:53:50 +08:00
parent 817223d79f
commit 9e5aca8d74
10 changed files with 260 additions and 59 deletions

View File

@@ -58,7 +58,7 @@ public class MainPageController {
/** /**
* 团队管理 * 团队管理
* @param name * @param name
* @param page * @param current
* @param size * @param size
* @param typeCode * @param typeCode
* @return * @return

View File

@@ -258,14 +258,14 @@ public class MerchantProfitController {
@GetMapping("/profitOrderList") @GetMapping("/profitOrderList")
public Result<List<ProfitOrderVO>> ProfitOrderList(@RequestParam Integer type, @RequestParam Integer page, public Result<List<ProfitOrderVO>> ProfitOrderList(@RequestParam Integer type, @RequestParam Integer page,
@RequestParam Integer size){ @RequestParam Integer size, String startTime, String endTime){
UserApp userApp = userAppService.queryUserAppByToken(); UserApp userApp = userAppService.queryUserAppByToken();
Integer pageSize = size; Integer pageSize = size;
Integer offset = (page-1) * size; Integer offset = (page-1) * size;
if (type == 1) { if (type == 1) {
return ResultGenerator.genSuccessResult(merchantProfitMapper.directlyOrder(userApp.getUserId(), pageSize, offset)); return ResultGenerator.genSuccessResult(merchantProfitMapper.directlyOrder(userApp.getUserId(), pageSize, offset, startTime, endTime));
} }
return ResultGenerator.genSuccessResult(merchantProfitMapper.teamOrder(userApp.getUserId(), pageSize, offset)); return ResultGenerator.genSuccessResult(merchantProfitMapper.teamOrder(userApp.getUserId(), pageSize, offset, startTime, endTime));
} }
} }

View File

@@ -5,6 +5,7 @@ import cn.pluss.platform.dto.MerchantFeeDTO;
import cn.pluss.platform.entity.MerchantChannelStatus; import cn.pluss.platform.entity.MerchantChannelStatus;
import cn.pluss.platform.entity.MerchantProfit; import cn.pluss.platform.entity.MerchantProfit;
import cn.pluss.platform.vo.DeviceGoodsVO; import cn.pluss.platform.vo.DeviceGoodsVO;
import cn.pluss.platform.vo.MerChannelStatusVO;
import cn.pluss.platform.vo.MerchantProfitVO; import cn.pluss.platform.vo.MerchantProfitVO;
import cn.pluss.platform.vo.ProfitOrderVO; import cn.pluss.platform.vo.ProfitOrderVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -32,6 +33,7 @@ public interface MerchantProfitMapper extends BaseMapper<MerchantProfit> {
List<MerchantProfit> queryMerchantProfitPage(Map map); List<MerchantProfit> queryMerchantProfitPage(Map map);
Integer queryMerchantProfitPageCount(Map map); Integer queryMerchantProfitPageCount(Map map);
Integer queryMerchantProfitPageCountV2(@Param("userId") String userId);
void saveMerchantProfitBatch(List<MerchantProfit> merchantProfitList); void saveMerchantProfitBatch(List<MerchantProfit> merchantProfitList);
@@ -118,7 +120,12 @@ public interface MerchantProfitMapper extends BaseMapper<MerchantProfit> {
BigDecimal getConsumeFeeTeamToday(@Param("userId") String userId); BigDecimal getConsumeFeeTeamToday(@Param("userId") String userId);
List<MerchantProfitVO> getTeamList(@Param("typeCode") String typeCode, @Param("userId") Long userId, List<MerchantProfitVO> getTeamList(@Param("typeCode") String typeCode, @Param("userId") Long userId,
@Param("userName") String userName); @Param("userName") String userName, @Param("pageSize") Integer pageSize,
@Param("offset") Integer offset);
List<MerchantProfitVO> getMerchantTeamList(@Param("typeCode") String typeCode, @Param("userId") Long userId,
@Param("userName") String userName, @Param("pageSize") Integer pageSize,
@Param("offset") Integer offset);
@Select("SELECT\n" + @Select("SELECT\n" +
"\tcount(*) \n" + "\tcount(*) \n" +
@@ -128,8 +135,9 @@ public interface MerchantProfitMapper extends BaseMapper<MerchantProfit> {
"\tparent_user_id = #{userId}\n" + "\tparent_user_id = #{userId}\n" +
"\tAND type_code = #{typeCode}") "\tAND type_code = #{typeCode}")
Integer getCountChild( @Param("userId") Long userId,@Param("typeCode") String typeCod); Integer getCountChild( @Param("userId") Long userId,@Param("typeCode") String typeCod);
Integer getCountChildV2( @Param("userId") Long userId);
List<MerchantChannelStatus> getChannelStatus(@Param("merchantCode") String merchantCode); List<MerChannelStatusVO> getChannelStatus(@Param("merchantCode") String merchantCode);
/** /**
* 直属交易 * 直属交易
@@ -138,10 +146,12 @@ public interface MerchantProfitMapper extends BaseMapper<MerchantProfit> {
* @param offset * @param offset
* @return * @return
*/ */
List<ProfitOrderVO> directlyOrder(@Param("userId") Long userId,@Param("pageSize") Integer pageSize,@Param("offset") Integer offset); List<ProfitOrderVO> directlyOrder(@Param("userId") Long userId,@Param("pageSize") Integer pageSize,@Param("offset") Integer offset,
@Param("startTime") String startTime, @Param("endTime") String endTime);
/** /**
* 团队交易 * 团队交易
*/ */
List<ProfitOrderVO> teamOrder(@Param("userId") Long userId,@Param("pageSize") Integer pageSize,@Param("offset") Integer offset); List<ProfitOrderVO> teamOrder(@Param("userId") Long userId,@Param("pageSize") Integer pageSize,@Param("offset") Integer offset,
@Param("startTime") String startTime, @Param("endTime") String endTime);
} }

View File

@@ -880,7 +880,8 @@
LEFT JOIN tb_pluss_merchant_base_info b ON b.userId = p.user_id LEFT JOIN tb_pluss_merchant_base_info b ON b.userId = p.user_id
LEFT JOIN tb_pluss_merchant_order v ON v.merchantCode = b.merchantCode LEFT JOIN tb_pluss_merchant_order v ON v.merchantCode = b.merchantCode
WHERE WHERE
FIND_IN_SET( p.user_id, ID._ids ) b.userId != #{userId}
AND FIND_IN_SET( p.user_id, ID._ids )
AND v.status = 1 AND v.status = 1
</select> </select>
<select id="getConsumeFeeTeamToday" resultType="java.math.BigDecimal"> <select id="getConsumeFeeTeamToday" resultType="java.math.BigDecimal">
@@ -925,14 +926,65 @@
AND ua.userName = #{userName} AND ua.userName = #{userName}
</if> </if>
order by ua.userId DESC order by ua.userId DESC
LIMIT #{pageSize} OFFSET #{offset}
</select> </select>
<select id="getChannelStatus" resultType="cn.pluss.platform.entity.MerchantChannelStatus">
<select id="getMerchantTeamList" resultType="cn.pluss.platform.vo.MerchantProfitVO">
SELECT
p.user_id AS id,
u.loginName AS phone,
ua.userName,
pr.createTime AS createDt,
p.parent_user_id,
pr.trueName AS parentTrueName,
p.type_code,
IFNULL( k.sumConsumeFee, 0 ) AS consumeFee,
IFNULL( k.yestedayConsumeFee, 0 ) AS yestedayConsumeFee,
IFNULL(n.num,0) as countNum,
k.merchantCode
FROM
(
SELECT
@ids AS _ids,
( SELECT @ids := GROUP_CONCAT( user_id ) FROM tb_pluss_user_promotion WHERE FIND_IN_SET( parent_user_id, @ids ) ) AS cids,
@l := @l + 1 AS LEVEL
FROM
tb_pluss_user_promotion,
( SELECT @ids := #{userId}, @l := 0 ) b
WHERE @ids IS NOT NULL ) ID,
tb_pluss_user_promotion p
LEFT JOIN tb_pluss_user_info u ON p.user_id = u.id
LEFT JOIN tb_pluss_user_info pr ON p.parent_user_id = pr.id
left join view_order_user_num n on p.user_id=n.userId
LEFT JOIN tb_pluss_user_app ua ON n.userId = ua.userId
LEFT JOIN (
SELECT
i.userId,
i.merchantCode,
IFNULL( sum( i.sumConsumeFee ), 0 ) AS sumConsumeFee,
IFNULL( sum( i.yestedayConsumeFee ), 0 ) AS yestedayConsumeFee
FROM
view_order_info i
GROUP BY
i.userId
) k ON p.user_id = k.userId
WHERE
FIND_IN_SET( p.user_id, ID._ids )
AND p.user_id != #{userId}
<if test="userName != null and userName != ''">
AND u.trueName = #{userName}
</if>
ORDER BY
user_id
LIMIT #{pageSize} OFFSET #{offset}
</select>
<select id="getChannelStatus" resultType="cn.pluss.platform.vo.MerChannelStatusVO">
SELECT SELECT
`status`, authorizationStatus,remark,virChannelFlag `status`, authorizationStatus,remark,virChannelFlag
FROM FROM
tb_pluss_merchant_channel_status tb_pluss_merchant_channel_status
WHERE merchantCode = #{merchantCode} WHERE merchantCode = #{merchantCode}
AND virChannelFlag != 1
</select> </select>
<select id="directlyOrder" resultType="cn.pluss.platform.vo.ProfitOrderVO"> <select id="directlyOrder" resultType="cn.pluss.platform.vo.ProfitOrderVO">
SELECT SELECT
@@ -943,6 +995,12 @@
FROM FROM
view_base_order v view_base_order v
WHERE v.userId in (select p.user_id from tb_pluss_user_promotion p where p.parent_user_id= #{userId}) WHERE v.userId in (select p.user_id from tb_pluss_user_promotion p where p.parent_user_id= #{userId})
<if test="startTime != null">
AND v.createDt &gt;= #{startTime}
</if>
<if test="endTime != null">
AND v.createDt &lt;= #{endTime}
</if>
order by v.id desc order by v.id desc
limit #{pageSize} offset #{offset} limit #{pageSize} offset #{offset}
</select> </select>
@@ -978,8 +1036,80 @@
user_id user_id
) )
and v.userId!=#{userId} and v.userId!=#{userId}
<if test="startTime != null">
AND v.createDt &gt;= #{startTime}
</if>
<if test="endTime != null">
AND v.createDt &lt;= #{endTime}
</if>
ORDER BY ORDER BY
v.id desc v.id desc
limit #{pageSize} offset #{offset} limit #{pageSize} offset #{offset}
</select> </select>
<select id="queryMerchantProfitPageCountV2" resultType="java.lang.Integer">
SELECT
COUNT(v.userId)
FROM
view_base_order v
WHERE
v.userId IN (
SELECT
p.user_id
FROM
(
SELECT
@ids AS _ids,
( SELECT @ids := GROUP_CONCAT( user_id ) FROM tb_pluss_user_promotion WHERE FIND_IN_SET( parent_user_id, @ids ) ) AS cids,
@l := @l + 1 AS LEVEL
FROM
tb_pluss_user_promotion,
( SELECT @ids := #{userId}, @l := 0 ) b
WHERE
@ids IS NOT NULL
) ID,
tb_pluss_user_promotion p
WHERE
FIND_IN_SET( p.user_id, ID._ids )
ORDER BY
user_id
)
AND v.userId != #{userId}
ORDER BY
v.id DESC
</select>
<select id="getCountChildV2" resultType="java.lang.Integer">
SELECT
count(p.user_id)
FROM
(
SELECT
@ids AS _ids,
( SELECT @ids := GROUP_CONCAT( user_id ) FROM tb_pluss_user_promotion WHERE FIND_IN_SET( parent_user_id, @ids ) ) AS cids,
@l := @l + 1 AS LEVEL
FROM
tb_pluss_user_promotion,
( SELECT @ids := #{userId}, @l := 0 ) b
WHERE @ids IS NOT NULL ) ID,
tb_pluss_user_promotion p
LEFT JOIN tb_pluss_user_info u ON p.user_id = u.id
LEFT JOIN tb_pluss_user_info pr ON p.parent_user_id = pr.id
LEFT JOIN view_order_user_num n ON p.user_id = n.userId
LEFT JOIN tb_pluss_user_app ua ON n.userId = ua.userId
LEFT JOIN (
SELECT
i.userId,
i.merchantCode,
IFNULL( sum( i.sumConsumeFee ), 0 ) AS sumConsumeFee,
IFNULL( sum( i.yestedayConsumeFee ), 0 ) AS yestedayConsumeFee
FROM
view_order_info i
GROUP BY
i.userId
) k ON p.user_id = k.userId
WHERE
FIND_IN_SET( p.user_id, ID._ids )
AND p.user_id != #{userId}
ORDER BY
user_id
</select>
</mapper> </mapper>

View File

@@ -1674,6 +1674,7 @@
LEFT JOIN tb_pluss_user_promotion up ON ua.userId = up.parent_user_id LEFT JOIN tb_pluss_user_promotion up ON ua.userId = up.parent_user_id
WHERE WHERE
up.parent_user_id = #{userId} up.parent_user_id = #{userId}
AND up.type_code = 'MC'
AND up.create_time <![CDATA[ >= ]]> #{startTime} AND up.create_time <![CDATA[ >= ]]> #{startTime}
AND up.create_time <![CDATA[ <= ]]> #{endTime} AND up.create_time <![CDATA[ <= ]]> #{endTime}
</select> </select>

View File

@@ -48,7 +48,7 @@ public class ActivityActivateController extends BaseNoModelController {
/** /**
* 引导页 * 引导页
* *
* @return * @return
*/ */
@RequestMapping(value = "/index", method = RequestMethod.GET) @RequestMapping(value = "/index", method = RequestMethod.GET)
@@ -64,7 +64,7 @@ public class ActivityActivateController extends BaseNoModelController {
@RequestMapping(value = "/queryActivityActivateByPage", method = RequestMethod.POST) @RequestMapping(value = "/queryActivityActivateByPage", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public Map<String, Object> queryActivityActivateByPage(@RequestParam(defaultValue = "1") Integer currPage, public Map<String, Object> queryActivityActivateByPage(@RequestParam(defaultValue = "1") Integer currPage,
String name) { String name) {
Map<String, Object> map = new HashMap<>(16); Map<String, Object> map = new HashMap<>(16);
Map<String, Object> result = new HashMap<>(16); Map<String, Object> result = new HashMap<>(16);
Boolean bol = verifyUserRole(); Boolean bol = verifyUserRole();
@@ -182,7 +182,7 @@ public class ActivityActivateController extends BaseNoModelController {
/** /**
* 保存对象 * 保存对象
* *
* @throws IOException * @throws IOException
*/ */
@RequestMapping(value = "/saveActivityActivate", method = RequestMethod.POST) @RequestMapping(value = "/saveActivityActivate", method = RequestMethod.POST)
@@ -238,7 +238,7 @@ public class ActivityActivateController extends BaseNoModelController {
/** /**
* 修改对象 * 修改对象
* *
* @throws IOException * @throws IOException
*/ */
@RequestMapping(value = "/updateActivityActivate", method = RequestMethod.POST) @RequestMapping(value = "/updateActivityActivate", method = RequestMethod.POST)
@@ -256,7 +256,7 @@ public class ActivityActivateController extends BaseNoModelController {
/** /**
* 删除对象 * 删除对象
* *
* @throws IOException * @throws IOException
*/ */
@RequestMapping(value = "/deleteActivityActivate", method = RequestMethod.POST) @RequestMapping(value = "/deleteActivityActivate", method = RequestMethod.POST)
@@ -298,5 +298,4 @@ public class ActivityActivateController extends BaseNoModelController {
List<MerchantBaseInfo> merchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(null); List<MerchantBaseInfo> merchantBaseInfoList = merchantBaseInfoService.queryMerchantBaseInfoList(null);
request.setAttribute("merchantBaseInfoList", merchantBaseInfoList); request.setAttribute("merchantBaseInfoList", merchantBaseInfoList);
} }
} }

View File

@@ -1,9 +1,12 @@
package cn.pluss.platform.vo; package cn.pluss.platform.vo;
import cn.pluss.platform.entity.MerchantChannelStatus; import cn.pluss.platform.entity.MerchantChannelStatus;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@@ -25,6 +28,10 @@ public class MerchantProfitVO {
* userId * userId
*/ */
private String userId; private String userId;
/**
* parent_user_id
*/
private Integer parent_user_id;
/** /**
*总交易金额 *总交易金额
*/ */
@@ -49,12 +56,14 @@ public class MerchantProfitVO {
/** /**
* 入网时间 * 入网时间
*/ */
private String createDt; @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createDt;
private List<MerChannelStatusVO> channelStatus;
private String statusD1 = "0"; private String statusD1 = "0";
private String statusD0 = "0"; private String statusD0 = "0";
private String authorizationStatus = "0"; private String authorizationStatus = "0";
private String remarkD1; private String remarkD1;
private String remarkD0; private String remarkD0;
} }

View File

@@ -1,8 +1,11 @@
package cn.pluss.platform.vo; package cn.pluss.platform.vo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* 直推间推商户收款 * 直推间推商户收款
@@ -14,7 +17,9 @@ public class ProfitOrderVO {
private String merchantName; private String merchantName;
private BigDecimal consumeFee; private BigDecimal consumeFee;
private String transDt; @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date transDt;
private String orderNumber; private String orderNumber;
} }

View File

@@ -88,7 +88,7 @@ public class PromoterMainPageServiceImpl implements MainPageService {
//今日收款笔数 //今日收款笔数
queryMap.put("recordDate", DateUtils.getDayBegin()); queryMap.put("recordDate", DateUtils.getDayBegin());
queryMap.put("retype", "1"); queryMap.put("retype", "1");
totalOrderCount = merchantProfitService.queryMerchantProfitPageCount(queryMap); totalOrderCount = merchantProfitMapper.queryMerchantProfitPageCountV2(userId);
todayProfit = merchantProfitService.queryMerchantProfitSumPrice(queryMap); todayProfit = merchantProfitService.queryMerchantProfitSumPrice(queryMap);
//今日收益 //今日收益
BigDecimal todaySum = merchantProfitMapper.getTodaySum(userId); BigDecimal todaySum = merchantProfitMapper.getTodaySum(userId);
@@ -102,7 +102,7 @@ public class PromoterMainPageServiceImpl implements MainPageService {
//今日收款 //今日收款
BigDecimal consumeFeeTeamToday = merchantProfitMapper.getConsumeFeeTeamToday(userId); BigDecimal consumeFeeTeamToday = merchantProfitMapper.getConsumeFeeTeamToday(userId);
//总商户数 //总商户数
Integer countChildAll = merchantProfitMapper.getCountChild(Long.valueOf(userId), "MC"); Integer countChildAll = merchantProfitMapper.getCountChildV2(Long.valueOf(userId));
resultMap.put("promoteFee", promoteFee + ""); resultMap.put("promoteFee", promoteFee + "");
resultMap.put("totalOrderCount", totalOrderCount + ""); resultMap.put("totalOrderCount", totalOrderCount + "");

View File

@@ -1,14 +1,15 @@
package cn.pluss.platform.merchantProfit.impl; package cn.pluss.platform.merchantProfit.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.pluss.platform.api.PageInfo;
import cn.pluss.platform.constants.Constant; import cn.pluss.platform.constants.Constant;
import cn.pluss.platform.entity.*; import cn.pluss.platform.entity.*;
import cn.pluss.platform.enums.BstLevelCode; import cn.pluss.platform.enums.BstLevelCode;
import cn.pluss.platform.enums.UserRoleEnum; import cn.pluss.platform.enums.UserRoleEnum;
import cn.pluss.platform.exception.MsgException; import cn.pluss.platform.exception.MsgException;
import cn.pluss.platform.mapper.*; import cn.pluss.platform.mapper.MerchantOrderMapper;
import cn.pluss.platform.merchant.MerchantRateNewService; import cn.pluss.platform.mapper.MerchantProfitMapper;
import cn.pluss.platform.mapper.UserAppMapper;
import cn.pluss.platform.mapper.UserPromotionMapper;
import cn.pluss.platform.merchantProfit.MerchantProfitService; import cn.pluss.platform.merchantProfit.MerchantProfitService;
import cn.pluss.platform.notice.NoticeService; import cn.pluss.platform.notice.NoticeService;
import cn.pluss.platform.user.UserLevelService; import cn.pluss.platform.user.UserLevelService;
@@ -16,14 +17,11 @@ import cn.pluss.platform.user.impl.GeneralPushUtil;
import cn.pluss.platform.userAssess.UserAssessService; import cn.pluss.platform.userAssess.UserAssessService;
import cn.pluss.platform.userRewardFlow.UserRewardFlowService; import cn.pluss.platform.userRewardFlow.UserRewardFlowService;
import cn.pluss.platform.util.DateUtils; import cn.pluss.platform.util.DateUtils;
import cn.pluss.platform.util.StringUtil; import cn.pluss.platform.vo.MerChannelStatusVO;
import cn.pluss.platform.vo.MerchantProfitVO; import cn.pluss.platform.vo.MerchantProfitVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -31,7 +29,6 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Service @Service
@@ -110,7 +107,6 @@ public class MerchantProfitServiceImpl extends ServiceImpl<MerchantProfitMapper,
@Override @Override
public Map<String, Object> teamList(String typeCode, Long userId,Integer page,Integer size, public Map<String, Object> teamList(String typeCode, Long userId,Integer page,Integer size,
String name) { String name) {
page = page-1;
switch (typeCode){ switch (typeCode){
case "AG": case "AG":
typeCode = "FB"; typeCode = "FB";
@@ -127,53 +123,104 @@ public class MerchantProfitServiceImpl extends ServiceImpl<MerchantProfitMapper,
throw new MsgException("身份错误"); throw new MsgException("身份错误");
} }
// PageInfo<MerchantProfitVO> teamList= merchantProfitMapper.getTeamList(typeCode, userId, page,size,name); // PageInfo<MerchantProfitVO> teamList= merchantProfitMapper.getTeamList(typeCode, userId, page,size,name);
Integer countChild = merchantProfitMapper.getCountChild(userId, typeCode); Integer countChild = merchantProfitMapper.getCountChild(userId, typeCode);
Integer pagerSize = size;
Integer offset = (page - 1) * size;
//商户列表 //商户列表
if ("MC".equals(typeCode)) { if ("MC".equals(typeCode)) {
List<MerchantProfitVO> teamList = merchantProfitMapper.getTeamList(typeCode, userId,name); List<MerchantProfitVO> teamList = merchantProfitMapper.getMerchantTeamList(typeCode, userId, name, pagerSize, offset);
for (MerchantProfitVO values : teamList) { for (MerchantProfitVO values : teamList) {
List<MerChannelStatusVO> list = new ArrayList<>();
if (values.getMerchantCode() != null) { if (values.getMerchantCode() != null) {
String merchantCode = values.getMerchantCode(); MerChannelStatusVO V0 = new MerChannelStatusVO();
List<MerchantChannelStatus> channelStatus = merchantProfitMapper.getChannelStatus(merchantCode); V0.setStatus("1");
if (channelStatus != null) { V0.setVirChannelFlag("D1");
for (MerchantChannelStatus valuesStatus : channelStatus) { V0.setAuthorizationStatus("0");
if ("D1".equals(valuesStatus.getVirChannelFlag())) { V0.setRemark("");
values.setStatusD1(valuesStatus.getStatus()); list.add(V0);
values.setRemarkD1(valuesStatus.getStatus()); MerChannelStatusVO V1 = new MerChannelStatusVO();
values.setAuthorizationStatus(valuesStatus.getAuthorizationStatus()); V1.setStatus("1");
} V1.setVirChannelFlag("D0");
if ("D0".equals(valuesStatus.getVirChannelFlag())) { V1.setAuthorizationStatus("0");
values.setStatusD0(valuesStatus.getStatus()); V1.setRemark("");
values.setRemarkD0(valuesStatus.getStatus()); list.add(V1);
} values.setChannelStatus(list);
} continue;
}
Integer countUser = mapperOrderMapper.getCountUser(Long.valueOf(values.getUserId()));
if (countUser > 0) {
values.setCountNum(countUser);
values.setConsumeFee(mapperOrderMapper.getAmountData(values.getMerchantCode()));
values.setYestedayConsumeFee(mapperOrderMapper.getPlatformAmtYestday(values.getMerchantCode(),
DateUtils.getBeginDayOfYesterday(), DateUtils.getEndDayOfYesterDay()));
}
} }
} String merchantCode = values.getMerchantCode();
List<MerChannelStatusVO> channelStatus = merchantProfitMapper.getChannelStatus(merchantCode);
//没有
if (ObjectUtil.isEmpty(channelStatus) || channelStatus.size() <= 0) {
MerChannelStatusVO V0 = new MerChannelStatusVO();
V0.setStatus("1");
V0.setVirChannelFlag("D1");
V0.setAuthorizationStatus("0");
V0.setRemark("");
list.add(V0);
MerChannelStatusVO V1 = new MerChannelStatusVO();
V1.setStatus("1");
V1.setVirChannelFlag("D0");
V1.setAuthorizationStatus("0");
V1.setRemark("");
list.add(V1);
values.setChannelStatus(list);
continue;
}
//一个
if (channelStatus.size() == 1) {
MerChannelStatusVO channelStatus1 = channelStatus.get(0);
switch (channelStatus1.getVirChannelFlag()) {
case "D0":
list.add(channelStatus1);
MerChannelStatusVO V1 = new MerChannelStatusVO();
V1.setStatus("1");
V1.setVirChannelFlag("D1");
V1.setAuthorizationStatus("0");
V1.setRemark("");
list.add(V1);
values.setChannelStatus(list);
break;
case "D1":
list.add(channelStatus1);
MerChannelStatusVO V0 = new MerChannelStatusVO();
V0.setStatus("1");
V0.setVirChannelFlag("D0");
V0.setAuthorizationStatus("0");
V0.setRemark("");
list.add(V0);
values.setChannelStatus(list);
break;
teamList = teamList.stream().skip(page * size).limit(size).collect(Collectors.toList()); }
continue;
}
//两个
if (channelStatus.size() == 2) {
values.setChannelStatus(channelStatus);
continue;
}
// Integer countUser = mapperOrderMapper.getCountUser(Long.valueOf(values.getUserId()));
// if (countUser > 0) {
// values.setCountNum(countUser);
// values.setConsumeFee(mapperOrderMapper.getAmountData(values.getMerchantCode()));
// values.setYestedayConsumeFee(mapperOrderMapper.getPlatformAmtYestday(values.getMerchantCode(),
// DateUtils.getBeginDayOfYesterday(), DateUtils.getEndDayOfYesterDay()));
// }
}
HashMap<String, Object> hashMap = new HashMap<>(); HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("total", countChild); hashMap.put("total", countChild);
hashMap.put("teamList", teamList); hashMap.put("teamList", teamList);
return hashMap; return hashMap;
} }
//团队管理 //团队管理
List<MerchantProfitVO> teamList = merchantProfitMapper.getTeamList(typeCode, userId,name); List<MerchantProfitVO> teamList = merchantProfitMapper.getTeamList(typeCode, userId, name, pagerSize, offset);
for (MerchantProfitVO values : teamList) { for (MerchantProfitVO values : teamList) {
values.setCurrentMonth(mapperOrderMapper.getPlatformAmtYestday(values.getMerchantCode(), values.setCurrentMonth(mapperOrderMapper.getPlatformAmtYestday(values.getMerchantCode(),
DateUtils.getBeginDayOfMonth(), DateUtils.getEndDayOfMonth())); DateUtils.getBeginDayOfMonth(), DateUtils.getEndDayOfMonth()));
values.setConsumeFee(mapperOrderMapper.getAmountData(values.getMerchantCode())); values.setConsumeFee(mapperOrderMapper.getAmountData(values.getMerchantCode()));
} }
teamList = teamList.stream().skip(page * size).limit(size).collect(Collectors.toList());
HashMap<String, Object> hashMap = new HashMap<>(); HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("total", countChild); hashMap.put("total", countChild);
hashMap.put("teamList", teamList); hashMap.put("teamList", teamList);