提交 9b2d89ed authored 作者: huyufan's avatar huyufan

货主资金管理

上级 280c8586
......@@ -3,24 +3,22 @@ package com.clx.performance.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;
import java.util.Optional;
@Getter
@AllArgsConstructor
@SuppressWarnings("all")
public enum OwnerAccountTypeEnum {
public enum IdTypeEnum {
;
@Getter
@AllArgsConstructor
public enum Status {
MARGIN_ACCOUNT(1, "保证金账户"),
PREPAID_FREIGHT_ACCOUNT(2, "预付运费账户")
public enum Type {
TOP_UP(1L, "充值"),
CASE_OUT(2L, "提现")
;
private final Integer code;
private final Long code;
private final String msg;
}
}
package com.clx.performance.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
@SuppressWarnings("all")
public enum OwnerAccountEnum {
;
@Getter
@AllArgsConstructor
public enum AccountTypeStatus {
MARGIN_ACCOUNT(1, "保证金账户"),
PREPAID_FREIGHT_ACCOUNT(2, "预付运费账户")
;
private final Integer code;
private final String msg;
}
@Getter
@AllArgsConstructor
public enum TopUpStatus {
PENDING(10, "待审批"),
APPROVAL_REJECTION(20, "审批拒绝"),
APPROVAL_APPROVE(30, "审批通过"),
;
private final Integer code;
private final String msg;
}
@Getter
@AllArgsConstructor
public enum CaseOutStatus {
PENDING_PAYMENT(10, "待付款"),
TO_BE_CONFIRMED(20, "待货主确认"),
PAID(30, "已付款"),
;
private final Integer code;
private final String msg;
}
@Getter
@AllArgsConstructor
public enum RunningWaterStatus {
TOP_UP(10, "充值"),
FROZEN(20, "冻结"),
THAW(30, "解冻"),
CASE_OUT_FROZEN(40, "提现冻结"),
CASE_OUT_SUCCESS(50, "提现成功"),
TAKE_OUT(60, "扣除"),
CASE_OUT_FAIL(70, "提现失败"),
;
private final Integer code;
private final String msg;
}
}
package com.clx.performance.param.pc;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@ApiModel(description = "提现审批")
@Getter
@Setter
@ToString
@NoArgsConstructor
public class OwnerCaseOutApproveParam {
@ApiModelProperty(value = "id", example = "1")
private Integer id;
@ApiModelProperty(value = "平台付款银行")
private String platformPaymentBank;
@ApiModelProperty(value = "平台付款银行账号")
private String platformPaymentBankNumber;
@ApiModelProperty(value = "付款凭证", example = "a.png")
private String paymentProof;
}
package com.clx.performance.param.pc;
import com.msl.common.convertor.type.MoneyOutConvert;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import java.math.BigDecimal;
@ApiModel(description = "货主提现")
@Getter
@Setter
@ToString
@NoArgsConstructor
public class OwnerCaseOutParam {
@ApiModelProperty(value = "货主用户编号", example = "123")
private Long ownerUserNo;
@ApiModelProperty(value = "提现金额(元)", example = "1.23")
@MoneyOutConvert
private BigDecimal caseOutBalance;
@ApiModelProperty(value = "账户类型: 1:保证金 2:预付运费", example = "1")
private Integer accountType;
@ApiModelProperty(value = "提现银行", example = "浙江银行")
private String caseOutBank;
@ApiModelProperty(value = "提现银行卡号", example = "62213545878787")
private String caseOutBankNumber;
}
\ No newline at end of file
......@@ -25,31 +25,18 @@ public class OwnerTopUpParam {
@MoneyOutConvert
private BigDecimal topUpBalance;
@ApiModelProperty(value = "充值类型: 1:保证金 2:预付运费", example = "1.23")
private Integer topUpType;
@ApiModelProperty(value = "状态 待审批:10 审批拒绝:20 审批通过:30", example = "10")
private Integer status;
@ApiModelProperty(value = "账户类型: 1:保证金 2:预付运费", example = "1")
private Integer accountType;
@ApiModelProperty(value = "打款银行", example = "浙江银行")
private String topUpBankName;
private String drawingBank;
@ApiModelProperty(value = "打款银行卡号", example = "62213545878787")
private String topUpBankNumber;
private String drawingBankNumber;
@ApiModelProperty(value = "打款凭证", example = "/a.png")
private String topUpImg;
@ApiModelProperty(value = "操作时间", example = "2023-01-01 00:00:00")
private String createTime;
@ApiModelProperty(value = "操作人", example = "张三")
private String createBy;
private String drawingProof;
@ApiModelProperty(value = "审批时间", example = "2023-01-01 00:00:00")
private String approvalTime;
@ApiModelProperty(value = "审批人", example = "管理员")
private String approvalBy;
}
\ No newline at end of file
package com.clx.performance.param.pc;
import com.msl.common.base.PageParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
* @Author huyufan
* @create 2023-09-19 13:33
*/
@Getter
@Setter
@NoArgsConstructor
@ToString
public class PageOwnerAccountRunningWaterParam extends PageParam {
@ApiModelProperty(value="账户类型",example = "1:保证金账户 2:预付金账户")
private String accountType;
@ApiModelProperty(value="流水类型 10:充值 20:冻结 30:解冻 40:提现冻结 50:提现成功 60:扣除 70:提现失败",example = "10")
private String runningWaterType;
@ApiModelProperty(value="操作开始时间",example = "2020-01-01 10:10:10")
private String beginTime;
@ApiModelProperty(value = "操作结束时间",example = "2020-01-01 10:10:10")
private String endTime;
}
package com.clx.performance.param.pc;
import com.msl.common.base.PageParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class PageOwnerCaseOutListParam extends PageParam {
@ApiModelProperty(value = "开始时间", example = "2020-01-01 10:10:10")
private String beginTime;
@ApiModelProperty(value = "结束时间", example = "2020-01-01 10:10:10")
private String endTime;
@ApiModelProperty(value = "充值账户类型 1:保证金 2:预付运费", example = "1")
private Integer accountType;
@ApiModelProperty(value = "货主用户编码")
private Long ownerUserNo;
}
package com.clx.performance.param.pc;
import com.msl.common.base.PageParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class PageOwnerTopUpListParam extends PageParam {
@ApiModelProperty(value = "开始时间", example = "2020-01-01 10:10:10")
private String beginTime;
@ApiModelProperty(value = "结束时间", example = "2020-01-01 10:10:10")
private String endTime;
@ApiModelProperty(value = "充值账户类型 1:保证金 2:预付运费", example = "1")
private Integer accountType;
@ApiModelProperty(value = "货主用户编码")
private Long ownerUserNo;
}
......@@ -15,7 +15,7 @@ import lombok.ToString;
@Setter
@NoArgsConstructor
@ToString
public class PageOwnerMarginAccountParam extends PageParam {
public class PagePlatformMarginAccountParam extends PageParam {
@ApiModelProperty(value="流水编号",example = "201457878")
private String runningWaterNo;
......
......@@ -15,7 +15,7 @@ import lombok.ToString;
@Setter
@NoArgsConstructor
@ToString
public class PageOwnerPrepaidFreightAccountParam extends PageParam {
public class PagePlatformPrepaidFreightAccountParam extends PageParam {
@ApiModelProperty(value="订单编号",example = "201457878")
private String orderNo;
......
package com.clx.performance.vo.pc;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 货主提现;
*
* @date : 2023-10-12
*/
@Getter
@Setter
@NoArgsConstructor
public class OwnerCaseOutVO {
/**
* id
*/
@ApiModelProperty(value = "id")
private Integer id;
/**
* 货主编号
*/
@ApiModelProperty(value = "id")
private Long ownerUserNo;
/**
* 提现编号
*/
@ApiModelProperty(value = "id")
private Long caseOutNo;
/**
* 提现账户类型
*/
@ApiModelProperty(value = "id")
private Integer caseOutType;
/**
* 提现金额
*/
@ApiModelProperty(value = "id")
private BigDecimal caseOutBalance;
/**
* 状态
*/
@ApiModelProperty(value = "状态 10:代付款 20:待货主确认 30:已付款")
private Integer status;
/**
* 提现银行
*/
@ApiModelProperty(value = "提现银行")
private String caseOutBank;
/**
* 提现银行卡号
*/
@ApiModelProperty(value = "提现银行卡号")
private String caseOutBankNumber;
/**
* 操作人
*/
@ApiModelProperty(value = "操作人")
private String createBy;
/**
* 付款时间
*/
@ApiModelProperty(value = "付款时间")
private LocalDateTime paymentTime;
/**
* 平台付款银行
*/
@ApiModelProperty(value = "平台付款银行")
private String platformPaymentBank;
/**
* 平台付款银行账号
*/
@ApiModelProperty(value = "平台付款银行账号")
private String platformPaymentBankNumber;
/**
* 付款人
*/
@ApiModelProperty(value = "付款人")
private String paymentBy;
/**
* 付款凭证
*/
@ApiModelProperty(value = "付款凭证")
private String paymentProof;
/**
* 创建时间
*/
@ApiModelProperty(value = "操作时间")
private LocalDateTime createTime;
/**
* 修改时间
*/
@ApiModelProperty(value = "修改时间")
private LocalDateTime modifyTime;
}
\ No newline at end of file
package com.clx.performance.vo.pc;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 货主充值
*
* @date : 2023-10-12
*/
@Getter
@Setter
@NoArgsConstructor
public class OwnerTopUpVO {
/**
* id
*/
@ApiModelProperty(value = "id")
private Integer id;
/**
* 充值编号
*/
@ApiModelProperty(value = "充值编号")
private Long topUpNo;
/**
* 货主编码
*/
@ApiModelProperty(value = "货主编码")
private Long ownerUserNo;
/**
* 充值类型
*/
@ApiModelProperty(value = "充值类型")
private Integer topUpType;
/**
* 充值金额
*/
@ApiModelProperty(value = "充值金额")
private BigDecimal topUpBalance;
/**
* 状态
*/
@ApiModelProperty(value = "状态")
private Integer status;
/**
* 打款银行
*/
@ApiModelProperty(value = "打款银行")
private String drawingBank;
/**
* 打款银行卡号
*/
@ApiModelProperty(value = "打款银行卡号")
private String drawingBankNumber;
/**
* 打款凭证
*/
@ApiModelProperty(value = "打款凭证")
private String drawingProof;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
/**
* 操作人
*/
@ApiModelProperty(value = "操作人")
private String createBy;
/**
* 审批时间
*/
@ApiModelProperty(value = "审批时间")
private LocalDateTime approvalTime;
/**
* 审批人
*/
@ApiModelProperty(value = "审批人")
private String approvalBy;
/**
* 审批拒绝
*/
@ApiModelProperty(value = "审批拒绝")
private String approvalTurnDown;
}
\ No newline at end of file
package com.clx.performance.component;
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
import com.clx.performance.constant.RedisConstants;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
/**
* 雪花算法生成唯一标示
* datacenterId:根据服务的ip地址区分,当前最多支持32太机器
* channelConfTypeId: 用于区分不同渠道的消息标示 用了6位的二进制位标示
* 从17位~23位 可看当前消息类型
* channelConfType : 1:充值 2:外呼 3:push
*/
@Component
public class IdGenerateSnowFlake implements InitializingBean {
@Autowired
private NacosDiscoveryProperties nacosDiscoveryProperties;
@Autowired
private RedisTemplate<String, String> redisTemplate;
//时间 41位
private static long lastTime = System.currentTimeMillis();
//数据中心ID 5位(默认0-31) 通过nacos获取服务ip注册redis统计 %32
private long datacenterId = 0;
private long datacenterIdShift = 4;
private long channelConfTypeId = 0;
private long channelConfTypeIdShirt = 6;
// 机房机器ID 5位(默认0-31)
// private long workerId = 0;
// private long workerIdShift = 5;
//随机数 12位(默认0~4095)
private AtomicLong random = new AtomicLong();
private long randomShift = 12;
//随机数的最大值
private long maxRandom = (long) Math.pow(2, randomShift);
// public SnowFlake(long workerIdShift, long datacenterIdShift){
// if (workerIdShift < 0 ||
// datacenterIdShift < 0 ||
// workerIdShift + datacenterIdShift > 22) {
// throw new IllegalArgumentException("参数不匹配");
// }
// this.workerIdShift = workerIdShift;
// this.datacenterIdShift = datacenterIdShift;
// this.randomShift = 22 - datacenterIdShift - workerIdShift;
// this.maxRandom = (long) Math.pow(2, randomShift);
// }
//获取雪花的ID
private long getId(Long channelConfTypeId) {
return lastTime << (channelConfTypeIdShirt + datacenterIdShift + randomShift) |
channelConfTypeId << (datacenterIdShift + randomShift) |
datacenterId << randomShift |
random.get();
}
//生成一个新的ID
public synchronized long nextId(Long channelConfTypeId) {
long now = System.currentTimeMillis();
//如果当前时间和上一次时间不在同一毫秒内,直接返回
if (now > lastTime) {
lastTime = now;
random.set(0);
return getId(channelConfTypeId);
}
//将最后的随机数,进行+1操作
if (random.incrementAndGet() < maxRandom) {
return getId(channelConfTypeId);
}
//自选等待下一毫秒
while (now <= lastTime) {
now = System.currentTimeMillis();
}
lastTime = now;
random.set(0);
return getId(channelConfTypeId);
}
public synchronized String nextIdToString(Long channelConfTypeId) {
long now = System.currentTimeMillis();
//如果当前时间和上一次时间不在同一毫秒内,直接返回
if (now > lastTime) {
lastTime = now;
random.set(0);
return getId(channelConfTypeId) + "";
}
//将最后的随机数,进行+1操作
if (random.incrementAndGet() < maxRandom) {
return getId(channelConfTypeId) + "";
}
//自选等待下一毫秒
while (now <= lastTime) {
now = System.currentTimeMillis();
}
lastTime = now;
random.set(0);
return getId(channelConfTypeId) + "";
}
/**
* 获取channelType
* @param n
* @return
*/
public Integer getChannelType(Long n){
String binaryString = Long.toBinaryString(n);
String substring = binaryString.substring(41, 47);
return Integer.parseInt(substring,2);
}
//测试
public static void main(String[] args) {
IdGenerateSnowFlake msgSnowFlake = new IdGenerateSnowFlake();
String s1 = msgSnowFlake.nextIdToString(0L);
String s2 = msgSnowFlake.nextIdToString(1L);
String s3 = msgSnowFlake.nextIdToString(2L);
String s4 = msgSnowFlake.nextIdToString(3L);
String s5 = msgSnowFlake.nextIdToString(4L);
Integer channelType = msgSnowFlake.getChannelType(Long.valueOf(s1));
Integer channelType1 = msgSnowFlake.getChannelType(Long.valueOf(s2));
Integer channelType2 = msgSnowFlake.getChannelType(Long.valueOf(s3));
Integer channelType3 = msgSnowFlake.getChannelType(Long.valueOf(s4));
Integer channelType4 = msgSnowFlake.getChannelType(Long.valueOf(s5));
System.out.println(channelType1);
}
/**
* 根据不同的ip注册机器ID,用于保证ID全局唯一
* @throws Exception
*/
@Override
public void afterPropertiesSet() throws Exception {
Map<Object, Object> msgSnowFlake = redisTemplate.opsForHash().entries(RedisConstants.ID_SNOWFLAKE);
String ip = nacosDiscoveryProperties.getIp();
datacenterId = msgSnowFlake.size() % 32;
redisTemplate.opsForHash().put(RedisConstants.ID_SNOWFLAKE, ip, String.valueOf(msgSnowFlake.size() + 1));
}
}
\ No newline at end of file
......@@ -20,4 +20,9 @@ public class RedisConstants {
public static final String ORDER_GOODS_STATUS_LAZY = "clx:order:goods:status:lazy:";
/**
* 雪花
*/
public static final String ID_SNOWFLAKE = "clx-performance:idsnowflake";
}
package com.clx.performance.controller.pc;
package com.clx.performance.controller.pc.carrier;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.PageOwnerAccountListParam;
import com.clx.performance.param.pc.PageOwnerMarginAccountParam;
import com.clx.performance.param.pc.PageOwnerPrepaidFreightAccountParam;
import com.clx.performance.param.pc.*;
import com.clx.performance.service.OwnerAccountService;
import com.clx.performance.service.OwnerCaseOutService;
import com.clx.performance.service.OwnerTopUpService;
import com.clx.performance.vo.pc.OwnerAccountRunningWaterRecordVO;
import com.clx.performance.vo.pc.OwnerAccountVO;
import com.clx.performance.vo.pc.OwnerCaseOutVO;
import com.clx.performance.vo.pc.OwnerTopUpVO;
import com.msl.common.base.PageData;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result;
......@@ -17,18 +19,22 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Slf4j
@RestController
@RequestMapping("/pc/ownerAccount")
@RequestMapping(value="/pc/carrier")
@Validated
@Api(tags = "承运端-资金")
@AllArgsConstructor
@Api(tags = "PC-资金管理")
public class OwnerAccountController {
public class CarrierAccountController {
private final OwnerAccountService ownerAccountService;
private final OwnerTopUpService ownerTopUpService;
private final OwnerCaseOutService ownerCaseOutService;
@ApiOperation(value = "查看资金管理列表", notes = "<br>By:胡宇帆")
@PostMapping("/pageList")
@UnitCovert(param = false)
......@@ -38,35 +44,48 @@ public class OwnerAccountController {
}
@ApiOperation(value = "保证金账户详情流水列表", notes = "<br>By:胡宇帆")
@PostMapping("/margin_account_page_list")
@PostMapping("/marginAccountPageList")
@UnitCovert(param = false)
public Result<PageData<OwnerAccountRunningWaterRecordVO>> marginAccountPageList(@RequestBody PageOwnerMarginAccountParam param) {
public Result<PageData<OwnerAccountRunningWaterRecordVO>> marginAccountPageList(@RequestBody PagePlatformMarginAccountParam param) {
IPage<OwnerAccountRunningWaterRecordVO> page = ownerAccountService.marginAccountPageList(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
@ApiOperation(value = "预付金账户详情流水列表", notes = "<br>By:胡宇帆")
@PostMapping("/prepaidFreight_account_page_list")
@PostMapping("/prepaidFreightAccountPageList")
@UnitCovert(param = false)
public Result<PageData<OwnerAccountRunningWaterRecordVO>> prepaidFreightAccountPageList(@RequestBody PageOwnerPrepaidFreightAccountParam param) {
public Result<PageData<OwnerAccountRunningWaterRecordVO>> prepaidFreightAccountPageList(@RequestBody PagePlatformPrepaidFreightAccountParam param) {
IPage<OwnerAccountRunningWaterRecordVO> page = ownerAccountService.prepaidFreightAccountPageList(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
@ApiOperation(value = "查看资金管理列表", notes = "<br>By:胡宇帆")
@GetMapping("/account_info")
@ApiOperation(value = "充值审批", notes = "<br>By:胡宇帆")
@GetMapping("/accountTopUpApprove")
public void accountTopUpApprove(@RequestParam Integer id, @RequestParam String turnDownContent) {
ownerAccountService.accountTopUpApprove(id,turnDownContent);
}
@ApiOperation(value = "提现审批", notes = "<br>By:胡宇帆")
@PostMapping("/accountCaseOutApprove")
public void accountCaseOutApprove(@RequestBody OwnerCaseOutApproveParam param) {
ownerAccountService.accountCaseOutApprove(param);
}
@ApiOperation(value = "充值审批列表", notes = "<br>By:胡宇帆")
@PostMapping("/ownerTopUpPageList")
@UnitCovert(param = false)
public Result<List<OwnerAccountVO>> accountInfo(@RequestParam String ownerNo) {
List<OwnerAccountVO> accountVOList = ownerAccountService.accountInfo(ownerNo);
return Result.ok(accountVOList);
public Result<PageData<OwnerTopUpVO>> ownerTopUpPageList(@RequestBody PageOwnerTopUpListParam param) {
IPage<OwnerTopUpVO> page = ownerTopUpService.ownerTopUpPageList(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
@ApiOperation(value = "账户充值", notes = "<br>By:胡宇帆")
@GetMapping("/account_top_up")
@ApiOperation(value = "提现审批列表", notes = "<br>By:胡宇帆")
@PostMapping("/ownerCaseOutPageList")
@UnitCovert(param = false)
public Result<List<OwnerAccountVO>> account_top_up(@RequestParam String ownerNo) {
List<OwnerAccountVO> accountVOList = ownerAccountService.accountInfo(ownerNo);
return Result.ok(accountVOList);
public Result<PageData<OwnerCaseOutVO>> ownerCaseOutPageList(@RequestBody PageOwnerCaseOutListParam param) {
IPage<OwnerCaseOutVO> page = ownerCaseOutService.ownerCaseOutPageList(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
}
package com.clx.performance.controller.pc.owner;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.*;
import com.clx.performance.service.OwnerAccountService;
import com.clx.performance.service.OwnerCaseOutService;
import com.clx.performance.service.OwnerRunningWaterRecordService;
import com.clx.performance.service.OwnerTopUpService;
import com.clx.performance.vo.pc.OwnerAccountRunningWaterRecordVO;
import com.clx.performance.vo.pc.OwnerAccountVO;
import com.clx.performance.vo.pc.OwnerCaseOutVO;
import com.clx.performance.vo.pc.OwnerTopUpVO;
import com.msl.common.base.PageData;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Slf4j
@RestController
@RequestMapping("/pc/owner")
@Validated
@AllArgsConstructor
@Api(tags = "PC-资金管理")
public class OwnerAccountController {
private final OwnerAccountService ownerAccountService;
private final OwnerTopUpService ownerTopUpService;
private final OwnerCaseOutService ownerCaseOutService;
private final OwnerRunningWaterRecordService ownerRunningWaterRecordService;
@ApiOperation(value = "账户信息", notes = "<br>By:胡宇帆")
@GetMapping("/accountInfo")
@UnitCovert(param = false)
public Result<List<OwnerAccountVO>> accountInfo(@RequestParam String ownerNo) {
List<OwnerAccountVO> accountVOList = ownerAccountService.accountInfo(ownerNo);
return Result.ok(accountVOList);
}
@ApiOperation(value = "货主充值记录列表", notes = "<br>By:胡宇帆")
@PostMapping("/ownerTopUpPageList")
@UnitCovert(param = false)
public Result<PageData<OwnerTopUpVO>> ownerTopUpPageList(@RequestBody PageOwnerTopUpListParam param) {
IPage<OwnerTopUpVO> page = ownerTopUpService.ownerTopUpPageList(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
@ApiOperation(value = "货主提现记录列表", notes = "<br>By:胡宇帆")
@PostMapping("/ownerCaseOutPageList")
@UnitCovert(param = false)
public Result<PageData<OwnerCaseOutVO>> ownerCaseOutPageList(@RequestBody PageOwnerCaseOutListParam param) {
IPage<OwnerCaseOutVO> page = ownerCaseOutService.ownerCaseOutPageList(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
@ApiOperation(value = "账户充值", notes = "<br>By:胡宇帆")
@PostMapping("/accountTopUp")
@UnitCovert(param = false)
public Result<Long> accountTopUp(@RequestBody OwnerTopUpParam param) {
Long id = ownerAccountService.accountTopUp(param);
return Result.ok(id);
}
@ApiOperation(value = "账户提现", notes = "<br>By:胡宇帆")
@PostMapping("/accountCaseOut")
@UnitCovert(param = false)
public Result<Long> accountCaseOut(@RequestBody OwnerCaseOutParam param) {
Long id = ownerAccountService.accountCaseOut(param);
return Result.ok(id);
}
@ApiOperation(value = "货主账户流水列表", notes = "<br>By:胡宇帆")
@PostMapping("/ownerAccountRunningWaterPageList")
@UnitCovert(param = false)
public Result<PageData<OwnerAccountRunningWaterRecordVO>> ownerAccountRunningWaterPageList(@RequestBody PageOwnerAccountRunningWaterParam param) {
IPage<OwnerAccountRunningWaterRecordVO> page = ownerRunningWaterRecordService.ownerAccountRunningWaterPageList(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
}
package com.clx.performance.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.mapper.OwnerCaseOutMapper;
import com.clx.performance.model.OwnerCaseOut;
import com.clx.performance.param.pc.PageOwnerCaseOutListParam;
import com.clx.performance.vo.pc.OwnerCaseOutVO;
import com.msl.common.dao.BaseDao;
public interface OwnerCaseOutDao extends BaseDao<OwnerCaseOutMapper, OwnerCaseOut, Integer> {
IPage<OwnerCaseOutVO> ownerCaseOutPageList(PageOwnerCaseOutListParam param);
}
......@@ -3,15 +3,18 @@ package com.clx.performance.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.mapper.OwnerRunningWaterRecordMapper;
import com.clx.performance.model.OwnerRunningWaterRecord;
import com.clx.performance.param.pc.PageOwnerMarginAccountParam;
import com.clx.performance.param.pc.PageOwnerPrepaidFreightAccountParam;
import com.clx.performance.param.pc.PageOwnerAccountRunningWaterParam;
import com.clx.performance.param.pc.PagePlatformMarginAccountParam;
import com.clx.performance.param.pc.PagePlatformPrepaidFreightAccountParam;
import com.clx.performance.vo.pc.OwnerAccountRunningWaterRecordVO;
import com.msl.common.dao.BaseDao;
public interface OwnerRunningWaterRecordDao extends BaseDao<OwnerRunningWaterRecordMapper, OwnerRunningWaterRecord, Integer> {
IPage<OwnerAccountRunningWaterRecordVO> marginAccountPageList(PageOwnerMarginAccountParam param);
IPage<OwnerAccountRunningWaterRecordVO> marginAccountPageList(PagePlatformMarginAccountParam param);
IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PageOwnerPrepaidFreightAccountParam param);
IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PagePlatformPrepaidFreightAccountParam param);
IPage<OwnerAccountRunningWaterRecordVO> ownerAccountRunningWaterPageList(PageOwnerAccountRunningWaterParam param);
}
package com.clx.performance.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.mapper.OwnerTopUpMapper;
import com.clx.performance.model.OwnerTopUp;
import com.clx.performance.param.pc.PageOwnerTopUpListParam;
import com.clx.performance.vo.pc.OwnerTopUpVO;
import com.msl.common.dao.BaseDao;
public interface OwnerTopUpDao extends BaseDao<OwnerTopUpMapper, OwnerTopUp, Integer> {
IPage<OwnerTopUpVO> ownerTopUpPageList(PageOwnerTopUpListParam param);
}
package com.clx.performance.dao.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.OwnerCaseOutDao;
import com.clx.performance.mapper.OwnerCaseOutMapper;
import com.clx.performance.model.OwnerCaseOut;
import com.clx.performance.param.pc.PageOwnerCaseOutListParam;
import com.clx.performance.vo.pc.OwnerCaseOutVO;
import com.msl.common.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Repository;
@Repository
public class OwnerCaseOutDaoImpl extends BaseDaoImpl<OwnerCaseOutMapper, OwnerCaseOut, Integer> implements OwnerCaseOutDao {
@Override
public IPage<OwnerCaseOutVO> ownerCaseOutPageList(PageOwnerCaseOutListParam param) {
Page<OwnerCaseOutVO> page = Page.of(param.getPage(), param.getPageSize());
return baseMapper.ownerCaseOutPageList(page, param);
}
}
......@@ -5,8 +5,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.OwnerRunningWaterRecordDao;
import com.clx.performance.mapper.OwnerRunningWaterRecordMapper;
import com.clx.performance.model.OwnerRunningWaterRecord;
import com.clx.performance.param.pc.PageOwnerMarginAccountParam;
import com.clx.performance.param.pc.PageOwnerPrepaidFreightAccountParam;
import com.clx.performance.param.pc.PageOwnerAccountRunningWaterParam;
import com.clx.performance.param.pc.PagePlatformMarginAccountParam;
import com.clx.performance.param.pc.PagePlatformPrepaidFreightAccountParam;
import com.clx.performance.vo.pc.OwnerAccountRunningWaterRecordVO;
import com.msl.common.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Repository;
......@@ -15,14 +16,20 @@ import org.springframework.stereotype.Repository;
public class OwnerRunningWaterRecordDaoImpl extends BaseDaoImpl<OwnerRunningWaterRecordMapper, OwnerRunningWaterRecord, Integer> implements OwnerRunningWaterRecordDao {
@Override
public IPage<OwnerAccountRunningWaterRecordVO> marginAccountPageList(PageOwnerMarginAccountParam param) {
public IPage<OwnerAccountRunningWaterRecordVO> marginAccountPageList(PagePlatformMarginAccountParam param) {
Page<OwnerAccountRunningWaterRecordVO> page = Page.of(param.getPage(), param.getPageSize());
return baseMapper.marginAccountPageList(page, param);
}
@Override
public IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PageOwnerPrepaidFreightAccountParam param) {
public IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PagePlatformPrepaidFreightAccountParam param) {
Page<OwnerAccountRunningWaterRecordVO> page = Page.of(param.getPage(), param.getPageSize());
return baseMapper.prepaidFreightAccountPageList(page, param);
}
@Override
public IPage<OwnerAccountRunningWaterRecordVO> ownerAccountRunningWaterPageList(PageOwnerAccountRunningWaterParam param) {
Page<OwnerAccountRunningWaterRecordVO> page = Page.of(param.getPage(), param.getPageSize());
return baseMapper.ownerAccountRunningWaterPageList(page, param);
}
}
package com.clx.performance.dao.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.OwnerTopUpDao;
import com.clx.performance.mapper.OwnerTopUpMapper;
import com.clx.performance.model.OwnerTopUp;
import com.clx.performance.param.pc.PageOwnerTopUpListParam;
import com.clx.performance.vo.pc.OwnerTopUpVO;
import com.msl.common.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Repository;
@Repository
public class OwnerTopUpDaoImpl extends BaseDaoImpl<OwnerTopUpMapper, OwnerTopUp, Integer> implements OwnerTopUpDao {
@Override
public IPage<OwnerTopUpVO> ownerTopUpPageList(PageOwnerTopUpListParam param) {
Page<OwnerTopUpVO> page = Page.of(param.getPage(), param.getPageSize());
return baseMapper.ownerTopUpPageList(page, param);
}
}
package com.clx.performance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.model.OwnerCaseOut;
import com.clx.performance.param.pc.PageOwnerCaseOutListParam;
import com.clx.performance.sqlProvider.OwnerCaseOutProvider;
import com.clx.performance.sqlProvider.OwnerTopUpProvider;
import com.clx.performance.vo.pc.OwnerCaseOutVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectProvider;
/**
* 货主提现
......@@ -10,4 +17,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface OwnerCaseOutMapper extends BaseMapper<OwnerCaseOut> {
@SelectProvider(type = OwnerCaseOutProvider.class, method = "ownerCaseOutPageList")
IPage<OwnerCaseOutVO> ownerCaseOutPageList(Page<OwnerCaseOutVO> page, PageOwnerCaseOutListParam param);
}
\ No newline at end of file
......@@ -4,8 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.model.OwnerRunningWaterRecord;
import com.clx.performance.param.pc.PageOwnerMarginAccountParam;
import com.clx.performance.param.pc.PageOwnerPrepaidFreightAccountParam;
import com.clx.performance.param.pc.PageOwnerAccountRunningWaterParam;
import com.clx.performance.param.pc.PagePlatformMarginAccountParam;
import com.clx.performance.param.pc.PagePlatformPrepaidFreightAccountParam;
import com.clx.performance.sqlProvider.OwnerRunningWaterRecordSqlProvider;
import com.clx.performance.vo.pc.OwnerAccountRunningWaterRecordVO;
import org.apache.ibatis.annotations.Mapper;
......@@ -18,8 +19,11 @@ import org.apache.ibatis.annotations.SelectProvider;
public interface OwnerRunningWaterRecordMapper extends BaseMapper<OwnerRunningWaterRecord> {
@SelectProvider(type = OwnerRunningWaterRecordSqlProvider.class, method = "marginAccountPageList")
IPage<OwnerAccountRunningWaterRecordVO> marginAccountPageList(Page<OwnerAccountRunningWaterRecordVO> page, PageOwnerMarginAccountParam param);
IPage<OwnerAccountRunningWaterRecordVO> marginAccountPageList(Page<OwnerAccountRunningWaterRecordVO> page, PagePlatformMarginAccountParam param);
@SelectProvider(type = OwnerRunningWaterRecordSqlProvider.class, method = "prepaidFreightAccountPageList")
IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(Page<OwnerAccountRunningWaterRecordVO> page, PageOwnerPrepaidFreightAccountParam param);
IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(Page<OwnerAccountRunningWaterRecordVO> page, PagePlatformPrepaidFreightAccountParam param);
@SelectProvider(type = OwnerRunningWaterRecordSqlProvider.class, method = "ownerAccountRunningWaterPageList")
IPage<OwnerAccountRunningWaterRecordVO> ownerAccountRunningWaterPageList(Page<OwnerAccountRunningWaterRecordVO> page, PageOwnerAccountRunningWaterParam param);
}
\ No newline at end of file
package com.clx.performance.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.model.OwnerTopUp;
import com.clx.performance.param.pc.PageOwnerTopUpListParam;
import com.clx.performance.sqlProvider.OwnerTopUpProvider;
import com.clx.performance.vo.pc.OwnerTopUpVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.SelectProvider;
/**
* 货主充值
......@@ -10,4 +16,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface OwnerTopUpMapper extends BaseMapper<OwnerTopUp> {
@SelectProvider(type = OwnerTopUpProvider.class, method = "ownerTopUpPageList")
IPage<OwnerTopUpVO> ownerTopUpPageList(Page<OwnerTopUpVO> page, PageOwnerTopUpListParam param);
}
\ No newline at end of file
......@@ -9,8 +9,8 @@ import com.msl.common.model.HasKey;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.apache.poi.hpsf.Decimal;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
......@@ -29,21 +29,28 @@ public class OwnerCaseOut implements HasKey<Integer> {
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 货主编号
*/
@TableField("owner_user_no")
private Long ownerUserNo;
/**
* 提现编号
*/
@TableField("case_out_no")
private Long caseOutNo;
/**
* 提现账户类型
* 账户类型 1: 保证金 2:预付运费
*/
@TableField("case_out_type")
private Integer caseOutType;
@TableField("account_type")
private Integer accountType;
/**
* 提现金额
*/
@TableField("case_out_balance")
private Decimal caseOutBalance;
private BigDecimal caseOutBalance;
/**
* 状态
*/
......@@ -59,11 +66,6 @@ public class OwnerCaseOut implements HasKey<Integer> {
*/
@TableField("case_out_bank_number")
private String caseOutBankNumber;
/**
* 提现时间
*/
@TableField("case_out_time")
private LocalDateTime caseOutTime;
/**
* 操作人
*/
......
......@@ -10,6 +10,7 @@ import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
......@@ -37,17 +38,17 @@ public class OwnerTopUp implements HasKey<Integer> {
* 货主编码
*/
@TableField("owner_user_no")
private Integer ownerUserNo;
private Long ownerUserNo;
/**
* 充值类型
*/
@TableField("top_up_type")
private Integer topUpType;
@TableField("account_type")
private Integer accountType;
/**
* 充值金额
*/
@TableField("top_up_balance")
private Double topUpBalance;
private BigDecimal topUpBalance;
/**
* 状态
*/
......@@ -93,6 +94,12 @@ public class OwnerTopUp implements HasKey<Integer> {
*/
@TableField("approval_turn_down")
private String approvalTurnDown;
/**
* 修改时间
*/
@TableField("modified_time")
private LocalDateTime modifiedTime;
@KeyColumn("id")
@Override
public Integer gainKey() {
......
package com.clx.performance.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.PageOwnerAccountListParam;
import com.clx.performance.param.pc.PageOwnerMarginAccountParam;
import com.clx.performance.param.pc.PageOwnerPrepaidFreightAccountParam;
import com.clx.performance.param.pc.*;
import com.clx.performance.vo.pc.OwnerAccountRunningWaterRecordVO;
import com.clx.performance.vo.pc.OwnerAccountVO;
......@@ -12,9 +10,26 @@ import java.util.List;
public interface OwnerAccountService {
IPage<OwnerAccountVO> pageList(PageOwnerAccountListParam param);
IPage<OwnerAccountRunningWaterRecordVO> marginAccountPageList(PageOwnerMarginAccountParam param);
IPage<OwnerAccountRunningWaterRecordVO> marginAccountPageList(PagePlatformMarginAccountParam param);
IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PageOwnerPrepaidFreightAccountParam param);
IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PagePlatformPrepaidFreightAccountParam param);
List<OwnerAccountVO> accountInfo(String ownerNo);
Long accountTopUp(OwnerTopUpParam param);
Long accountCaseOut(OwnerCaseOutParam param);
/**
* 充值审批
* @param id
* @param turnDownContent
*/
void accountTopUpApprove(Integer id, String turnDownContent);
/**
* 提现审批
* @param param
*/
void accountCaseOutApprove(OwnerCaseOutApproveParam param);
}
package com.clx.performance.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.PageOwnerCaseOutListParam;
import com.clx.performance.vo.pc.OwnerCaseOutVO;
public interface OwnerCaseOutService {
/**
* 车主提现列表
* @param param
* @return
*/
IPage<OwnerCaseOutVO> ownerCaseOutPageList(PageOwnerCaseOutListParam param);
}
package com.clx.performance.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.PageOwnerAccountRunningWaterParam;
import com.clx.performance.vo.pc.OwnerAccountRunningWaterRecordVO;
public interface OwnerRunningWaterRecordService {
/**
* 查询货主账户流水列表
* @param param
* @return
*/
IPage<OwnerAccountRunningWaterRecordVO> ownerAccountRunningWaterPageList(PageOwnerAccountRunningWaterParam param);
}
package com.clx.performance.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.param.pc.PageOwnerTopUpListParam;
import com.clx.performance.vo.pc.OwnerTopUpVO;
public interface OwnerTopUpService {
/**
* 货主充值记录列表
* @param param
* @return
*/
IPage<OwnerTopUpVO> ownerTopUpPageList(PageOwnerTopUpListParam param);
}
package com.clx.performance.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.component.IdGenerateSnowFlake;
import com.clx.performance.dao.OwnerAccountDao;
import com.clx.performance.dao.OwnerCaseOutDao;
import com.clx.performance.dao.OwnerRunningWaterRecordDao;
import com.clx.performance.param.pc.PageOwnerAccountListParam;
import com.clx.performance.param.pc.PageOwnerMarginAccountParam;
import com.clx.performance.param.pc.PageOwnerPrepaidFreightAccountParam;
import com.clx.performance.dao.OwnerTopUpDao;
import com.clx.performance.enums.IdTypeEnum;
import com.clx.performance.enums.OwnerAccountEnum;
import com.clx.performance.model.OwnerCaseOut;
import com.clx.performance.model.OwnerTopUp;
import com.clx.performance.param.pc.*;
import com.clx.performance.service.OwnerAccountService;
import com.clx.performance.vo.pc.OwnerAccountRunningWaterRecordVO;
import com.clx.performance.vo.pc.OwnerAccountVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.List;
......@@ -24,18 +30,24 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
private final OwnerRunningWaterRecordDao ownerRunningWaterRecordDao;
private final IdGenerateSnowFlake idGenerateSnowFlake;
private final OwnerTopUpDao ownerTopUpDao;
private final OwnerCaseOutDao ownerCaseOutDao;
@Override
public IPage<OwnerAccountVO> pageList(PageOwnerAccountListParam param) {
return ownerAccountDao.pageList(param);
}
@Override
public IPage<OwnerAccountRunningWaterRecordVO> marginAccountPageList(PageOwnerMarginAccountParam param) {
public IPage<OwnerAccountRunningWaterRecordVO> marginAccountPageList(PagePlatformMarginAccountParam param) {
return ownerRunningWaterRecordDao.marginAccountPageList(param);
}
@Override
public IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PageOwnerPrepaidFreightAccountParam param) {
public IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PagePlatformPrepaidFreightAccountParam param) {
return ownerRunningWaterRecordDao.prepaidFreightAccountPageList(param);
}
......@@ -43,4 +55,71 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
public List<OwnerAccountVO> accountInfo(String ownerNo) {
return ownerAccountDao.accountInfo(ownerNo);
}
@Override
public Long accountTopUp(OwnerTopUpParam param) {
OwnerTopUp entity = new OwnerTopUp();
entity.setAccountType(param.getAccountType());
entity.setOwnerUserNo(param.getOwnerUserNo());
entity.setTopUpBalance(param.getTopUpBalance());
entity.setStatus(OwnerAccountEnum.TopUpStatus.PENDING.getCode());
entity.setDrawingBank(param.getDrawingBank());
entity.setDrawingBankNumber(param.getDrawingBankNumber());
entity.setDrawingProof(param.getDrawingProof());
//充值编号
entity.setTopUpNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.TOP_UP.getCode()));
ownerTopUpDao.saveEntity(entity);
return entity.getTopUpNo();
}
@Override
public Long accountCaseOut(OwnerCaseOutParam param) {
OwnerCaseOut entity = new OwnerCaseOut();
entity.setAccountType(param.getAccountType());
entity.setCaseOutNo(idGenerateSnowFlake.nextId(IdTypeEnum.Type.CASE_OUT.getCode()));
entity.setOwnerUserNo(param.getOwnerUserNo());
entity.setCaseOutBalance(param.getCaseOutBalance());
entity.setStatus(OwnerAccountEnum.CaseOutStatus.PENDING_PAYMENT.getCode());
entity.setCaseOutBank(param.getCaseOutBank());
entity.setCaseOutBankNumber(param.getCaseOutBankNumber());
ownerCaseOutDao.saveEntity(entity);
return entity.getCaseOutNo();
}
/**
* 充值审批
*
* @param id
* @param turnDownContent
*/
@Override
public void accountTopUpApprove(Integer id, String turnDownContent) {
OwnerTopUp entity = new OwnerTopUp();
if (StringUtils.isNotBlank(turnDownContent)) {
entity.setId(id);
entity.setApprovalTurnDown(turnDownContent);
entity.setStatus(OwnerAccountEnum.TopUpStatus.APPROVAL_REJECTION.getCode());
ownerTopUpDao.updateEntityByKey(entity);
} else {
entity.setId(id);
entity.setStatus(OwnerAccountEnum.TopUpStatus.APPROVAL_APPROVE.getCode());
ownerTopUpDao.updateEntityByKey(entity);
}
}
/**
* 提现审批
* @param param
*/
@Override
public void accountCaseOutApprove(OwnerCaseOutApproveParam param) {
OwnerCaseOut entity = new OwnerCaseOut();
entity.setId(param.getId());
entity.setPaymentProof(param.getPaymentProof());
entity.setPlatformPaymentBank(entity.getPlatformPaymentBank());
entity.setPlatformPaymentBankNumber(param.getPlatformPaymentBankNumber());
ownerCaseOutDao.updateEntityByKey(entity);
}
}
package com.clx.performance.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.dao.OwnerCaseOutDao;
import com.clx.performance.param.pc.PageOwnerCaseOutListParam;
import com.clx.performance.service.OwnerCaseOutService;
import com.clx.performance.vo.pc.OwnerCaseOutVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@AllArgsConstructor
public class OwnerCaseOutServiceImpl implements OwnerCaseOutService {
private final OwnerCaseOutDao ownerCaseOutDao;
/**
* 车主提现列表
*
* @param param
* @return
*/
@Override
public IPage<OwnerCaseOutVO> ownerCaseOutPageList(PageOwnerCaseOutListParam param) {
return ownerCaseOutDao.ownerCaseOutPageList(param);
}
}
package com.clx.performance.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.dao.OwnerRunningWaterRecordDao;
import com.clx.performance.param.pc.PageOwnerAccountRunningWaterParam;
import com.clx.performance.service.OwnerRunningWaterRecordService;
import com.clx.performance.vo.pc.OwnerAccountRunningWaterRecordVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@AllArgsConstructor
public class OwnerRunningWaterRecordServiceImpl implements OwnerRunningWaterRecordService {
private final OwnerRunningWaterRecordDao ownerRunningWaterRecordDao;
@Override
public IPage<OwnerAccountRunningWaterRecordVO> ownerAccountRunningWaterPageList(PageOwnerAccountRunningWaterParam param) {
return ownerRunningWaterRecordDao.ownerAccountRunningWaterPageList(param);
}
}
package com.clx.performance.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.dao.OwnerTopUpDao;
import com.clx.performance.param.pc.PageOwnerTopUpListParam;
import com.clx.performance.service.OwnerTopUpService;
import com.clx.performance.vo.pc.OwnerTopUpVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@AllArgsConstructor
public class OwnerTopUpServiceImpl implements OwnerTopUpService {
private final OwnerTopUpDao ownerTopUpDao;
@Override
public IPage<OwnerTopUpVO> ownerTopUpPageList(PageOwnerTopUpListParam param) {
return ownerTopUpDao.ownerTopUpPageList(param);
}
}
package com.clx.performance.sqlProvider;
import cn.hutool.core.util.ObjectUtil;
import com.clx.performance.param.pc.PageOwnerCaseOutListParam;
import com.clx.performance.param.pc.PageOwnerTopUpListParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.jdbc.SQL;
public class OwnerCaseOutProvider {
public String ownerCaseOutPageList(@Param("param") PageOwnerCaseOutListParam param) {
String sql = new SQL() {{
SELECT("a.id, a.owner_user_no," +
" a.case_out_no, a.case_out_balance, a.account_type, " +
" a.status,a.case_out_bank,a.case_out_bank_number,a.payment_time,a.create_by,a.platform_payment_bank_number,a.platform_payment_bank,a.payment_by,a.payment_proof,a.create_time,a.modify_time");
FROM("owner_case_out a");
if (StringUtils.isNotBlank(param.getBeginTime()) && StringUtils.isNotBlank(param.getEndTime())) {
WHERE("a.create_time >= #{param.beginTime} and a.create_time <= #{param.endTime}");
}
if (ObjectUtil.isNotNull(param.getAccountType())) {
WHERE("a.account_type = #{param.accountType}");
}
if (ObjectUtil.isNotNull(param.getOwnerUserNo())) {
WHERE("a.owner_user_no = #{param.ownerUserNo}");
}
ORDER_BY("a.create_time desc");
}}.toString();
return sql;
}
}
package com.clx.performance.sqlProvider;
import cn.hutool.core.util.ObjectUtil;
import com.clx.performance.enums.OwnerAccountTypeEnum;
import com.clx.performance.param.pc.PageOwnerMarginAccountParam;
import com.clx.performance.param.pc.PageOwnerPrepaidFreightAccountParam;
import com.clx.performance.enums.OwnerAccountEnum;
import com.clx.performance.param.pc.PageOwnerAccountRunningWaterParam;
import com.clx.performance.param.pc.PagePlatformMarginAccountParam;
import com.clx.performance.param.pc.PagePlatformPrepaidFreightAccountParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.jdbc.SQL;
public class OwnerRunningWaterRecordSqlProvider {
public String marginAccountPageList(@Param("param") PageOwnerMarginAccountParam param) {
public String marginAccountPageList(@Param("param") PagePlatformMarginAccountParam param) {
String sql = new SQL() {{
SELECT("a.id, a.owner_code," +
" a.owner_name, a.mobile, a.account_type, a.running_water_type,a.order_id,a.order_no,a.order_child_id,a.order_child_no,a.alteration_balance," +
" a.account_balance,a.usable_balance, a.frozen_balance,a.create_by,a.create_time");
FROM("owner_running_water_record a");
WHERE("a.account_type =" + OwnerAccountTypeEnum.Status.MARGIN_ACCOUNT.getCode());
WHERE("a.account_type =" + OwnerAccountEnum.AccountTypeStatus.MARGIN_ACCOUNT.getCode());
if (StringUtils.isNotBlank(param.getBeginTime()) && StringUtils.isNotBlank(param.getEndTime())) {
WHERE("a.create_time >= #{param.beginTime} and a.create_time <= #{param.endTime}");
......@@ -32,13 +33,13 @@ public class OwnerRunningWaterRecordSqlProvider {
return sql;
}
public String prepaidFreightAccountPageList(@Param("param") PageOwnerPrepaidFreightAccountParam param) {
public String prepaidFreightAccountPageList(@Param("param") PagePlatformPrepaidFreightAccountParam param) {
String sql = new SQL() {{
SELECT("a.id, a.owner_user_no," +
" a.owner_user_name, a.mobile, a.account_type, a.running_water_type,a.order_id,a.order_no,a.order_child_id,a.order_child_no,a.alteration_balance," +
" a.account_balance,a.usable_balance, a.frozen_balance,a.create_by,a.create_time");
FROM("owner_running_water_record a");
WHERE("a.account_type =" + OwnerAccountTypeEnum.Status.PREPAID_FREIGHT_ACCOUNT.getCode());
WHERE("a.account_type =" + OwnerAccountEnum.AccountTypeStatus.PREPAID_FREIGHT_ACCOUNT.getCode());
if (StringUtils.isNotBlank(param.getBeginTime()) && StringUtils.isNotBlank(param.getEndTime())) {
WHERE("a.create_time >= #{param.beginTime} and a.create_time <= #{param.endTime}");
......@@ -57,4 +58,25 @@ public class OwnerRunningWaterRecordSqlProvider {
return sql;
}
public String ownerAccountRunningWaterPageList(@Param("param") PageOwnerAccountRunningWaterParam param) {
String sql = new SQL() {{
SELECT("a.id, a.owner_user_no," +
" a.owner_user_name, a.mobile, a.account_type, a.running_water_type,a.order_id,a.order_no,a.order_child_id,a.order_child_no,a.alteration_balance," +
" a.account_balance,a.usable_balance, a.frozen_balance,a.create_by,a.create_time");
FROM("owner_running_water_record a");
if (ObjectUtil.isNotNull(param.getAccountType())) {
WHERE("a.account_type = #{param.accountType}");
}
if (StringUtils.isNotBlank(param.getBeginTime()) && StringUtils.isNotBlank(param.getEndTime())) {
WHERE("a.create_time >= #{param.beginTime} and a.create_time <= #{param.endTime}");
}
if (ObjectUtil.isNotNull(param.getRunningWaterType())) {
WHERE("a.running_water_type = #{param.runningWaterType}");
}
ORDER_BY("a.create_time desc");
}}.toString();
return sql;
}
}
package com.clx.performance.sqlProvider;
import cn.hutool.core.util.ObjectUtil;
import com.clx.performance.param.pc.PageOwnerAccountListParam;
import com.clx.performance.param.pc.PageOwnerTopUpListParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.jdbc.SQL;
public class OwnerTopUpProvider {
public String ownerTopUpPageList(@Param("param") PageOwnerTopUpListParam param) {
String sql = new SQL() {{
SELECT("a.id, a.owner_user_no," +
" a.top_up_no, a.top_up_balance, a.account_type, " +
" a.status,a.drawing_bank, a.drawing_bank_number,a.drawing_proof,a.approval_time,a.approval_by,a.approval_turn_down,a.create_by,a.create_time,a.modify_time");
FROM("owner_top_up a");
if (StringUtils.isNotBlank(param.getBeginTime()) && StringUtils.isNotBlank(param.getEndTime())) {
WHERE("a.create_time >= #{param.beginTime} and a.create_time <= #{param.endTime}");
}
if (ObjectUtil.isNotNull(param.getAccountType())) {
WHERE("a.account_type = #{param.accountType}");
}
if (ObjectUtil.isNotNull(param.getOwnerUserNo())) {
WHERE("a.owner_user_no = #{param.ownerUserNo}");
}
ORDER_BY("a.create_time desc");
}}.toString();
return sql;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论