提交 bfb6ab7e authored 作者: jiangwenye's avatar jiangwenye

Merge branch 'v11.1_plat_acc_config_20240125' of…

Merge branch 'v11.1_plat_acc_config_20240125' of https://t.clxkj.cn/clx-java/clx-performance into test Conflicts: performance-web/src/main/java/com/clx/performance/service/impl/OwnerAccountServiceImpl.java performance-web/src/main/java/com/clx/performance/service/impl/breakcontract/BreakContractSettlementOwnerServiceImpl.java performance-web/src/main/java/com/clx/performance/service/impl/settle/SettlementOwnerServiceImpl.java performance-web/src/main/java/com/clx/performance/service/impl/settle/SettlementServiceImpl.java
......@@ -123,6 +123,13 @@ public enum PerformanceResultEnum implements ResultEnum {
NB_BANK_PAY_TYPE_ERROR(1802, "支付方式不支持"),
NB_BANK_ORDER_PAY_ERROR(1803, "宁波银行订单支付失败"),
PLATFORM_ACCOUNT_CONFIG_ONLY(1913, "当前配置已存在"),
PLATFORM_ACCOUNT_CONFIG_WITHDRAWAL_IS_NULL(1914, "提现平台账户未配置"),
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;
......
......@@ -4,33 +4,55 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Getter
@Setter
public class SavePlatformAccountConfigParam {
@ApiModelProperty(value = "id")
private Integer Id;
@NotNull(message = "应用场景不能为空")
@ApiModelProperty(value = "应用场景 1-结算单,2-违约结算单,3-充值,4-提现")
private Integer businessType;
@NotNull(message = "货主类型不能为空")
@ApiModelProperty(value = "货主类型 1-企业,2-个人")
private Integer ownerType;
@ApiModelProperty(value = "开票标识:1网运单 2普通单")
private Integer invoiceType;
@ApiModelProperty(value = "开票公司id")
private Integer invoiceCompanyId;
@ApiModelProperty(value = "开票公司名称")
private String invoiceCompanyName;
@NotNull(message = "配置范围不能为空")
@ApiModelProperty(value = "配置范围:1收款账户 2付款账户")
private Integer configRange;
@NotBlank(message = "公司名称不能为空")
@ApiModelProperty(value = "公司名称")
private String companyName;
@NotBlank(message = "银行名称不能为空")
@ApiModelProperty(value = "银行名称")
private String bankName;
@NotBlank(message = "开户行不能为空")
@ApiModelProperty(value = "开户行")
private String openBank;
@NotBlank(message = "银行编码不能为空")
@ApiModelProperty(value = "银行编码")
private String bankCode;
@NotBlank(message = "银行账号不能为空")
@ApiModelProperty(value = "银行账号")
private String bankCardNo;
......
......@@ -48,6 +48,15 @@ public class CarrierPagePlatformAccountConfigVO {
@ApiModelProperty(value = "银行账号")
private String bankCardNo;
@ApiModelProperty(value = "创建人编码")
private Long createUserNo;
@ApiModelProperty(value = "创建人姓名")
private String createUserName;
@ApiModelProperty(value = "修改人编码")
private Long modifiedUserNo;
@ApiModelProperty(value = "修改人姓名")
private String modifiedUserName;
@ApiModelProperty(value = "删除状态: 0-否;1-是")
private Integer deleteStatus;
@ApiModelProperty(value = "创建时间")
......
......@@ -54,4 +54,11 @@ public class CarrierPageSettlementOwnerVO {
private Integer status;
@ApiModelProperty("结算方式 1装车净重 2卸车净重")
private Integer settlementWay;
@ApiModelProperty("开票公司简称")
private String invoicingCompanyShorterName;
@ApiModelProperty("开票公司统一社会信用代码")
private String invoicingCompanyGroupCode;
@ApiModelProperty("是否上报 0-否;1-是")
private Integer reportFlag;
}
......@@ -153,5 +153,12 @@ public class CarrierSettlementOwnerDetailVO {
@ApiModelProperty(value = "结算单操作日志")
private List<SettlementLogVO> settlementLogs;
@ApiModelProperty("开票公司简称")
private String invoicingCompanyShorterName;
@ApiModelProperty("开票公司统一社会信用代码")
private String invoicingCompanyGroupCode;
@ApiModelProperty("是否上报 0-否;1-是")
private Integer reportFlag;
}
\ No newline at end of file
......@@ -55,4 +55,13 @@ public class OwnerPageSettlementOwnerVO {
@ApiModelProperty(value = "结算方式 1装车净重 2卸车净重")
private Integer settlementWay;
@ApiModelProperty(value="开票公司id",example = "1")
private Integer invoicingCompanyId; //开票公司id
@ApiModelProperty(value="开票公司简称",example = "1")
private String invoicingCompanyShorterName; //开票公司简称
@ApiModelProperty(value="开票公司统一社会信用代码",example = "1")
private String invoicingCompanyGroupCode; //开票公司统一社会信用代码
@ApiModelProperty(value="是否上报 0-否;1-是",example = "1")
private Integer reportFlag; //是否上报 0-否;1-是
}
......@@ -86,6 +86,15 @@ public class PageOwnerSettlementOwnerDetailVO {
private Integer settlementWay;
@ApiModelProperty(value="开票公司id",example = "1")
private Integer invoicingCompanyId; //开票公司id
@ApiModelProperty(value="开票公司简称",example = "1")
private String invoicingCompanyShorterName; //开票公司简称
@ApiModelProperty(value="开票公司统一社会信用代码",example = "1")
private String invoicingCompanyGroupCode; //开票公司统一社会信用代码
@ApiModelProperty(value="是否上报 0-否;1-是",example = "1")
private Integer reportFlag; //是否上报 0-否;1-是
@ApiModelProperty(value="创建时间",example = "2013-01-01 00:00:00")
private String createTime;
......
package com.clx.performance.controller.pc.carrier;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.enums.PlatformAccountConfigEnum;
import com.clx.performance.model.PlatformAccountConfig;
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.service.PlatformAccountConfigService;
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.clx.performance.vo.pc.carrier.settle.CarrierPagePlatformAccountConfigVO;
import com.clx.user.param.pc.driver.truck.PageDriverTruckParam;
import com.msl.common.base.PageData;
import com.msl.common.convertor.aspect.UnitCovert;
import com.msl.common.exception.ServiceSystemException;
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.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.http.HttpHeaders;
......@@ -26,6 +33,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotBlank;
import java.util.List;
@Slf4j
......@@ -42,6 +50,8 @@ public class CarrierAccountController {
private final OwnerCaseOutService ownerCaseOutService;
private final PlatformAccountConfigService platformAccountConfigService;
@ApiOperation(value = "查看资金管理列表(保证金和预付运费)", notes = "<br>By:胡宇帆")
@PostMapping("/pageList")
......@@ -115,4 +125,22 @@ public class CarrierAccountController {
return Result.page(page.getRecords(), page.getTotal(), page.getPages());
}
@ApiOperation(value = "提现审批平台付款银行账号", notes = "<br>By:jiangwenye")
@GetMapping("/ownerCaseOutAccount")
@UnitCovert(param = false)
public Result<CarrierPagePlatformAccountConfigVO> ownerCaseOutAccount() {
List<CarrierPagePlatformAccountConfigVO> configs =
platformAccountConfigService.getPlatformAccountConfigByType(
PlatformAccountConfigEnum.BusinessType.WITHDRAWAL.getCode(),
PlatformAccountConfigEnum.OwnerType.COMPANY.getCode(),
null,null,null);
if(CollectionUtils.isEmpty(configs)){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_WITHDRAWAL_IS_NULL);
}
if(configs.size() > 1){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_WITHDRAWAL_MANY);
}
return Result.ok(configs.get(0));
}
}
......@@ -62,6 +62,12 @@ public class OwnerSettlementOwnerController {
return Result.ok(settlementOwnerService.getSettlementPlatformAccount());
}
@ApiOperation(value = "获取违约结算平台收款账号",notes = "<br>By:姜文业")
@GetMapping("/getBreakSettlementPlatformAccount")
public Result<SettlementPlatformAccountVO> getBreakSettlementPlatformAccount() {
return Result.ok(settlementOwnerService.getBreakSettlementPlatformAccount());
}
@ApiOperation(value = "付款接口",notes = "<br>By:李瑞新")
@PostMapping("/updatePaymentSettlement")
public Result updatePaymentSettlement(@RequestBody @Validated OwnerPaymentSettlementParam param) {
......
......@@ -6,6 +6,8 @@ import com.clx.performance.model.PlatformAccountConfig;
import com.clx.performance.param.pc.carrier.PagePlatformAccountConfigParam;
import com.msl.common.dao.BaseDao;
import java.util.List;
public interface PlatformAccountConfigDao extends BaseDao<PlatformAccountConfigMapper, PlatformAccountConfig, Integer> {
......@@ -15,4 +17,12 @@ public interface PlatformAccountConfigDao extends BaseDao<PlatformAccountConfigM
boolean updatePlatformAccountConfig(PlatformAccountConfig platformAccountConfig);
List<PlatformAccountConfig> checkPlatformAccountConfigOnly(PlatformAccountConfig config);
List<PlatformAccountConfig> getPlatformAccountConfigByType(Integer businessType,
Integer ownerType,
Integer invoiceType,
Integer invoiceCompanyId,
Integer configRange);
}
......@@ -5,12 +5,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.clx.order.enums.DeleteStatusEnum;
import com.clx.performance.dao.PlatformAccountConfigDao;
import com.clx.performance.enums.PlatformAccountConfigEnum;
import com.clx.performance.mapper.PlatformAccountConfigMapper;
import com.clx.performance.model.PlatformAccountConfig;
import com.clx.performance.param.pc.carrier.PagePlatformAccountConfigParam;
import com.msl.common.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Objects;
/**
......@@ -61,4 +63,44 @@ public class PlatformAccountConfigImpl extends BaseDaoImpl<PlatformAccountConfig
.set(PlatformAccountConfig::getBankCardNo, config.getBankCardNo())
);
}
@Override
public List<PlatformAccountConfig> checkPlatformAccountConfigOnly(PlatformAccountConfig config) {
LambdaQueryWrapper<PlatformAccountConfig> query = new LambdaQueryWrapper<>();
query.eq(PlatformAccountConfig :: getDeleteStatus, DeleteStatusEnum.YES.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.SETTLE.getCode())){
query.eq(PlatformAccountConfig :: getInvoiceType, config.getInvoiceType());
}
return baseMapper.selectList(query);
}
@Override
public List<PlatformAccountConfig> getPlatformAccountConfigByType(Integer businessType,
Integer ownerType,
Integer invoiceType,
Integer invoiceCompanyId,
Integer configRange){
LambdaQueryWrapper<PlatformAccountConfig> query = new LambdaQueryWrapper<>();
query.eq(PlatformAccountConfig :: getDeleteStatus, DeleteStatusEnum.YES.getCode());
if(Objects.nonNull(businessType)){
query.eq(PlatformAccountConfig :: getBusinessType, businessType);
}
if(Objects.nonNull(ownerType)){
query.eq(PlatformAccountConfig :: getOwnerType, ownerType);
}
if(Objects.nonNull(invoiceCompanyId)){
query.eq(PlatformAccountConfig :: getInvoiceCompanyId, invoiceCompanyId);
}
if(Objects.nonNull(configRange)){
query.eq(PlatformAccountConfig :: getConfigRange, configRange);
}
if(Objects.nonNull(invoiceType)){
query.eq(PlatformAccountConfig :: getInvoiceType, invoiceType);
}
return baseMapper.selectList(query);
}
}
package com.clx.performance.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.msl.common.config.KeyColumn;
......@@ -92,7 +93,12 @@ public class OrderChild implements HasKey<Integer> {
private Integer settlementAccountPeriod; //结算账期 1拉运完成结 2月结
private Integer settlementWay; //结算方式 1装车净重 2卸车净重
private Integer settlementWay; //结算方式 1装车净重
private Integer invoicingCompanyId; //开票公司id
private String invoicingCompanyShorterName; //开票公司简称
private String invoicingCompanyGroupCode; //开票公司统一社会信用代码
private Integer reportFlag; //是否上报 0-否;1-是
private LocalDateTime createTime; //创建时间
private LocalDateTime modifiedTime; //修改时间
......
......@@ -39,6 +39,11 @@ public class PlatformAccountConfig implements HasKey<Integer> {
private String bankCode; //银行编码
private String bankCardNo; //银行账号
private Long createUserNo; //创建人编码
private String createUserName; //创建人姓名
private Long modifiedUserNo; //修改人编码
private String modifiedUserName; //修改人姓名
private Integer deleteStatus; //删除状态: 0-否;1-是
private LocalDateTime createTime; //创建时间
private LocalDateTime modifiedTime; //修改时间
......
......@@ -68,6 +68,10 @@ public class SettlementOwner implements HasKey<Integer> {
private Integer mergeStatus; //是否合并 0-否,1-是
private Integer mergeSettlementFlag; //合并结算单标志 1:普通结算单 2:合并结算单
private String mergedBy; //合并人
private Integer invoicingCompanyId; //开票公司id
private String invoicingCompanyShorterName; //开票公司简称
private String invoicingCompanyGroupCode; //开票公司统一社会信用代码
private Integer reportFlag; //是否上报 0-否;1-是
private LocalDateTime mergeTime; //合并结算单时间
private LocalDateTime createTime; //创建时间
private LocalDateTime modifiedTime; //修改时间
......
......@@ -53,6 +53,10 @@ public class SettlementOwnerDetail implements HasKey<Integer> {
private Integer invoiceType; //开票标识:1网运单 2普通单
private Integer finalPaymentStatus; //尾款状态 0-否,1-是,2-无需支付
private Integer invoiceStatus; //开票状态 0-否,1-是,2-无需开票
private Integer invoicingCompanyId; //开票公司id
private String invoicingCompanyShorterName; //开票公司简称
private String invoicingCompanyGroupCode; //开票公司统一社会信用代码
private Integer reportFlag; //是否上报 0-否;1-是
private Integer status; //状态
private LocalDateTime createTime; //创建时间
private LocalDateTime modifiedTime; //修改时间
......
package com.clx.performance.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.performance.model.PlatformAccountConfig;
import com.clx.performance.param.pc.carrier.PagePlatformAccountConfigParam;
import com.clx.performance.param.pc.carrier.SavePlatformAccountConfigParam;
import com.clx.performance.vo.pc.carrier.settle.*;
import java.util.List;
/**
* @author jiangwenye
* Date 2024-01-25
......@@ -22,4 +25,10 @@ public interface PlatformAccountConfigService {
void updatePlatformAccountConfig(SavePlatformAccountConfigParam config);
List<CarrierPagePlatformAccountConfigVO> getPlatformAccountConfigByType(Integer businessType,
Integer ownerType,
Integer invoiceType,
Integer invoiceCompanyId,
Integer configRange);
}
......@@ -394,6 +394,12 @@ public class OrderChildServiceImpl implements OrderChildService {
orderChild.setSettlementAccountPeriod(orderGoods.getSettlementAccountPeriod());
orderChild.setSettlementWay(orderGoods.getSettlementWay());
//设置开票公司信息
orderChild.setInvoicingCompanyId(orderInfo.getInvoicingCompanyId());
orderChild.setInvoicingCompanyShorterName(orderInfo.getInvoicingCompanyShorterName());
orderChild.setInvoicingCompanyGroupCode(orderInfo.getInvoicingCompanyGroupCode());
orderChild.setReportFlag(orderInfo.getReportFlag());
// 更新货单数据
updateOrderGoodsAmount(orderGoods, orderChild);
......
......@@ -19,6 +19,7 @@ import com.clx.performance.dao.loan.OwnerLoanAccountDao;
import com.clx.performance.enums.IdTypeEnum;
import com.clx.performance.enums.OwnerAccountEnum;
import com.clx.performance.enums.PerformanceResultEnum;
import com.clx.performance.enums.PlatformAccountConfigEnum;
import com.clx.performance.extranal.user.OwnerInfoService;
import com.clx.performance.model.*;
import com.clx.performance.model.loan.OwnerLoanAccount;
......@@ -34,6 +35,7 @@ import com.clx.performance.param.pc.owner.CreteAccountParam;
import com.clx.performance.param.pc.owner.FrozenAccountParam;
import com.clx.performance.param.pc.owner.ThawAccountParam;
import com.clx.performance.service.OwnerAccountService;
import com.clx.performance.service.PlatformAccountConfigService;
import com.clx.performance.struct.OwnerAccountStruct;
import com.clx.performance.struct.loan.OwnerLoanAccountStruct;
import com.clx.performance.utils.MyMD5Util;
......@@ -45,6 +47,7 @@ import com.clx.performance.vo.pc.OwnerAccountAllVO;
import com.clx.performance.vo.pc.OwnerAccountRunningWaterRecordVO;
import com.clx.performance.vo.pc.OwnerAccountVO;
import com.clx.performance.vo.pc.OwnerLoanAccountVO;
import com.clx.performance.vo.pc.carrier.settle.CarrierPagePlatformAccountConfigVO;
import com.clx.user.enums.owner.FreezeSettingEnum;
import com.clx.user.feign.OwnerFeign;
import com.clx.user.feign.OwnerInfoFeign;
......@@ -59,6 +62,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.commons.lang3.StringUtils;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.amqp.core.Message;
......@@ -119,6 +123,8 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
private final OwnerLoanAccountStruct ownerLoanAccountStruct;
private final PlatformAccountConfigService platformAccountConfigService;
@Override
public IPage<OwnerAccountVO> pageList(PageOwnerAccountListParam param) {
return ownerAccountDao.pageList(param);
......@@ -623,7 +629,26 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
@Override
public OwnerTransferInfo transferPublic() {
return ownerTransferInfoDao.getEntityByKey(1).orElse(null);
List<CarrierPagePlatformAccountConfigVO> configs =
platformAccountConfigService.getPlatformAccountConfigByType(
PlatformAccountConfigEnum.BusinessType.RECHARGE.getCode(),
PlatformAccountConfigEnum.OwnerType.COMPANY.getCode(),
null,null,null);
if(CollectionUtils.isEmpty(configs)){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_RECHARGE_IS_NULL);
}
if(configs.size() > 1){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_RECHARGE_MANY);
}
OwnerTransferInfo info = new OwnerTransferInfo();
CarrierPagePlatformAccountConfigVO vo = configs.get(0);
info.setAccountNumber(vo.getBankCardNo());
info.setOpenAccountBank(vo.getOpenBank());
info.setOpenAccountBankNumber(vo.getBankCode());
info.setEnterpriseName(vo.getCompanyName());
return info;
//return ownerTransferInfoDao.getEntityByKey(1).orElse(null);
}
@Override
......
......@@ -11,11 +11,16 @@ import com.clx.performance.param.pc.carrier.SavePlatformAccountConfigParam;
import com.clx.performance.service.PlatformAccountConfigService;
import com.clx.performance.struct.PlatformAccountConfigStruct;
import com.clx.performance.vo.pc.carrier.settle.*;
import com.msl.common.exception.ServiceSystemException;
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.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* @author jiangwenye
......@@ -53,6 +58,9 @@ public class PlatformAccountConfigServiceImpl implements PlatformAccountConfigSe
@Override
public void updatePlatformAccountConfig(SavePlatformAccountConfigParam param) {
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
PlatformAccountConfig config = new PlatformAccountConfig();
config.setId(param.getId());
config.setBusinessType(param.getBusinessType());
......@@ -66,11 +74,17 @@ public class PlatformAccountConfigServiceImpl implements PlatformAccountConfigSe
config.setOpenBank(param.getOpenBank());
config.setBankCode(param.getBankCode());
config.setBankCardNo(param.getBankCardNo());
config.setModifiedUserNo(loginUserInfo.getUserNo());
config.setModifiedUserName(loginUserInfo.getShadowUserName());
if(!checkConfigOnly(config)){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_ONLY);
}
platformAccountConfigDao.updatePlatformAccountConfig(config);
}
@Override
public void savePlatformAccountConfig(SavePlatformAccountConfigParam param){
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
PlatformAccountConfig config = new PlatformAccountConfig();
config.setBusinessType(param.getBusinessType());
config.setOwnerType(param.getOwnerType());
......@@ -84,8 +98,37 @@ public class PlatformAccountConfigServiceImpl implements PlatformAccountConfigSe
config.setBankCode(param.getBankCode());
config.setBankCardNo(param.getBankCardNo());
config.setDeleteStatus(DeleteStatusEnum.YES.getCode());
config.setCreateUserNo(loginUserInfo.getUserNo());
config.setCreateUserName(loginUserInfo.getShadowUserName());
if(!checkConfigOnly(config)){
throw new ServiceSystemException(PerformanceResultEnum.PLATFORM_ACCOUNT_CONFIG_ONLY);
}
platformAccountConfigDao.saveEntity(config);
}
public boolean checkConfigOnly(PlatformAccountConfig config){
List<PlatformAccountConfig> checkList = platformAccountConfigDao.checkPlatformAccountConfigOnly(config);
if(CollectionUtils.isNotEmpty(checkList)){
if(checkList.size() > 1){
return false;
}
PlatformAccountConfig check = checkList.get(0);
if(!Objects.equals(check.getId(),config.getId())){
return false;
}
}
return true;
}
@Override
public List<CarrierPagePlatformAccountConfigVO> getPlatformAccountConfigByType(Integer businessType,
Integer ownerType,
Integer invoiceType,
Integer invoiceCompanyId,
Integer configRange){
List<PlatformAccountConfig> configs = platformAccountConfigDao.getPlatformAccountConfigByType( businessType, ownerType, invoiceType, invoiceCompanyId, configRange);
List<CarrierPagePlatformAccountConfigVO> list = platformAccountConfigStruct.convertToVOList(configs);
return list;
}
}
......@@ -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;
......@@ -41,6 +43,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;
......@@ -85,6 +88,7 @@ public class BreakContractSettlementOwnerServiceImpl implements BreakContractSe
private final BreakContractOwnerRecordDao breakContractOwnerRecordDao;
private final OrderGoodsDao orderGoodsDao;
private final OwnerAccountPasswordDao ownerAccountPasswordDao;
private final PlatformAccountConfigService platformAccountConfigService;
......@@ -396,15 +400,32 @@ 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);
List<CarrierPagePlatformAccountConfigVO> configs =
platformAccountConfigService.getPlatformAccountConfigByType(
PlatformAccountConfigEnum.BusinessType.BREAK.getCode(),
PlatformAccountConfigEnum.OwnerType.COMPANY.getCode(),
null,
null,
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());
......
package com.clx.performance.service.impl.settle;
import com.clx.order.vo.feign.FeignOrderInfoVO;
import com.clx.performance.config.MslPaymentConfig;
import com.clx.performance.constant.RedissonConstants;
import com.clx.performance.dao.OrderChildDao;
......@@ -17,6 +18,7 @@ import com.clx.performance.enums.settle.SettlementLogEnum;
import com.clx.performance.enums.settle.SettlementOwnerEnum;
import com.clx.performance.enums.settle.SettlementPlatformEnum;
import com.clx.performance.extranal.user.DriverService;
import com.clx.performance.extranal.user.OrderService;
import com.clx.performance.extranal.user.OwnerInfoService;
import com.clx.performance.model.OrderChild;
import com.clx.performance.model.OrderGoods;
......@@ -103,6 +105,10 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
@Autowired
RedisUtil redisUtil;
@Autowired
private OrderService orderService;
......@@ -293,6 +299,8 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
private String settlementPeriodMonthInit(SettlementOwnerDetail settlementOwnerDetail, LocalDateTime settlementPeriodTime,OwnerInfoFeignVO ownerInfo){
FeignOrderInfoVO orderInfo = orderService.getOrderInfo(settlementOwnerDetail.getOrderNo()).orElseThrow(PerformanceResultEnum.ORDER_INVALID);
//获取所有detail
SettlementOwner settlementOwner = new SettlementOwner();
......@@ -331,6 +339,11 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
settlementOwner.setCompanyContactMobile(ownerInfo.getContactsTelephone());
settlementOwner.setCompanyContactAddress(ownerInfo.getContactsAddress());
settlementOwner.setSettlementWay(settlementOwnerDetail.getSettlementWay());
//设置开票公司
settlementOwner.setInvoicingCompanyId(orderInfo.getInvoicingCompanyId());
settlementOwner.setInvoicingCompanyShorterName(orderInfo.getInvoicingCompanyShorterName());
settlementOwner.setInvoicingCompanyGroupCode(orderInfo.getInvoicingCompanyGroupCode());
settlementOwner.setReportFlag(orderInfo.getReportFlag());
settlementOwnerDao.saveEntity(settlementOwner);
//保存结算单日志----创建结算单
......@@ -373,6 +386,9 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
* 拉运完成结 初始化
*/
private String settlementPeriodImmediateInit(SettlementOwnerDetail settlementOwnerDetail,OwnerInfoFeignVO ownerInfo){
FeignOrderInfoVO orderInfo = orderService.getOrderInfo(settlementOwnerDetail.getOrderNo()).orElseThrow(PerformanceResultEnum.ORDER_INVALID);
SettlementOwner settlementOwner = new SettlementOwner();
String settlementNo = settlementNoGenerate();
......@@ -409,6 +425,11 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
settlementOwner.setSettlementWay(settlementOwnerDetail.getSettlementWay());
settlementOwner.setInvoiceStatus(SettlementOwnerEnum.InvoiceStatus.NOT_INVOICE.getCode());
//设置开票公司
settlementOwner.setInvoicingCompanyId(orderInfo.getInvoicingCompanyId());
settlementOwner.setInvoicingCompanyShorterName(orderInfo.getInvoicingCompanyShorterName());
settlementOwner.setInvoicingCompanyGroupCode(orderInfo.getInvoicingCompanyGroupCode());
settlementOwner.setReportFlag(orderInfo.getReportFlag());
settlementOwnerDao.saveEntity(settlementOwner);
//保存结算单日志----创建结算单
......
......@@ -92,8 +92,12 @@ public class SettlementOwnerDetailServiceImpl implements SettlementOwnerDetailS
//
settlementOwnerDetail.setFinalPaymentStatus(SettlementOwnerDetailEnum.FinalPaymentStatus.NO.getCode());
//设置开票公司信息
settlementOwnerDetail.setInvoicingCompanyId(orderChild.getInvoicingCompanyId());
settlementOwnerDetail.setInvoicingCompanyShorterName(orderChild.getInvoicingCompanyShorterName());
settlementOwnerDetail.setInvoicingCompanyGroupCode(orderChild.getInvoicingCompanyGroupCode());
settlementOwnerDetail.setReportFlag(orderChild.getReportFlag());
settlementOwnerDetailDao.saveEntity(settlementOwnerDetail);
return settlementOwnerDetail.getId();
}
......
......@@ -12,6 +12,7 @@ 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.enums.settle.SettlementLogEnum;
import com.clx.performance.enums.settle.SettlementOwnerDetailEnum;
......@@ -24,6 +25,7 @@ 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;
......@@ -44,6 +46,7 @@ import com.msl.user.utils.TokenUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -83,6 +86,8 @@ public class SettlementOwnerServiceImpl implements SettlementOwnerService {
private final NetworkSyncComponent networkSyncComponent;
private final SettlementMqHandlerService settlementMqHandlerService;
private final PlatformAccountConfigService platformAccountConfigService;
private final OwnerAccountPasswordDao ownerAccountPasswordDao;
......@@ -182,20 +187,78 @@ public class SettlementOwnerServiceImpl implements SettlementOwnerService {
return vo;
}
@Override
public SettlementPlatformAccountVO getCarrierSettlementPlatformAccount(String settlementNo){
public SettlementPlatformAccountVO getBreakSettlementPlatformAccount() {
//平台账号
SettlementPlatformAccount platformAccount = settlementPlatformAccountDao.getSettlementPlatformAccount();
//SettlementPlatformAccount platformAccount = settlementPlatformAccountDao.getSettlementPlatformAccount();
//返回对象
SettlementPlatformAccountVO vo = new SettlementPlatformAccountVO();
/*if(Objects.nonNull(platformAccount)){
vo.setPayee(platformAccount.getCardHolder());
vo.setPayeeBankCardNo(platformAccount.getBankCardNo());
vo.setPayeeBankName(platformAccount.getBankName());
}*/
List<CarrierPagePlatformAccountConfigVO> configs =
platformAccountConfigService.getPlatformAccountConfigByType(
PlatformAccountConfigEnum.BusinessType.BREAK.getCode(),
PlatformAccountConfigEnum.OwnerType.COMPANY.getCode(),
null,
null,
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());
......
package com.clx.performance.service.impl.settle;
import cn.hutool.json.JSONUtil;
import com.clx.order.enums.OrderEnum;
import com.clx.performance.component.IdGenerateSnowFlake;
import com.clx.performance.constant.RabbitKeyConstants;
import com.clx.performance.dao.OrderChildDao;
......@@ -142,6 +143,14 @@ public class SettlementServiceImpl implements SettlementService {
// throw new ServiceSystemException(PerformanceResultEnum.ORDER_CHILD_SYNC_ERROR);
//
// }
if(Objects.equals(orderChild.getReportFlag(), OrderEnum.ReportFlag.YES.getCode())){
log.info("运单号:{},对应的开票公司上报标识为【是】",orderChild.getChildNo());
Message message = MessageBuilder.withBody(JSONUtil.parse(orderChild).toString().getBytes()).build();
rabbitTemplate.send(
RabbitKeyConstants.ORDER_CHILD_SYNC_TRANSPORT_EXCHANGE, RabbitKeyConstants.ORDER_CHILD_SYNC_TRANSPORT_ROUTE_KEY, message
);
return;
}
}
// 结算金额
......
......@@ -21,6 +21,8 @@ public interface SettlementOwnerService {
SettlementPlatformAccountVO getSettlementPlatformAccount();
SettlementPlatformAccountVO getBreakSettlementPlatformAccount();
SettlementPlatformAccountVO getCarrierSettlementPlatformAccount(String settlementNo);
void updatePaymentSettlement(OwnerPaymentSettlementParam param);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论