提交 f7f4e378 authored 作者: liuhaiquan's avatar liuhaiquan

Merge remote-tracking branch 'origin/test' into test

package com.clx.performance.vo.app; package com.clx.performance.vo.app;
import com.msl.common.convertor.type.MoneyOutConvert;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -27,51 +28,53 @@ public class APPNetworkDriverRunningWaterRecordVO { ...@@ -27,51 +28,53 @@ public class APPNetworkDriverRunningWaterRecordVO {
private Integer runningWaterType; private Integer runningWaterType;
@ApiModelProperty("流水类型简介") @ApiModelProperty("流水类型简介")
private Integer runningWaterTypeMsg; private String runningWaterTypeMsg;
@ApiModelProperty("资金类型 10:收入 20:冻结 30:支出") @ApiModelProperty("资金类型 10:收入 20:冻结 30:支出")
private Integer fundType; private Integer fundType;
@ApiModelProperty("资金类型简介") @ApiModelProperty("资金类型简介")
private Integer fundTypeMsg; private String fundTypeMsg;
@ApiModelProperty("") @ApiModelProperty("")
private Long relationId; private Long relationId;
@ApiModelProperty("订单ID") @ApiModelProperty("货单编号")
private Integer orderId; private String orderGoodsNo;
@ApiModelProperty("订单编号") @ApiModelProperty("订单编号")
private String orderNo; private String orderNo;
@ApiModelProperty("运单ID")
private Integer orderChildId;
@ApiModelProperty("运单编号") @ApiModelProperty("运单编号")
private String orderChildNo; private String childNo;
@ApiModelProperty("变动金额") @ApiModelProperty("变动金额")
@MoneyOutConvert
private BigDecimal alterationBalance; private BigDecimal alterationBalance;
@ApiModelProperty("冻结金额") @ApiModelProperty("冻结金额")
@MoneyOutConvert
private BigDecimal frozenBalance; private BigDecimal frozenBalance;
@ApiModelProperty("可用余额") @ApiModelProperty("可用余额")
@MoneyOutConvert
private BigDecimal usableBalance; private BigDecimal usableBalance;
@ApiModelProperty("账户余额") @ApiModelProperty("账户余额")
@MoneyOutConvert
private BigDecimal accountBalance; private BigDecimal accountBalance;
@ApiModelProperty("扣除金额") @ApiModelProperty("扣除金额")
@MoneyOutConvert
private BigDecimal takeOutBalance; private BigDecimal takeOutBalance;
@ApiModelProperty("操作人") @ApiModelProperty("操作人")
private String createBy; private String createBy;
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private LocalDateTime createTime; private String createTime;
@ApiModelProperty("修改时间") @ApiModelProperty("修改时间")
private LocalDateTime modifiedTime; private String modifiedTime;
} }
package com.clx.performance.vo.pc; package com.clx.performance.vo.pc;
import com.msl.common.convertor.type.MoneyOutConvert;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
...@@ -60,6 +61,7 @@ public class NetworkCaseOutRecordVO { ...@@ -60,6 +61,7 @@ public class NetworkCaseOutRecordVO {
private String childNo; private String childNo;
@ApiModelProperty("变动金额") @ApiModelProperty("变动金额")
@MoneyOutConvert
private BigDecimal alterationBalance; private BigDecimal alterationBalance;
@ApiModelProperty("操作人") @ApiModelProperty("操作人")
......
package com.clx.performance.vo.pc; package com.clx.performance.vo.pc;
import com.msl.common.convertor.type.MoneyOutConvert;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
...@@ -35,13 +36,13 @@ public class NetworkDriverRunningWaterRecordVO{ ...@@ -35,13 +36,13 @@ public class NetworkDriverRunningWaterRecordVO{
private Integer runningWaterType; private Integer runningWaterType;
@ApiModelProperty("流水类型简介") @ApiModelProperty("流水类型简介")
private Integer runningWaterTypeMsg; private String runningWaterTypeMsg;
@ApiModelProperty("资金类型 10:收入 20:冻结 30:支出") @ApiModelProperty("资金类型 10:收入 20:冻结 30:支出")
private Integer fundType; private Integer fundType;
@ApiModelProperty("资金类型简介") @ApiModelProperty("资金类型简介")
private Integer fundTypeMsg; private String fundTypeMsg;
@ApiModelProperty("") @ApiModelProperty("")
private Long relationId; private Long relationId;
...@@ -59,18 +60,23 @@ public class NetworkDriverRunningWaterRecordVO{ ...@@ -59,18 +60,23 @@ public class NetworkDriverRunningWaterRecordVO{
private String orderChildNo; private String orderChildNo;
@ApiModelProperty("变动金额") @ApiModelProperty("变动金额")
@MoneyOutConvert
private BigDecimal alterationBalance; private BigDecimal alterationBalance;
@ApiModelProperty("冻结金额") @ApiModelProperty("冻结金额")
@MoneyOutConvert
private BigDecimal frozenBalance; private BigDecimal frozenBalance;
@ApiModelProperty("可用余额") @ApiModelProperty("可用余额")
@MoneyOutConvert
private BigDecimal usableBalance; private BigDecimal usableBalance;
@ApiModelProperty("账户余额") @ApiModelProperty("账户余额")
@MoneyOutConvert
private BigDecimal accountBalance; private BigDecimal accountBalance;
@ApiModelProperty("扣除金额") @ApiModelProperty("扣除金额")
@MoneyOutConvert
private BigDecimal takeOutBalance; private BigDecimal takeOutBalance;
@ApiModelProperty("操作人") @ApiModelProperty("操作人")
......
...@@ -44,7 +44,7 @@ public class NetworkDriverAccountController { ...@@ -44,7 +44,7 @@ public class NetworkDriverAccountController {
@ApiOperation(value = "网络货运账户详情", notes = "<br>By:胡宇帆") @ApiOperation(value = "网络货运账户详情", notes = "<br>By:胡宇帆")
@PostMapping("/networkAccountInfoList") @PostMapping("/networkAccountInfoList")
@UnitCovert(param = false) @UnitCovert(param = false)
public Result<PageData<NetworkDriverRunningWaterRecordVO>> networkAccountInfoList(PageNetworkAccountInfoListParam param) { public Result<PageData<NetworkDriverRunningWaterRecordVO>> networkAccountInfoList(@RequestBody PageNetworkAccountInfoListParam param) {
IPage<NetworkDriverRunningWaterRecordVO> page = networkDriverRunningWaterRecordService.networkDriverRunningWaterRecordList(param); IPage<NetworkDriverRunningWaterRecordVO> page = networkDriverRunningWaterRecordService.networkDriverRunningWaterRecordList(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages()); return Result.page(page.getRecords(), page.getTotal(), page.getPages());
} }
...@@ -52,7 +52,7 @@ public class NetworkDriverAccountController { ...@@ -52,7 +52,7 @@ public class NetworkDriverAccountController {
@ApiOperation(value = "车主提现", notes = "<br>By:胡宇帆") @ApiOperation(value = "车主提现", notes = "<br>By:胡宇帆")
@PostMapping("/networkCaseOutRecord") @PostMapping("/networkCaseOutRecord")
@UnitCovert(param = false) @UnitCovert(param = false)
public Result<PageData<NetworkCaseOutRecordVO>> networkCaseOutRecord(PageNetworkCaseOutRecordListParam param) { public Result<PageData<NetworkCaseOutRecordVO>> networkCaseOutRecord(@RequestBody PageNetworkCaseOutRecordListParam param) {
IPage<NetworkCaseOutRecordVO> page = networkCaseOutRecordService.networkCaseOutRecord(param); IPage<NetworkCaseOutRecordVO> page = networkCaseOutRecordService.networkCaseOutRecord(param);
return Result.page(page.getRecords(), page.getTotal(), page.getPages()); return Result.page(page.getRecords(), page.getTotal(), page.getPages());
} }
......
...@@ -4,6 +4,7 @@ package com.clx.performance.dao.impl.settle; ...@@ -4,6 +4,7 @@ package com.clx.performance.dao.impl.settle;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.dao.settle.NetworkDriverRunningWaterRecordDao; import com.clx.performance.dao.settle.NetworkDriverRunningWaterRecordDao;
import com.clx.performance.enums.NetworkDriverAccountEnum;
import com.clx.performance.mapper.settle.NetworkDriverRunningWaterRecordMapper; import com.clx.performance.mapper.settle.NetworkDriverRunningWaterRecordMapper;
import com.clx.performance.model.settle.NetworkDriverRunningWaterRecord; import com.clx.performance.model.settle.NetworkDriverRunningWaterRecord;
import com.clx.performance.param.app.NetworkDriverPageParam; import com.clx.performance.param.app.NetworkDriverPageParam;
...@@ -39,4 +40,12 @@ public class NetworkDriverRunningWaterRecordDaoImpl extends BaseDaoImpl<NetworkD ...@@ -39,4 +40,12 @@ public class NetworkDriverRunningWaterRecordDaoImpl extends BaseDaoImpl<NetworkD
Page<APPNetworkDriverRunningWaterRecordVO> page = Page.of(param.getPage(), param.getPageSize()); Page<APPNetworkDriverRunningWaterRecordVO> page = Page.of(param.getPage(), param.getPageSize());
return baseMapper.runningWaterList(page, param); return baseMapper.runningWaterList(page, param);
} }
@Override
public void updateFrozenFlagByChildNo(String childNo) {
update(lUdWrapper().set(NetworkDriverRunningWaterRecord::getFrozenFlag, 1)
.eq(NetworkDriverRunningWaterRecord::getChildNo, childNo)
.eq(NetworkDriverRunningWaterRecord::getRunningWaterType, NetworkDriverAccountEnum.RunningWaterStatus.CASE_OUT_FROZEN.getCode())
);
}
} }
...@@ -22,4 +22,6 @@ public interface NetworkDriverRunningWaterRecordDao extends BaseDao<NetworkDrive ...@@ -22,4 +22,6 @@ public interface NetworkDriverRunningWaterRecordDao extends BaseDao<NetworkDrive
IPage<APPNetworkDriverRunningWaterRecordVO> pageFrozenList(NetworkDriverPageParam param); IPage<APPNetworkDriverRunningWaterRecordVO> pageFrozenList(NetworkDriverPageParam param);
IPage<APPNetworkDriverRunningWaterRecordVO> runningWaterList(NetworkDriverPageParam param); IPage<APPNetworkDriverRunningWaterRecordVO> runningWaterList(NetworkDriverPageParam param);
void updateFrozenFlagByChildNo(String childNo);
} }
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.model.settle.NetworkDriverAccount; import com.clx.performance.model.settle.NetworkDriverAccount;
import com.clx.performance.param.pc.PageNetworkAccountListParam; import com.clx.performance.param.pc.PageNetworkAccountListParam;
import com.clx.performance.sqlProvider.settle.NetworkDriverAccountProvider; import com.clx.performance.sqlProvider.settle.NetworkDriverAccountProvider;
import com.clx.performance.vo.pc.IntegralRecordVO;
import com.clx.performance.vo.pc.NetworkDriverAccountVO; import com.clx.performance.vo.pc.NetworkDriverAccountVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider; import org.apache.ibatis.annotations.SelectProvider;
...@@ -19,7 +20,7 @@ import org.apache.ibatis.annotations.Update; ...@@ -19,7 +20,7 @@ import org.apache.ibatis.annotations.Update;
public interface NetworkDriverAccountMapper extends BaseMapper<NetworkDriverAccount> { public interface NetworkDriverAccountMapper extends BaseMapper<NetworkDriverAccount> {
@SelectProvider(type = NetworkDriverAccountProvider.class, method = "networkAccountList") @SelectProvider(type = NetworkDriverAccountProvider.class, method = "networkAccountList")
IPage<NetworkDriverAccountVO> networkAccountList(Page<NetworkDriverAccountVO> page, PageNetworkAccountListParam param); IPage<NetworkDriverAccountVO> networkAccountList(@Param("page")Page<NetworkDriverAccountVO> page, @Param("param")PageNetworkAccountListParam param);
@Update("update network_driver_account set usable_balance = usable_balance + #{account.usableBalance}" @Update("update network_driver_account set usable_balance = usable_balance + #{account.usableBalance}"
+ ",account_balance = account_balance + #{account.accountBalance}" + ",account_balance = account_balance + #{account.accountBalance}"
......
...@@ -160,10 +160,11 @@ public class OrderChildServiceImpl implements OrderChildService { ...@@ -160,10 +160,11 @@ public class OrderChildServiceImpl implements OrderChildService {
private ZjxlGpsService zjxlGpsService; private ZjxlGpsService zjxlGpsService;
@Autowired @Autowired
private OwnerRunningWaterRecordDao ownerRunningWaterRecordDao; private UserService userService;
@Autowired @Autowired
private UserService userService; private OwnerRunningWaterRecordDao ownerRunningWaterRecordDao;
@Override @Override
......
...@@ -71,6 +71,7 @@ import java.util.ArrayList; ...@@ -71,6 +71,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.UUID; import java.util.UUID;
import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Slf4j @Slf4j
......
...@@ -21,6 +21,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -21,6 +21,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime;
/** /**
* @author kavin * @author kavin
...@@ -58,6 +59,7 @@ public class NetworkDriverAccountServiceImpl implements NetworkDriverAccountServ ...@@ -58,6 +59,7 @@ public class NetworkDriverAccountServiceImpl implements NetworkDriverAccountServ
.accountBalance(BigDecimal.ZERO) .accountBalance(BigDecimal.ZERO)
.usableBalance(BigDecimal.ZERO) .usableBalance(BigDecimal.ZERO)
.frozenBalance(BigDecimal.ZERO) .frozenBalance(BigDecimal.ZERO)
.createTime(LocalDateTime.now())
.createBy("系统") .createBy("系统")
.walletCode(walletCode).build(); .walletCode(walletCode).build();
networkDriverAccountDao.saveEntity(entity); networkDriverAccountDao.saveEntity(entity);
......
...@@ -64,8 +64,7 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver ...@@ -64,8 +64,7 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver
/** /**
* 运单同步网络货运生成司机运单结算流水 * 运单同步网络货运生成司机运单结算流水
* @param userNo * @param settlementDriverDetail
* @param money
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
...@@ -74,9 +73,9 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver ...@@ -74,9 +73,9 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver
NetworkDriverAccount networkDriverAccount = networkDriverAccountDao.getOneByField(NetworkDriverAccount::getDriverUserNo, settlementDriverDetail.getDriverUserNo()).get(); NetworkDriverAccount networkDriverAccount = networkDriverAccountDao.getOneByField(NetworkDriverAccount::getDriverUserNo, settlementDriverDetail.getDriverUserNo()).get();
log.info("查询出NetworkDriverAccount{}", JSONUtil.parse(networkDriverAccount)); log.info("查询出NetworkDriverAccount{}", JSONUtil.parse(networkDriverAccount));
NetworkDriverAccount build = NetworkDriverAccount.builder().id(networkDriverAccount.getId()) NetworkDriverAccount build = NetworkDriverAccount.builder().id(networkDriverAccount.getId())
.usableBalance(settlementDriverDetail.getPrepayFreight()) .usableBalance(settlementDriverDetail.getSettlementFreight())
.frozenBalance(BigDecimal.ZERO) .frozenBalance(BigDecimal.ZERO)
.accountBalance(settlementDriverDetail.getPrepayFreight()).build(); .accountBalance(settlementDriverDetail.getSettlementFreight()).build();
while (true) { while (true) {
NetworkDriverAccount account = networkDriverAccountDao.getEntityByKey(build.getId()).get(); NetworkDriverAccount account = networkDriverAccountDao.getEntityByKey(build.getId()).get();
build.setModifiedTime(account.getModifiedTime()); build.setModifiedTime(account.getModifiedTime());
...@@ -85,8 +84,10 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver ...@@ -85,8 +84,10 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver
if (i == 1) { if (i == 1) {
account = networkDriverAccountDao.getEntityByKey(build.getId()).get(); account = networkDriverAccountDao.getEntityByKey(build.getId()).get();
NetworkDriverRunningWaterRecord entity = NetworkDriverRunningWaterRecord.builder() NetworkDriverRunningWaterRecord entity = NetworkDriverRunningWaterRecord.builder()
.mobile(networkDriverAccount.getMobile())
.usableBalance(account.getUsableBalance()) .usableBalance(account.getUsableBalance())
.alterationBalance(settlementDriverDetail.getPrepayFreight()).accountBalance(account.getAccountBalance()) .alterationBalance(settlementDriverDetail.getSettlementFreight())
.accountBalance(account.getAccountBalance())
.frozenBalance(account.getFrozenBalance()).createBy("系统") .frozenBalance(account.getFrozenBalance()).createBy("系统")
.fundType(NetworkDriverAccountEnum.FundType.INCOME.getCode()) .fundType(NetworkDriverAccountEnum.FundType.INCOME.getCode())
.fundTypeMsg(NetworkDriverAccountEnum.FundType.INCOME.getMsg()) .fundTypeMsg(NetworkDriverAccountEnum.FundType.INCOME.getMsg())
...@@ -109,18 +110,18 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver ...@@ -109,18 +110,18 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver
/** /**
* 运单同步网络货运后司机运单提现冻结流水 * 运单同步网络货运后司机运单提现冻结流水
* @param userNo * @param settlementDriverDetail
* @param money
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void generateCaseOutFrozenRunningWaterRecord(SettlementDriverDetail settlementDriverDetail) { public void generateCaseOutFrozenRunningWaterRecord(SettlementDriverDetail settlementDriverDetail) {
log.info("运单同步网络货运后司机运单提现冻结流水"); log.info("运单同步网络货运后司机运单提现冻结流水");
NetworkDriverAccount networkDriverAccount = networkDriverAccountDao.getOneByField(NetworkDriverAccount::getDriverUserNo, settlementDriverDetail.getDriverUserNo()).get(); NetworkDriverAccount networkDriverAccount = networkDriverAccountDao.getOneByField(NetworkDriverAccount::getDriverUserNo, settlementDriverDetail.getDriverUserNo()).get();
log.info("查询出NetworkDriverAccount{}", JSONUtil.parse(networkDriverAccount)); log.info("查询出NetworkDriverAccount{}", JSONUtil.parse(networkDriverAccount));
NetworkDriverAccount build = NetworkDriverAccount.builder().id(networkDriverAccount.getId()) NetworkDriverAccount build = NetworkDriverAccount.builder().id(networkDriverAccount.getId())
.frozenBalance(settlementDriverDetail.getPrepayFreight()) .frozenBalance(settlementDriverDetail.getSettlementFreight())
.accountBalance(BigDecimal.ZERO) .accountBalance(BigDecimal.ZERO)
.usableBalance(settlementDriverDetail.getPrepayFreight()).build(); .usableBalance(settlementDriverDetail.getSettlementFreight()).build();
while (true) { while (true) {
NetworkDriverAccount account = networkDriverAccountDao.getEntityByKey(build.getId()).get(); NetworkDriverAccount account = networkDriverAccountDao.getEntityByKey(build.getId()).get();
build.setModifiedTime(account.getModifiedTime()); build.setModifiedTime(account.getModifiedTime());
...@@ -130,7 +131,9 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver ...@@ -130,7 +131,9 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver
account = networkDriverAccountDao.getEntityByKey(build.getId()).get(); account = networkDriverAccountDao.getEntityByKey(build.getId()).get();
NetworkDriverRunningWaterRecord entity = NetworkDriverRunningWaterRecord.builder() NetworkDriverRunningWaterRecord entity = NetworkDriverRunningWaterRecord.builder()
.usableBalance(account.getUsableBalance()) .usableBalance(account.getUsableBalance())
.alterationBalance(settlementDriverDetail.getPrepayFreight()).accountBalance(account.getAccountBalance()) .mobile(networkDriverAccount.getMobile())
.alterationBalance(settlementDriverDetail.getSettlementFreight())
.accountBalance(account.getAccountBalance())
.frozenBalance(account.getFrozenBalance()).createBy("系统") .frozenBalance(account.getFrozenBalance()).createBy("系统")
.fundType(NetworkDriverAccountEnum.FundType.FROZEN.getCode()) .fundType(NetworkDriverAccountEnum.FundType.FROZEN.getCode())
.fundTypeMsg(NetworkDriverAccountEnum.FundType.FROZEN.getMsg()) .fundTypeMsg(NetworkDriverAccountEnum.FundType.FROZEN.getMsg())
...@@ -138,6 +141,7 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver ...@@ -138,6 +141,7 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver
.driverUserNo(account.getDriverUserNo()) .driverUserNo(account.getDriverUserNo())
.runningWaterNo(idGenerateSnowFlake.nextId(3L)) .runningWaterNo(idGenerateSnowFlake.nextId(3L))
.runningWaterTypeMsg(NetworkDriverAccountEnum.RunningWaterStatus.CASE_OUT_FROZEN.getMsg()) .runningWaterTypeMsg(NetworkDriverAccountEnum.RunningWaterStatus.CASE_OUT_FROZEN.getMsg())
.frozenFlag(0)
.runningWaterType(NetworkDriverAccountEnum.RunningWaterStatus.CASE_OUT_FROZEN.getCode()) .runningWaterType(NetworkDriverAccountEnum.RunningWaterStatus.CASE_OUT_FROZEN.getCode())
.childNo(settlementDriverDetail.getChildNo()) .childNo(settlementDriverDetail.getChildNo())
.orderNo(settlementDriverDetail.getOrderNo()) .orderNo(settlementDriverDetail.getOrderNo())
...@@ -151,22 +155,29 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver ...@@ -151,22 +155,29 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void generateCaseOutSuccessRunningWaterRecord(SettlementDriverDetail settlementDriverDetail) { public void generateCaseOutSuccessRunningWaterRecord(SettlementDriverDetail settlementDriverDetail) {
log.info("运单同步网络货运生成司机运单提现成功流水");
NetworkDriverAccount networkDriverAccount = networkDriverAccountDao.getOneByField(NetworkDriverAccount::getDriverUserNo, settlementDriverDetail.getDriverUserNo()).get(); NetworkDriverAccount networkDriverAccount = networkDriverAccountDao.getOneByField(NetworkDriverAccount::getDriverUserNo, settlementDriverDetail.getDriverUserNo()).get();
log.info("查询出NetworkDriverAccount{}", JSONUtil.parse(networkDriverAccount));
NetworkDriverAccount build = NetworkDriverAccount.builder().id(networkDriverAccount.getId()) NetworkDriverAccount build = NetworkDriverAccount.builder().id(networkDriverAccount.getId())
.frozenBalance(settlementDriverDetail.getPrepayFreight().negate()) .frozenBalance(settlementDriverDetail.getSettlementFreight().negate())
.usableBalance(BigDecimal.ZERO) .usableBalance(BigDecimal.ZERO)
.accountBalance(settlementDriverDetail.getPrepayFreight()).build(); .accountBalance(settlementDriverDetail.getSettlementFreight()).build();
while (true) { while (true) {
NetworkDriverAccount account = networkDriverAccountDao.getEntityByKey(build.getId()).get(); NetworkDriverAccount account = networkDriverAccountDao.getEntityByKey(build.getId()).get();
build.setModifiedTime(account.getModifiedTime()); build.setModifiedTime(account.getModifiedTime());
Integer i = networkDriverAccountDao.updateAccountCAS(build, LocalDateTime.now(), false); Integer i = networkDriverAccountDao.updateAccountCAS(build, LocalDateTime.now(), false);
if (i == 1) { if (i == 1) {
networkDriverRunningWaterRecordDao.updateFrozenFlagByChildNo(settlementDriverDetail.getChildNo());
account = networkDriverAccountDao.getEntityByKey(build.getId()).get(); account = networkDriverAccountDao.getEntityByKey(build.getId()).get();
NetworkDriverRunningWaterRecord entity = NetworkDriverRunningWaterRecord.builder() NetworkDriverRunningWaterRecord entity = NetworkDriverRunningWaterRecord.builder()
.usableBalance(account.getUsableBalance()) .usableBalance(account.getUsableBalance())
.alterationBalance(settlementDriverDetail.getPrepayFreight()).accountBalance(account.getAccountBalance()) .mobile(networkDriverAccount.getMobile())
.alterationBalance(settlementDriverDetail.getSettlementFreight())
.accountBalance(account.getAccountBalance())
.frozenBalance(account.getFrozenBalance()).createBy("系统") .frozenBalance(account.getFrozenBalance()).createBy("系统")
.fundType(NetworkDriverAccountEnum.FundType.EXPENDITURE.getCode()) .fundType(NetworkDriverAccountEnum.FundType.EXPENDITURE.getCode())
.fundTypeMsg(NetworkDriverAccountEnum.FundType.EXPENDITURE.getMsg()) .fundTypeMsg(NetworkDriverAccountEnum.FundType.EXPENDITURE.getMsg())
...@@ -189,7 +200,7 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver ...@@ -189,7 +200,7 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver
@Override @Override
public void generateNetworkDriverRunningWaterRecord(SettlementDriverDetail settlementDriverDetail, Integer runningWaterType) { public void generateNetworkDriverRunningWaterRecord(SettlementDriverDetail settlementDriverDetail, Integer runningWaterType) {
if (NetworkDriverAccountEnum.RunningWaterStatus.SETTLEMENT.getCode().equals(runningWaterType)) { if (NetworkDriverAccountEnum.RunningWaterStatus.SETTLEMENT.getCode().equals(runningWaterType)) {
log.info("执行生成网络货运钱包相关,参数userNo:{},money{},runningWaterType:{}", settlementDriverDetail.getDriverUserNo(), settlementDriverDetail.getPrepayFreight(), runningWaterType); log.info("执行生成网络货运钱包相关,参数userNo:{},money{},runningWaterType:{}", settlementDriverDetail.getDriverUserNo(), settlementDriverDetail.getSettlementFreight(), runningWaterType);
strategyMap.get(NetworkDriverAccountEnum.RunningWaterStatus.SETTLEMENT.getCode()).accept(settlementDriverDetail); strategyMap.get(NetworkDriverAccountEnum.RunningWaterStatus.SETTLEMENT.getCode()).accept(settlementDriverDetail);
strategyMap.get(NetworkDriverAccountEnum.RunningWaterStatus.CASE_OUT_FROZEN.getCode()).accept(settlementDriverDetail); strategyMap.get(NetworkDriverAccountEnum.RunningWaterStatus.CASE_OUT_FROZEN.getCode()).accept(settlementDriverDetail);
} }
...@@ -219,8 +230,8 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver ...@@ -219,8 +230,8 @@ public class NetworkDriverRunningWaterRecordServiceImpl implements NetworkDriver
.driverUserName(settlementDriverDetail.getDriverName()).mobile(bankCardVO.getMobile()) .driverUserName(settlementDriverDetail.getDriverName()).mobile(bankCardVO.getMobile())
.status(NetworkDriverAccountEnum.CaseOutRecordStatus.WAIT_PLATFORM_PAY.getCode()) .status(NetworkDriverAccountEnum.CaseOutRecordStatus.WAIT_PLATFORM_PAY.getCode())
.statusMsg(NetworkDriverAccountEnum.CaseOutRecordStatus.WAIT_PLATFORM_PAY.getMsg()) .statusMsg(NetworkDriverAccountEnum.CaseOutRecordStatus.WAIT_PLATFORM_PAY.getMsg())
.bank(bankCardVO.getBank()).collectionBankCode(bankCardVO.getBankCode()) .bank(bankCardVO.getBank()).collectionBankCode(bankCardVO.getCardNo())
.payee(bankCardVO.getName()).alterationBalance(settlementDriverDetail.getPrepayFreight()) .payee(bankCardVO.getName()).alterationBalance(settlementDriverDetail.getSettlementFreight())
.orderNo(settlementDriverDetail.getOrderNo()).orderGoodsNo(settlementDriverDetail.getOrderGoodsNo()) .orderNo(settlementDriverDetail.getOrderNo()).orderGoodsNo(settlementDriverDetail.getOrderGoodsNo())
.childNo(settlementDriverDetail.getChildNo()) .childNo(settlementDriverDetail.getChildNo())
.platform("网运平台").createBy("系统").build(); .platform("网运平台").createBy("系统").build();
......
...@@ -7,7 +7,10 @@ import com.clx.performance.dto.PayStatusNotifyDTO; ...@@ -7,7 +7,10 @@ import com.clx.performance.dto.PayStatusNotifyDTO;
import com.clx.performance.enums.NetworkDriverAccountEnum; import com.clx.performance.enums.NetworkDriverAccountEnum;
import com.clx.performance.model.settle.OrderChildSyncTransportRecord; import com.clx.performance.model.settle.OrderChildSyncTransportRecord;
import com.clx.performance.model.settle.SettlementDriverDetail; import com.clx.performance.model.settle.SettlementDriverDetail;
import com.clx.performance.service.settle.NetworkDriverRunningWaterRecordService;
import com.clx.performance.service.settle.OrderChildSyncTransportRecordService; import com.clx.performance.service.settle.OrderChildSyncTransportRecordService;
import com.clx.performance.service.settle.SettlementDriverDetailService;
import com.clx.performance.service.settle.SettlementDriverService;
import com.clx.performance.struct.settle.SettlementDriverDetailStruct; import com.clx.performance.struct.settle.SettlementDriverDetailStruct;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -29,6 +32,10 @@ public class OrderChildSyncTransportRecordServiceImpl implements OrderChildSyncT ...@@ -29,6 +32,10 @@ public class OrderChildSyncTransportRecordServiceImpl implements OrderChildSyncT
private final NetworkCaseOutRecordDao networkCaseOutRecordDao; private final NetworkCaseOutRecordDao networkCaseOutRecordDao;
private final NetworkDriverRunningWaterRecordService networkDriverRunningWaterRecordService;
private final SettlementDriverDetailService settlementDriverDetailService;
@Override @Override
public void addOrderChildSyncTransportRecord(SettlementDriverDetail detail) { public void addOrderChildSyncTransportRecord(SettlementDriverDetail detail) {
OrderChildSyncTransportRecord record = struct.convertRecord(detail); OrderChildSyncTransportRecord record = struct.convertRecord(detail);
...@@ -45,5 +52,7 @@ public class OrderChildSyncTransportRecordServiceImpl implements OrderChildSyncT ...@@ -45,5 +52,7 @@ public class OrderChildSyncTransportRecordServiceImpl implements OrderChildSyncT
NetworkDriverAccountEnum.CaseOutRecordStatus.PAYED.getCode(), NetworkDriverAccountEnum.CaseOutRecordStatus.PAYED.getCode(),
NetworkDriverAccountEnum.CaseOutRecordStatus.PAYED.getMsg() NetworkDriverAccountEnum.CaseOutRecordStatus.PAYED.getMsg()
); );
SettlementDriverDetail driverDetail = settlementDriverDetailService.selectOneByChildNo(childNo);
networkDriverRunningWaterRecordService.generateCaseOutSuccessRunningWaterRecord(driverDetail);
} }
} }
...@@ -115,4 +115,9 @@ public class SettlementDriverDetailServiceImpl implements SettlementDriverDetai ...@@ -115,4 +115,9 @@ public class SettlementDriverDetailServiceImpl implements SettlementDriverDetai
List<CarrierPageSettlementDriverDetailVO> list = settlementOwnerDetailStruct.covertList(result.getRecords()); List<CarrierPageSettlementDriverDetailVO> list = settlementOwnerDetailStruct.covertList(result.getRecords());
return new Page<CarrierPageSettlementDriverDetailVO>().setRecords(list).setTotal(result.getTotal()).setPages(result.getPages()); return new Page<CarrierPageSettlementDriverDetailVO>().setRecords(list).setTotal(result.getTotal()).setPages(result.getPages());
} }
@Override
public SettlementDriverDetail selectOneByChildNo(String childNo) {
return settlementDriverDetailDao.getByChildNo(childNo).get();
}
} }
...@@ -2,6 +2,7 @@ package com.clx.performance.service.settle; ...@@ -2,6 +2,7 @@ package com.clx.performance.service.settle;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.model.OrderChild; import com.clx.performance.model.OrderChild;
import com.clx.performance.model.settle.SettlementDriverDetail;
import com.clx.performance.param.pc.driver.PageCarrierSettlementDriverDetailParam; import com.clx.performance.param.pc.driver.PageCarrierSettlementDriverDetailParam;
import com.clx.performance.vo.pc.carrier.settle.CarrierPageSettlementDriverDetailVO; import com.clx.performance.vo.pc.carrier.settle.CarrierPageSettlementDriverDetailVO;
...@@ -15,4 +16,6 @@ public interface SettlementDriverDetailService { ...@@ -15,4 +16,6 @@ public interface SettlementDriverDetailService {
Integer saveSettlementDetail(OrderChild orderChild); Integer saveSettlementDetail(OrderChild orderChild);
IPage<CarrierPageSettlementDriverDetailVO> pageSettlementDriverDetail(PageCarrierSettlementDriverDetailParam param); IPage<CarrierPageSettlementDriverDetailVO> pageSettlementDriverDetail(PageCarrierSettlementDriverDetailParam param);
SettlementDriverDetail selectOneByChildNo(String childNo);
} }
package com.clx.performance.sqlProvider.settle; package com.clx.performance.sqlProvider.settle;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.performance.param.pc.PageNetworkAccountListParam; import com.clx.performance.param.pc.PageNetworkAccountListParam;
import com.clx.performance.vo.pc.NetworkDriverAccountVO;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.jdbc.SQL; import org.apache.ibatis.jdbc.SQL;
public class NetworkDriverAccountProvider { public class NetworkDriverAccountProvider {
public String networkAccountList(@Param("param") PageNetworkAccountListParam param) { public String networkAccountList(@Param("page") Page<NetworkDriverAccountVO> page, @Param("param") PageNetworkAccountListParam param) {
String sql = new SQL() {{ String sql = new SQL() {{
SELECT("a.id, a.driver_user_no," + SELECT("a.id, a.driver_user_no," +
" a.driver_user_name, a.mobile, a.account_balance, " + " a.driver_user_name, a.mobile, a.account_balance, " +
......
...@@ -15,8 +15,8 @@ public class NetworkDriverRunningWaterRecordProvider { ...@@ -15,8 +15,8 @@ public class NetworkDriverRunningWaterRecordProvider {
String sql = new SQL() {{ String sql = new SQL() {{
SELECT("a.id, a.running_water_no," + SELECT("a.id, a.running_water_no," +
" a.driver_user_no,a.driver_user_name, a.mobile,a.running_water_type,a.running_water_type_msg,a.fund_type_msg,a.account_balance, " + " a.driver_user_no,a.driver_user_name, a.mobile,a.running_water_type,a.running_water_type_msg,a.fund_type_msg,a.account_balance, " +
" a.fund_type,a.order_no,a.order_goods_no,a.child_no,a.alteration_balance" + " a.fund_type,a.order_no,a.order_goods_no,a.child_no,a.alteration_balance," +
"a.usable_balance,a.frozen_balance,a.take_out_balance,a.create_by,date_format(a.create_time, '%Y-%m-%d %H:%i:%s') as create_time"); "a.usable_balance,a.frozen_balance,a.create_by,date_format(a.create_time, '%Y-%m-%d %H:%i:%s') as create_time");
FROM("network_driver_running_water_record a"); FROM("network_driver_running_water_record a");
if (StringUtils.isNotBlank(param.getDriverUserNo())) { if (StringUtils.isNotBlank(param.getDriverUserNo())) {
...@@ -37,8 +37,8 @@ public class NetworkDriverRunningWaterRecordProvider { ...@@ -37,8 +37,8 @@ public class NetworkDriverRunningWaterRecordProvider {
String sql = new SQL() {{ String sql = new SQL() {{
SELECT("a.id, a.running_water_no," + SELECT("a.id, a.running_water_no," +
" a.driver_user_no,a.driver_user_name, a.mobile,a.running_water_type,a.running_water_type_msg,a.fund_type_msg, a.account_balance,a.frozen_flag, " + " a.driver_user_no,a.driver_user_name, a.mobile,a.running_water_type,a.running_water_type_msg,a.fund_type_msg, a.account_balance,a.frozen_flag, " +
" a.fund_type,a.order_no,a.order_goods_no,a.child_no,a.alteration_balance" + " a.fund_type,a.order_no,a.order_goods_no,a.child_no,a.alteration_balance," +
"a.usable_balance,a.frozen_balance,a.take_out_balance,a.create_by,date_format(a.create_time, '%Y-%m-%d %H:%i:%s') as create_time"); "a.usable_balance,a.frozen_balance,a.create_by,date_format(a.create_time, '%Y-%m-%d %H:%i:%s') as create_time");
FROM("network_driver_running_water_record a"); FROM("network_driver_running_water_record a");
WHERE("a.driver_user_no = #{param.userNo}"); WHERE("a.driver_user_no = #{param.userNo}");
...@@ -54,8 +54,8 @@ public class NetworkDriverRunningWaterRecordProvider { ...@@ -54,8 +54,8 @@ public class NetworkDriverRunningWaterRecordProvider {
String sql = new SQL() {{ String sql = new SQL() {{
SELECT("a.id, a.running_water_no," + SELECT("a.id, a.running_water_no," +
" a.driver_user_no,a.driver_user_name, a.mobile,a.running_water_type,a.running_water_type_msg,a.fund_type_msg,a.account_balance, " + " a.driver_user_no,a.driver_user_name, a.mobile,a.running_water_type,a.running_water_type_msg,a.fund_type_msg,a.account_balance, " +
" a.fund_type,a.order_no,a.order_goods_no,a.child_no,a.alteration_balance" + " a.fund_type,a.order_no,a.order_goods_no,a.child_no,a.alteration_balance," +
"a.usable_balance,a.frozen_balance,a.take_out_balance,a.create_by,date_format(a.create_time, '%Y-%m-%d %H:%i:%s') as create_time"); "a.usable_balance,a.frozen_balance,a.create_by,date_format(a.create_time, '%Y-%m-%d %H:%i:%s') as create_time");
FROM("network_driver_running_water_record a"); FROM("network_driver_running_water_record a");
if (ObjectUtil.isNotNull(param.getUserNo())) { if (ObjectUtil.isNotNull(param.getUserNo())) {
WHERE("a.driver_user_no = #{param.userNo}"); WHERE("a.driver_user_no = #{param.userNo}");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论