分销修改
This commit is contained in:
parent
ff32ec71c1
commit
0ef7e2643e
|
|
@ -40,78 +40,78 @@ public class DistributionController {
|
|||
@Resource
|
||||
private AppWxServiceImpl appWxService;
|
||||
|
||||
/**
|
||||
* 配置信息详情
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "distribution:detail", name = "分销配置")
|
||||
@GetMapping
|
||||
public CzgResult<MkDistributionConfigVO> detail() {
|
||||
return CzgResult.success(configService.detail(StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息修改
|
||||
*
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "distribution:edit", name = "分销修改")
|
||||
@SaCheckMainShop
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit( @RequestBody MkDistributionConfigDTO dto) {
|
||||
return CzgResult.success(configService.edit(StpKit.USER.getShopId(), dto));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 现金充值
|
||||
* @param payParam 充值信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
@PostMapping("/cashPay")
|
||||
public CzgResult<Boolean> cashPayOrder(@Validated @RequestBody MkDistributionPayDTO payParam) {
|
||||
AssertUtil.isNull(payParam.getShopId(), "店铺id不能为空");
|
||||
AssertUtil.isNull(payParam.getAmount(), "充值金额不能为空");
|
||||
AssertUtil.isTrue(payParam.getAmount().compareTo(BigDecimal.ZERO) == 0, "金额不为0");
|
||||
return CzgResult.success(distributionUserService.cashPayOrder(StpKit.USER.getLoginIdAsLong(), payParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 金额记录
|
||||
* @param type manual_recharge充值 self_recharge自助充值 refund退款 manual_sub手动扣减 sub统扣减
|
||||
* @param key 搜索
|
||||
*/
|
||||
@GetMapping("/flow")
|
||||
public CzgResult<Map<String, Object>> flow(@RequestParam(required = false) Long shopId, @RequestParam(required = false) String type, @RequestParam(required = false) String key) {
|
||||
return CzgResult.success(distributionAmountFlowService.pageInfo(StpKit.USER.isAdmin() ? shopId : StpKit.USER.getShopId(), type, key));
|
||||
}
|
||||
|
||||
/**
|
||||
* 开通记录
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param key 用户id昵称
|
||||
*/
|
||||
@GetMapping("openFlow")
|
||||
public CzgResult<Map<String, Object>> openFlow(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime, @RequestParam(required = false) String key) {
|
||||
return CzgResult.success(distributionAmountFlowService.openPageInfo(StpKit.USER.getShopId(),
|
||||
StrUtil.isNotBlank(startTime) ? DateUtil.parseLocalDateTime(startTime) : null, StrUtil.isNotBlank(endTime) ? DateUtil.parseLocalDateTime(endTime) : null, key));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分销明细
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param key 用户id昵称
|
||||
* @param status pending待入账 success已入账
|
||||
*/
|
||||
@GetMapping("distributionFlow")
|
||||
public CzgResult<Map<String, Object>> distributionFlow(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime,
|
||||
@RequestParam(required = false) String key, @RequestParam(required = false) String status,
|
||||
@RequestParam(required = false) Long id) {
|
||||
return CzgResult.success(distributionFlowService.pageInfo(StpKit.USER.getShopId(),
|
||||
StrUtil.isNotBlank(startTime) ? DateUtil.parseLocalDateTime(startTime) : null, StrUtil.isNotBlank(endTime) ? DateUtil.parseLocalDateTime(endTime) : null, key, status, id));
|
||||
}
|
||||
// /**
|
||||
// * 配置信息详情
|
||||
// */
|
||||
// @SaAdminCheckPermission(value = "distribution:detail", name = "分销配置")
|
||||
// @GetMapping
|
||||
// public CzgResult<MkDistributionConfigVO> detail() {
|
||||
// return CzgResult.success(configService.detail(StpKit.USER.getShopId()));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 配置信息修改
|
||||
// *
|
||||
// * @return 是否成功
|
||||
// */
|
||||
// @SaAdminCheckPermission(value = "distribution:edit", name = "分销修改")
|
||||
// @SaCheckMainShop
|
||||
// @PutMapping
|
||||
// public CzgResult<Boolean> edit( @RequestBody MkDistributionConfigDTO dto) {
|
||||
// return CzgResult.success(configService.edit(StpKit.USER.getShopId(), dto));
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 现金充值
|
||||
// * @param payParam 充值信息
|
||||
// * @return 是否成功
|
||||
// */
|
||||
// @PostMapping("/cashPay")
|
||||
// public CzgResult<Boolean> cashPayOrder(@Validated @RequestBody MkDistributionPayDTO payParam) {
|
||||
// AssertUtil.isNull(payParam.getShopId(), "店铺id不能为空");
|
||||
// AssertUtil.isNull(payParam.getAmount(), "充值金额不能为空");
|
||||
// AssertUtil.isTrue(payParam.getAmount().compareTo(BigDecimal.ZERO) == 0, "金额不为0");
|
||||
// return CzgResult.success(distributionUserService.cashPayOrder(StpKit.USER.getLoginIdAsLong(), payParam));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 金额记录
|
||||
// * @param type manual_recharge充值 self_recharge自助充值 refund退款 manual_sub手动扣减 sub统扣减
|
||||
// * @param key 搜索
|
||||
// */
|
||||
// @GetMapping("/flow")
|
||||
// public CzgResult<Map<String, Object>> flow(@RequestParam(required = false) Long shopId, @RequestParam(required = false) String type, @RequestParam(required = false) String key) {
|
||||
// return CzgResult.success(distributionAmountFlowService.pageInfo(StpKit.USER.isAdmin() ? shopId : StpKit.USER.getShopId(), type, key));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 开通记录
|
||||
// * @param startTime 开始时间
|
||||
// * @param endTime 结束时间
|
||||
// * @param key 用户id昵称
|
||||
// */
|
||||
// @GetMapping("openFlow")
|
||||
// public CzgResult<Map<String, Object>> openFlow(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime, @RequestParam(required = false) String key) {
|
||||
// return CzgResult.success(distributionAmountFlowService.openPageInfo(StpKit.USER.getShopId(),
|
||||
// StrUtil.isNotBlank(startTime) ? DateUtil.parseLocalDateTime(startTime) : null, StrUtil.isNotBlank(endTime) ? DateUtil.parseLocalDateTime(endTime) : null, key));
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 分销明细
|
||||
// * @param startTime 开始时间
|
||||
// * @param endTime 结束时间
|
||||
// * @param key 用户id昵称
|
||||
// * @param status pending待入账 success已入账
|
||||
// */
|
||||
// @GetMapping("distributionFlow")
|
||||
// public CzgResult<Map<String, Object>> distributionFlow(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime,
|
||||
// @RequestParam(required = false) String key, @RequestParam(required = false) String status,
|
||||
// @RequestParam(required = false) Long id) {
|
||||
// return CzgResult.success(distributionFlowService.pageInfo(StpKit.USER.getShopId(),
|
||||
// StrUtil.isNotBlank(startTime) ? DateUtil.parseLocalDateTime(startTime) : null, StrUtil.isNotBlank(endTime) ? DateUtil.parseLocalDateTime(endTime) : null, key, status, id));
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -80,9 +80,6 @@ public class MkDistributionWithdrawFlow implements Serializable {
|
|||
private String status;
|
||||
|
||||
|
||||
@Column(ignore = true)
|
||||
private String nickName;
|
||||
@Column(ignore = true)
|
||||
private String phone;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.czg.market.vo;
|
||||
|
||||
import com.czg.market.entity.MkDistributionWithdrawFlow;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class MkDistributionWithdrawFlowVO extends MkDistributionWithdrawFlow {
|
||||
@Column(ignore = true)
|
||||
private String nickName;
|
||||
@Column(ignore = true)
|
||||
private String phone;
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.czg.utils;
|
||||
|
||||
import cn.hutool.core.text.NamingCase;
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.core.constant.SqlConnector;
|
||||
import com.mybatisflex.core.query.*;
|
||||
import com.mybatisflex.core.table.TableInfo;
|
||||
|
|
@ -12,6 +13,7 @@ import com.mybatisflex.core.util.StringUtil;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.invoke.SerializedLambda;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
|
@ -30,6 +32,7 @@ public class MyQueryWrapper extends QueryWrapper implements Serializable {
|
|||
TableInfo tableInfo = TableInfoFactory.ofEntityClass(clazz);
|
||||
for (Method declaredMethod : clazz.getDeclaredMethods()) {
|
||||
String methodName = declaredMethod.getName();
|
||||
|
||||
// 只处理 getter:getXxx() / isXxx()
|
||||
if ((methodName.startsWith("get") && methodName.length() > 3)
|
||||
|| (methodName.startsWith("is") && methodName.length() > 2)) {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.czg.account.entity.ShopUser;
|
|||
import com.czg.account.entity.UserInfo;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.constant.TableValueConstant;
|
||||
import com.czg.market.vo.MkDistributionWithdrawFlowVO;
|
||||
import com.czg.utils.MyQueryWrapper;
|
||||
import com.czg.utils.PageUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
|
|
@ -48,19 +49,19 @@ public class MkDistributionWithdrawFlowServiceImpl extends ServiceImpl<MkDistrib
|
|||
if (StrUtil.isNotBlank(key)){
|
||||
queryWrapper.and(and -> {
|
||||
and.or(or -> {
|
||||
or.like(ShopUser::getId, key);
|
||||
or.like(UserInfo::getId, key);
|
||||
});
|
||||
|
||||
and.or(or -> {
|
||||
or.like(ShopUser::getNickName, key);
|
||||
or.like(UserInfo::getNickName, key);
|
||||
});
|
||||
|
||||
and.or(or -> {
|
||||
or.like(ShopUser::getPhone, key);
|
||||
or.like(UserInfo::getPhone, key);
|
||||
});
|
||||
});
|
||||
}
|
||||
Page<MkDistributionWithdrawFlow> page = page(PageUtil.buildPage(), queryWrapper);
|
||||
Page<MkDistributionWithdrawFlowVO> page = pageAs(PageUtil.buildPage(), queryWrapper, MkDistributionWithdrawFlowVO.class);
|
||||
Map<String, Object> map = BeanUtil.beanToMap(page);
|
||||
map.put("pending", getOne(new QueryWrapper().eq(MkDistributionWithdrawFlow::getStatus, TableValueConstant.DistributionWithdrawFlow.Status.PENDING.getCode()).select("sum(amount)")));
|
||||
map.put("finish", getOne(new QueryWrapper().eq(MkDistributionWithdrawFlow::getStatus, TableValueConstant.DistributionWithdrawFlow.Status.FINISH.getCode()).select("sum(amount)")));
|
||||
|
|
|
|||
Loading…
Reference in New Issue