提交 28de2b7c authored 作者: liuhaiquan's avatar liuhaiquan

Merge remote-tracking branch 'origin/v11.1_plat_acc_config_20240125' into…

Merge remote-tracking branch 'origin/v11.1_plat_acc_config_20240125' into v11.1_plat_acc_config_20240125
......@@ -118,6 +118,8 @@ public enum PerformanceResultEnum implements ResultEnum {
PLATFORM_ACCOUNT_CONFIG_WITHDRAWAL_MANY(1915, "提现平台账户配置不唯一"),
PLATFORM_ACCOUNT_CONFIG_RECHARGE_IS_NULL(1916, "充值平台账户未配置"),
PLATFORM_ACCOUNT_CONFIG_RECHARGE_MANY(1917, "充值平台账户配置不唯一"),
PLATFORM_ACCOUNT_CONFIG_IS_NULL(1918, "平台账户未配置"),
PLATFORM_ACCOUNT_CONFIG_MANY(1919, "平台账户配置不唯一"),
;
private final int code;
private final String msg;
......
......@@ -22,15 +22,12 @@ public class SavePlatformAccountConfigParam {
@ApiModelProperty(value = "货主类型 1-企业,2-个人")
private Integer ownerType;
@NotNull(message = "开票标识不能为空")
@ApiModelProperty(value = "开票标识:1网运单 2普通单")
private Integer invoiceType;
@NotNull(message = "开票公司id不能为空")
@ApiModelProperty(value = "开票公司id")
private Integer invoiceCompanyId;
@NotBlank(message = "开票公司名称不能为空")
@ApiModelProperty(value = "开票公司名称")
private String invoiceCompanyName;
......
......@@ -62,6 +62,18 @@ public class OwnerSettlementOwnerController {
return Result.ok(settlementOwnerService.getSettlementPlatformAccount());
}
@ApiOperation(value = "获取结算平台收款账号",notes = "<br>By:李瑞新")
@GetMapping("/getSettlementPlatformAccountById")
public Result<SettlementPlatformAccountVO> getSettlementPlatformAccountById(@NotNull(message = "id不能为空") Integer id) {
return Result.ok(settlementOwnerService.getSettlementPlatformAccountById(id));
}
@ApiOperation(value = "获取违约结算平台收款账号",notes = "<br>By:姜文业")
@GetMapping("/getBreakSettlementPlatformAccount")
public Result<SettlementPlatformAccountVO> getBreakSettlementPlatformAccount(@NotNull(message = "id不能为空") Integer id) {
return Result.ok(settlementOwnerService.getBreakSettlementPlatformAccount(id));
}
@ApiOperation(value = "付款接口",notes = "<br>By:李瑞新")
@PostMapping("/updatePaymentSettlement")
public Result updatePaymentSettlement(@RequestBody @Validated OwnerPaymentSettlementParam param) {
......
......@@ -68,12 +68,26 @@ public class PlatformAccountConfigImpl extends BaseDaoImpl<PlatformAccountConfig
public List<PlatformAccountConfig> checkPlatformAccountConfigOnly(PlatformAccountConfig config) {
LambdaQueryWrapper<PlatformAccountConfig> query = new LambdaQueryWrapper<>();
query.eq(PlatformAccountConfig :: getDeleteStatus, DeleteStatusEnum.YES.getCode());
if(Objects.equals(config.getBusinessType(), PlatformAccountConfigEnum.BusinessType.SETTLE.getCode())){
query.eq(PlatformAccountConfig :: getBusinessType, config.getBusinessType());
query.eq(PlatformAccountConfig :: getOwnerType, config.getOwnerType());
query.eq(PlatformAccountConfig :: getInvoiceType, config.getInvoiceType());
query.eq(PlatformAccountConfig :: getInvoiceCompanyId, config.getInvoiceCompanyId());
query.eq(PlatformAccountConfig :: getConfigRange, config.getConfigRange());
if(Objects.equals(config.getBusinessType(), PlatformAccountConfigEnum.BusinessType.SETTLE.getCode())){
query.eq(PlatformAccountConfig :: getInvoiceType, config.getInvoiceType());
}
if(Objects.equals(config.getBusinessType(), PlatformAccountConfigEnum.BusinessType.BREAK.getCode())){
query.eq(PlatformAccountConfig :: getBusinessType, config.getBusinessType());
query.eq(PlatformAccountConfig :: getOwnerType, config.getOwnerType());
query.eq(PlatformAccountConfig :: getInvoiceCompanyId, config.getInvoiceCompanyId());
query.eq(PlatformAccountConfig :: getConfigRange, config.getConfigRange());
}
if(Objects.equals(config.getBusinessType(), PlatformAccountConfigEnum.BusinessType.RECHARGE.getCode())){
query.eq(PlatformAccountConfig :: getBusinessType, config.getBusinessType());
query.eq(PlatformAccountConfig :: getOwnerType, config.getOwnerType());
}
if(Objects.equals(config.getBusinessType(), PlatformAccountConfigEnum.BusinessType.WITHDRAWAL.getCode())){
query.eq(PlatformAccountConfig :: getBusinessType, config.getBusinessType());
query.eq(PlatformAccountConfig :: getOwnerType, config.getOwnerType());
}
return baseMapper.selectList(query);
}
......
......@@ -75,7 +75,7 @@ public class PlatformAccountConfigServiceImpl implements PlatformAccountConfigSe
config.setBankCode(param.getBankCode());
config.setBankCardNo(param.getBankCardNo());
config.setModifiedUserNo(loginUserInfo.getUserNo());
config.setModifiedUserName(loginUserInfo.getShadowUserName());
config.setModifiedUserName(loginUserInfo.getUserName());
if(!checkConfigOnly(config)){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_ONLY);
}
......@@ -99,7 +99,7 @@ public class PlatformAccountConfigServiceImpl implements PlatformAccountConfigSe
config.setBankCardNo(param.getBankCardNo());
config.setDeleteStatus(DeleteStatusEnum.YES.getCode());
config.setCreateUserNo(loginUserInfo.getUserNo());
config.setCreateUserName(loginUserInfo.getShadowUserName());
config.setCreateUserName(loginUserInfo.getUserName());
if(!checkConfigOnly(config)){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_ONLY);
}
......
......@@ -23,10 +23,12 @@ import com.clx.performance.model.breakcontract.BreakContractOwnerRecord;
import com.clx.performance.model.breakcontract.BreakContractOwnerRule;
import com.clx.performance.model.breakcontract.BreakContractSettlementLog;
import com.clx.performance.model.breakcontract.BreakContractSettlementOwner;
import com.clx.performance.model.settle.SettlementOwner;
import com.clx.performance.model.settle.SettlementPlatformAccount;
import com.clx.performance.param.feign.OrderAdjustTonnageDownParam;
import com.clx.performance.param.pc.breakcontract.carrier.*;
import com.clx.performance.service.OwnerAccountService;
import com.clx.performance.service.PlatformAccountConfigService;
import com.clx.performance.service.breakcontract.BreakContractOwnerRecordService;
import com.clx.performance.service.breakcontract.BreakContractSettlementLogService;
import com.clx.performance.service.breakcontract.BreakContractSettlementOwnerService;
......@@ -40,6 +42,7 @@ import com.clx.performance.vo.pc.breakcontract.carrier.BreakContractOwnerRuleVO;
import com.clx.performance.vo.pc.breakcontract.carrier.CarrierBreakContractSettlementLogVO;
import com.clx.performance.vo.pc.breakcontract.carrier.CarrierBreakContractSettlementOwnerDetailVO;
import com.clx.performance.vo.pc.breakcontract.carrier.PageCarrierBreakContractSettlementOwnerVO;
import com.clx.performance.vo.pc.carrier.settle.CarrierPagePlatformAccountConfigVO;
import com.clx.performance.vo.pc.owner.settle.SettlementPlatformAccountVO;
import com.clx.user.vo.pc.owner.OwnerBindCardVO;
import com.msl.common.exception.ServiceSystemException;
......@@ -83,6 +86,7 @@ public class BreakContractSettlementOwnerServiceImpl implements BreakContractSe
private final BreakContractOwnerRecordService breakContractOwnerRecordService;
private final BreakContractOwnerRecordDao breakContractOwnerRecordDao;
private final OrderGoodsDao orderGoodsDao;
private final PlatformAccountConfigService platformAccountConfigService;
......@@ -383,15 +387,33 @@ public class BreakContractSettlementOwnerServiceImpl implements BreakContractSe
@Override
public SettlementPlatformAccountVO getCarrierSettlementPlatformAccount(Integer id) {
//平台账号
SettlementPlatformAccount platformAccount = settlementPlatformAccountDao.getSettlementPlatformAccount();
//SettlementPlatformAccount platformAccount = settlementPlatformAccountDao.getSettlementPlatformAccount();
//返回对象
SettlementPlatformAccountVO vo = new SettlementPlatformAccountVO();
if(Objects.nonNull(platformAccount)){
/*if(Objects.nonNull(platformAccount)){
vo.setPaymentBankCardNo(platformAccount.getBankCardNo());
vo.setPaymentBankName(platformAccount.getBankName());
}
}*/
//货主账号
BreakContractSettlementOwner settlementOwner = breakContractSettlementOwnerDao.getEntityByKey(id).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
FeignOrderVO orderInfoFeign = orderFeign.getOrderInfoFeign(settlementOwner.getOrderNo());
List<CarrierPagePlatformAccountConfigVO> configs =
platformAccountConfigService.getPlatformAccountConfigByType(
PlatformAccountConfigEnum.BusinessType.BREAK.getCode(),
PlatformAccountConfigEnum.OwnerType.COMPANY.getCode(),
null,
orderInfoFeign.getInvoicingCompanyId(),
PlatformAccountConfigEnum.ConfigRange.PAY.getCode());
if(CollectionUtils.isEmpty(configs)){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_IS_NULL);
}
if(configs.size() > 1){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_MANY);
}
vo.setPaymentBankCardNo(configs.get(0).getBankCardNo());
vo.setPaymentBankName(configs.get(0).getBankName());
OwnerBindCardVO card = ownerAccountService.getOwnerBindCard(settlementOwner.getOwnerUserNo());
if(Objects.nonNull(card)){
vo.setPayee(card.getName());
......
......@@ -3,7 +3,10 @@ package com.clx.performance.service.impl.settle;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.order.feign.OrderFeign;
import com.clx.order.vo.feign.FeignOrderVO;
import com.clx.performance.component.NetworkSyncComponent;
import com.clx.performance.dao.breakcontract.BreakContractSettlementOwnerDao;
import com.clx.performance.dao.settle.SettlementLogDao;
import com.clx.performance.dao.settle.SettlementOwnerDao;
import com.clx.performance.dao.settle.SettlementOwnerDetailDao;
......@@ -11,13 +14,16 @@ import com.clx.performance.dao.settle.SettlementPlatformAccountDao;
import com.clx.performance.dto.InvoicingStatusNotifyDTO;
import com.clx.performance.enums.OrderChildLogEnum;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.enums.PlatformAccountConfigEnum;
import com.clx.performance.enums.settle.*;
import com.clx.performance.model.breakcontract.BreakContractSettlementOwner;
import com.clx.performance.model.settle.SettlementLog;
import com.clx.performance.model.settle.SettlementOwner;
import com.clx.performance.model.settle.SettlementOwnerDetail;
import com.clx.performance.model.settle.SettlementPlatformAccount;
import com.clx.performance.param.pc.owner.*;
import com.clx.performance.service.OwnerAccountService;
import com.clx.performance.service.PlatformAccountConfigService;
import com.clx.performance.service.settle.SettlementLogService;
import com.clx.performance.service.settle.SettlementMqHandlerService;
import com.clx.performance.service.settle.SettlementOwnerService;
......@@ -36,6 +42,7 @@ import com.msl.user.data.UserSessionData;
import com.msl.user.utils.TokenUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -75,6 +82,10 @@ public class SettlementOwnerServiceImpl implements SettlementOwnerService {
private final NetworkSyncComponent networkSyncComponent;
private final SettlementMqHandlerService settlementMqHandlerService;
private final PlatformAccountConfigService platformAccountConfigService;
private final OrderFeign orderFeign;
private final BreakContractSettlementOwnerDao breakContractSettlementOwnerDao;
@Override
......@@ -172,20 +183,106 @@ public class SettlementOwnerServiceImpl implements SettlementOwnerService {
return vo;
}
@Override
public SettlementPlatformAccountVO getSettlementPlatformAccountById(Integer id) {
//返回对象
SettlementPlatformAccountVO vo = new SettlementPlatformAccountVO();
SettlementOwner settlementOwner = settlementOwnerDao.getEntityByKey(id).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
FeignOrderVO orderInfoFeign = orderFeign.getOrderInfoFeign(settlementOwner.getOrderNo());
List<CarrierPagePlatformAccountConfigVO> configs =
platformAccountConfigService.getPlatformAccountConfigByType(
PlatformAccountConfigEnum.BusinessType.SETTLE.getCode(),
PlatformAccountConfigEnum.OwnerType.COMPANY.getCode(),
settlementOwner.getInvoiceType(),
orderInfoFeign.getInvoicingCompanyId(),
PlatformAccountConfigEnum.ConfigRange.COLLECTION.getCode());
if(CollectionUtils.isEmpty(configs)){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_IS_NULL);
}
if(configs.size() > 1){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_MANY);
}
vo.setPayee(configs.get(0).getCompanyName());
vo.setPayeeBankCardNo(configs.get(0).getBankCardNo());
vo.setPayeeBankName(configs.get(0).getBankName());
//当前账号
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
OwnerBindCardVO card = ownerAccountService.getOwnerBindCard(loginUserInfo.getUserNo());
if(Objects.nonNull(card)){
vo.setPaymentBankCardNo(card.getOwnerBankAccount());
vo.setPaymentBankName(card.getOwnerAccountBank());
}
return vo;
}
@Override
public SettlementPlatformAccountVO getCarrierSettlementPlatformAccount(String settlementNo){
//平台账号
SettlementPlatformAccount platformAccount = settlementPlatformAccountDao.getSettlementPlatformAccount();
public SettlementPlatformAccountVO getBreakSettlementPlatformAccount(Integer id) {
//返回对象
SettlementPlatformAccountVO vo = new SettlementPlatformAccountVO();
BreakContractSettlementOwner settlementOwner = breakContractSettlementOwnerDao.getEntityByKey(id).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
FeignOrderVO orderInfoFeign = orderFeign.getOrderInfoFeign(settlementOwner.getOrderNo());
List<CarrierPagePlatformAccountConfigVO> configs =
platformAccountConfigService.getPlatformAccountConfigByType(
PlatformAccountConfigEnum.BusinessType.BREAK.getCode(),
PlatformAccountConfigEnum.OwnerType.COMPANY.getCode(),
null,
orderInfoFeign.getInvoicingCompanyId(),
PlatformAccountConfigEnum.ConfigRange.COLLECTION.getCode());
if(CollectionUtils.isEmpty(configs)){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_IS_NULL);
}
if(configs.size() > 1){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_MANY);
}
vo.setPayee(configs.get(0).getCompanyName());
vo.setPayeeBankCardNo(configs.get(0).getBankCardNo());
vo.setPayeeBankName(configs.get(0).getBankName());
//当前账号
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
OwnerBindCardVO card = ownerAccountService.getOwnerBindCard(loginUserInfo.getUserNo());
if(Objects.nonNull(card)){
vo.setPaymentBankCardNo(card.getOwnerBankAccount());
vo.setPaymentBankName(card.getOwnerAccountBank());
}
return vo;
}
@Override
public SettlementPlatformAccountVO getCarrierSettlementPlatformAccount(String settlementNo){
/*//平台账号
SettlementPlatformAccount platformAccount = settlementPlatformAccountDao.getSettlementPlatformAccount();
if(Objects.nonNull(platformAccount)){
vo.setPaymentBankCardNo(platformAccount.getBankCardNo());
vo.setPaymentBankName(platformAccount.getBankName());
}*/
//返回对象
SettlementPlatformAccountVO vo = new SettlementPlatformAccountVO();
SettlementOwner settlementOwner = settlementOwnerDao.selectBySettlementNo(settlementNo).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
List<CarrierPagePlatformAccountConfigVO> configs =
platformAccountConfigService.getPlatformAccountConfigByType(
PlatformAccountConfigEnum.BusinessType.SETTLE.getCode(),
PlatformAccountConfigEnum.OwnerType.COMPANY.getCode(),
PlatformAccountConfigEnum.InvoiceType.ORDINARY.getCode(),
settlementOwner.getInvoicingCompanyId(),
PlatformAccountConfigEnum.ConfigRange.PAY.getCode());
if(CollectionUtils.isEmpty(configs)){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_IS_NULL);
}
if(configs.size() > 1){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_MANY);
}
vo.setPaymentBankCardNo(configs.get(0).getBankCardNo());
vo.setPaymentBankName(configs.get(0).getBankName());
//货主账号
SettlementOwner settlementOwner = settlementOwnerDao.selectBySettlementNo(settlementNo).orElseThrow(PerformanceResultEnum.DATA_NOT_FIND);
OwnerBindCardVO card = ownerAccountService.getOwnerBindCard(settlementOwner.getOwnerUserNo());
if(Objects.nonNull(card)){
vo.setPayee(card.getName());
......
......@@ -21,6 +21,10 @@ public interface SettlementOwnerService {
SettlementPlatformAccountVO getSettlementPlatformAccount();
SettlementPlatformAccountVO getSettlementPlatformAccountById(Integer id);
SettlementPlatformAccountVO getBreakSettlementPlatformAccount(Integer id);
SettlementPlatformAccountVO getCarrierSettlementPlatformAccount(String settlementNo);
void updatePaymentSettlement(OwnerPaymentSettlementParam param);
......
......@@ -9,13 +9,14 @@ import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import java.util.List;
import java.util.Objects;
@Mapper(componentModel = "spring", uses = DateStructUtil.class, imports = {PlatformAccountConfigEnum.class, DateUtils.class})
@Mapper(componentModel = "spring", uses = DateStructUtil.class, imports = {PlatformAccountConfigEnum.class, Objects.class, DateUtils.class})
public interface PlatformAccountConfigStruct {
@Mapping(target = "businessTypeMsg", expression = "java(PlatformAccountConfigEnum.BusinessType.getMsgByCode(config.getBusinessType()))")
@Mapping(target = "ownerTypeMsg", expression = "java(PlatformAccountConfigEnum.OwnerType.getMsgByCode(config.getOwnerType()))")
@Mapping(target = "invoiceTypeMsg", expression = "java(PlatformAccountConfigEnum.InvoiceType.getMsgByCode(config.getInvoiceType()))")
@Mapping(target = "configRangeMsg", expression = "java(PlatformAccountConfigEnum.ConfigRange.getMsgByCode(config.getConfigRange()))")
@Mapping(target = "businessTypeMsg", expression = "java(Objects.isNull(config.getBusinessType()) ? null : PlatformAccountConfigEnum.BusinessType.getMsgByCode(config.getBusinessType()))")
@Mapping(target = "ownerTypeMsg", expression = "java(Objects.isNull(config.getOwnerType()) ? null : PlatformAccountConfigEnum.OwnerType.getMsgByCode(config.getOwnerType()))")
@Mapping(target = "invoiceTypeMsg", expression = "java(Objects.isNull(config.getInvoiceType()) ? null : PlatformAccountConfigEnum.InvoiceType.getMsgByCode(config.getInvoiceType()))")
@Mapping(target = "configRangeMsg", expression = "java(Objects.isNull(config.getConfigRange()) ? null : PlatformAccountConfigEnum.ConfigRange.getMsgByCode(config.getConfigRange()))")
CarrierPagePlatformAccountConfigVO convertToDetail(PlatformAccountConfig config);
List<CarrierPagePlatformAccountConfigVO> convertToVOList(List<PlatformAccountConfig> settlementOwners);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论