提现列表,创客相关
This commit is contained in:
@@ -46,13 +46,13 @@ public class CashController {
|
|||||||
@ApiImplicitParam(name = "type", value = "提现类型 0粉丝分润 1推广分润 99其他 ", paramType = "type", dataType = "Integer", required = true),
|
@ApiImplicitParam(name = "type", value = "提现类型 0粉丝分润 1推广分润 99其他 ", paramType = "type", dataType = "Integer", required = true),
|
||||||
@ApiImplicitParam(name = "status", value = "提现状态 0 申请提现 1 提现成功 2 提现失败", paramType = "status", dataType = "Integer"),
|
@ApiImplicitParam(name = "status", value = "提现状态 0 申请提现 1 提现成功 2 提现失败", paramType = "status", dataType = "Integer"),
|
||||||
@ApiImplicitParam(name = "merchantCode", value = "商家Code", paramType = "merchantCode", dataType = "String", required = true), })
|
@ApiImplicitParam(name = "merchantCode", value = "商家Code", paramType = "merchantCode", dataType = "String", required = true), })
|
||||||
public Result<PageInfo<Cash>> list(@RequestParam(defaultValue = "1") Integer page,
|
public Result<PageInfo<Cash>> list(@RequestParam(defaultValue = "1") Integer offset,
|
||||||
@RequestParam(defaultValue = "10") Integer size, Integer type, Integer status, String merchantCode,
|
@RequestParam(defaultValue = "10") Integer pageSize, Integer type, Integer status, String merchantCode,
|
||||||
String userId) {
|
String userId) {
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("pageSize", size);
|
map.put("pageSize", pageSize);
|
||||||
map.put("offset", (page - 1) * size);
|
map.put("offset", (offset - 1) * pageSize);
|
||||||
map.put("status",status);
|
map.put("status",status);
|
||||||
if (StringUtil.isEmpty(userId)) {
|
if (StringUtil.isEmpty(userId)) {
|
||||||
return ResultGenerator.genFailResult("无用户id");
|
return ResultGenerator.genFailResult("无用户id");
|
||||||
@@ -63,8 +63,8 @@ public class CashController {
|
|||||||
List<Cash> cashList = cashService.queryCashPage(map);
|
List<Cash> cashList = cashService.queryCashPage(map);
|
||||||
Integer count = cashService.queryCashPageCount(map);
|
Integer count = cashService.queryCashPageCount(map);
|
||||||
// 返回参数
|
// 返回参数
|
||||||
PageInfo<Cash> pageInfo = new PageInfo<>(count.longValue(), (long) StringUtil.getPageCount(count, size),
|
PageInfo<Cash> pageInfo = new PageInfo<>(count.longValue(), (long) StringUtil.getPageCount(count, pageSize),
|
||||||
page.longValue(), size.longValue(), cashList);
|
offset.longValue(), pageSize.longValue(), cashList);
|
||||||
return ResultGenerator.genSuccessResult(pageInfo);
|
return ResultGenerator.genSuccessResult(pageInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,12 +42,10 @@ public class MainPageController {
|
|||||||
public Result<?> getSpreadData() {
|
public Result<?> getSpreadData() {
|
||||||
UserApp userApp = userAppService.queryUserAppByToken();
|
UserApp userApp = userAppService.queryUserAppByToken();
|
||||||
Map<String, Object> resultMap;
|
Map<String, Object> resultMap;
|
||||||
|
|
||||||
resultMap = promoterMainPageService.getSpreadData(userApp.getUserId() + "");
|
resultMap = promoterMainPageService.getSpreadData(userApp.getUserId() + "");
|
||||||
|
|
||||||
return ResultGenerator.genSuccessResult(resultMap);
|
return ResultGenerator.genSuccessResult(resultMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/userApp/modifyFee")
|
@GetMapping("/userApp/modifyFee")
|
||||||
public Result<Object> modifyFee(@RequestParam("id") Integer id, @RequestParam("fee") BigDecimal fee){
|
public Result<Object> modifyFee(@RequestParam("id") Integer id, @RequestParam("fee") BigDecimal fee){
|
||||||
UserApp result = userAppService.queryUserBaseInfoByToken();
|
UserApp result = userAppService.queryUserBaseInfoByToken();
|
||||||
@@ -74,4 +72,23 @@ public class MainPageController {
|
|||||||
return ResultGenerator.genSuccessResult(merchantProfitVOS);
|
return ResultGenerator.genSuccessResult(merchantProfitVOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创客团队管理
|
||||||
|
* @param name
|
||||||
|
* @param current
|
||||||
|
* @param size
|
||||||
|
* @param typeCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/userApp/teamQuotaControl")
|
||||||
|
public Result<Object> teamQuotaControl(String name,
|
||||||
|
@RequestParam(defaultValue = "1") Integer current,
|
||||||
|
@RequestParam(defaultValue = "10") Integer size,
|
||||||
|
@RequestParam("typeCode") String typeCode){
|
||||||
|
UserApp result = userAppService.queryUserBaseInfoByToken();
|
||||||
|
Map<String, Object> merchantProfitVOS = merchantProfitService.teamQuotaList(typeCode, result.getUserId(),
|
||||||
|
current,size,name);
|
||||||
|
return ResultGenerator.genSuccessResult(merchantProfitVOS);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +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);
|
Integer queryMerchantProfitPageCountV2(@Param("userId") String userId, @Param("startTime") Date startTime,@Param("endTime") Date endTime);
|
||||||
|
|
||||||
void saveMerchantProfitBatch(List<MerchantProfit> merchantProfitList);
|
void saveMerchantProfitBatch(List<MerchantProfit> merchantProfitList);
|
||||||
|
|
||||||
@@ -135,6 +135,15 @@ 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);
|
||||||
|
@Select("SELECT\n" +
|
||||||
|
"\tcount(*) \n" +
|
||||||
|
"FROM\n" +
|
||||||
|
"\ttb_pluss_user_promotion \n" +
|
||||||
|
"WHERE\n" +
|
||||||
|
"\tparent_user_id = #{userId}\n" +
|
||||||
|
"\tAND type_code = #{typeCode}"+
|
||||||
|
"\tAND is_extend = '0'")
|
||||||
|
Integer getCountQuotaChild( @Param("userId") Long userId,@Param("typeCode") String typeCod);
|
||||||
Integer getCountChildV2( @Param("userId") Long userId);
|
Integer getCountChildV2( @Param("userId") Long userId);
|
||||||
|
|
||||||
List<MerChannelStatusVO> getChannelStatus(@Param("merchantCode") String merchantCode);
|
List<MerChannelStatusVO> getChannelStatus(@Param("merchantCode") String merchantCode);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public interface UserMakerFlowMapper extends BaseMapper<UserMakerFlow> {
|
|||||||
"\tmf.id,\n" +
|
"\tmf.id,\n" +
|
||||||
"\tmf.biz_code AS bizCode,\n" +
|
"\tmf.biz_code AS bizCode,\n" +
|
||||||
"\tmf.biz_name AS bizName,\n" +
|
"\tmf.biz_name AS bizName,\n" +
|
||||||
"\tbi.alias AS userName,\n" +
|
"\tmo.merchantName AS userName,\n" +
|
||||||
"\tmf.amount AS lowerAmount,\n" +
|
"\tmf.amount AS lowerAmount,\n" +
|
||||||
"\tmf.create_time AS createTime,\n" +
|
"\tmf.create_time AS createTime,\n" +
|
||||||
"\tmo.consumeFee AS amount \n" +
|
"\tmo.consumeFee AS amount \n" +
|
||||||
|
|||||||
@@ -922,6 +922,7 @@
|
|||||||
WHERE
|
WHERE
|
||||||
up.parent_user_id = #{userId}
|
up.parent_user_id = #{userId}
|
||||||
AND up.type_code = #{typeCode}
|
AND up.type_code = #{typeCode}
|
||||||
|
AND up.is_extend ='0'
|
||||||
<if test="userName != null and userName != ''">
|
<if test="userName != null and userName != ''">
|
||||||
AND ua.userName = #{userName}
|
AND ua.userName = #{userName}
|
||||||
</if>
|
</if>
|
||||||
@@ -1074,6 +1075,7 @@
|
|||||||
user_id
|
user_id
|
||||||
)
|
)
|
||||||
AND v.userId != #{userId}
|
AND v.userId != #{userId}
|
||||||
|
AND v.transDt BETWEEN #{startTime} AND #{endTime}
|
||||||
ORDER BY
|
ORDER BY
|
||||||
v.id DESC
|
v.id DESC
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -18,5 +18,6 @@ public interface UserMakerQuotaService extends IService<UserMakerQuota> {
|
|||||||
|
|
||||||
void quotaInfo(MerchantOrder order);
|
void quotaInfo(MerchantOrder order);
|
||||||
|
|
||||||
|
|
||||||
List<UserMakerQuotaVO> quotaList(Integer page, Integer size,Integer type);
|
List<UserMakerQuotaVO> quotaList(Integer page, Integer size,Integer type);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import cn.pluss.platform.util.N;
|
|||||||
import cn.pluss.platform.vo.UserMakerQuotaVO;
|
import cn.pluss.platform.vo.UserMakerQuotaVO;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import io.swagger.models.auth.In;
|
import io.swagger.models.auth.In;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
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;
|
||||||
@@ -28,6 +29,7 @@ import java.util.*;
|
|||||||
* @author lyf
|
* @author lyf
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper, UserMakerQuota> implements UserMakerQuotaService {
|
public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper, UserMakerQuota> implements UserMakerQuotaService {
|
||||||
@Resource
|
@Resource
|
||||||
private UserMakerQuotaMapper userMakerQuotaMapper;
|
private UserMakerQuotaMapper userMakerQuotaMapper;
|
||||||
@@ -59,32 +61,8 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void quotaInfo(MerchantOrder order) {
|
public void quotaInfo(MerchantOrder order) {
|
||||||
BigDecimal consumeFee = new BigDecimal(String.valueOf(order.getConsumeFee()));
|
this.makerQuota(order);
|
||||||
//商户码转userId
|
|
||||||
if (consumeFee.compareTo(new BigDecimal("0.01"))>0) {
|
|
||||||
MerchantBaseInfo merchantBaseInfoByMerchantCode = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(order.getMerchantCode());
|
|
||||||
if(merchantBaseInfoByMerchantCode == null)
|
|
||||||
return;
|
|
||||||
//找到上级增加额度
|
|
||||||
UserPromotion userInfo = userPromotionMapper.selectByPrimaryKey(Long.valueOf(merchantBaseInfoByMerchantCode.getUserId()));
|
|
||||||
if (userInfo != null) {
|
|
||||||
UserPromotion userParent = userPromotionMapper.selectByUserIdMC(Long.valueOf(userInfo.getParentUserId()));
|
|
||||||
if (userParent != null && "1".equals(userParent.getIsExtend())){
|
|
||||||
BigDecimal profit = consumeFee.multiply(new BigDecimal("0.5")).setScale(2,BigDecimal.ROUND_DOWN);
|
|
||||||
String s = String.valueOf(userParent.getUserId());
|
|
||||||
Integer integer = Integer.valueOf(s);
|
|
||||||
this.modMakerFunds(integer,"SD","免费额度",profit,"",order.getOrderNumber());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//给自己计算
|
|
||||||
assert userInfo != null;
|
|
||||||
if ("1".equals(userInfo.getIsExtend())){
|
|
||||||
profit(userInfo,consumeFee,order);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -106,29 +84,74 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//增加额度
|
//增加额度
|
||||||
private void makerQuota(MerchantOrder order){
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
||||||
BigDecimal consumeFee = new BigDecimal(String.valueOf(order.getConsumeFee()));
|
public void makerQuota(MerchantOrder order){
|
||||||
//商户码转userId
|
|
||||||
if (consumeFee.compareTo(new BigDecimal("0.01"))>0) {
|
|
||||||
MerchantBaseInfo merchantBaseInfoByMerchantCode = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(order.getMerchantCode());
|
//查询自己是否为创客
|
||||||
UserPromotion userInfo = userPromotionMapper.selectByPrimaryKey(Long.valueOf(merchantBaseInfoByMerchantCode.getUserId()));
|
MerchantBaseInfo merchantBaseInfoByMerchantCode = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(order.getMerchantCode());
|
||||||
if (userInfo != null && "1".equals(userInfo.getIsExtend())){
|
if(ObjectUtil.isEmpty(merchantBaseInfoByMerchantCode)){
|
||||||
BigDecimal profit = consumeFee.multiply(new BigDecimal("0.0038")).setScale(2, RoundingMode.DOWN);
|
log.error("商户信息异常:{}",order.getOrderNumber());
|
||||||
String s = String.valueOf(userInfo.getUserId());
|
return;
|
||||||
Integer integer = Integer.valueOf(s);
|
|
||||||
this.modMakerFunds(integer,"SD","免费额度",profit,"",order.getOrderNumber());
|
|
||||||
}
|
|
||||||
if (userInfo != null) {
|
|
||||||
UserPromotion userParent = userPromotionMapper.selectByUserIdMC(Long.valueOf(userInfo.getParentUserId()));
|
|
||||||
if (userParent != null) {
|
|
||||||
UserMakerQuota userMakerQuota = new UserMakerQuota();
|
|
||||||
userMakerQuota.setUserId(userParent.getUserId());
|
|
||||||
userMakerQuota.setAmount(consumeFee.divide(new BigDecimal("2"),2,BigDecimal.ROUND_DOWN));
|
|
||||||
userMakerQuota.setCreateTime(new Date());
|
|
||||||
userMakerQuotaMapper.insert(userMakerQuota);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!"1".equals(merchantBaseInfoByMerchantCode.getMerchantType())){
|
||||||
|
log.error("商户并非小微商户:{},{}",merchantBaseInfoByMerchantCode.getMerchantCode(),merchantBaseInfoByMerchantCode.getMerchantType());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
UserPromotion userInfo = userPromotionMapper.selectByPrimaryKey(Long.valueOf(merchantBaseInfoByMerchantCode.getUserId()));
|
||||||
|
if(ObjectUtil.isEmpty(userInfo)){
|
||||||
|
log.error("用户所属关系不存在");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if("1".equals(userInfo.getIsExtend())){
|
||||||
|
UserMakerQuota userMakerQuota = userMakerQuotaMapper.selectByUserId(userInfo.getUserId().intValue());
|
||||||
|
if(ObjectUtil.isEmpty(userMakerQuota)){
|
||||||
|
log.error("当前额度为0,{},{},{}",order.getOrderNumber(),order.getConsumeFee(),userInfo.getUserId());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
BigDecimal havingBalance=userMakerQuota.getAmount().subtract(new BigDecimal(order.getConsumeFee())).setScale(2,BigDecimal.ROUND_DOWN);
|
||||||
|
if(havingBalance.compareTo(BigDecimal.ZERO)>=0){
|
||||||
|
BigDecimal profit=new BigDecimal(order.getConsumeFee()).multiply(new BigDecimal("0.0038")).setScale(2, BigDecimal.ROUND_DOWN);
|
||||||
|
BigDecimal bigDecimal = new BigDecimal(order.getConsumeFee().toString());
|
||||||
|
//提现金额
|
||||||
|
userAccountService.modFunds(userInfo.getUserId().intValue(), "LD", "增加收益", profit, "");
|
||||||
|
//额度改变
|
||||||
|
modMakerFunds(userInfo.getUserId().intValue(), "LD", "收款消耗", bigDecimal, "",order.getOrderNumber());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(havingBalance.compareTo(BigDecimal.ZERO)<0){
|
||||||
|
BigDecimal profit=userMakerQuota.getAmount().multiply(new BigDecimal("0.0038")).setScale(2, BigDecimal.ROUND_DOWN);
|
||||||
|
|
||||||
|
//提现金额
|
||||||
|
userAccountService.modFunds(userInfo.getUserId().intValue(), "LD", "增加收益", profit.abs().negate(), "");
|
||||||
|
modMakerFunds(userInfo.getUserId().intValue(), "LD", "收款消耗", userMakerQuota.getAmount().abs().negate(), "",order.getOrderNumber());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}else {
|
||||||
|
UserPromotion userParent = userPromotionMapper.selectByUserIdMC(Long.valueOf(userInfo.getParentUserId()));
|
||||||
|
if (userParent == null){
|
||||||
|
log.error("不存在的用户关系:{}",userInfo.getParentUserId());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!"1".equals(userParent.getIsExtend())){
|
||||||
|
log.error("商户用户类型异常:{},{}",userParent.getUserId(),userParent.getIsExtend());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
BigDecimal profit = new BigDecimal(order.getConsumeFee()).multiply(new BigDecimal("0.5")).setScale(2, BigDecimal.ROUND_DOWN);
|
||||||
|
String s = String.valueOf(userParent.getUserId());
|
||||||
|
Integer integer = Integer.valueOf(s);
|
||||||
|
this.modMakerFunds(integer, "SD", "免费额度", profit, "", order.getOrderNumber());
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//增加提现金额
|
//增加提现金额
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -181,10 +204,6 @@ public class UserMakerQuotaServiceImpl extends ServiceImpl<UserMakerQuotaMapper,
|
|||||||
if(N.gt(difference,BigDecimal.ZERO)){
|
if(N.gt(difference,BigDecimal.ZERO)){
|
||||||
difference=difference.abs();
|
difference=difference.abs();
|
||||||
}
|
}
|
||||||
if ("LD".equals(bizCode)){
|
|
||||||
difference = difference.negate();
|
|
||||||
}
|
|
||||||
|
|
||||||
userMakerQuotaMapper.updateMakerFreeze(userId,difference);
|
userMakerQuotaMapper.updateMakerFreeze(userId,difference);
|
||||||
|
|
||||||
UserMakerFlow flow=new UserMakerFlow();
|
UserMakerFlow flow=new UserMakerFlow();
|
||||||
|
|||||||
@@ -97,7 +97,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 = merchantProfitMapper.queryMerchantProfitPageCountV2(userId);
|
totalOrderCount = merchantProfitMapper.queryMerchantProfitPageCountV2(userId,DateUtils.getDayBegin(),DateUtils.getDayEnd());
|
||||||
todayProfit = merchantProfitService.queryMerchantProfitSumPrice(queryMap);
|
todayProfit = merchantProfitService.queryMerchantProfitSumPrice(queryMap);
|
||||||
|
|
||||||
//今日收益
|
//今日收益
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ public interface MerchantProfitService extends IService<MerchantProfit> {
|
|||||||
void sendProfitMessage(UserApp userApp, BigDecimal profitMoney, String orderNumber);
|
void sendProfitMessage(UserApp userApp, BigDecimal profitMoney, String orderNumber);
|
||||||
|
|
||||||
Map<String, Object> teamList(String typeCode, Long userId, Integer page,Integer size,String name);
|
Map<String, Object> teamList(String typeCode, Long userId, Integer page,Integer size,String name);
|
||||||
|
Map<String, Object> teamQuotaList(String typeCode, Long userId, Integer page,Integer size,String name);
|
||||||
|
|
||||||
Map<String, Object> merchantListData(Long userId);
|
Map<String, Object> merchantListData(Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,21 +135,22 @@ public class MerchantProfitServiceImpl extends ServiceImpl<MerchantProfitMapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 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);
|
||||||
UserPromotion userPromotion = userPromotionMapper.selectByPrimaryKey(userId);
|
// UserPromotion userPromotion = userPromotionMapper.selectByPrimaryKey(userId);
|
||||||
if (Objects.equals(userPromotion.getIsExtend(), "1")){
|
// if (Objects.equals(userPromotion.getIsExtend(), "1")){
|
||||||
List<MerchantProfitVO> teamList = merchantProfitMapper.getTeamList(typeCode, userId, name, pagerSize, offset);
|
// List<MerchantProfitVO> teamList = merchantProfitMapper.getTeamList(typeCode, userId, name, pagerSize, offset);
|
||||||
for (MerchantProfitVO values : teamList) {
|
//
|
||||||
values.setCurrentMonth(mapperOrderMapper.getPlatformAmtYestday(values.getMerchantCode(),
|
// teamList.stream().parallel().forEach(values->{
|
||||||
DateUtils.getBeginDayOfMonth(), DateUtils.getEndDayOfMonth()));
|
// values.setCurrentMonth(mapperOrderMapper.getPlatformAmtYestday(values.getMerchantCode(),
|
||||||
values.setConsumeFee(mapperOrderMapper.getAmountData(values.getMerchantCode()));
|
// DateUtils.getBeginDayOfMonth(), DateUtils.getEndDayOfMonth()));
|
||||||
}
|
// values.setConsumeFee(mapperOrderMapper.getAmountData(values.getMerchantCode()));
|
||||||
HashMap<String, Object> hashMap = new HashMap<>();
|
// });
|
||||||
hashMap.put("total", countChild);
|
//
|
||||||
hashMap.put("teamList", teamList);
|
// HashMap<String, Object> hashMap = new HashMap<>();
|
||||||
return hashMap;
|
// hashMap.put("total", countChild);
|
||||||
}
|
// hashMap.put("teamList", teamList);
|
||||||
|
// return hashMap;
|
||||||
|
// }
|
||||||
//商户列表
|
//商户列表
|
||||||
if ("MC".equals(typeCode)) {
|
if ("MC".equals(typeCode)) {
|
||||||
List<MerchantProfitVO> teamList = merchantProfitMapper.getMerchantTeamList(typeCode, userId, name, pagerSize, offset);
|
List<MerchantProfitVO> teamList = merchantProfitMapper.getMerchantTeamList(typeCode, userId, name, pagerSize, offset);
|
||||||
@@ -249,6 +250,29 @@ public class MerchantProfitServiceImpl extends ServiceImpl<MerchantProfitMapper,
|
|||||||
return hashMap;
|
return hashMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> teamQuotaList(String typeCode, Long userId, Integer page, Integer size, String name) {
|
||||||
|
Integer pagerSize = size;
|
||||||
|
Integer offset = (page - 1) * size;
|
||||||
|
Integer countChild = merchantProfitMapper.getCountQuotaChild(userId, typeCode);
|
||||||
|
UserPromotion userPromotion = userPromotionMapper.selectByPrimaryKey(userId);
|
||||||
|
if (Objects.equals(userPromotion.getIsExtend(), "1")){
|
||||||
|
List<MerchantProfitVO> teamList = merchantProfitMapper.getTeamList(typeCode, userId, name, pagerSize, offset);
|
||||||
|
|
||||||
|
teamList.stream().parallel().forEach(values->{
|
||||||
|
values.setCurrentMonth(mapperOrderMapper.getPlatformAmtYestday(values.getMerchantCode(),
|
||||||
|
DateUtils.getBeginDayOfMonth(), DateUtils.getEndDayOfMonth()));
|
||||||
|
values.setConsumeFee(mapperOrderMapper.getAmountData(values.getMerchantCode()));
|
||||||
|
});
|
||||||
|
|
||||||
|
HashMap<String, Object> hashMap = new HashMap<>();
|
||||||
|
hashMap.put("total", countChild);
|
||||||
|
hashMap.put("teamList", teamList);
|
||||||
|
return hashMap;
|
||||||
|
}
|
||||||
|
return new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> merchantListData(Long userId) {
|
public Map<String, Object> merchantListData(Long userId) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user