集成bms服务模块
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
package com.mhd.bms.domain.billManage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 账单流水明细对象 bill_detail
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillDetail extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("账单流水明细id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long billDetailId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("账单管理id")
|
||||
@Excel(name = "账单管理id")
|
||||
private Long billManageId;
|
||||
|
||||
@ApiModelProperty("账单编号")
|
||||
@Excel(name = "账单编号")
|
||||
private String billNumber;
|
||||
|
||||
@ApiModelProperty("计费流水id")
|
||||
@Excel(name = "计费流水id")
|
||||
private Long billingStatementId;
|
||||
|
||||
@ApiModelProperty("计费流水号")
|
||||
@Excel(name = "计费流水号")
|
||||
private String billingFlow;
|
||||
|
||||
@ApiModelProperty("费用总额")
|
||||
@Excel(name = "费用总额")
|
||||
private BigDecimal billingTotalAmount;
|
||||
|
||||
@ApiModelProperty("账单优惠金额")
|
||||
@Excel(name = "账单优惠金额")
|
||||
private BigDecimal billingDiscountAmount;
|
||||
|
||||
@ApiModelProperty("账单金额")
|
||||
@Excel(name = "账单金额")
|
||||
private BigDecimal billingAmount;
|
||||
|
||||
@ApiModelProperty("账单类型(1-应收,2-应付)")
|
||||
@Excel(name = "账单类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer billType;
|
||||
|
||||
@ApiModelProperty("期望金额")
|
||||
@Excel(name = "期望金额")
|
||||
private BigDecimal billingExpectedAmount;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
package com.mhd.bms.domain.billManage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 账单管理对象 bill_manage
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillManage extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("账单管理id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long billManageId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("账单编号")
|
||||
@Excel(name = "账单编号")
|
||||
private String billNumber;
|
||||
|
||||
@ApiModelProperty("账单类型(1-应收,2-应付)")
|
||||
@Excel(name = "账单类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer billType;
|
||||
|
||||
@ApiModelProperty("账单状态(1-未确认,2-对账中,3-未收款/付款,4-部分收款/付款,5-已收款/付款,6-已作废,7-已退款)")
|
||||
@Excel(name = "账单状态", readConverterExp = "1=-未确认,2-对账中,3-未收款/付款,4-部分收款/付款,5-已收款/付款,6-已作废,7-已退款")
|
||||
private Integer billState;
|
||||
|
||||
@ApiModelProperty("账单流程节点(1-发起对账,2-客户确认,3-财务审核,4-收款/付款)")
|
||||
@Excel(name = "账单流程节点", readConverterExp = "1=-发起对账,2-客户确认,3-财务审核,4-收款/付款")
|
||||
private Integer billStep;
|
||||
|
||||
@ApiModelProperty("系统来源")
|
||||
@Excel(name = "系统来源")
|
||||
private String belongModule;
|
||||
|
||||
@ApiModelProperty("系统来源code")
|
||||
@Excel(name = "系统来源code")
|
||||
private String belongModuleCode;
|
||||
|
||||
@ApiModelProperty("结算对象id")
|
||||
@Excel(name = "结算对象id")
|
||||
private Long settlementCustomersId;
|
||||
|
||||
@ApiModelProperty("结算对象code")
|
||||
@Excel(name = "结算对象code")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("结算对象")
|
||||
@Excel(name = "结算对象")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("账单总金额")
|
||||
@Excel(name = "账单总金额")
|
||||
private BigDecimal billTotalAmount;
|
||||
|
||||
@ApiModelProperty("优惠金额")
|
||||
@Excel(name = "优惠金额")
|
||||
private BigDecimal billDiscountAmount;
|
||||
|
||||
@ApiModelProperty("账单金额")
|
||||
@Excel(name = "账单金额")
|
||||
private BigDecimal billAmount;
|
||||
|
||||
@ApiModelProperty("已收/付金额")
|
||||
@Excel(name = "已收/付金额")
|
||||
private BigDecimal billAmountSettlement;
|
||||
|
||||
@ApiModelProperty("未收/付金额")
|
||||
@Excel(name = "未收/付金额")
|
||||
private BigDecimal billAmountUnsettled;
|
||||
|
||||
@ApiModelProperty("期望金额")
|
||||
@Excel(name = "期望金额")
|
||||
private BigDecimal billExpectedAmount;
|
||||
|
||||
@ApiModelProperty("对账状态(1-暂未确认,2-申请调账,3-财务调账,4-核对无误)")
|
||||
@Excel(name = "对账状态", readConverterExp = "1=-暂未确认,2-申请调账,3-财务调账,4-核对无误")
|
||||
private Integer reconciliationStatus;
|
||||
|
||||
@ApiModelProperty("对账意见描述")
|
||||
@Excel(name = "对账意见描述")
|
||||
private String reconciliationOpinion;
|
||||
|
||||
@ApiModelProperty("客户凭证地址")
|
||||
@Excel(name = "客户凭证地址")
|
||||
private String voucherAddress;
|
||||
|
||||
@ApiModelProperty("财务审核结果(1-同意,2-拒绝)")
|
||||
@Excel(name = "财务审核结果(1-同意,2-拒绝)")
|
||||
private Integer financialReviewFlag;
|
||||
|
||||
@ApiModelProperty("审核意见描述")
|
||||
@Excel(name = "审核意见描述")
|
||||
private String financialReviewOpinion;
|
||||
|
||||
@ApiModelProperty("周期开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cycleBeginTime;
|
||||
|
||||
@ApiModelProperty("周期结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cycleEndTime;
|
||||
|
||||
@ApiModelProperty("收款/付款时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "收款/付款时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date settlementTime;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String billRemark;
|
||||
|
||||
@ApiModelProperty("折扣百分比")
|
||||
@Excel(name = "折扣百分比")
|
||||
private BigDecimal billDiscount;
|
||||
|
||||
@ApiModelProperty("折扣上限金额")
|
||||
@Excel(name = "折扣上限金额")
|
||||
private BigDecimal billDiscountLimit;
|
||||
|
||||
@ApiModelProperty("费用计算精度code")
|
||||
@Excel(name = "费用计算精度code")
|
||||
private String costAccuracyCode;
|
||||
|
||||
@ApiModelProperty("费用计算精度name")
|
||||
@Excel(name = "费用计算精度name")
|
||||
private String costAccuracyName;
|
||||
|
||||
@ApiModelProperty("尾数计算code")
|
||||
@Excel(name = "尾数计算code")
|
||||
private String tailCalculationCode;
|
||||
|
||||
@ApiModelProperty("尾数计算name")
|
||||
@Excel(name = "尾数计算name")
|
||||
private String tailCalculationName;
|
||||
|
||||
@ApiModelProperty("账单金额精度code")
|
||||
@Excel(name = "账单金额精度code")
|
||||
private String amountAccuracyCode;
|
||||
|
||||
@ApiModelProperty("账单金额精度name")
|
||||
@Excel(name = "账单金额精度name")
|
||||
private String amountAccuracyName;
|
||||
|
||||
@ApiModelProperty("结算方式(1-现金,2-油卡)")
|
||||
private Integer settlementWay;
|
||||
|
||||
@ApiModelProperty("结算方式")
|
||||
private String settlementMethod;
|
||||
|
||||
@ApiModelProperty("结算方式编码")
|
||||
private String settlementMethodCode;
|
||||
|
||||
@ApiModelProperty("实收金额")
|
||||
private BigDecimal actualReceivedAmount;
|
||||
|
||||
@ApiModelProperty("结算单优惠金额")
|
||||
private BigDecimal settlementDiscountsAmount;
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.mhd.bms.domain.billManage.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.billManage.entity.BillDetail;
|
||||
import com.mhd.bms.domain.billManage.repository.po.BillDetailPO;
|
||||
import com.mhd.bms.domain.billManage.repository.todo.BillDetailDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 账单流水明细Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
public interface IBillDetailService extends IService<BillDetail>
|
||||
{
|
||||
|
||||
/**
|
||||
* 新增账单流水明细
|
||||
*/
|
||||
public Boolean insert(BillDetailDO billDetailDO);
|
||||
|
||||
/**
|
||||
* 修改账单流水明细
|
||||
*/
|
||||
public Boolean update(BillDetailDO billDetailDO);
|
||||
|
||||
/**
|
||||
* 批量删除账单流水明细
|
||||
*/
|
||||
public Boolean delete(Long[] billDetailIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询账单流水明细
|
||||
*/
|
||||
public BillDetailPO getInfo(Long billDetailId);
|
||||
|
||||
List<BillDetailPO> getDetailsByBillManageId(Long billManageId);
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.mhd.bms.domain.billManage.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.billManage.entity.BillManage;
|
||||
import com.mhd.bms.domain.billManage.repository.po.BillManagePO;
|
||||
import com.mhd.bms.domain.billManage.repository.todo.BillManageDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 账单管理Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
public interface IBillManageService extends IService<BillManage>
|
||||
{
|
||||
/**
|
||||
* 分页查询账单管理列表
|
||||
*/
|
||||
public List<BillManagePO> queryList(BillManageDO billManageDO);
|
||||
|
||||
/**
|
||||
* 新增账单管理
|
||||
*/
|
||||
public Boolean insert(BillManageDO billManageDO);
|
||||
|
||||
/**
|
||||
* 修改账单管理
|
||||
*/
|
||||
public Boolean update(BillManageDO billManageDO);
|
||||
|
||||
/**
|
||||
* 批量删除账单管理
|
||||
*/
|
||||
public Boolean delete(Long[] billManageIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询账单管理
|
||||
*/
|
||||
public BillManagePO getInfo(Long billManageId);
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.mhd.bms.domain.billManage.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.billManage.entity.BillDetail;
|
||||
import com.mhd.bms.domain.billManage.repository.po.BillDetailPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 账单流水明细Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
public interface BillDetailMapper extends BaseMapper<BillDetail>
|
||||
{
|
||||
|
||||
List<BillDetailPO> getDetailsByBillManageId(@Param("billManageId") Long billManageId);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.mhd.bms.domain.billManage.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.billManage.entity.BillManage;
|
||||
import com.mhd.bms.domain.billManage.repository.po.BillManagePO;
|
||||
import com.mhd.bms.domain.billManage.repository.todo.BillManageDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 账单管理Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
public interface BillManageMapper extends BaseMapper<BillManage>
|
||||
{
|
||||
/**
|
||||
* 查询账单管理列表
|
||||
*/
|
||||
public List<BillManagePO> queryList(@Param("billManageDO") BillManageDO billManageDO);
|
||||
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package com.mhd.bms.domain.billManage.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.billManage.entity.BillDetail;
|
||||
import com.mhd.bms.domain.billManage.repository.facade.IBillDetailService;
|
||||
import com.mhd.bms.domain.billManage.repository.mapper.BillDetailMapper;
|
||||
import com.mhd.bms.domain.billManage.repository.po.BillDetailPO;
|
||||
import com.mhd.bms.domain.billManage.repository.todo.BillDetailDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 账单流水明细Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
@Service
|
||||
public class BillDetailImpl extends ServiceImpl<BillDetailMapper, BillDetail> implements IBillDetailService {
|
||||
@Autowired
|
||||
private BillDetailMapper billDetailMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 新增账单流水明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(BillDetailDO billDetailDO) {
|
||||
BillDetail billDetail = new BillDetail();
|
||||
BeanUtils.copyProperties(billDetailDO,billDetail);
|
||||
return this.save(billDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账单流水明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(BillDetailDO billDetailDO) {
|
||||
BillDetail billDetail = new BillDetail();
|
||||
BeanUtils.copyProperties(billDetailDO,billDetail);
|
||||
return this.updateById(billDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除账单流水明细
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] billDetailIds ) {
|
||||
List<BillDetail> list = new ArrayList<>();
|
||||
for (Long id : billDetailIds) {
|
||||
BillDetail billDetail = new BillDetail();
|
||||
billDetail.setBillDetailId(id);
|
||||
billDetail.setDelFlag(2);
|
||||
list.add(billDetail);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账单流水明细
|
||||
*/
|
||||
@Override
|
||||
public BillDetailPO getInfo(Long billDetailId) {
|
||||
BillDetail billDetail = this.getById(billDetailId);
|
||||
BillDetailPO billDetailPO = new BillDetailPO();
|
||||
BeanUtils.copyProperties(billDetail,billDetailPO);
|
||||
return billDetailPO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BillDetailPO> getDetailsByBillManageId(Long billManageId) {
|
||||
return billDetailMapper.getDetailsByBillManageId(billManageId);
|
||||
}
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.mhd.bms.domain.billManage.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.billManage.entity.BillManage;
|
||||
import com.mhd.bms.domain.billManage.repository.facade.IBillManageService;
|
||||
import com.mhd.bms.domain.billManage.repository.mapper.BillManageMapper;
|
||||
import com.mhd.bms.domain.billManage.repository.po.BillManagePO;
|
||||
import com.mhd.bms.domain.billManage.repository.todo.BillManageDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 账单管理Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
@Service
|
||||
public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> implements IBillManageService{
|
||||
@Autowired
|
||||
private BillManageMapper billManageMapper;
|
||||
|
||||
/**
|
||||
* 查询账单管理列表
|
||||
*/
|
||||
@Override
|
||||
public List<BillManagePO> queryList(BillManageDO billManageDO)
|
||||
{
|
||||
return billManageMapper.queryList(billManageDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增账单管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(BillManageDO billManageDO) {
|
||||
BillManage billManage = new BillManage();
|
||||
BeanUtils.copyProperties(billManageDO,billManage);
|
||||
return this.save(billManage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账单管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(BillManageDO billManageDO) {
|
||||
BillManage billManage = new BillManage();
|
||||
BeanUtils.copyProperties(billManageDO,billManage);
|
||||
return this.updateById(billManage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除账单管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] billManageIds ) {
|
||||
List<BillManage> list = new ArrayList<>();
|
||||
for (Long id : billManageIds) {
|
||||
BillManage billManage = new BillManage();
|
||||
billManage.setBillManageId(id);
|
||||
billManage.setDelFlag(2);
|
||||
list.add(billManage);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账单管理
|
||||
*/
|
||||
@Override
|
||||
public BillManagePO getInfo(Long billManageId) {
|
||||
BillManage billManage = this.getById(billManageId);
|
||||
BillManagePO billManagePO = new BillManagePO();
|
||||
BeanUtils.copyProperties(billManage,billManagePO);
|
||||
return billManagePO;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.mhd.bms.domain.billManage.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 账单流水明细对象 bill_detail
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "账单流水明细对象", description = "账单流水明细响应对象")
|
||||
public class BillDetailPO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("账单流水明细id")
|
||||
private Long billDetailId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("账单管理id")
|
||||
@Excel(name = "账单管理id")
|
||||
private Long billManageId;
|
||||
|
||||
@ApiModelProperty("账单编号")
|
||||
@Excel(name = "账单编号")
|
||||
private String billNumber;
|
||||
|
||||
@ApiModelProperty("计费流水id")
|
||||
@Excel(name = "计费流水id")
|
||||
private Long billingStatementId;
|
||||
|
||||
@ApiModelProperty("计费流水号")
|
||||
@Excel(name = "计费流水号")
|
||||
private String billingFlow;
|
||||
|
||||
@ApiModelProperty("费用总额")
|
||||
@Excel(name = "费用总额")
|
||||
private BigDecimal billingTotalAmount;
|
||||
|
||||
@ApiModelProperty("账单优惠金额")
|
||||
@Excel(name = "账单优惠金额")
|
||||
private BigDecimal billingDiscountAmount;
|
||||
|
||||
@ApiModelProperty("账单金额")
|
||||
@Excel(name = "账单金额")
|
||||
private BigDecimal billingAmount;
|
||||
|
||||
@ApiModelProperty("账单类型(1-应收,2-应付)")
|
||||
@Excel(name = "账单类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer billType;
|
||||
|
||||
@ApiModelProperty("期望金额")
|
||||
@Excel(name = "期望金额")
|
||||
private BigDecimal billingExpectedAmount;
|
||||
|
||||
@ApiModelProperty("结算对象code")
|
||||
@Excel(name = "结算对象code")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("结算对象")
|
||||
@Excel(name = "结算对象")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("业务日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "业务日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date businessDate;
|
||||
|
||||
@ApiModelProperty("周期开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cycleBeginTime;
|
||||
|
||||
@ApiModelProperty("周期结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cycleEndTime;
|
||||
|
||||
@ApiModelProperty("费用类型code(服务项)")
|
||||
@Excel(name = "费用类型code", readConverterExp = "服=务项")
|
||||
private String serviceItemsCode;
|
||||
|
||||
@ApiModelProperty("费用类型")
|
||||
@Excel(name = "费用类型")
|
||||
private String serviceItemsName;
|
||||
|
||||
@ApiModelProperty("一级费用科目code")
|
||||
@Excel(name = "一级费用科目code")
|
||||
private String firstSubjectCode;
|
||||
|
||||
@ApiModelProperty("一级费用科目(结算项)")
|
||||
@Excel(name = "一级费用科目", readConverterExp = "结=算项")
|
||||
private String firstSubjectName;
|
||||
|
||||
@ApiModelProperty("二级费用科目code")
|
||||
@Excel(name = "二级费用科目code")
|
||||
private String secondSubjectCode;
|
||||
|
||||
@ApiModelProperty("二级费用科目(结算项)")
|
||||
@Excel(name = "二级费用科目", readConverterExp = "结=算项")
|
||||
private String secondSubjectName;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
package com.mhd.bms.domain.billManage.repository.po;
|
||||
|
||||
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 账单管理对象 bill_manage
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "账单管理对象", description = "账单管理响应对象")
|
||||
public class BillManagePO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("账单管理id")
|
||||
private Long billManageId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("账单编号")
|
||||
@Excel(name = "账单编号")
|
||||
private String billNumber;
|
||||
|
||||
@ApiModelProperty("账单类型(1-应收,2-应付)")
|
||||
@Excel(name = "账单类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer billType;
|
||||
|
||||
@ApiModelProperty("账单状态(1-未确认,2-对账中,3-未收款/付款,4-部分收款/付款,5-已收款/付款,6-已作废,7-已退款)")
|
||||
@Excel(name = "账单状态", readConverterExp = "1=-未确认,2-对账中,3-未收款/付款,4-部分收款/付款,5-已收款/付款,6-已作废,7-已退款")
|
||||
private Integer billState;
|
||||
|
||||
@ApiModelProperty("账单流程节点(1-发起对账,2-客户确认,3-财务审核,4-收款/付款)")
|
||||
@Excel(name = "账单流程节点", readConverterExp = "1=-发起对账,2-客户确认,3-财务审核,4-收款/付款")
|
||||
private Integer billStep;
|
||||
|
||||
@ApiModelProperty("系统来源")
|
||||
@Excel(name = "系统来源")
|
||||
private String belongModule;
|
||||
|
||||
@ApiModelProperty("系统来源code")
|
||||
@Excel(name = "系统来源code")
|
||||
private String belongModuleCode;
|
||||
|
||||
@ApiModelProperty("结算对象id")
|
||||
@Excel(name = "结算对象id")
|
||||
private Long settlementCustomersId;
|
||||
|
||||
@ApiModelProperty("结算对象code")
|
||||
@Excel(name = "结算对象code")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("结算对象")
|
||||
@Excel(name = "结算对象")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("账单总金额")
|
||||
@Excel(name = "账单总金额")
|
||||
private BigDecimal billTotalAmount;
|
||||
|
||||
@ApiModelProperty("优惠金额")
|
||||
@Excel(name = "优惠金额")
|
||||
private BigDecimal billDiscountAmount;
|
||||
|
||||
@ApiModelProperty("账单金额")
|
||||
@Excel(name = "账单金额")
|
||||
private BigDecimal billAmount;
|
||||
|
||||
@ApiModelProperty("已收/付金额")
|
||||
@Excel(name = "已收/付金额")
|
||||
private BigDecimal billAmountSettlement;
|
||||
|
||||
@ApiModelProperty("未收/付金额")
|
||||
@Excel(name = "未收/付金额")
|
||||
private BigDecimal billAmountUnsettled;
|
||||
|
||||
@ApiModelProperty("期望金额")
|
||||
@Excel(name = "期望金额")
|
||||
private BigDecimal billExpectedAmount;
|
||||
|
||||
@ApiModelProperty("对账状态(1-暂未确认,2-申请调账,3-财务调账,4-核对无误)")
|
||||
@Excel(name = "对账状态", readConverterExp = "1=-暂未确认,2-申请调账,3-财务调账,4-核对无误")
|
||||
private Integer reconciliationStatus;
|
||||
|
||||
@ApiModelProperty("对账意见描述")
|
||||
@Excel(name = "对账意见描述")
|
||||
private String reconciliationOpinion;
|
||||
|
||||
@ApiModelProperty("客户凭证地址")
|
||||
@Excel(name = "客户凭证地址")
|
||||
private String voucherAddress;
|
||||
|
||||
@ApiModelProperty("财务审核结果(1-同意,2-拒绝)")
|
||||
@Excel(name = "财务审核结果(1-同意,2-拒绝)")
|
||||
private Integer financialReviewFlag;
|
||||
|
||||
@ApiModelProperty("审核意见描述")
|
||||
@Excel(name = "审核意见描述")
|
||||
private String financialReviewOpinion;
|
||||
|
||||
@ApiModelProperty("周期开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cycleBeginTime;
|
||||
|
||||
@ApiModelProperty("周期结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cycleEndTime;
|
||||
|
||||
@ApiModelProperty("收款/付款时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "收款/付款时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date settlementTime;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String billRemark;
|
||||
|
||||
@ApiModelProperty("折扣百分比")
|
||||
@Excel(name = "折扣百分比")
|
||||
private BigDecimal billDiscount;
|
||||
|
||||
@ApiModelProperty("折扣上限金额")
|
||||
@Excel(name = "折扣上限金额")
|
||||
private BigDecimal billDiscountLimit;
|
||||
|
||||
@ApiModelProperty("费用计算精度code")
|
||||
@Excel(name = "费用计算精度code")
|
||||
private String costAccuracyCode;
|
||||
|
||||
@ApiModelProperty("费用计算精度name")
|
||||
@Excel(name = "费用计算精度name")
|
||||
private String costAccuracyName;
|
||||
|
||||
@ApiModelProperty("尾数计算code")
|
||||
@Excel(name = "尾数计算code")
|
||||
private String tailCalculationCode;
|
||||
|
||||
@ApiModelProperty("尾数计算name")
|
||||
@Excel(name = "尾数计算name")
|
||||
private String tailCalculationName;
|
||||
|
||||
@ApiModelProperty("账单金额精度code")
|
||||
@Excel(name = "账单金额精度code")
|
||||
private String amountAccuracyCode;
|
||||
|
||||
@ApiModelProperty("账单金额精度name")
|
||||
@Excel(name = "账单金额精度name")
|
||||
private String amountAccuracyName;
|
||||
|
||||
@ApiModelProperty("账单详情明细列表")
|
||||
private List<BillDetailPO> billDetailPOList;
|
||||
|
||||
@ApiModelProperty("账单流水明细表")
|
||||
private List<BillingStatementPO> billingStatementPOList;
|
||||
|
||||
@ApiModelProperty("结算方式(1-现金,2-油卡)")
|
||||
private Integer settlementWay;
|
||||
|
||||
@ApiModelProperty("结算方式")
|
||||
private String settlementMethod;
|
||||
|
||||
@ApiModelProperty("结算方式编码")
|
||||
private String settlementMethodCode;
|
||||
|
||||
@ApiModelProperty("实收金额")
|
||||
private BigDecimal actualReceivedAmount;
|
||||
|
||||
@ApiModelProperty("结算单优惠金额")
|
||||
private BigDecimal settlementDiscountsAmount;
|
||||
|
||||
@ApiModelProperty("流水ids")
|
||||
private String billingStatementIds;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.mhd.bms.domain.billManage.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 账单流水明细对象 bill_detail
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillDetailDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("账单流水明细id")
|
||||
private Long billDetailId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("账单管理id")
|
||||
@Excel(name = "账单管理id")
|
||||
private Long billManageId;
|
||||
|
||||
@ApiModelProperty("账单编号")
|
||||
@Excel(name = "账单编号")
|
||||
private String billNumber;
|
||||
|
||||
@ApiModelProperty("计费流水id")
|
||||
@Excel(name = "计费流水id")
|
||||
private Long billingStatementId;
|
||||
|
||||
@ApiModelProperty("计费流水号")
|
||||
@Excel(name = "计费流水号")
|
||||
private String billingFlow;
|
||||
|
||||
@ApiModelProperty("费用总额")
|
||||
@Excel(name = "费用总额")
|
||||
private BigDecimal billingTotalAmount;
|
||||
|
||||
@ApiModelProperty("账单优惠金额")
|
||||
@Excel(name = "账单优惠金额")
|
||||
private BigDecimal billingDiscountAmount;
|
||||
|
||||
@ApiModelProperty("账单金额")
|
||||
@Excel(name = "账单金额")
|
||||
private BigDecimal billingAmount;
|
||||
|
||||
@ApiModelProperty("账单类型(1-应收,2-应付)")
|
||||
@Excel(name = "账单类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer billType;
|
||||
|
||||
@ApiModelProperty("期望金额")
|
||||
@Excel(name = "期望金额")
|
||||
private BigDecimal billingExpectedAmount;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
}
|
||||
+208
@@ -0,0 +1,208 @@
|
||||
package com.mhd.bms.domain.billManage.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
* 账单管理对象 bill_manage
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillManageDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("账单管理id")
|
||||
private Long billManageId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("账单编号")
|
||||
@Excel(name = "账单编号")
|
||||
private String billNumber;
|
||||
|
||||
@ApiModelProperty("账单类型(1-应收,2-应付)")
|
||||
@Excel(name = "账单类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer billType;
|
||||
|
||||
@ApiModelProperty("账单状态(1-未确认,2-对账中,3-未收款/付款,4-部分收款/付款,5-已收款/付款,6-已作废,7-已退款)")
|
||||
@Excel(name = "账单状态", readConverterExp = "1=-未确认,2-对账中,3-未收款/付款,4-部分收款/付款,5-已收款/付款,6-已作废,7-已退款")
|
||||
private Integer billState;
|
||||
|
||||
@ApiModelProperty("账单流程节点(1-发起对账,2-客户确认,3-财务审核,4-收款/付款)")
|
||||
@Excel(name = "账单流程节点", readConverterExp = "1=-发起对账,2-客户确认,3-财务审核,4-收款/付款")
|
||||
private Integer billStep;
|
||||
|
||||
@ApiModelProperty("系统来源")
|
||||
@Excel(name = "系统来源")
|
||||
private String belongModule;
|
||||
|
||||
@ApiModelProperty("系统来源code")
|
||||
@Excel(name = "系统来源code")
|
||||
private String belongModuleCode;
|
||||
|
||||
@ApiModelProperty("结算对象id")
|
||||
@Excel(name = "结算对象id")
|
||||
private Long settlementCustomersId;
|
||||
|
||||
@ApiModelProperty("结算对象code")
|
||||
@Excel(name = "结算对象code")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("结算对象")
|
||||
@Excel(name = "结算对象")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("账单总金额")
|
||||
@Excel(name = "账单总金额")
|
||||
private BigDecimal billTotalAmount;
|
||||
|
||||
@ApiModelProperty("优惠金额")
|
||||
@Excel(name = "优惠金额")
|
||||
private BigDecimal billDiscountAmount;
|
||||
|
||||
@ApiModelProperty("账单金额")
|
||||
@Excel(name = "账单金额")
|
||||
private BigDecimal billAmount;
|
||||
|
||||
@ApiModelProperty("已收/付金额")
|
||||
@Excel(name = "已收/付金额")
|
||||
private BigDecimal billAmountSettlement;
|
||||
|
||||
@ApiModelProperty("未收/付金额")
|
||||
@Excel(name = "未收/付金额")
|
||||
private BigDecimal billAmountUnsettled;
|
||||
|
||||
@ApiModelProperty("期望金额")
|
||||
@Excel(name = "期望金额")
|
||||
private BigDecimal billExpectedAmount;
|
||||
|
||||
@ApiModelProperty("对账状态(1-暂未确认,2-申请调账,3-财务调账,4-核对无误)")
|
||||
@Excel(name = "对账状态", readConverterExp = "1=-暂未确认,2-申请调账,3-财务调账,4-核对无误")
|
||||
private Integer reconciliationStatus;
|
||||
|
||||
@ApiModelProperty("对账意见描述")
|
||||
@Excel(name = "对账意见描述")
|
||||
private String reconciliationOpinion;
|
||||
|
||||
@ApiModelProperty("客户凭证地址")
|
||||
@Excel(name = "客户凭证地址")
|
||||
private String voucherAddress;
|
||||
|
||||
@ApiModelProperty("财务审核结果(1-同意,2-拒绝)")
|
||||
@Excel(name = "财务审核结果(1-同意,2-拒绝)")
|
||||
private Integer financialReviewFlag;
|
||||
|
||||
@ApiModelProperty("审核意见描述")
|
||||
@Excel(name = "审核意见描述")
|
||||
private String financialReviewOpinion;
|
||||
|
||||
@ApiModelProperty("周期开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cycleBeginTime;
|
||||
|
||||
@ApiModelProperty("周期结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cycleEndTime;
|
||||
|
||||
@ApiModelProperty("收款/付款时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "收款/付款时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date settlementTime;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String billRemark;
|
||||
|
||||
@ApiModelProperty("折扣百分比")
|
||||
@Excel(name = "折扣百分比")
|
||||
private BigDecimal billDiscount;
|
||||
|
||||
@ApiModelProperty("折扣上限金额")
|
||||
@Excel(name = "折扣上限金额")
|
||||
private BigDecimal billDiscountLimit;
|
||||
|
||||
@ApiModelProperty("费用计算精度code")
|
||||
@Excel(name = "费用计算精度code")
|
||||
private String costAccuracyCode;
|
||||
|
||||
@ApiModelProperty("费用计算精度name")
|
||||
@Excel(name = "费用计算精度name")
|
||||
private String costAccuracyName;
|
||||
|
||||
@ApiModelProperty("尾数计算code")
|
||||
@Excel(name = "尾数计算code")
|
||||
private String tailCalculationCode;
|
||||
|
||||
@ApiModelProperty("尾数计算name")
|
||||
@Excel(name = "尾数计算name")
|
||||
private String tailCalculationName;
|
||||
|
||||
@ApiModelProperty("账单金额精度code")
|
||||
@Excel(name = "账单金额精度code")
|
||||
private String amountAccuracyCode;
|
||||
|
||||
@ApiModelProperty("账单金额精度name")
|
||||
@Excel(name = "账单金额精度name")
|
||||
private String amountAccuracyName;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
|
||||
@ApiModelProperty(name = "创建时间查询条件开始日期")
|
||||
private String createTimeStart;
|
||||
@ApiModelProperty(name = "创建时间查询条件结束日期")
|
||||
private String createTimeEnd;
|
||||
@ApiModelProperty(name = "修改时间查询条件开始日期")
|
||||
private String updateTimeStart;
|
||||
@ApiModelProperty(name = "修改时间查询条件结束日期")
|
||||
private String updateTimeEnd;
|
||||
|
||||
@ApiModelProperty("查询条件类型(1-未结清,2-已结清,3-已作废)")
|
||||
private Integer queryParam;
|
||||
|
||||
@ApiModelProperty(name = "账单管理id集合")
|
||||
private Set<String> billManageIdSet;
|
||||
|
||||
@ApiModelProperty("结算方式(1-现金,2-油卡)")
|
||||
private Integer settlementWay;
|
||||
|
||||
@ApiModelProperty("结算方式")
|
||||
private String settlementMethod;
|
||||
|
||||
@ApiModelProperty("结算方式编码")
|
||||
private String settlementMethodCode;
|
||||
|
||||
@ApiModelProperty("实收金额")
|
||||
private BigDecimal actualReceivedAmount;
|
||||
|
||||
@ApiModelProperty("结算单优惠金额")
|
||||
private BigDecimal settlementDiscountsAmount;
|
||||
}
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
package com.mhd.bms.domain.billManage.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.mhd.bms.domain.billManage.entity.BillDetail;
|
||||
import com.mhd.bms.domain.billManage.repository.facade.IBillDetailService;
|
||||
import com.mhd.bms.domain.billManage.repository.po.BillDetailPO;
|
||||
import com.mhd.bms.domain.billManage.repository.todo.BillDetailDO;
|
||||
import com.mhd.bms.interfaces.dto.billManage.BillDetailDTO;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 账单流水明细
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BillDetailDomainService {
|
||||
|
||||
@Autowired
|
||||
private IBillDetailService billDetailService;
|
||||
|
||||
|
||||
/**
|
||||
* 新增账单流水明细
|
||||
*/
|
||||
public Boolean insert(BillDetailDO billDetailDO) {
|
||||
|
||||
return billDetailService.insert(billDetailDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账单流水明细
|
||||
*/
|
||||
public Boolean update(BillDetailDO billDetailDO) {
|
||||
return billDetailService.update(billDetailDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除账单流水明细
|
||||
*/
|
||||
public Boolean delete(Long[] billDetailIds) {
|
||||
return billDetailService.delete(billDetailIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取账单流水明细详细信息
|
||||
*/
|
||||
public BillDetailPO getInfo(Long billDetailId)
|
||||
{
|
||||
return billDetailService.getInfo(billDetailId);
|
||||
}
|
||||
|
||||
|
||||
public Boolean insertBatch(List<BillDetail> billDetailList) {
|
||||
return billDetailService.saveBatch(billDetailList);
|
||||
}
|
||||
|
||||
public List<BillDetail> queryByLambda(LambdaQueryWrapper<BillDetail> queryWrapper) {
|
||||
return billDetailService.list(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据账单管理id删除账单明细
|
||||
*/
|
||||
public Boolean deletByManageIds(Set<String> billManageIds) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
LambdaUpdateWrapper<BillDetail> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.in(BillDetail::getBillManageId, billManageIds);
|
||||
updateWrapper.set(BillDetail::getDelFlag, 2);
|
||||
updateWrapper.set(BillDetail::getUpdateBy, loginUser.getUserPo().getUserId());
|
||||
updateWrapper.set(BillDetail::getUpdateTime, new Date());
|
||||
updateWrapper.set(BillDetail::getUpdateByName, loginUser.getUserPo().getUserName());
|
||||
return billDetailService.update(updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据账单管理,查询账单详情
|
||||
*/
|
||||
public List<BillDetailPO> getDetailsByBillManageId(Long billManageId) {
|
||||
return billDetailService.getDetailsByBillManageId(billManageId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据账单管理id删除账单明细
|
||||
* @param billManageId
|
||||
* @return
|
||||
*/
|
||||
public Boolean removeByBillManageId(Long billManageId) {
|
||||
LambdaQueryWrapper<BillDetail> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BillDetail::getBillManageId, billManageId);
|
||||
queryWrapper.eq(BillDetail::getDelFlag, 1);
|
||||
return billDetailService.remove(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量保存明细
|
||||
* @param billDetailDTOList
|
||||
* @return
|
||||
*/
|
||||
public Boolean saveBatch(List<BillDetailDTO> billDetailDTOList) {
|
||||
List<BillDetail> billDetailList = new ArrayList<>();
|
||||
billDetailDTOList.forEach(billDetailDTO -> {
|
||||
BillDetail billDetail = new BillDetail();
|
||||
BeanUtils.copyProperties(billDetailDTO, billDetail);
|
||||
//校验相加是否合理
|
||||
if((billDetail.getBillingDiscountAmount().add(billDetail.getBillingAmount())).compareTo(billDetail.getBillingTotalAmount()) != 0){
|
||||
throw new ServiceException("账单明细"+ billDetailDTO.getBillingFlow() +"费用异常,请重试");
|
||||
}
|
||||
billDetailList.add(billDetail);
|
||||
});
|
||||
return billDetailService.saveBatch(billDetailList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改详情金额
|
||||
*/
|
||||
public Boolean changeAmount(List<BillDetailDTO> billDetailDTOList) {
|
||||
List<BillDetail> billDetailList = new ArrayList<>();
|
||||
billDetailDTOList.forEach(billDetailDTO -> {
|
||||
BillDetail billDetail = new BillDetail();
|
||||
billDetail.setBillingExpectedAmount(billDetailDTO.getBillingExpectedAmount());
|
||||
billDetail.setBillingTotalAmount(billDetailDTO.getBillingTotalAmount());
|
||||
billDetail.setBillingAmount(billDetailDTO.getBillingAmount());
|
||||
billDetail.setBillingDiscountAmount(billDetailDTO.getBillingDiscountAmount());
|
||||
//校验相加是否合理
|
||||
if((billDetail.getBillingDiscountAmount().add(billDetail.getBillingAmount())).compareTo(billDetail.getBillingTotalAmount()) != 0){
|
||||
throw new ServiceException("账单明细"+ billDetailDTO.getBillingFlow() +"费用异常,请重试");
|
||||
}
|
||||
billDetail.setBillDetailId(billDetailDTO.getBillDetailId());
|
||||
billDetailList.add(billDetail);
|
||||
});
|
||||
return billDetailService.updateBatchById(billDetailList);
|
||||
}
|
||||
}
|
||||
+506
@@ -0,0 +1,506 @@
|
||||
package com.mhd.bms.domain.billManage.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.mhd.bms.domain.billManage.entity.BillDetail;
|
||||
import com.mhd.bms.domain.billManage.entity.BillManage;
|
||||
import com.mhd.bms.domain.billManage.repository.facade.IBillManageService;
|
||||
import com.mhd.bms.domain.billManage.repository.po.BillManagePO;
|
||||
import com.mhd.bms.domain.billManage.repository.todo.BillDetailDO;
|
||||
import com.mhd.bms.domain.billManage.repository.todo.BillManageDO;
|
||||
import com.mhd.bms.domain.billOperationLog.entity.BillOperationLog;
|
||||
import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO;
|
||||
import com.mhd.bms.domain.billOperationLog.service.BillOperationLogDomainService;
|
||||
import com.mhd.bms.domain.billingStatement.entity.BillingStatement;
|
||||
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO;
|
||||
import com.mhd.bms.domain.billingStatement.service.BillingStatementDomainService;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDO;
|
||||
import com.mhd.bms.domain.receiptManage.entity.ReceiptDetail;
|
||||
import com.mhd.bms.domain.receiptManage.repository.todo.ReceiptManageDO;
|
||||
import com.mhd.bms.domain.settlementCustomers.repository.po.SettlementCustomersPO;
|
||||
import com.mhd.bms.domain.settlementCustomers.service.SettlementCustomersDomainService;
|
||||
import com.mhd.bms.infrastructure.constant.BillLogsConstants;
|
||||
import com.mhd.bms.interfaces.assembler.billManage.BillManageAssembler;
|
||||
import com.mhd.bms.interfaces.dto.billManage.BillManageDTO;
|
||||
import com.mhd.bms.interfaces.dto.billingStatement.BillingStatementDTO;
|
||||
import com.mhd.bms.interfaces.dto.paymentOrder.PaymentOrderDetailsDTO;
|
||||
import com.mhd.bms.interfaces.dto.receiptManage.ReceiptDetailDTO;
|
||||
import com.mhd.common.core.domain.po.SysDictDataVo;
|
||||
import com.mhd.common.core.enums.DictCode;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
|
||||
import com.mhd.common.core.utils.OrderSequence;
|
||||
import com.mhd.common.core.utils.StringUtils;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 账单管理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-02
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BillManageDomainService {
|
||||
|
||||
@Autowired
|
||||
private IBillManageService billManageService;
|
||||
@Autowired
|
||||
private BillingStatementDomainService billingStatementDomainService;
|
||||
@Autowired
|
||||
private BillDetailDomainService billDetailDomainService;
|
||||
@Autowired
|
||||
private SystemServiceFeign systemServiceFeign;
|
||||
@Autowired
|
||||
private BillOperationLogDomainService billOperationLogDomainService;
|
||||
@Autowired
|
||||
private SettlementCustomersDomainService settlementCustomersDomainService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询账单管理列表
|
||||
*/
|
||||
public List<BillManagePO> queryList(BillManageDO billManageDO) {
|
||||
return billManageService.queryList(billManageDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增账单管理
|
||||
*/
|
||||
public Boolean insert(BillManageDO billManageDO) {
|
||||
|
||||
return billManageService.insert(billManageDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账单管理
|
||||
*/
|
||||
public Boolean update(BillManageDO billManageDO) {
|
||||
return billManageService.update(billManageDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除账单管理
|
||||
*/
|
||||
public Boolean delete(Long[] billManageIds) {
|
||||
return billManageService.delete(billManageIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取账单管理详细信息
|
||||
*/
|
||||
public BillManagePO getInfo(Long billManageId)
|
||||
{
|
||||
return billManageService.getInfo(billManageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存账单
|
||||
*/
|
||||
public Boolean saveBill(List<BillingStatementPO> billingStatementPOS,String billingRemark,Date billCreateTime) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
BillManage billManage = new BillManage();
|
||||
billManage.setCreateBy(loginUser.getUserPo().getUserId());
|
||||
billManage.setCreateByName(loginUser.getUserPo().getUserName());
|
||||
billManage.setCreateTime(billCreateTime==null ? new Date():billCreateTime);
|
||||
billManage.setDelFlag(1);
|
||||
billManage.setBillNumber(OrderSequence.getOrderCode("ZD"));
|
||||
billManage.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
billManage.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
billManage.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
billManage.setBillType(billingStatementPOS.get(0).getAccountExpenseType());
|
||||
billManage.setBelongModule(billingStatementPOS.get(0).getBelongModule());
|
||||
billManage.setBelongModuleCode(billingStatementPOS.get(0).getBelongModuleCode());
|
||||
billManage.setSettlementCustomersId(billingStatementPOS.get(0).getSettlementCustomersId());
|
||||
billManage.setSettlementEntity(billingStatementPOS.get(0).getSettlementEntity());
|
||||
billManage.setSettlementCustomersCode(billingStatementPOS.get(0).getSettlementCustomersCode());
|
||||
billManage.setBillRemark(billingRemark);
|
||||
//查询结算对象信息
|
||||
SettlementCustomersPO settlementCustomersPO = settlementCustomersDomainService.getInfo(billingStatementPOS.get(0).getSettlementCustomersId());
|
||||
if(null == settlementCustomersPO){
|
||||
throw new ServiceException("结算对象信息未找到");
|
||||
}
|
||||
billManage.setSettlementMethod(settlementCustomersPO.getSettlementMethod());
|
||||
billManage.setSettlementMethodCode(settlementCustomersPO.getSettlementMethodCode());
|
||||
// if(settlementCustomersPO.getMainRole()==1){
|
||||
// billManage.setBillType(1);
|
||||
// }else {
|
||||
// billManage.setBillType(2);
|
||||
// }
|
||||
//计算所有流水列表中的最早周期开始时间和晚周期结束时间
|
||||
List<Date> cycleBeginTimeSet = billingStatementPOS.stream().map(BillingStatementPO::getCycleBeginTime).collect(Collectors.toList());
|
||||
List<Date> cycleEndTimeSet = billingStatementPOS.stream().map(BillingStatementPO::getCycleEndTime).collect(Collectors.toList());
|
||||
cycleBeginTimeSet.removeIf(Objects::isNull);
|
||||
cycleEndTimeSet.removeIf(Objects::isNull);
|
||||
if(cycleBeginTimeSet.size()>0){
|
||||
billManage.setCycleBeginTime(Collections.min(cycleBeginTimeSet));
|
||||
}
|
||||
if(cycleEndTimeSet.size()>0){
|
||||
billManage.setCycleEndTime(Collections.max(cycleEndTimeSet));
|
||||
}
|
||||
//将所有的流水金额相加
|
||||
billManage.setBillTotalAmount(billingStatementPOS.stream().map(BillingStatementPO::getBillingAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
billManage.setBillAmount(billManage.getBillTotalAmount());
|
||||
billManage.setBillAmountUnsettled(billManage.getBillTotalAmount());
|
||||
boolean flag = billManageService.save(billManage);
|
||||
List<BillDetail> billDetailList = new ArrayList<>();
|
||||
for (BillingStatementPO billingStatementPO : billingStatementPOS) {
|
||||
//生成对账单详情
|
||||
BillDetail billDetail = new BillDetail();
|
||||
billDetail.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
billDetail.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
billDetail.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
billDetail.setCreateBy(billManage.getCreateBy());
|
||||
billDetail.setCreateByName(billManage.getCreateByName());
|
||||
billDetail.setCreateTime(billManage.getCreateTime());
|
||||
billDetail.setBillManageId(billManage.getBillManageId());
|
||||
billDetail.setBillNumber(billManage.getBillNumber());
|
||||
billDetail.setBillingStatementId(billingStatementPO.getBillingStatementId());
|
||||
billDetail.setBillingFlow(billingStatementPO.getBillingFlow());
|
||||
billDetail.setBillingTotalAmount(billingStatementPO.getBillingAmount());
|
||||
billDetail.setBillingAmount(billingStatementPO.getBillingAmount());
|
||||
billDetail.setBillType(billingStatementPO.getAccountExpenseType());
|
||||
billDetailList.add(billDetail);
|
||||
}
|
||||
boolean flagTwo = billDetailDomainService.insertBatch(billDetailList);
|
||||
//保存账单操作记录
|
||||
BillOperationLogDO billOperationLogDO = new BillOperationLogDO();
|
||||
billOperationLogDO.setBillManageId(billManage.getBillManageId());
|
||||
billOperationLogDO.setOperationInfo(StringUtils.format(BillLogsConstants.create_bill_text, billManage.getBillNumber(), billManage.getBillTotalAmount()));
|
||||
billOperationLogDO.setOperationType(1);
|
||||
boolean three = billOperationLogDomainService.saveBillOperationLog(billOperationLogDO);
|
||||
return flag && flagTwo && three;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存账单
|
||||
* @param billingStatementDTO
|
||||
* @return
|
||||
*/
|
||||
public Boolean save(BillingStatementDTO billingStatementDTO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
//根据前端传的流水id,查询计费流水信息列表
|
||||
Set<String> billingSet = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet());
|
||||
BillingStatementDO billingStatementDO = new BillingStatementDO();
|
||||
billingStatementDO.setBillingStatementIdSet(billingSet);
|
||||
List<BillingStatementPO> billingStatementPOS = billingStatementDomainService.queryList(billingStatementDO);
|
||||
|
||||
if(billingStatementPOS==null || billingStatementPOS.size()==0){
|
||||
throw new ServiceException("所选流水信息未找到");
|
||||
}
|
||||
return saveBill(billingStatementPOS,billingStatementDTO.getBillingRemark(),billingStatementDTO.getBillCreateTime());
|
||||
}
|
||||
|
||||
|
||||
public List<BillManage> queryListLambda(LambdaQueryWrapper<BillManage> queryWrapper) {
|
||||
return billManageService.list(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 作废账单
|
||||
*/
|
||||
public Boolean nullifyByIds(Set<String> billManageIds) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
LambdaUpdateWrapper<BillManage> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.in(BillManage::getBillManageId,billManageIds)
|
||||
.set(BillManage::getBillState,6)
|
||||
.set(BillManage::getUpdateBy,loginUser.getUserPo().getUserId())
|
||||
.set(BillManage::getUpdateByName,loginUser.getUserPo().getUserName())
|
||||
.set(BillManage::getUpdateTime,new Date());
|
||||
|
||||
//调整账单操作日志
|
||||
BillOperationLogDO billOperationLogDO = new BillOperationLogDO();
|
||||
billOperationLogDO.setBillManageIdSet(billManageIds);
|
||||
billOperationLogDO.setOperationInfo(BillLogsConstants.nullify_bill_text);
|
||||
billOperationLogDO.setOperationType(8);
|
||||
boolean three = billOperationLogDomainService.saveBillOperationLogBatch(billOperationLogDO);
|
||||
boolean flag = billManageService.update(updateWrapper);
|
||||
return flag && three;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起对账
|
||||
*/
|
||||
public Boolean reconciliation(BillManageDO billManageDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
LambdaUpdateWrapper<BillManage> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.in(BillManage::getBillManageId,billManageDO.getBillManageIdSet())
|
||||
.set(BillManage::getBillStep,2)
|
||||
.set(BillManage::getBillState,2)
|
||||
.set(BillManage::getReconciliationStatus,1)
|
||||
.set(BillManage::getUpdateBy,loginUser.getUserPo().getUserId())
|
||||
.set(BillManage::getUpdateByName,loginUser.getUserPo().getUserName())
|
||||
.set(BillManage::getUpdateTime,new Date());
|
||||
boolean flag = billManageService.update(updateWrapper);
|
||||
//保存账单操作记录
|
||||
BillOperationLogDO billOperationLogDO = new BillOperationLogDO();
|
||||
billOperationLogDO.setBillManageIdSet(billManageDO.getBillManageIdSet());
|
||||
billOperationLogDO.setOperationInfo(BillLogsConstants.initiate_bill_text);
|
||||
billOperationLogDO.setOperationType(4);
|
||||
boolean three = billOperationLogDomainService.saveBillOperationLogBatch(billOperationLogDO);
|
||||
return flag && three;
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认账单
|
||||
*/
|
||||
public Boolean confirmBilling(BillManageDO billManageDO) {
|
||||
//直接修改状态到未收款3状态
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
LambdaUpdateWrapper<BillManage> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.in(BillManage::getBillManageId,billManageDO.getBillManageIdSet())
|
||||
.set(BillManage::getBillStep,4)
|
||||
.set(BillManage::getBillState,3)
|
||||
.set(BillManage::getUpdateBy,loginUser.getUserPo().getUserId())
|
||||
.set(BillManage::getUpdateByName,loginUser.getUserPo().getUserName())
|
||||
.set(BillManage::getUpdateTime,new Date());
|
||||
boolean flag = billManageService.update(updateWrapper);
|
||||
//保存账单操作记录
|
||||
BillOperationLogDO billOperationLogDO = new BillOperationLogDO();
|
||||
billOperationLogDO.setBillManageIdSet(billManageDO.getBillManageIdSet());
|
||||
billOperationLogDO.setOperationInfo(BillLogsConstants.confirm_bill_text);
|
||||
billOperationLogDO.setOperationType(3);
|
||||
boolean three = billOperationLogDomainService.saveBillOperationLogBatch(billOperationLogDO);
|
||||
return flag && three;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理数据
|
||||
*/
|
||||
public void handlData(BillManageDO billManageDO) {
|
||||
if(StringUtils.isNotEmpty(billManageDO.getAmountAccuracyCode())){
|
||||
List<SysDictDataVo> sysDictDataVoList = new ArrayList<>();
|
||||
AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.AMOUNT_ACCURACY.getCode());
|
||||
if("200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
sysDictDataVoList = JSON.parseArray(JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class);
|
||||
if(sysDictDataVoList != null && sysDictDataVoList.size()>0){
|
||||
sysDictDataVoList.stream().filter(info -> ObjectUtil.equal(info.getDictValue(), billManageDO.getAmountAccuracyCode())).findAny().ifPresent(sysDictDataVo -> billManageDO.setAmountAccuracyName(sysDictDataVo.getDictLabel()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotEmpty(billManageDO.getCostAccuracyCode())){
|
||||
List<SysDictDataVo> sysDictDataVoList = new ArrayList<>();
|
||||
AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.COST_ACCURACY.getCode());
|
||||
if("200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
sysDictDataVoList = JSON.parseArray(JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class);
|
||||
if(sysDictDataVoList != null && sysDictDataVoList.size()>0){
|
||||
sysDictDataVoList.stream().filter(info -> ObjectUtil.equal(info.getDictValue(), billManageDO.getCostAccuracyCode())).findAny().ifPresent(sysDictDataVo -> billManageDO.setCostAccuracyName(sysDictDataVo.getDictLabel()));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotEmpty(billManageDO.getTailCalculationCode())){
|
||||
List<SysDictDataVo> sysDictDataVoList = new ArrayList<>();
|
||||
AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.TAIL_CALCULATION.getCode());
|
||||
if("200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
sysDictDataVoList = JSON.parseArray(JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class);
|
||||
if(sysDictDataVoList != null && sysDictDataVoList.size()>0){
|
||||
sysDictDataVoList.stream().filter(info -> ObjectUtil.equal(info.getDictValue(), billManageDO.getTailCalculationCode())).findAny().ifPresent(sysDictDataVo -> billManageDO.setTailCalculationName(sysDictDataVo.getDictLabel()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新账单信息(收款)
|
||||
*/
|
||||
public Boolean updateBillSettlementInfo(ReceiptManageDO receiptManageDO) {
|
||||
Set<String> bills = Stream.of(receiptManageDO.getBillManageIds().split(",")).collect(Collectors.toSet());
|
||||
LambdaQueryWrapper<BillManage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BillManage::getBillManageId,bills);
|
||||
List<BillManage> billManageList = queryListLambda(queryWrapper);
|
||||
if(billManageList ==null || billManageList.size()==0){
|
||||
throw new ServiceException("账单信息未找到");
|
||||
}
|
||||
List<ReceiptDetailDTO> receiptDetailPOList = receiptManageDO.getReceiptDetailDTOList();
|
||||
List<BillManage> billManageListSave = new ArrayList<>();
|
||||
List<BillOperationLog> billOperationLogSave = new ArrayList<>();
|
||||
billManageList.forEach(billManage -> {
|
||||
BillManage billManageSave = new BillManage();
|
||||
billManageSave.setBillManageId(billManage.getBillManageId());
|
||||
//计算已收,未收金额,账单已收金额 = 结算单明细收款金额 + 收款优惠金额
|
||||
BigDecimal collectedDiscount = receiptDetailPOList.stream().filter(receiptDetailPO -> ObjectUtil.equal(receiptDetailPO.getBillManageId(),billManage.getBillManageId())).map(ReceiptDetailDTO::getCollectedDiscount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal collectedAmount = receiptDetailPOList.stream().filter(receiptDetailPO -> ObjectUtil.equal(receiptDetailPO.getBillManageId(),billManage.getBillManageId())).map(ReceiptDetailDTO::getCollectedAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal all = collectedAmount.add(collectedDiscount);
|
||||
billManageSave.setBillAmountSettlement(billManage.getBillAmountSettlement().add(all));
|
||||
//计算账单未收,账单金额 - 已收金额
|
||||
billManageSave.setBillAmountUnsettled(billManage.getBillAmount().subtract(billManageSave.getBillAmountSettlement()));
|
||||
//计算实收金额
|
||||
billManageSave.setActualReceivedAmount(billManage.getActualReceivedAmount().add(collectedAmount));
|
||||
//计算结算单优惠金额
|
||||
billManageSave.setSettlementDiscountsAmount(billManage.getSettlementDiscountsAmount().add(collectedDiscount));
|
||||
//如果未收金额为0 ,则更新状态到已收款,如果未收金额不为0 ,则更新状态到部分收款
|
||||
if(billManageSave.getBillAmountUnsettled().compareTo(BigDecimal.ZERO)==0){
|
||||
billManageSave.setBillState(5);
|
||||
}else {
|
||||
billManageSave.setBillState(4);
|
||||
}
|
||||
billManageListSave.add(billManageSave);
|
||||
//保存账单操作记录
|
||||
BillOperationLog billOperationLog = new BillOperationLog();
|
||||
billOperationLog.setBillManageId(billManage.getBillManageId());
|
||||
billOperationLog.setOperationInfo(StringUtils.format(BillLogsConstants.collection_bill_text,receiptManageDO.getCollectionNum(),all,collectedAmount,collectedDiscount));
|
||||
billOperationLog.setOperationType(7);
|
||||
billOperationLogSave.add(billOperationLog);
|
||||
});
|
||||
Boolean three = billOperationLogDomainService.insertBatch(billOperationLogSave);
|
||||
Boolean flag = billManageService.updateBatchById(billManageListSave);
|
||||
return flag && three;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据账单id查询账单信息
|
||||
*/
|
||||
public BillManagePO getDetailsById(Long billManageId) {
|
||||
BillManagePO result = billManageService.getInfo(billManageId);
|
||||
//查询账单关联流水列表
|
||||
List<BillingStatementPO> billingStatementPOList = billingStatementDomainService.getDetailsByManageId(billManageId);
|
||||
result.setBillingStatementPOList(billingStatementPOList);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存结算单退款后账单的操作状态
|
||||
*/
|
||||
public Boolean saveRefundLogs(List<ReceiptDetail> receiptDetails) {
|
||||
List<Long> billManageIds = receiptDetails.stream().map(ReceiptDetail::getBillManageId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<BillManage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BillManage::getBillManageId,billManageIds);
|
||||
List<BillManage> billManageList = billManageService.list(queryWrapper);
|
||||
List<BillOperationLog> billOperationLogSave = new ArrayList<>();
|
||||
for (ReceiptDetail receiptDetail : receiptDetails) {
|
||||
BillManage billManage = billManageList.stream().filter(billManage1 -> ObjectUtil.equal(billManage1.getBillManageId(),receiptDetail.getBillManageId())).findAny().orElse(null);
|
||||
if(null == billManage){
|
||||
throw new ServiceException("结算单" + receiptDetail.getBillNumber() + "账单信息未找到,请重试");
|
||||
}
|
||||
//保存账单操作记录
|
||||
BillOperationLog billOperationLog = new BillOperationLog();
|
||||
billOperationLog.setBillManageId(billManage.getBillManageId());
|
||||
billOperationLog.setOperationInfo(StringUtils.format(BillLogsConstants.refund_bill_text,receiptDetail.getCollectionNum(),receiptDetail.getCollectedAmount()));
|
||||
billOperationLog.setOperationType(10);
|
||||
billOperationLogSave.add(billOperationLog);
|
||||
}
|
||||
return billOperationLogDomainService.insertBatch(billOperationLogSave);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更改账单状态(付款)
|
||||
*/
|
||||
public Boolean updateBillPaymentInfo(PaymentOrderDO paymentOrderDO) {
|
||||
Set<String> bills = Stream.of(paymentOrderDO.getBillManageIds()).collect(Collectors.toSet());
|
||||
LambdaQueryWrapper<BillManage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BillManage::getBillManageId,bills);
|
||||
List<BillManage> billManageList = queryListLambda(queryWrapper);
|
||||
if(billManageList ==null || billManageList.size()==0){
|
||||
throw new ServiceException("账单信息未找到");
|
||||
}
|
||||
List<PaymentOrderDetailsDTO> paymentOrderDetailsDTOList = paymentOrderDO.getPaymentOrderDetailsDTOList();
|
||||
List<BillManage> billManageListSave = new ArrayList<>();
|
||||
List<BillOperationLog> billOperationLogSave = new ArrayList<>();
|
||||
billManageList.forEach(billManage -> {
|
||||
PaymentOrderDetailsDTO paymentOrderDetailsDTO = paymentOrderDetailsDTOList.stream().filter(paymentOrderDetailsDTO1 -> ObjectUtil.equal(paymentOrderDetailsDTO1.getBillManageId(),billManage.getBillManageId())).findAny().orElse(null);
|
||||
if(null == paymentOrderDetailsDTO){
|
||||
throw new ServiceException("账单信息未找到");
|
||||
}
|
||||
BillManage billManageSave = new BillManage();
|
||||
billManageSave.setBillManageId(billManage.getBillManageId());
|
||||
//计算付款金额
|
||||
BigDecimal paymentAmount = paymentOrderDetailsDTO.getPaymentAmount();
|
||||
BigDecimal all = billManage.getBillAmountSettlement().add(paymentAmount);
|
||||
billManageSave.setBillAmountSettlement(all);
|
||||
//计算账单未付,账单金额 - 已付金额
|
||||
billManageSave.setBillAmountUnsettled(billManage.getBillAmount().subtract(billManageSave.getBillAmountSettlement()));
|
||||
//如果未收金额为0 ,则更新状态到已收款,如果未收金额不为0 ,则更新状态到部分收款
|
||||
if(billManageSave.getBillAmountUnsettled().compareTo(BigDecimal.ZERO)==0){
|
||||
billManageSave.setBillState(5);
|
||||
}else {
|
||||
billManageSave.setBillState(4);
|
||||
}
|
||||
billManageListSave.add(billManageSave);
|
||||
//保存账单操作记录
|
||||
BillOperationLog billOperationLog = new BillOperationLog();
|
||||
billOperationLog.setBillManageId(billManage.getBillManageId());
|
||||
billOperationLog.setOperationInfo(StringUtils.format(BillLogsConstants.payment_bill_text,paymentOrderDetailsDTO.getPaymentOrderNum(),paymentAmount));
|
||||
billOperationLog.setOperationType(11);
|
||||
billOperationLogSave.add(billOperationLog);
|
||||
});
|
||||
Boolean three = billOperationLogDomainService.insertBatch(billOperationLogSave);
|
||||
Boolean flag = billManageService.updateBatchById(billManageListSave);
|
||||
return flag && three;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新账单
|
||||
*/
|
||||
public Boolean updateBatchById(List<BillManage> billManageList) {
|
||||
return billManageService.updateBatchById(billManageList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量生成账单,账单浏览
|
||||
*/
|
||||
public BillManagePO getBillBrowse(List<BillingStatementPO> value) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
BillManagePO billManagePO = new BillManagePO();
|
||||
//将value中的id用逗号拼接成字符串
|
||||
Set<Long> billingStatementIds = value.stream().map(BillingStatementPO::getBillingStatementId).collect(Collectors.toSet());
|
||||
//转成字符串
|
||||
String billingStatementIdsStr = billingStatementIds.stream().map(String::valueOf).collect(Collectors.joining(","));
|
||||
billManagePO.setBillingStatementIds(billingStatementIdsStr);
|
||||
billManagePO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
billManagePO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
billManagePO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
billManagePO.setBillType(value.get(0).getAccountExpenseType());
|
||||
billManagePO.setBelongModule(value.get(0).getBelongModule());
|
||||
billManagePO.setBelongModuleCode(value.get(0).getBelongModuleCode());
|
||||
billManagePO.setSettlementCustomersId(value.get(0).getSettlementCustomersId());
|
||||
billManagePO.setSettlementEntity(value.get(0).getSettlementEntity());
|
||||
billManagePO.setSettlementCustomersCode(value.get(0).getSettlementCustomersCode());
|
||||
//将所有的流水金额相加
|
||||
billManagePO.setBillTotalAmount(value.stream().map(BillingStatementPO::getBillingAmount).reduce(BigDecimal.ZERO, BigDecimal::add));
|
||||
billManagePO.setBillAmount(billManagePO.getBillTotalAmount());
|
||||
return billManagePO;
|
||||
}
|
||||
|
||||
public List<BillManage> billAnalysisList(QueryWrapper<BillManage> queryWrapper) {
|
||||
return billManageService.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.mhd.bms.domain.billOperationLog.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 账单操作日志对象 bill_operation_log
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillOperationLog extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("账单操作日志id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long billOperationLogId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("账单管理id")
|
||||
@Excel(name = "账单管理id")
|
||||
private Long billManageId;
|
||||
|
||||
@ApiModelProperty("操作类型(1-创建账单,2-调整账单,3-确认账单,4-发起对账,5-客户确认,6-财务审核,7-收款,8-作废账单,9-删除账单,10-退款,11-付款)")
|
||||
@Excel(name = "操作类型", readConverterExp = "1=-创建账单,2-调整账单,3-确认账单,4-发起对账,5-客户确认,6-财务审核,7-收款,8-作废账单,9-删除账单,10-退款,11-付款")
|
||||
private Integer operationType;
|
||||
|
||||
@ApiModelProperty("操作信息")
|
||||
@Excel(name = "操作信息")
|
||||
private String operationInfo;
|
||||
|
||||
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.mhd.bms.domain.billOperationLog.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.billOperationLog.entity.BillOperationLog;
|
||||
import com.mhd.bms.domain.billOperationLog.repository.po.BillOperationLogPO;
|
||||
import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 账单操作日志Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
public interface IBillOperationLogService extends IService<BillOperationLog>
|
||||
{
|
||||
/**
|
||||
* 分页查询账单操作日志列表
|
||||
*/
|
||||
public List<BillOperationLogPO> queryList(BillOperationLogDO billOperationLogDO);
|
||||
|
||||
/**
|
||||
* 新增账单操作日志
|
||||
*/
|
||||
public Boolean insert(BillOperationLogDO billOperationLogDO);
|
||||
|
||||
/**
|
||||
* 修改账单操作日志
|
||||
*/
|
||||
public Boolean update(BillOperationLogDO billOperationLogDO);
|
||||
|
||||
/**
|
||||
* 批量删除账单操作日志
|
||||
*/
|
||||
public Boolean delete(Long[] billOperationLogIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询账单操作日志
|
||||
*/
|
||||
public BillOperationLogPO getInfo(Long billOperationLogId);
|
||||
|
||||
/**
|
||||
* 查询账单操作日志记录表
|
||||
*/
|
||||
List<BillOperationLogPO> getDetailsById(Long billManageId);
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.mhd.bms.domain.billOperationLog.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.billOperationLog.entity.BillOperationLog;
|
||||
import com.mhd.bms.domain.billOperationLog.repository.po.BillOperationLogPO;
|
||||
import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 账单操作日志Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
public interface BillOperationLogMapper extends BaseMapper<BillOperationLog>
|
||||
{
|
||||
/**
|
||||
* 查询账单操作日志列表
|
||||
*/
|
||||
public List<BillOperationLogPO> queryList(@Param("billOperationLogDO") BillOperationLogDO billOperationLogDO);
|
||||
|
||||
List<BillOperationLogPO> getDetailsById(@Param("billManageIds") Long billManageId);
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package com.mhd.bms.domain.billOperationLog.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.billOperationLog.entity.BillOperationLog;
|
||||
import com.mhd.bms.domain.billOperationLog.repository.facade.IBillOperationLogService;
|
||||
import com.mhd.bms.domain.billOperationLog.repository.mapper.BillOperationLogMapper;
|
||||
import com.mhd.bms.domain.billOperationLog.repository.po.BillOperationLogPO;
|
||||
import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 账单操作日志Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
@Service
|
||||
public class BillOperationLogImpl extends ServiceImpl<BillOperationLogMapper, BillOperationLog> implements IBillOperationLogService{
|
||||
@Autowired
|
||||
private BillOperationLogMapper billOperationLogMapper;
|
||||
|
||||
/**
|
||||
* 查询账单操作日志列表
|
||||
*/
|
||||
@Override
|
||||
public List<BillOperationLogPO> queryList(BillOperationLogDO billOperationLogDO)
|
||||
{
|
||||
return billOperationLogMapper.queryList(billOperationLogDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增账单操作日志
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(BillOperationLogDO billOperationLogDO) {
|
||||
BillOperationLog billOperationLog = new BillOperationLog();
|
||||
BeanUtils.copyProperties(billOperationLogDO,billOperationLog);
|
||||
return this.save(billOperationLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账单操作日志
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(BillOperationLogDO billOperationLogDO) {
|
||||
BillOperationLog billOperationLog = new BillOperationLog();
|
||||
BeanUtils.copyProperties(billOperationLogDO,billOperationLog);
|
||||
return this.updateById(billOperationLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除账单操作日志
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] billOperationLogIds ) {
|
||||
List<BillOperationLog> list = new ArrayList<>();
|
||||
for (Long id : billOperationLogIds) {
|
||||
BillOperationLog billOperationLog = new BillOperationLog();
|
||||
billOperationLog.setBillOperationLogId(id);
|
||||
billOperationLog.setDelFlag(2);
|
||||
list.add(billOperationLog);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账单操作日志
|
||||
*/
|
||||
@Override
|
||||
public BillOperationLogPO getInfo(Long billOperationLogId) {
|
||||
BillOperationLog billOperationLog = this.getById(billOperationLogId);
|
||||
BillOperationLogPO billOperationLogPO = new BillOperationLogPO();
|
||||
BeanUtils.copyProperties(billOperationLog,billOperationLogPO);
|
||||
return billOperationLogPO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询账单操作日志记录表
|
||||
*/
|
||||
@Override
|
||||
public List<BillOperationLogPO> getDetailsById(Long billManageId) {
|
||||
return billOperationLogMapper.getDetailsById(billManageId);
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.mhd.bms.domain.billOperationLog.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 账单操作日志对象 bill_operation_log
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "账单操作日志对象", description = "账单操作日志响应对象")
|
||||
public class BillOperationLogPO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("账单操作日志id")
|
||||
private Long billOperationLogId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("账单管理id")
|
||||
@Excel(name = "账单管理id")
|
||||
private Long billManageId;
|
||||
|
||||
@ApiModelProperty("操作类型(1-创建账单,2-调整账单,3-确认账单,4-发起对账,5-客户确认,6-财务审核,7-收款,8-作废账单,9-删除账单,10-退款,11-付款)")
|
||||
@Excel(name = "操作类型", readConverterExp = "1=-创建账单,2-调整账单,3-确认账单,4-发起对账,5-客户确认,6-财务审核,7-收款,8-作废账单,9-删除账单,10-退款,11-付款")
|
||||
private Integer operationType;
|
||||
|
||||
@ApiModelProperty("操作信息")
|
||||
@Excel(name = "操作信息")
|
||||
private String operationInfo;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.mhd.bms.domain.billOperationLog.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
* 账单操作日志对象 bill_operation_log
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillOperationLogDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("账单操作日志id")
|
||||
private Long billOperationLogId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("账单管理id")
|
||||
@Excel(name = "账单管理id")
|
||||
private Long billManageId;
|
||||
|
||||
@ApiModelProperty("操作类型(1-创建账单,2-调整账单,3-确认账单,4-发起对账,5-客户确认,6-财务审核,7-收款,8-作废账单,9-删除账单,10-退款,11-付款)")
|
||||
@Excel(name = "操作类型", readConverterExp = "1=-创建账单,2-调整账单,3-确认账单,4-发起对账,5-客户确认,6-财务审核,7-收款,8-作废账单,9-删除账单,10-退款,11-付款")
|
||||
private Integer operationType;
|
||||
|
||||
@ApiModelProperty("操作信息")
|
||||
@Excel(name = "操作信息")
|
||||
private String operationInfo;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty(name = "账单管理id集合")
|
||||
private Set<String> billManageIdSet;
|
||||
}
|
||||
+164
@@ -0,0 +1,164 @@
|
||||
package com.mhd.bms.domain.billOperationLog.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.mhd.bms.domain.billOperationLog.entity.BillOperationLog;
|
||||
import com.mhd.bms.domain.billOperationLog.repository.facade.IBillOperationLogService;
|
||||
import com.mhd.bms.domain.billOperationLog.repository.po.BillOperationLogPO;
|
||||
import com.mhd.bms.domain.billOperationLog.repository.todo.BillOperationLogDO;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 账单操作日志
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BillOperationLogDomainService {
|
||||
|
||||
@Autowired
|
||||
private IBillOperationLogService billOperationLogService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询账单操作日志列表
|
||||
*/
|
||||
public List<BillOperationLogPO> queryList(BillOperationLogDO billOperationLogDO) {
|
||||
return billOperationLogService.queryList(billOperationLogDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增账单操作日志
|
||||
*/
|
||||
public Boolean insert(BillOperationLogDO billOperationLogDO) {
|
||||
|
||||
return billOperationLogService.insert(billOperationLogDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账单操作日志
|
||||
*/
|
||||
public Boolean update(BillOperationLogDO billOperationLogDO) {
|
||||
return billOperationLogService.update(billOperationLogDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除账单操作日志
|
||||
*/
|
||||
public Boolean delete(Long[] billOperationLogIds) {
|
||||
return billOperationLogService.delete(billOperationLogIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取账单操作日志详细信息
|
||||
*/
|
||||
public BillOperationLogPO getInfo(Long billOperationLogId)
|
||||
{
|
||||
return billOperationLogService.getInfo(billOperationLogId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存操作日志
|
||||
*/
|
||||
public Boolean saveBillOperationLog(BillOperationLogDO billOperationLogDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
String userName = loginUser.getUserPo().getUserName();
|
||||
// 获取登录人id
|
||||
Long userId = loginUser.getUserid();
|
||||
billOperationLogDO.setCreateByName(userName);
|
||||
billOperationLogDO.setUpdateByName(userName);
|
||||
billOperationLogDO.setCreateTime(new Date());
|
||||
billOperationLogDO.setUpdateTime(new Date());
|
||||
billOperationLogDO.setDelFlag(1);
|
||||
billOperationLogDO.setCreateBy(userId);
|
||||
billOperationLogDO.setUpdateBy(userId);
|
||||
billOperationLogDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
billOperationLogDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
billOperationLogDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
return billOperationLogService.insert(billOperationLogDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量保存操作日志
|
||||
*/
|
||||
public Boolean saveBillOperationLogBatch(BillOperationLogDO billOperationLogDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
if(billOperationLogDO.getBillManageIdSet()==null || billOperationLogDO.getBillManageIdSet().size()==0){
|
||||
throw new ServiceException("账单集合不能为空");
|
||||
}
|
||||
String userName = loginUser.getUserPo().getUserName();
|
||||
// 获取登录人id
|
||||
Long userId = loginUser.getUserid();
|
||||
BillOperationLogDO common = new BillOperationLogDO();
|
||||
common.setCreateByName(userName);
|
||||
common.setUpdateByName(userName);
|
||||
common.setCreateTime(new Date());
|
||||
common.setUpdateTime(new Date());
|
||||
common.setDelFlag(1);
|
||||
common.setCreateBy(userId);
|
||||
common.setUpdateBy(userId);
|
||||
common.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
common.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
common.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
common.setOperationType(billOperationLogDO.getOperationType());
|
||||
common.setOperationInfo(billOperationLogDO.getOperationInfo());
|
||||
List<BillOperationLog> saveList = new ArrayList<>();
|
||||
for (String billManageId : billOperationLogDO.getBillManageIdSet()) {
|
||||
BillOperationLog save = new BillOperationLog();
|
||||
BeanUtils.copyProperties(common, save);
|
||||
save.setBillManageId(Long.valueOf(billManageId));
|
||||
saveList.add(save);
|
||||
}
|
||||
return billOperationLogService.saveBatch(saveList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量保存数据
|
||||
* @param billOperationLogSave
|
||||
* @return
|
||||
*/
|
||||
public Boolean insertBatch(List<BillOperationLog> billOperationLogSave) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
for (BillOperationLog billOperationLog : billOperationLogSave) {
|
||||
billOperationLog.setCreateByName(loginUser.getUserPo().getUserName());
|
||||
billOperationLog.setCreateTime(new Date());
|
||||
billOperationLog.setCreateBy(loginUser.getUserid());
|
||||
billOperationLog.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
billOperationLog.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
billOperationLog.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
}
|
||||
return billOperationLogService.saveBatch(billOperationLogSave);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询账单操作日志记录表
|
||||
*/
|
||||
public List<BillOperationLogPO> getDetailsById(Long billManageId) {
|
||||
return billOperationLogService.getDetailsById(billManageId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.mhd.bms.domain.billingRules.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 计费参数对象 billing_params
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillingParams extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("计费参数id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long billingParamsId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("计费参数表名称")
|
||||
@Excel(name = "计费参数表名称")
|
||||
private String billingParamsName;
|
||||
|
||||
@ApiModelProperty("说明")
|
||||
@Excel(name = "说明")
|
||||
private String billingIllustrate;
|
||||
|
||||
@ApiModelProperty("计费参数json串")
|
||||
@Excel(name = "计费参数json串")
|
||||
private String billingParamsJson;
|
||||
|
||||
@ApiModelProperty("计费参数输出json串")
|
||||
@Excel(name = "计费参数输出json串")
|
||||
private String billingOutputJson;
|
||||
|
||||
@ApiModelProperty("预置规则json串")
|
||||
@Excel(name = "预置规则json串")
|
||||
private String preSetRules;
|
||||
|
||||
@ApiModelProperty("计费规则id")
|
||||
private Long billingRulesId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.mhd.bms.domain.billingRules.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 计费规则对象 billing_rules
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillingRules extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("计费规则id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long billingRulesId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("费用类型code(服务项)")
|
||||
@Excel(name = "费用类型code", readConverterExp = "服=务项")
|
||||
private String serviceItemsCode;
|
||||
|
||||
@ApiModelProperty("费用类型")
|
||||
@Excel(name = "费用类型")
|
||||
private String serviceItemsName;
|
||||
|
||||
@ApiModelProperty("一级费用科目code")
|
||||
@Excel(name = "一级费用科目code")
|
||||
private String firstSubjectCode;
|
||||
|
||||
@ApiModelProperty("一级费用科目(结算项)")
|
||||
@Excel(name = "一级费用科目", readConverterExp = "结=算项")
|
||||
private String firstSubjectName;
|
||||
|
||||
@ApiModelProperty("二级费用科目code")
|
||||
@Excel(name = "二级费用科目code")
|
||||
private String secondSubjectCode;
|
||||
|
||||
@ApiModelProperty("二级费用科目(结算项)")
|
||||
@Excel(name = "二级费用科目", readConverterExp = "结=算项")
|
||||
private String secondSubjectName;
|
||||
|
||||
@ApiModelProperty("单据类型code")
|
||||
@Excel(name = "单据类型code")
|
||||
private String documentTypeCode;
|
||||
|
||||
@ApiModelProperty("单据类型")
|
||||
@Excel(name = "单据类型")
|
||||
private String documentType;
|
||||
|
||||
@ApiModelProperty("规则说明")
|
||||
@Excel(name = "规则说明", readConverterExp = "规则说明")
|
||||
private String billingRulesIllustrate;
|
||||
|
||||
@ApiModelProperty("状态(1-开启,2-关闭)")
|
||||
@Excel(name = "状态", readConverterExp = "1=-开启,2-关闭")
|
||||
private Integer billingRulesState;
|
||||
|
||||
@ApiModelProperty("计费公式")
|
||||
@Excel(name = "计费公式")
|
||||
private String billingFormula;
|
||||
|
||||
@ApiModelProperty("计费规则编码")
|
||||
@Excel(name = "计费规则编码")
|
||||
private String billingRulesCode;
|
||||
|
||||
@ApiModelProperty("计费规则名称")
|
||||
@Excel(name = "计费规则名称", readConverterExp = "计费规则名称")
|
||||
private String billingRulesName;
|
||||
|
||||
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.mhd.bms.domain.billingRules.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.billingRules.entity.BillingParams;
|
||||
import com.mhd.bms.domain.billingRules.repository.po.BillingParamsPO;
|
||||
import com.mhd.bms.domain.billingRules.repository.todo.BillingParamsDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计费参数Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
public interface IBillingParamsService extends IService<BillingParams>
|
||||
{
|
||||
/**
|
||||
* 分页查询计费参数列表
|
||||
*/
|
||||
public List<BillingParamsPO> queryList(BillingParamsDO billingParamsDO);
|
||||
|
||||
/**
|
||||
* 新增计费参数
|
||||
*/
|
||||
public Boolean insert(BillingParamsDO billingParamsDO);
|
||||
|
||||
/**
|
||||
* 修改计费参数
|
||||
*/
|
||||
public Boolean update(BillingParamsDO billingParamsDO);
|
||||
|
||||
/**
|
||||
* 批量删除计费参数
|
||||
*/
|
||||
public Boolean delete(Long[] billingParamsIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询计费参数
|
||||
*/
|
||||
public BillingParamsPO getInfo(Long billingParamsId);
|
||||
|
||||
/**
|
||||
* 根据计费规则id查询计费参数
|
||||
*/
|
||||
List<BillingParamsPO> queryListByRulesId(Long billingRulesId);
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.mhd.bms.domain.billingRules.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.billingRules.entity.BillingRules;
|
||||
import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO;
|
||||
import com.mhd.bms.domain.billingRules.repository.todo.BillingRulesDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计费规则Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
public interface IBillingRulesService extends IService<BillingRules>
|
||||
{
|
||||
/**
|
||||
* 分页查询计费规则列表
|
||||
*/
|
||||
public List<BillingRulesPO> queryList(BillingRulesDO billingRulesDO);
|
||||
|
||||
/**
|
||||
* 新增计费规则
|
||||
*/
|
||||
public Boolean insert(BillingRulesDO billingRulesDO);
|
||||
|
||||
/**
|
||||
* 修改计费规则
|
||||
*/
|
||||
public Boolean update(BillingRulesDO billingRulesDO);
|
||||
|
||||
/**
|
||||
* 批量删除计费规则
|
||||
*/
|
||||
public Boolean delete(Long[] billingRulesIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询计费规则
|
||||
*/
|
||||
public BillingRulesPO getInfo(Long billingRulesId);
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.mhd.bms.domain.billingRules.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.billingRules.entity.BillingParams;
|
||||
import com.mhd.bms.domain.billingRules.repository.po.BillingParamsPO;
|
||||
import com.mhd.bms.domain.billingRules.repository.todo.BillingParamsDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 计费参数Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
public interface BillingParamsMapper extends BaseMapper<BillingParams>
|
||||
{
|
||||
/**
|
||||
* 查询计费参数列表
|
||||
*/
|
||||
public List<BillingParamsPO> queryList(BillingParamsDO billingParamsDO);
|
||||
|
||||
List<BillingParamsPO> queryListByRulesId(@Param("billingRulesId") Long billingRulesId);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.mhd.bms.domain.billingRules.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.billingRules.entity.BillingRules;
|
||||
import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO;
|
||||
import com.mhd.bms.domain.billingRules.repository.todo.BillingRulesDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 计费规则Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
public interface BillingRulesMapper extends BaseMapper<BillingRules>
|
||||
{
|
||||
/**
|
||||
* 查询计费规则列表
|
||||
*/
|
||||
public List<BillingRulesPO> queryList(@Param("billingRulesDO") BillingRulesDO billingRulesDO);
|
||||
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.mhd.bms.domain.billingRules.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.billingRules.entity.BillingParams;
|
||||
import com.mhd.bms.domain.billingRules.repository.facade.IBillingParamsService;
|
||||
import com.mhd.bms.domain.billingRules.repository.mapper.BillingParamsMapper;
|
||||
import com.mhd.bms.domain.billingRules.repository.po.BillingParamsPO;
|
||||
import com.mhd.bms.domain.billingRules.repository.todo.BillingParamsDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计费参数Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
@Service
|
||||
public class BillingParamsImpl extends ServiceImpl<BillingParamsMapper, BillingParams> implements IBillingParamsService {
|
||||
@Autowired
|
||||
private BillingParamsMapper billingParamsMapper;
|
||||
|
||||
/**
|
||||
* 查询计费参数列表
|
||||
*/
|
||||
@Override
|
||||
public List<BillingParamsPO> queryList(BillingParamsDO billingParamsDO)
|
||||
{
|
||||
return billingParamsMapper.queryList(billingParamsDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计费参数
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(BillingParamsDO billingParamsDO) {
|
||||
BillingParams billingParams = new BillingParams();
|
||||
BeanUtils.copyProperties(billingParamsDO,billingParams);
|
||||
return this.save(billingParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计费参数
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(BillingParamsDO billingParamsDO) {
|
||||
BillingParams billingParams = new BillingParams();
|
||||
BeanUtils.copyProperties(billingParamsDO,billingParams);
|
||||
return this.updateById(billingParams);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计费参数
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] billingParamsIds ) {
|
||||
List<BillingParams> list = new ArrayList<>();
|
||||
for (Long id : billingParamsIds) {
|
||||
BillingParams billingParams = new BillingParams();
|
||||
billingParams.setBillingParamsId(id);
|
||||
billingParams.setDelFlag(2);
|
||||
list.add(billingParams);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计费参数
|
||||
*/
|
||||
@Override
|
||||
public BillingParamsPO getInfo(Long billingParamsId) {
|
||||
BillingParams billingParams = this.getById(billingParamsId);
|
||||
BillingParamsPO billingParamsPO = new BillingParamsPO();
|
||||
BeanUtils.copyProperties(billingParams,billingParamsPO);
|
||||
return billingParamsPO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BillingParamsPO> queryListByRulesId(Long billingRulesId) {
|
||||
return billingParamsMapper.queryListByRulesId(billingRulesId);
|
||||
}
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.mhd.bms.domain.billingRules.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.billingRules.entity.BillingRules;
|
||||
import com.mhd.bms.domain.billingRules.repository.facade.IBillingRulesService;
|
||||
import com.mhd.bms.domain.billingRules.repository.mapper.BillingRulesMapper;
|
||||
import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO;
|
||||
import com.mhd.bms.domain.billingRules.repository.todo.BillingRulesDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计费规则Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
@Service
|
||||
public class BillingRulesImpl extends ServiceImpl<BillingRulesMapper, BillingRules> implements IBillingRulesService{
|
||||
@Autowired
|
||||
private BillingRulesMapper billingRulesMapper;
|
||||
|
||||
/**
|
||||
* 查询计费规则列表
|
||||
*/
|
||||
@Override
|
||||
public List<BillingRulesPO> queryList(BillingRulesDO billingRulesDO)
|
||||
{
|
||||
return billingRulesMapper.queryList(billingRulesDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计费规则
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(BillingRulesDO billingRulesDO) {
|
||||
BillingRules billingRules = new BillingRules();
|
||||
BeanUtils.copyProperties(billingRulesDO,billingRules);
|
||||
boolean flag = this.save(billingRules);
|
||||
billingRulesDO.setBillingRulesId(billingRules.getBillingRulesId());
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计费规则
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(BillingRulesDO billingRulesDO) {
|
||||
BillingRules billingRules = new BillingRules();
|
||||
BeanUtils.copyProperties(billingRulesDO,billingRules);
|
||||
return this.updateById(billingRules);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计费规则
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] billingRulesIds ) {
|
||||
List<BillingRules> list = new ArrayList<>();
|
||||
for (Long id : billingRulesIds) {
|
||||
BillingRules billingRules = new BillingRules();
|
||||
billingRules.setBillingRulesId(id);
|
||||
billingRules.setDelFlag(2);
|
||||
list.add(billingRules);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计费规则
|
||||
*/
|
||||
@Override
|
||||
public BillingRulesPO getInfo(Long billingRulesId) {
|
||||
BillingRules billingRules = this.getById(billingRulesId);
|
||||
BillingRulesPO billingRulesPO = new BillingRulesPO();
|
||||
BeanUtils.copyProperties(billingRules,billingRulesPO);
|
||||
return billingRulesPO;
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.mhd.bms.domain.billingRules.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 计费参数对象 billing_params
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "计费参数对象", description = "计费参数响应对象")
|
||||
public class BillingParamsPO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("计费参数id")
|
||||
private Long billingParamsId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("计费参数表名称")
|
||||
@Excel(name = "计费参数表名称")
|
||||
private String billingParamsName;
|
||||
|
||||
@ApiModelProperty("说明")
|
||||
@Excel(name = "说明")
|
||||
private String billingIllustrate;
|
||||
|
||||
/**
|
||||
* {
|
||||
* "fields":"参与字段",
|
||||
* "chargingId":"计费标识P1、P2",
|
||||
* "ladderType":"阶梯类型(1-固定参数,2-无阶梯,3-到达阶梯,4-累进阶梯)",
|
||||
* "ladderRule":"阶梯规则(1-左开右闭,2-左闭右开)",
|
||||
* "ladderNum":"阶梯值",
|
||||
* "sort":"排序"
|
||||
* }
|
||||
*/
|
||||
@ApiModelProperty("计费参数json串")
|
||||
@Excel(name = "计费参数json串")
|
||||
private String billingParamsJson;
|
||||
|
||||
/**
|
||||
*{
|
||||
* "outFields":"输出字段",
|
||||
* "outChargingId":"输出计费标识",
|
||||
* "fieIdsType":"字段类型(1-整数,2-浮点数,3-时间)",
|
||||
* "sort":"排序"
|
||||
* }
|
||||
*/
|
||||
@ApiModelProperty("计费参数输出json串")
|
||||
@Excel(name = "计费参数输出json串")
|
||||
private String billingOutputJson;
|
||||
|
||||
/**
|
||||
* {
|
||||
* "fieIds1":"字段1",
|
||||
* "fieIds2":"字段2",
|
||||
* "fieIdsn":"字段N",
|
||||
* "outFieIds1":"输出字段1",
|
||||
* "outFieIds2":"输出字段2",
|
||||
* "outFieIdsn":"输出字段n"
|
||||
* }
|
||||
*/
|
||||
@ApiModelProperty("预置规则json串")
|
||||
@Excel(name = "预置规则json串")
|
||||
private String preSetRules;
|
||||
|
||||
@ApiModelProperty("计费规则id")
|
||||
private Long billingRulesId;
|
||||
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package com.mhd.bms.domain.billingRules.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 计费规则对象 billing_rules
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "计费规则对象", description = "计费规则响应对象")
|
||||
public class BillingRulesPO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("计费规则id")
|
||||
private Long billingRulesId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("费用类型code(服务项)")
|
||||
@Excel(name = "费用类型code", readConverterExp = "服=务项")
|
||||
private String serviceItemsCode;
|
||||
|
||||
@ApiModelProperty("费用类型")
|
||||
@Excel(name = "费用类型")
|
||||
private String serviceItemsName;
|
||||
|
||||
@ApiModelProperty("一级费用科目code")
|
||||
@Excel(name = "一级费用科目code")
|
||||
private String firstSubjectCode;
|
||||
|
||||
@ApiModelProperty("一级费用科目(结算项)")
|
||||
@Excel(name = "一级费用科目", readConverterExp = "结=算项")
|
||||
private String firstSubjectName;
|
||||
|
||||
@ApiModelProperty("二级费用科目code")
|
||||
@Excel(name = "二级费用科目code")
|
||||
private String secondSubjectCode;
|
||||
|
||||
@ApiModelProperty("二级费用科目(结算项)")
|
||||
@Excel(name = "二级费用科目", readConverterExp = "结=算项")
|
||||
private String secondSubjectName;
|
||||
|
||||
@ApiModelProperty("单据类型code")
|
||||
@Excel(name = "单据类型code")
|
||||
private String documentTypeCode;
|
||||
|
||||
@ApiModelProperty("单据类型")
|
||||
@Excel(name = "单据类型")
|
||||
private String documentType;
|
||||
|
||||
@ApiModelProperty("规则说明")
|
||||
@Excel(name = "规则说明", readConverterExp = "规则说明")
|
||||
private String billingRulesIllustrate;
|
||||
|
||||
@ApiModelProperty("状态(1-开启,2-关闭)")
|
||||
@Excel(name = "状态", readConverterExp = "1=-开启,2-关闭")
|
||||
private Integer billingRulesState;
|
||||
|
||||
@ApiModelProperty("计费公式")
|
||||
@Excel(name = "计费公式")
|
||||
private String billingFormula;
|
||||
|
||||
@ApiModelProperty("计费规则编码")
|
||||
@Excel(name = "计费规则编码")
|
||||
private String billingRulesCode;
|
||||
|
||||
@ApiModelProperty("计费规则名称")
|
||||
@Excel(name = "计费规则名称", readConverterExp = "计费规则名称")
|
||||
private String billingRulesName;
|
||||
|
||||
@ApiModelProperty("计费参数明细列表")
|
||||
private List<BillingParamsPO> billingParamsPOList;
|
||||
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package com.mhd.bms.domain.billingRules.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 计费参数对象 billing_params
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillingParamsDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("计费参数id")
|
||||
private Long billingParamsId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("计费参数表名称")
|
||||
@Excel(name = "计费参数表名称")
|
||||
private String billingParamsName;
|
||||
|
||||
@ApiModelProperty("说明")
|
||||
@Excel(name = "说明")
|
||||
private String billingIllustrate;
|
||||
|
||||
@ApiModelProperty("计费参数json串")
|
||||
@Excel(name = "计费参数json串")
|
||||
private String billingParamsJson;
|
||||
|
||||
@ApiModelProperty("计费参数输出json串")
|
||||
@Excel(name = "计费参数输出json串")
|
||||
private String billingOutputJson;
|
||||
|
||||
@ApiModelProperty("预置规则json串")
|
||||
@Excel(name = "预置规则json串")
|
||||
private String preSetRules;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty("计费规则id")
|
||||
private Long billingRulesId;
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
package com.mhd.bms.domain.billingRules.repository.todo;
|
||||
|
||||
import com.mhd.bms.interfaces.dto.billingRules.BillingParamsDTO;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 计费规则对象 billing_rules
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillingRulesDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("计费规则id")
|
||||
private Long billingRulesId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("费用类型code(服务项)")
|
||||
@Excel(name = "费用类型code", readConverterExp = "服=务项")
|
||||
private String serviceItemsCode;
|
||||
|
||||
@ApiModelProperty("费用类型")
|
||||
@Excel(name = "费用类型")
|
||||
private String serviceItemsName;
|
||||
|
||||
@ApiModelProperty("一级费用科目code")
|
||||
@Excel(name = "一级费用科目code")
|
||||
private String firstSubjectCode;
|
||||
|
||||
@ApiModelProperty("一级费用科目(结算项)")
|
||||
@Excel(name = "一级费用科目", readConverterExp = "结=算项")
|
||||
private String firstSubjectName;
|
||||
|
||||
@ApiModelProperty("二级费用科目code")
|
||||
@Excel(name = "二级费用科目code")
|
||||
private String secondSubjectCode;
|
||||
|
||||
@ApiModelProperty("二级费用科目(结算项)")
|
||||
@Excel(name = "二级费用科目", readConverterExp = "结=算项")
|
||||
private String secondSubjectName;
|
||||
|
||||
@ApiModelProperty("单据类型code")
|
||||
@Excel(name = "单据类型code")
|
||||
private String documentTypeCode;
|
||||
|
||||
@ApiModelProperty("单据类型")
|
||||
@Excel(name = "单据类型")
|
||||
private String documentType;
|
||||
|
||||
@ApiModelProperty("规则说明")
|
||||
@Excel(name = "规则说明", readConverterExp = "规则说明")
|
||||
private String billingRulesIllustrate;
|
||||
|
||||
@ApiModelProperty("状态(1-开启,2-关闭)")
|
||||
@Excel(name = "状态", readConverterExp = "1=-开启,2-关闭")
|
||||
private Integer billingRulesState;
|
||||
|
||||
@ApiModelProperty("计费公式")
|
||||
@Excel(name = "计费公式")
|
||||
private String billingFormula;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty(name = "计费参数集合")
|
||||
private List<BillingParamsDTO> billingParamsDTOList;
|
||||
|
||||
@ApiModelProperty("计费规则编码")
|
||||
@Excel(name = "计费规则编码")
|
||||
private String billingRulesCode;
|
||||
|
||||
@ApiModelProperty("计费规则名称")
|
||||
@Excel(name = "计费规则名称", readConverterExp = "计费规则名称")
|
||||
private String billingRulesName;
|
||||
|
||||
@ApiModelProperty(name = "创建时间查询条件开始日期")
|
||||
private String createTimeStart;
|
||||
|
||||
@ApiModelProperty(name = "创建时间查询条件结束日期")
|
||||
private String createTimeEnd;
|
||||
}
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
package com.mhd.bms.domain.billingRules.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.mhd.bms.domain.billingRules.entity.BillingParams;
|
||||
import com.mhd.bms.domain.billingRules.repository.facade.IBillingParamsService;
|
||||
import com.mhd.bms.domain.billingRules.repository.po.BillingParamsPO;
|
||||
import com.mhd.bms.domain.billingRules.repository.todo.BillingParamsDO;
|
||||
import com.mhd.bms.domain.billingRules.repository.todo.BillingRulesDO;
|
||||
import com.mhd.bms.interfaces.dto.billingRules.BillingParamsDTO;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 计费参数
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BillingParamsDomainService {
|
||||
|
||||
@Autowired
|
||||
private IBillingParamsService billingParamsService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询计费参数列表
|
||||
*/
|
||||
public List<BillingParamsPO> queryList(BillingParamsDO billingParamsDO) {
|
||||
return billingParamsService.queryList(billingParamsDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增计费参数
|
||||
*/
|
||||
public Boolean insert(BillingParamsDO billingParamsDO) {
|
||||
|
||||
return billingParamsService.insert(billingParamsDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计费参数
|
||||
*/
|
||||
public Boolean update(BillingParamsDO billingParamsDO) {
|
||||
return billingParamsService.update(billingParamsDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计费参数
|
||||
*/
|
||||
public Boolean delete(Long[] billingParamsIds) {
|
||||
return billingParamsService.delete(billingParamsIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计费参数详细信息
|
||||
*/
|
||||
public BillingParamsPO getInfo(Long billingParamsId)
|
||||
{
|
||||
return billingParamsService.getInfo(billingParamsId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存计费参数
|
||||
*/
|
||||
public boolean saveBillParam(BillingRulesDO billingRulesDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
List<BillingParamsDTO> billingParamsDTOList = billingRulesDO.getBillingParamsDTOList();
|
||||
List<BillingParams> billingParamsList = new ArrayList<>();
|
||||
for (BillingParamsDTO billingParamsDTO : billingParamsDTOList) {
|
||||
BillingParams billingParams = new BillingParams();
|
||||
BeanUtils.copyProperties(billingParamsDTO,billingParams);
|
||||
billingParams.setBillingRulesId(billingRulesDO.getBillingRulesId());
|
||||
billingParams.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
billingParams.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
billingParams.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
billingParams.setCreateBy(loginUser.getUserPo().getUserId());
|
||||
billingParams.setCreateByName(loginUser.getUserPo().getUserName());
|
||||
billingParams.setCreateTime(new Date());
|
||||
billingParamsList.add(billingParams);
|
||||
}
|
||||
return billingParamsService.saveBatch(billingParamsList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计费参数
|
||||
*/
|
||||
public boolean updateBillParam(BillingRulesDO billingRulesDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
List<BillingParamsDTO> billingParamsDTOList = billingRulesDO.getBillingParamsDTOList();
|
||||
List<BillingParams> billingParamsList = new ArrayList<>();
|
||||
for (BillingParamsDTO billingParamsDTO : billingParamsDTOList) {
|
||||
BillingParams billingParams = new BillingParams();
|
||||
BeanUtils.copyProperties(billingParamsDTO,billingParams);
|
||||
billingParams.setBillingRulesId(billingRulesDO.getBillingRulesId());
|
||||
if(billingParams.getBillingParamsId()==null){
|
||||
billingParams.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
billingParams.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
billingParams.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
billingParams.setCreateBy(loginUser.getUserPo().getUserId());
|
||||
billingParams.setCreateByName(loginUser.getUserPo().getUserName());
|
||||
billingParams.setCreateTime(new Date());
|
||||
}
|
||||
billingParamsList.add(billingParams);
|
||||
}
|
||||
return billingParamsService.saveOrUpdateBatch(billingParamsList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据计费规则id查询计费参数表信息
|
||||
* @param billingRulesId
|
||||
* @return
|
||||
*/
|
||||
public List<BillingParamsPO> getInfoByRuleId(Long billingRulesId) {
|
||||
return billingParamsService.queryListByRulesId(billingRulesId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+184
@@ -0,0 +1,184 @@
|
||||
package com.mhd.bms.domain.billingRules.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.mhd.bms.domain.billingRules.entity.BillingRules;
|
||||
import com.mhd.bms.domain.billingRules.repository.facade.IBillingParamsService;
|
||||
import com.mhd.bms.domain.billingRules.repository.facade.IBillingRulesService;
|
||||
import com.mhd.bms.domain.billingRules.repository.po.BillingParamsPO;
|
||||
import com.mhd.bms.domain.billingRules.repository.po.BillingRulesPO;
|
||||
import com.mhd.bms.domain.billingRules.repository.todo.BillingParamsDO;
|
||||
import com.mhd.bms.domain.billingRules.repository.todo.BillingRulesDO;
|
||||
import com.mhd.bms.domain.documentType.entity.DocumentType;
|
||||
import com.mhd.bms.domain.documentType.service.DocumentTypeDomainService;
|
||||
import com.mhd.bms.infrastructure.feign.vo.ExpenseAccountPO;
|
||||
import com.mhd.bms.interfaces.dto.billingRules.BillingRulesDTO;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
|
||||
import com.mhd.common.core.utils.StringUtils;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 计费规则
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BillingRulesDomainService {
|
||||
|
||||
@Autowired
|
||||
private IBillingRulesService billingRulesService;
|
||||
@Autowired
|
||||
private DocumentTypeDomainService documentTypeDomainService;
|
||||
@Autowired
|
||||
private SystemServiceFeign systemServiceFeign;
|
||||
@Autowired
|
||||
private IBillingParamsService billingParamsService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询计费规则列表
|
||||
*/
|
||||
public List<BillingRulesPO> queryList(BillingRulesDO billingRulesDO) {
|
||||
return billingRulesService.queryList(billingRulesDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增计费规则
|
||||
*/
|
||||
public Boolean insert(BillingRulesDO billingRulesDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
handleData(billingRulesDO);
|
||||
billingRulesDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
billingRulesDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
billingRulesDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
return billingRulesService.insert(billingRulesDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理数据
|
||||
*/
|
||||
private void handleData(BillingRulesDO billingRulesDO) {
|
||||
//根据单据类型id查询单据类型数据,并赋值
|
||||
if(StringUtils.isNotEmpty(billingRulesDO.getDocumentTypeCode())){
|
||||
DocumentType documentType = documentTypeDomainService.queryByCode(billingRulesDO.getDocumentTypeCode());
|
||||
if(null != documentType){
|
||||
billingRulesDO.setDocumentType(documentType.getDocumentType());
|
||||
billingRulesDO.setDocumentTypeCode(documentType.getDocumentTypeCode());
|
||||
}
|
||||
}
|
||||
//根据费用类型id查询费用类型对象数据,并赋值
|
||||
if(StringUtils.isNotEmpty(billingRulesDO.getServiceItemsCode())){
|
||||
AjaxResult ajaxResult = systemServiceFeign.getServiceItemsByCode(billingRulesDO.getServiceItemsCode());
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("费用类型未找到");
|
||||
}
|
||||
billingRulesDO.setServiceItemsName(JSONObject.parseObject(JSONObject.toJSONString(ajaxResult.get("data"))).getString("serviceItemsName"));
|
||||
}
|
||||
//根据费用科目code查询费用信息,并赋值
|
||||
if(StringUtils.isNotEmpty(billingRulesDO.getSecondSubjectCode())){
|
||||
AjaxResult ajaxResult = systemServiceFeign.getSubInfoByCode(billingRulesDO.getSecondSubjectCode());
|
||||
if("200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
ExpenseAccountPO expenseAccountPO = JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), ExpenseAccountPO.class);
|
||||
if(null == expenseAccountPO){
|
||||
throw new ServiceException("费用科目信息未找到");
|
||||
}
|
||||
if(expenseAccountPO.getFirstSubjectFlag()==1){
|
||||
//如果是一级科目
|
||||
billingRulesDO.setFirstSubjectName(expenseAccountPO.getSubjectName());
|
||||
billingRulesDO.setFirstSubjectCode(expenseAccountPO.getSubjectCode());
|
||||
billingRulesDO.setSecondSubjectCode("");
|
||||
}else {
|
||||
//不是一级科目
|
||||
billingRulesDO.setFirstSubjectName(expenseAccountPO.getUpperSubject());
|
||||
billingRulesDO.setFirstSubjectCode(expenseAccountPO.getUpperSubjectCode());
|
||||
billingRulesDO.setSecondSubjectCode(expenseAccountPO.getSubjectCode());
|
||||
billingRulesDO.setSecondSubjectName(expenseAccountPO.getSubjectName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计费规则
|
||||
*/
|
||||
public Boolean update(BillingRulesDO billingRulesDO) {
|
||||
return billingRulesService.update(billingRulesDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计费规则
|
||||
*/
|
||||
public Boolean delete(Long[] billingRulesIds) {
|
||||
return billingRulesService.delete(billingRulesIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计费规则详细信息
|
||||
*/
|
||||
public BillingRulesPO getInfo(Long billingRulesId)
|
||||
{
|
||||
return billingRulesService.getInfo(billingRulesId);
|
||||
}
|
||||
|
||||
|
||||
public BillingRulesPO getInfoByCode(String billingRulesCode) {
|
||||
BillingRulesPO billingRulesPO = new BillingRulesPO();
|
||||
LambdaQueryWrapper<BillingRules> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BillingRules::getBillingRulesCode, billingRulesCode);
|
||||
queryWrapper.eq(BillingRules::getDelFlag, 1);
|
||||
BillingRules billingRules = billingRulesService.getOne(queryWrapper);
|
||||
if(billingRules != null){
|
||||
BeanUtils.copyProperties(billingRules, billingRulesPO);
|
||||
return billingRulesPO;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计费规则状态
|
||||
*/
|
||||
public Boolean changeStates(BillingRulesDTO billingRulesDTO) {
|
||||
if(billingRulesDTO.getBillingRulesState() ==null || (billingRulesDTO.getBillingRulesState() != 1 && billingRulesDTO.getBillingRulesState() != 2)){
|
||||
throw new ServiceException("操作类型错误");
|
||||
}
|
||||
LambdaUpdateWrapper<BillingRules> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(BillingRules::getBillingRulesId,billingRulesDTO.getBillingRulesId());
|
||||
updateWrapper.eq(BillingRules::getDelFlag,1);
|
||||
updateWrapper.set(BillingRules::getBillingRulesState,billingRulesDTO.getBillingRulesState());
|
||||
return billingRulesService.update(updateWrapper);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据id查询计费规则信息
|
||||
*/
|
||||
public BillingRulesPO getInfoById(Long billingRulesId) {
|
||||
BillingRulesPO billingRulesPO = billingRulesService.getInfo(billingRulesId);
|
||||
if(null == billingRulesPO){
|
||||
throw new ServiceException("计费规则信息未找到");
|
||||
}
|
||||
//查询计费参数明细列表
|
||||
List<BillingParamsPO> billingParamsPOList = billingParamsService.queryListByRulesId(billingRulesId);
|
||||
billingRulesPO.setBillingParamsPOList(billingParamsPOList);
|
||||
return billingRulesPO;
|
||||
}
|
||||
}
|
||||
+192
@@ -0,0 +1,192 @@
|
||||
package com.mhd.bms.domain.billingStatement.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 计费流水对象 billing_statement
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-26
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillingStatement extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("计费流水id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long billingStatementId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("结算对象id")
|
||||
@Excel(name = "结算对象id")
|
||||
private Long settlementCustomersId;
|
||||
|
||||
@ApiModelProperty("结算对象code")
|
||||
@Excel(name = "结算对象code")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("结算对象")
|
||||
@Excel(name = "结算对象")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("业务日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "业务日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date businessDate;
|
||||
|
||||
@ApiModelProperty("周期开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cycleBeginTime;
|
||||
|
||||
@ApiModelProperty("周期结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cycleEndTime;
|
||||
|
||||
@ApiModelProperty("费用类型code(服务项)")
|
||||
@Excel(name = "费用类型code", readConverterExp = "服=务项")
|
||||
private String serviceItemsCode;
|
||||
|
||||
@ApiModelProperty("费用类型")
|
||||
@Excel(name = "费用类型")
|
||||
private String serviceItemsName;
|
||||
|
||||
@ApiModelProperty("费用类型id(服务项)")
|
||||
@Excel(name = "费用类型id", readConverterExp = "服=务项")
|
||||
private Long serviceItemsManageId;
|
||||
|
||||
@ApiModelProperty("一级费用科目code")
|
||||
@Excel(name = "一级费用科目code")
|
||||
private String firstSubjectCode;
|
||||
|
||||
@ApiModelProperty("一级费用科目(结算项)")
|
||||
@Excel(name = "一级费用科目", readConverterExp = "结=算项")
|
||||
private String firstSubjectName;
|
||||
|
||||
@ApiModelProperty("二级费用科目code")
|
||||
@Excel(name = "二级费用科目code")
|
||||
private String secondSubjectCode;
|
||||
|
||||
@ApiModelProperty("二级费用科目(结算项)")
|
||||
@Excel(name = "二级费用科目", readConverterExp = "结=算项")
|
||||
private String secondSubjectName;
|
||||
|
||||
@ApiModelProperty("流水金额")
|
||||
@Excel(name = "流水金额")
|
||||
private BigDecimal billingAmount;
|
||||
|
||||
@ApiModelProperty("收支类型(1-应收,2-应付)")
|
||||
@Excel(name = "收支类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer accountExpenseType;
|
||||
|
||||
@ApiModelProperty("流水备注")
|
||||
@Excel(name = "流水备注")
|
||||
private String billingRemark;
|
||||
|
||||
@ApiModelProperty("业务单号")
|
||||
@Excel(name = "业务单号")
|
||||
private String originalBusinessNum;
|
||||
|
||||
@ApiModelProperty("业务流水号")
|
||||
@Excel(name = "业务流水号")
|
||||
private String businessFlow;
|
||||
|
||||
@ApiModelProperty("合同编号")
|
||||
@Excel(name = "合同编号")
|
||||
private String contractNumber;
|
||||
|
||||
@ApiModelProperty("合同名称")
|
||||
@Excel(name = "合同名称")
|
||||
private String contractName;
|
||||
|
||||
@ApiModelProperty("合同管理id")
|
||||
@Excel(name = "合同管理id")
|
||||
private Long contractManageId;
|
||||
|
||||
@ApiModelProperty("项目编码")
|
||||
@Excel(name = "项目编码")
|
||||
private String projectCode;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("项目管理id")
|
||||
@Excel(name = "项目管理id")
|
||||
private Long projectManageId;
|
||||
|
||||
@ApiModelProperty("流水状态(1-待审核,2-已审核,3-已出账,4-已驳回,5-已作废)")
|
||||
@Excel(name = "流水状态", readConverterExp = "1=-待审核,2-已审核,3-已出账,4-已驳回,5-已作废")
|
||||
private Integer billingState;
|
||||
|
||||
@ApiModelProperty("红冲状态(1-未红冲,2-已红冲)")
|
||||
@Excel(name = "红冲状态", readConverterExp = "1=-未红冲,2-已红冲")
|
||||
private Integer redFlushState;
|
||||
|
||||
@ApiModelProperty("类型名称")
|
||||
@Excel(name = "类型名称")
|
||||
private String documentType;
|
||||
|
||||
@ApiModelProperty("类型编码")
|
||||
@Excel(name = "类型编码")
|
||||
private String documentTypeCode;
|
||||
|
||||
@ApiModelProperty("单据类型id")
|
||||
@Excel(name = "单据类型id")
|
||||
private Long documentTypeId;
|
||||
|
||||
@ApiModelProperty("对接系统编码")
|
||||
@Excel(name = "对接系统编码")
|
||||
private String belongModuleCode;
|
||||
|
||||
@ApiModelProperty("对接系统")
|
||||
@Excel(name = "对接系统")
|
||||
private String belongModule;
|
||||
|
||||
@ApiModelProperty("数据来源(1-系统生成,2-手工录入)")
|
||||
@Excel(name = "数据来源", readConverterExp = "1=-系统生成,2-手工录入")
|
||||
private Integer dataSources;
|
||||
|
||||
@ApiModelProperty("审核备注")
|
||||
@Excel(name = "审核备注")
|
||||
private String reviewRemarks;
|
||||
|
||||
@ApiModelProperty("计费流水号")
|
||||
@Excel(name = "计费流水号")
|
||||
private String billingFlow;
|
||||
|
||||
@ApiModelProperty("红冲原因")
|
||||
@Excel(name = "红冲原因")
|
||||
private String redFlushRemark;
|
||||
|
||||
@ApiModelProperty("合同类型(1-仓储,2-运输)")
|
||||
private Integer contractType;
|
||||
|
||||
@ApiModelProperty("结算方式(1-现金,2-油卡)")
|
||||
private Integer settlementWay;
|
||||
|
||||
@ApiModelProperty("业务单据记录id")
|
||||
private Long businessDocumentId;
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package com.mhd.bms.domain.billingStatement.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.billingStatement.entity.BillingStatement;
|
||||
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementCollectPO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementCollectDO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计费流水Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-26
|
||||
*/
|
||||
public interface IBillingStatementService extends IService<BillingStatement>
|
||||
{
|
||||
/**
|
||||
* 分页查询计费流水列表
|
||||
*/
|
||||
public List<BillingStatementPO> queryList(BillingStatementDO billingStatementDO);
|
||||
|
||||
/**
|
||||
* 查询出账汇总
|
||||
*/
|
||||
public List<BillingStatementCollectPO> queryCollectList(BillingStatementCollectDO billingStatementCollectDO);
|
||||
|
||||
/**
|
||||
* 查询出账详情
|
||||
*/
|
||||
public List<BillingStatementPO> queryDetails(BillingStatementCollectDO bdo);
|
||||
|
||||
/**
|
||||
* 新增计费流水
|
||||
*/
|
||||
public Boolean insert(BillingStatementDO billingStatementDO);
|
||||
|
||||
/**
|
||||
* 修改计费流水
|
||||
*/
|
||||
public Boolean update(BillingStatementDO billingStatementDO);
|
||||
|
||||
/**
|
||||
* 批量删除计费流水
|
||||
*/
|
||||
public Boolean delete(Long[] billingStatementIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询计费流水
|
||||
*/
|
||||
public BillingStatementPO getInfo(Long billingStatementId);
|
||||
|
||||
List<BillingStatementPO> queryPaymentOutList(BillingStatementDO billingStatementDO);
|
||||
|
||||
List<BillingStatementPO> getDetailsByManageId(Long billManageId);
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.mhd.bms.domain.billingStatement.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.billingStatement.entity.BillingStatement;
|
||||
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementCollectPO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementCollectDO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 计费流水Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-26
|
||||
*/
|
||||
public interface BillingStatementMapper extends BaseMapper<BillingStatement>
|
||||
{
|
||||
/**
|
||||
* 查询计费流水列表
|
||||
*/
|
||||
public List<BillingStatementPO> queryList(@Param("billingStatementDO") BillingStatementDO billingStatementDO);
|
||||
|
||||
|
||||
/**
|
||||
* 查询出账汇总
|
||||
*/
|
||||
public List<BillingStatementCollectPO> queryCollectList(@Param("billingStatementCollectDO") BillingStatementCollectDO billingStatementCollectDO);
|
||||
|
||||
/**
|
||||
* 查询出账详情
|
||||
*/
|
||||
public List<BillingStatementPO> queryDetails(@Param("bdo") BillingStatementCollectDO bdo);
|
||||
|
||||
|
||||
/**
|
||||
* 查询批量出账列表
|
||||
*/
|
||||
List<BillingStatementPO> queryPaymentOutList(@Param("billingStatementDO") BillingStatementDO billingStatementDO);
|
||||
|
||||
/**
|
||||
* 根据账单id,查询流水明细列表
|
||||
*/
|
||||
List<BillingStatementPO> getDetailsByManageId(@Param("billManageId") Long billManageId);
|
||||
}
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
package com.mhd.bms.domain.billingStatement.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.billingStatement.entity.BillingStatement;
|
||||
import com.mhd.bms.domain.billingStatement.repository.facade.IBillingStatementService;
|
||||
import com.mhd.bms.domain.billingStatement.repository.mapper.BillingStatementMapper;
|
||||
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementCollectPO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementCollectDO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计费流水Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-26
|
||||
*/
|
||||
@Service
|
||||
public class BillingStatementImpl extends ServiceImpl<BillingStatementMapper, BillingStatement> implements IBillingStatementService{
|
||||
@Autowired
|
||||
private BillingStatementMapper billingStatementMapper;
|
||||
|
||||
/**
|
||||
* 查询计费流水列表
|
||||
*/
|
||||
@Override
|
||||
public List<BillingStatementPO> queryList(BillingStatementDO billingStatementDO)
|
||||
{
|
||||
return billingStatementMapper.queryList(billingStatementDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BillingStatementCollectPO> queryCollectList(BillingStatementCollectDO billingStatementCollectDO) {
|
||||
return billingStatementMapper.queryCollectList(billingStatementCollectDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BillingStatementPO> queryDetails(BillingStatementCollectDO bdo) {
|
||||
return billingStatementMapper.queryDetails(bdo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计费流水
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(BillingStatementDO billingStatementDO) {
|
||||
BillingStatement billingStatement = new BillingStatement();
|
||||
BeanUtils.copyProperties(billingStatementDO,billingStatement);
|
||||
return this.save(billingStatement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计费流水
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(BillingStatementDO billingStatementDO) {
|
||||
BillingStatement billingStatement = new BillingStatement();
|
||||
BeanUtils.copyProperties(billingStatementDO,billingStatement);
|
||||
return this.updateById(billingStatement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计费流水
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] billingStatementIds ) {
|
||||
List<BillingStatement> list = new ArrayList<>();
|
||||
for (Long id : billingStatementIds) {
|
||||
BillingStatement billingStatement = new BillingStatement();
|
||||
billingStatement.setBillingStatementId(id);
|
||||
billingStatement.setDelFlag(2);
|
||||
list.add(billingStatement);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计费流水
|
||||
*/
|
||||
@Override
|
||||
public BillingStatementPO getInfo(Long billingStatementId) {
|
||||
BillingStatement billingStatement = this.getById(billingStatementId);
|
||||
BillingStatementPO billingStatementPO = new BillingStatementPO();
|
||||
BeanUtils.copyProperties(billingStatement,billingStatementPO);
|
||||
return billingStatementPO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询批量出账列表
|
||||
*/
|
||||
@Override
|
||||
public List<BillingStatementPO> queryPaymentOutList(BillingStatementDO billingStatementDO) {
|
||||
return billingStatementMapper.queryPaymentOutList(billingStatementDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据账单id,查询流水明细列表
|
||||
*/
|
||||
@Override
|
||||
public List<BillingStatementPO> getDetailsByManageId(Long billManageId) {
|
||||
return billingStatementMapper.getDetailsByManageId(billManageId);
|
||||
}
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package com.mhd.bms.domain.billingStatement.repository.po;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class BillingStatementCollectPO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("计费流水id")
|
||||
private Long billingStatementId;
|
||||
|
||||
@ApiModelProperty("结算对象")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("结算代码")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("费用总额")
|
||||
private BigDecimal billAmountSum;
|
||||
|
||||
@ApiModelProperty("应收汇总")
|
||||
private BigDecimal receivable;
|
||||
|
||||
@ApiModelProperty("应付汇总")
|
||||
private BigDecimal feesPayable;
|
||||
|
||||
@ApiModelProperty("费用类型")
|
||||
private Integer accountExpenseType;
|
||||
|
||||
@ApiModelProperty("流水数量")
|
||||
private Integer countFee;
|
||||
|
||||
@ApiModelProperty("创建时间从")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date businessStartDate;
|
||||
|
||||
@ApiModelProperty("创建时间至")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date businessEndDate;
|
||||
|
||||
@ApiModelProperty("所属组织")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("出账状态")
|
||||
private Integer billingState;
|
||||
|
||||
@ApiModelProperty("合同类型")
|
||||
@Excel(name = "合同类型")
|
||||
private String contractType;
|
||||
|
||||
@ApiModelProperty("流水状态拼接(统计使用)")
|
||||
private String billingStateCount;
|
||||
|
||||
|
||||
}
|
||||
+199
@@ -0,0 +1,199 @@
|
||||
package com.mhd.bms.domain.billingStatement.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 计费流水对象 billing_statement
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-26
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "计费流水对象", description = "计费流水响应对象")
|
||||
public class BillingStatementPO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("计费流水id")
|
||||
private Long billingStatementId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("结算对象id")
|
||||
@Excel(name = "结算对象id")
|
||||
private Long settlementCustomersId;
|
||||
|
||||
@ApiModelProperty("结算对象code")
|
||||
@Excel(name = "结算对象code")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("结算对象")
|
||||
@Excel(name = "结算对象")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("业务日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "业务日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date businessDate;
|
||||
|
||||
@ApiModelProperty("周期开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cycleBeginTime;
|
||||
|
||||
@ApiModelProperty("周期结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cycleEndTime;
|
||||
|
||||
@ApiModelProperty("费用类型code(服务项)")
|
||||
@Excel(name = "费用类型code", readConverterExp = "服=务项")
|
||||
private String serviceItemsCode;
|
||||
|
||||
@ApiModelProperty("费用类型")
|
||||
@Excel(name = "费用类型")
|
||||
private String serviceItemsName;
|
||||
|
||||
@ApiModelProperty("费用类型id(服务项)")
|
||||
@Excel(name = "费用类型id", readConverterExp = "服=务项")
|
||||
private Long serviceItemsManageId;
|
||||
|
||||
@ApiModelProperty("一级费用科目code")
|
||||
@Excel(name = "一级费用科目code")
|
||||
private String firstSubjectCode;
|
||||
|
||||
@ApiModelProperty("一级费用科目(结算项)")
|
||||
@Excel(name = "一级费用科目", readConverterExp = "结=算项")
|
||||
private String firstSubjectName;
|
||||
|
||||
@ApiModelProperty("二级费用科目code")
|
||||
@Excel(name = "二级费用科目code")
|
||||
private String secondSubjectCode;
|
||||
|
||||
@ApiModelProperty("二级费用科目(结算项)")
|
||||
@Excel(name = "二级费用科目", readConverterExp = "结=算项")
|
||||
private String secondSubjectName;
|
||||
|
||||
@ApiModelProperty("流水金额")
|
||||
@Excel(name = "流水金额")
|
||||
private BigDecimal billingAmount;
|
||||
|
||||
@ApiModelProperty("收支类型(1-应收,2-应付)")
|
||||
@Excel(name = "收支类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer accountExpenseType;
|
||||
|
||||
@ApiModelProperty("流水备注")
|
||||
@Excel(name = "流水备注")
|
||||
private String billingRemark;
|
||||
|
||||
@ApiModelProperty("业务单号")
|
||||
@Excel(name = "业务单号")
|
||||
private String originalBusinessNum;
|
||||
|
||||
@ApiModelProperty("业务流水号")
|
||||
@Excel(name = "业务流水号")
|
||||
private String businessFlow;
|
||||
|
||||
@ApiModelProperty("合同编号")
|
||||
@Excel(name = "合同编号")
|
||||
private String contractNumber;
|
||||
|
||||
@ApiModelProperty("合同名称")
|
||||
@Excel(name = "合同名称")
|
||||
private String contractName;
|
||||
|
||||
@ApiModelProperty("合同管理id")
|
||||
@Excel(name = "合同管理id")
|
||||
private Long contractManageId;
|
||||
|
||||
@ApiModelProperty("项目编码")
|
||||
@Excel(name = "项目编码")
|
||||
private String projectCode;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("项目管理id")
|
||||
@Excel(name = "项目管理id")
|
||||
private Long projectManageId;
|
||||
|
||||
@ApiModelProperty("流水状态(1-待审核,2-已审核,3-已出账,4-已驳回,5-已作废)")
|
||||
@Excel(name = "流水状态", readConverterExp = "1=-待审核,2-已审核,3-已出账,4-已驳回,5-已作废")
|
||||
private Integer billingState;
|
||||
|
||||
@ApiModelProperty("红冲状态(1-未红冲,2-已红冲)")
|
||||
@Excel(name = "红冲状态", readConverterExp = "1=-未红冲,2-已红冲")
|
||||
private Integer redFlushState;
|
||||
|
||||
@ApiModelProperty("类型名称")
|
||||
@Excel(name = "类型名称")
|
||||
private String documentType;
|
||||
|
||||
@ApiModelProperty("类型编码")
|
||||
@Excel(name = "类型编码")
|
||||
private String documentTypeCode;
|
||||
|
||||
@ApiModelProperty("单据类型id")
|
||||
@Excel(name = "单据类型id")
|
||||
private Long documentTypeId;
|
||||
|
||||
@ApiModelProperty("对接系统编码")
|
||||
@Excel(name = "对接系统编码")
|
||||
private String belongModuleCode;
|
||||
|
||||
@ApiModelProperty("对接系统")
|
||||
@Excel(name = "对接系统")
|
||||
private String belongModule;
|
||||
|
||||
@ApiModelProperty("数据来源(1-系统生成,2-手工录入)")
|
||||
@Excel(name = "数据来源", readConverterExp = "1=-系统生成,2-手工录入")
|
||||
private Integer dataSources;
|
||||
|
||||
@ApiModelProperty("审核备注")
|
||||
@Excel(name = "审核备注")
|
||||
private String reviewRemarks;
|
||||
|
||||
@ApiModelProperty("计费流水号")
|
||||
@Excel(name = "计费流水号")
|
||||
private String billingFlow;
|
||||
|
||||
@ApiModelProperty("红冲原因")
|
||||
@Excel(name = "红冲原因")
|
||||
private String redFlushRemark;
|
||||
|
||||
@ApiModelProperty("合同类型(1-仓储,2-运输)")
|
||||
private Integer contractType;
|
||||
|
||||
@ApiModelProperty("结算方式(1-现金,2-油卡)")
|
||||
private Integer settlementWay;
|
||||
|
||||
@ApiModelProperty("业务单据记录id")
|
||||
private Long businessDocumentId;
|
||||
|
||||
@ApiModelProperty("费用总额")
|
||||
private BigDecimal billingTotalAmount;
|
||||
|
||||
@ApiModelProperty("账单优惠金额")
|
||||
private BigDecimal billingDiscountAmount;
|
||||
|
||||
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.mhd.bms.domain.billingStatement.repository.todo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class BillingStatementCollectDO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("计费流水id")
|
||||
private Long billingStatementId;
|
||||
|
||||
@ApiModelProperty("结算对象")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("结算代码")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("费用总额")
|
||||
private BigDecimal billAmountSum;
|
||||
|
||||
@ApiModelProperty("费用类型")
|
||||
private Integer accountExpenseType;
|
||||
|
||||
@ApiModelProperty("流水数量")
|
||||
private Integer countFee;
|
||||
|
||||
@ApiModelProperty("创建时间从")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date businessStartDate;
|
||||
|
||||
@ApiModelProperty("创建时间至")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date businessEndDate;
|
||||
|
||||
@ApiModelProperty("所属组织")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("出账状态")
|
||||
private Integer billingState;
|
||||
|
||||
@ApiModelProperty("合同类型")
|
||||
@Excel(name = "合同类型")
|
||||
private String contractType;
|
||||
|
||||
}
|
||||
+224
@@ -0,0 +1,224 @@
|
||||
package com.mhd.bms.domain.billingStatement.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
* 计费流水对象 billing_statement
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-26
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillingStatementDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("计费流水id")
|
||||
private Long billingStatementId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("结算对象id")
|
||||
@Excel(name = "结算对象id")
|
||||
private Long settlementCustomersId;
|
||||
|
||||
@ApiModelProperty("结算对象code")
|
||||
@Excel(name = "结算对象code")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("结算对象")
|
||||
@Excel(name = "结算对象")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("业务日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "业务日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date businessDate;
|
||||
|
||||
@ApiModelProperty("周期开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "周期开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cycleBeginTime;
|
||||
|
||||
@ApiModelProperty("周期结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "周期结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date cycleEndTime;
|
||||
|
||||
@ApiModelProperty("费用类型code(服务项)")
|
||||
@Excel(name = "费用类型code", readConverterExp = "服=务项")
|
||||
private String serviceItemsCode;
|
||||
|
||||
@ApiModelProperty("费用类型")
|
||||
@Excel(name = "费用类型")
|
||||
private String serviceItemsName;
|
||||
|
||||
@ApiModelProperty("费用类型id(服务项)")
|
||||
@Excel(name = "费用类型id", readConverterExp = "服=务项")
|
||||
private Long serviceItemsManageId;
|
||||
|
||||
@ApiModelProperty("一级费用科目code")
|
||||
@Excel(name = "一级费用科目code")
|
||||
private String firstSubjectCode;
|
||||
|
||||
@ApiModelProperty("一级费用科目(结算项)")
|
||||
@Excel(name = "一级费用科目", readConverterExp = "结=算项")
|
||||
private String firstSubjectName;
|
||||
|
||||
@ApiModelProperty("二级费用科目code")
|
||||
@Excel(name = "二级费用科目code")
|
||||
private String secondSubjectCode;
|
||||
|
||||
@ApiModelProperty("二级费用科目(结算项)")
|
||||
@Excel(name = "二级费用科目", readConverterExp = "结=算项")
|
||||
private String secondSubjectName;
|
||||
|
||||
@ApiModelProperty("流水金额")
|
||||
@Excel(name = "流水金额")
|
||||
private BigDecimal billingAmount;
|
||||
|
||||
@ApiModelProperty("收支类型(1-应收,2-应付)")
|
||||
@Excel(name = "收支类型", readConverterExp = "1=-应收,2-应付")
|
||||
private Integer accountExpenseType;
|
||||
|
||||
@ApiModelProperty("流水备注")
|
||||
@Excel(name = "流水备注")
|
||||
private String billingRemark;
|
||||
|
||||
@ApiModelProperty("业务单号")
|
||||
@Excel(name = "业务单号")
|
||||
private String originalBusinessNum;
|
||||
|
||||
@ApiModelProperty("业务流水号")
|
||||
@Excel(name = "业务流水号")
|
||||
private String businessFlow;
|
||||
|
||||
@ApiModelProperty("合同编号")
|
||||
@Excel(name = "合同编号")
|
||||
private String contractNumber;
|
||||
|
||||
@ApiModelProperty("合同名称")
|
||||
@Excel(name = "合同名称")
|
||||
private String contractName;
|
||||
|
||||
@ApiModelProperty("合同管理id")
|
||||
@Excel(name = "合同管理id")
|
||||
private Long contractManageId;
|
||||
|
||||
@ApiModelProperty("项目编码")
|
||||
@Excel(name = "项目编码")
|
||||
private String projectCode;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("项目管理id")
|
||||
@Excel(name = "项目管理id")
|
||||
private Long projectManageId;
|
||||
|
||||
@ApiModelProperty("流水状态(1-待审核,2-已审核,3-已出账,4-已驳回,5-已作废)")
|
||||
@Excel(name = "流水状态", readConverterExp = "1=-待审核,2-已审核,3-已出账,4-已驳回,5-已作废")
|
||||
private Integer billingState;
|
||||
|
||||
@ApiModelProperty("红冲状态(1-未红冲,2-已红冲)")
|
||||
@Excel(name = "红冲状态", readConverterExp = "1=-未红冲,2-已红冲")
|
||||
private Integer redFlushState;
|
||||
|
||||
@ApiModelProperty("类型名称")
|
||||
@Excel(name = "类型名称")
|
||||
private String documentType;
|
||||
|
||||
@ApiModelProperty("类型编码")
|
||||
@Excel(name = "类型编码")
|
||||
private String documentTypeCode;
|
||||
|
||||
@ApiModelProperty("单据类型id")
|
||||
@Excel(name = "单据类型id")
|
||||
private Long documentTypeId;
|
||||
|
||||
@ApiModelProperty("对接系统编码")
|
||||
@Excel(name = "对接系统编码")
|
||||
private String belongModuleCode;
|
||||
|
||||
@ApiModelProperty("对接系统")
|
||||
@Excel(name = "对接系统")
|
||||
private String belongModule;
|
||||
|
||||
@ApiModelProperty("数据来源(1-系统生成,2-手工录入)")
|
||||
@Excel(name = "数据来源", readConverterExp = "1=-系统生成,2-手工录入")
|
||||
private Integer dataSources;
|
||||
|
||||
@ApiModelProperty("审核备注")
|
||||
@Excel(name = "审核备注")
|
||||
private String reviewRemarks;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty("计费流水号")
|
||||
@Excel(name = "计费流水号")
|
||||
private String billingFlow;
|
||||
|
||||
@ApiModelProperty("红冲原因")
|
||||
@Excel(name = "红冲原因")
|
||||
private String redFlushRemark;
|
||||
|
||||
@ApiModelProperty("查询状态(1-未出账,2-已出账,3-其他)")
|
||||
private Integer queryState;
|
||||
|
||||
@ApiModelProperty("合同类型(1-仓储,2-运输)")
|
||||
private Integer contractType;
|
||||
|
||||
@ApiModelProperty(name = "计费周期查询条件开始日期")
|
||||
private String businessDateStart;
|
||||
@ApiModelProperty(name = "计费周期查询条件结束日期")
|
||||
private String businessDateEnd;
|
||||
|
||||
@ApiModelProperty("计费流水ids")
|
||||
private String billingStatementIds;
|
||||
|
||||
@ApiModelProperty("计费流水ids")
|
||||
private Set<String> billingStatementIdSet;
|
||||
|
||||
@ApiModelProperty(name = "创建时间查询条件开始日期")
|
||||
private String createTimeStart;
|
||||
@ApiModelProperty(name = "创建时间查询条件结束日期")
|
||||
private String createTimeEnd;
|
||||
@ApiModelProperty(name = "修改时间查询条件开始日期")
|
||||
private String updateTimeStart;
|
||||
@ApiModelProperty(name = "修改时间查询条件结束日期")
|
||||
private String updateTimeEnd;
|
||||
|
||||
@ApiModelProperty("账单管理id")
|
||||
private Long billManageId;
|
||||
|
||||
@ApiModelProperty("结算方式(1-现金,2-油卡)")
|
||||
private Integer settlementWay;
|
||||
|
||||
@ApiModelProperty("业务单据记录id")
|
||||
private Long businessDocumentId;
|
||||
}
|
||||
+511
@@ -0,0 +1,511 @@
|
||||
package com.mhd.bms.domain.billingStatement.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.mhd.bms.domain.billManage.repository.facade.IBillManageService;
|
||||
import com.mhd.bms.domain.billManage.repository.po.BillManagePO;
|
||||
import com.mhd.bms.domain.billManage.service.BillManageDomainService;
|
||||
import com.mhd.bms.domain.billingStatement.entity.BillingStatement;
|
||||
import com.mhd.bms.domain.billingStatement.repository.facade.IBillingStatementService;
|
||||
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementCollectPO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.po.BillingStatementPO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementCollectDO;
|
||||
import com.mhd.bms.domain.billingStatement.repository.todo.BillingStatementDO;
|
||||
import com.mhd.bms.domain.businessDocument.repository.facade.IBusinessDocumentService;
|
||||
import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO;
|
||||
import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO;
|
||||
import com.mhd.bms.domain.settlementCustomers.entity.SettlementCustomers;
|
||||
import com.mhd.bms.domain.settlementCustomers.service.SettlementCustomersDomainService;
|
||||
import com.mhd.bms.infrastructure.feign.vo.ContractManageDetailPO;
|
||||
import com.mhd.bms.infrastructure.feign.vo.ContractManagePO;
|
||||
import com.mhd.bms.interfaces.dto.billingStatement.BillingStatementDTO;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
|
||||
import com.mhd.common.core.utils.StringUtils;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.mhd.common.core.utils.PageUtils.startPage;
|
||||
|
||||
/**
|
||||
* 计费流水
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-26
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BillingStatementDomainService {
|
||||
|
||||
@Autowired
|
||||
private IBillingStatementService billingStatementService;
|
||||
@Autowired
|
||||
private SystemServiceFeign systemServiceFeign;
|
||||
@Autowired
|
||||
private BillManageDomainService billManageDomainService;
|
||||
@Autowired
|
||||
private IBillManageService billManageService;
|
||||
@Autowired
|
||||
private SettlementCustomersDomainService settlementCustomersDomainService;
|
||||
@Autowired
|
||||
private IBusinessDocumentService businessDocumentService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询计费流水列表
|
||||
*/
|
||||
public List<BillingStatementPO> queryList(BillingStatementDO billingStatementDO) {
|
||||
return billingStatementService.queryList(billingStatementDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出账汇总
|
||||
*/
|
||||
public List<BillingStatementCollectPO> queryCollectList(BillingStatementCollectDO billingStatementCollectDO){
|
||||
return billingStatementService.queryCollectList(billingStatementCollectDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出账详情
|
||||
*/
|
||||
public List<BillingStatementPO> queryDetails(BillingStatementCollectDO bdo) {
|
||||
return billingStatementService.queryDetails(bdo);
|
||||
}
|
||||
/**
|
||||
* 新增计费流水
|
||||
*/
|
||||
public Boolean insert(BillingStatementDO billingStatementDO) {
|
||||
|
||||
return billingStatementService.insert(billingStatementDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计费流水
|
||||
*/
|
||||
public Boolean update(BillingStatementDO billingStatementDO) {
|
||||
return billingStatementService.update(billingStatementDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计费流水
|
||||
*/
|
||||
public Boolean delete(Long[] billingStatementIds) {
|
||||
return billingStatementService.delete(billingStatementIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计费流水详细信息
|
||||
*/
|
||||
public BillingStatementPO getInfo(Long billingStatementId)
|
||||
{
|
||||
return billingStatementService.getInfo(billingStatementId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量审核
|
||||
*/
|
||||
public Boolean reviewBilling(BillingStatementDTO billingStatementDTO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
List<BillingStatement> billingStatements = new ArrayList<>();
|
||||
Set<String> billingSet = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet());
|
||||
for (String billingId : billingSet) {
|
||||
Long billingStatementId = Long.valueOf(billingId);
|
||||
BillingStatementPO billingStatementPO = billingStatementService.getInfo(billingStatementId);
|
||||
if(null == billingStatementPO){
|
||||
throw new ServiceException("流水不存在");
|
||||
}
|
||||
if(billingStatementPO.getBillingState()!=1){
|
||||
throw new ServiceException("该计费流水状态不为待审核,不能进行审核");
|
||||
}
|
||||
if(billingStatementPO.getRedFlushState()==2){
|
||||
throw new ServiceException("计费流水"+ billingStatementPO.getBillingFlow() +"已红冲,不能进行审核");
|
||||
}
|
||||
BillingStatement billingStatement = new BillingStatement();
|
||||
billingStatement.setBillingStatementId(billingStatementId);
|
||||
billingStatement.setReviewRemarks(billingStatementDTO.getReviewRemarks());
|
||||
if(billingStatementDTO.getAuditOperation()==1){
|
||||
//审核通过
|
||||
billingStatement.setBillingState(2);
|
||||
}else {
|
||||
//审核不通过
|
||||
billingStatement.setBillingState(4);
|
||||
//计费流水审核不通过时,修改业务单据中的状态到已生效
|
||||
BusinessDocumentDO businessDocumentDO = new BusinessDocumentDO();
|
||||
businessDocumentDO.setBusinessDocumentId(billingStatementPO.getBusinessDocumentId());
|
||||
businessDocumentDO.setBusinessState(2);
|
||||
businessDocumentService.update(businessDocumentDO);
|
||||
}
|
||||
billingStatement.setUpdateTime(new Date());
|
||||
billingStatement.setUpdateBy(loginUser.getUserPo().getUserId());
|
||||
billingStatement.setUpdateByName(loginUser.getUserPo().getUserName());
|
||||
billingStatements.add(billingStatement);
|
||||
}
|
||||
return billingStatementService.updateBatchById(billingStatements);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量红冲
|
||||
*/
|
||||
public Boolean redFlushBilling(BillingStatementDTO billingStatementDTO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
//只有手工录入流水才可以进行红冲操作
|
||||
|
||||
List<BillingStatement> billingStatements = new ArrayList<>();
|
||||
Set<String> billingSet = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet());
|
||||
for (String billingId : billingSet) {
|
||||
Long billingStatementId = Long.valueOf(billingId);
|
||||
BillingStatementPO billingStatementPO = billingStatementService.getInfo(billingStatementId);
|
||||
if(null == billingStatementPO){
|
||||
throw new ServiceException("流水不存在");
|
||||
}
|
||||
if(billingStatementPO.getDataSources()!=2){
|
||||
throw new ServiceException("非手工录入流水,不可进行红冲操作");
|
||||
}
|
||||
//如果流水已出账,则不允许红冲
|
||||
if(billingStatementPO.getBillingState()==3){
|
||||
throw new ServiceException("计费流水"+ billingStatementPO.getBillingFlow() +"已出账,无法进行红冲操作");
|
||||
}
|
||||
BillingStatement billingStatement = new BillingStatement();
|
||||
billingStatement.setBillingStatementId(billingStatementId);
|
||||
billingStatement.setRedFlushRemark(billingStatementDTO.getRedFlushRemark());
|
||||
billingStatement.setRedFlushState(2);
|
||||
billingStatements.add(billingStatement);
|
||||
}
|
||||
return billingStatementService.updateBatchById(billingStatements);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验所选流水是否是唯一主体
|
||||
* @param billingStatementIds
|
||||
*/
|
||||
public void checkUniqueEntity(String billingStatementIds) {
|
||||
Set<String> billingSet = Stream.of(billingStatementIds.split(",")).collect(Collectors.toSet());
|
||||
LambdaQueryWrapper<BillingStatement> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BillingStatement::getBillingStatementId,billingSet);
|
||||
queryWrapper.eq(BillingStatement::getDelFlag,1);
|
||||
List<BillingStatement> billingStatementList = billingStatementService.list(queryWrapper);
|
||||
if(null == billingStatementList){
|
||||
throw new ServiceException("所选流水信息未找到,请刷新后重试");
|
||||
}
|
||||
if(billingStatementList.size()!=billingSet.size()){
|
||||
throw new ServiceException("所选流水信息未找到,请刷新后重试");
|
||||
}
|
||||
//判断流水状态如果不是已审核的状态则不能生成账单
|
||||
long billingStateSet = billingStatementList.stream().filter(item -> item.getBillingState()!=2).count();
|
||||
if(billingStateSet>0){
|
||||
throw new ServiceException("所选流水状态不是已审核状态,请刷新后重试");
|
||||
}
|
||||
//判断流水状态是否已经红冲
|
||||
long redFlushStateSet = billingStatementList.stream().filter(item -> item.getRedFlushState()==2).count();
|
||||
if(redFlushStateSet > 0){
|
||||
throw new ServiceException("所选流水状态不是未红冲状态,不能进行审核");
|
||||
}
|
||||
|
||||
//校验结算对象是否一致
|
||||
Set<Long> settlementCustomersIdSet = billingStatementList.stream().map(BillingStatement::getSettlementCustomersId).collect(Collectors.toSet());
|
||||
if(settlementCustomersIdSet.size()!=1){
|
||||
throw new ServiceException("所选流水结算对象不一致,请刷新后重试");
|
||||
}
|
||||
//校验来源系统是否一致
|
||||
Set<String> belongModuleCodeSet = billingStatementList.stream().map(BillingStatement::getBelongModuleCode).collect(Collectors.toSet());
|
||||
if(belongModuleCodeSet.size()!=1){
|
||||
throw new ServiceException("所选流水来源系统不一致,请刷新后重试");
|
||||
}
|
||||
//校验收支类型是否一致
|
||||
Set<Integer> accountExpenseTypeSet = billingStatementList.stream().map(BillingStatement::getAccountExpenseType).collect(Collectors.toSet());
|
||||
if(accountExpenseTypeSet.size()!=1){
|
||||
throw new ServiceException("所选流水收支类型不一致,请刷新后重试");
|
||||
}
|
||||
//校验组织是否一致
|
||||
Set<Long> organizationIdSet = billingStatementList.stream().map(BillingStatement::getOrganizationId).collect(Collectors.toSet());
|
||||
if(organizationIdSet.size()!=1){
|
||||
throw new ServiceException("所选流水组织不一致,请刷新后重试");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改流水状态
|
||||
* @param billingStatementDTO
|
||||
*/
|
||||
public Boolean updateBillingState(BillingStatementDTO billingStatementDTO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
Set<String> billingSet = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet());
|
||||
LambdaUpdateWrapper<BillingStatement> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.in(BillingStatement::getBillingStatementId,billingSet);
|
||||
|
||||
updateWrapper.set(BillingStatement::getBillingState,billingStatementDTO.getBillingState());
|
||||
updateWrapper.set(BillingStatement::getUpdateBy,loginUser.getUserPo().getUserId());
|
||||
updateWrapper.set(BillingStatement::getUpdateTime,new Date());
|
||||
updateWrapper.set(BillingStatement::getUpdateByName,loginUser.getUserPo().getUserName());
|
||||
|
||||
return billingStatementService.update(updateWrapper);
|
||||
}
|
||||
|
||||
|
||||
public Boolean nullifyByIds(BillingStatementDTO billingStatementDTO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
//只有待审核状态的记录可以作废
|
||||
List<BillingStatement> billingStatements = new ArrayList<>();
|
||||
Set<String> billingSet = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet());
|
||||
for (String billingId : billingSet) {
|
||||
Long billingStatementId = Long.valueOf(billingId);
|
||||
BillingStatementPO billingStatementPO = billingStatementService.getInfo(billingStatementId);
|
||||
if(null == billingStatementPO){
|
||||
throw new ServiceException("流水不存在");
|
||||
}
|
||||
if(billingStatementPO.getBillingState()!=1){
|
||||
throw new ServiceException("非待审核状态,不可进行作废操作");
|
||||
}
|
||||
BillingStatement billingStatement = new BillingStatement();
|
||||
billingStatement.setBillingStatementId(billingStatementId);
|
||||
billingStatement.setBillingState(5);
|
||||
billingStatements.add(billingStatement);
|
||||
}
|
||||
return billingStatementService.updateBatchById(billingStatements);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询批量出账列表
|
||||
*/
|
||||
public List<BillingStatementPO> queryPaymentOutList(BillingStatementDO billingStatementDO) {
|
||||
//只查询流水状态为已审核的
|
||||
billingStatementDO.setBillingState(2);
|
||||
billingStatementDO.setRedFlushState(1);
|
||||
return billingStatementService.queryPaymentOutList(billingStatementDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验是否可以生成账单
|
||||
*/
|
||||
public boolean checkGenerateBills(BillingStatementDTO billingStatementDTO) {
|
||||
Set<String> billingStatementIds = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet());
|
||||
LambdaQueryWrapper<BillingStatement> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BillingStatement::getBillingStatementId,billingStatementIds);
|
||||
queryWrapper.eq(BillingStatement::getDelFlag,1);
|
||||
List<BillingStatement> billingStatementList = billingStatementService.list(queryWrapper);
|
||||
if(billingStatementList ==null || billingStatementList.size()==0){
|
||||
return false;
|
||||
}
|
||||
//校验流水状态是否都是已审核状态,如果不是则返回false
|
||||
Set<Integer> billingStateSet = billingStatementList.stream().map(BillingStatement::getBillingState).collect(Collectors.toSet());
|
||||
if(billingStateSet.size()==1 && billingStateSet.contains(2)){
|
||||
return true;
|
||||
}
|
||||
//校验红冲状态是否都是未红冲,如果不是返回false
|
||||
Set<Integer> redFlushStateSet = billingStatementList.stream().map(BillingStatement::getRedFlushState).collect(Collectors.toSet());
|
||||
if(redFlushStateSet.size()==1 && redFlushStateSet.contains(1)){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量生成账单
|
||||
*/
|
||||
public void batchGenerateBills(BillingStatementDTO billingStatementDTO) {
|
||||
Set<String> billingSet = Stream.of(billingStatementDTO.getBillingStatementIds().split(",")).collect(Collectors.toSet());
|
||||
BillingStatementDO billingStatementDO = new BillingStatementDO();
|
||||
billingStatementDO.setBillingStatementIdSet(billingSet);
|
||||
List<BillingStatementPO> billingStatementPOS = billingStatementService.queryList(billingStatementDO);
|
||||
//判断流水状态如果不是已审核的状态则不能生成账单
|
||||
long billingStateSet = billingStatementPOS.stream().filter(item -> item.getBillingState()!=2).count();
|
||||
if(billingStateSet>0){
|
||||
throw new ServiceException("所选流水状态含有非已审核状态,请刷新后重试");
|
||||
}
|
||||
//将billingStatementPOS集合按照组织表ID、结算对象code、收支类型、对接系统编码进行分组,将结算对象code作为key,四个条件有一个不同则视为不同的分组
|
||||
Map<String, List<BillingStatementPO>> billingStatementPOSMap = billingStatementPOS.stream().collect(Collectors.groupingBy(billingStatementPO -> billingStatementPO.getOrganizationId()+"_"+billingStatementPO.getSettlementCustomersCode()+"_"+billingStatementPO.getAccountExpenseType()+"_"+billingStatementPO.getBelongModuleCode()));
|
||||
//遍历集合分别生成账单
|
||||
billingStatementPOSMap.forEach((key,value)->{
|
||||
final String billingRemark = billingStatementDTO.getBillingRemark();
|
||||
final Date billCreateTime = billingStatementDTO.getBillCreateTime();
|
||||
if(value.size()>0){
|
||||
//生成账单
|
||||
billManageDomainService.saveBill(value,billingRemark,billCreateTime);
|
||||
}
|
||||
});
|
||||
//修改流水状态
|
||||
billingStatementDTO.setBillingState(3);
|
||||
updateBillingState(billingStatementDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成流水
|
||||
*/
|
||||
public Boolean generateFlow(BusinessDocumentPO businessDocumentPO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
BillingStatementDO billingStatementDO = new BillingStatementDO();
|
||||
String[] ignroreFields = new String[]{"billingStatementId","dataSources","createBy","createByName","createTime","updateBy","updateByName","updateTime"};
|
||||
BeanUtils.copyProperties(businessDocumentPO,billingStatementDO,ignroreFields);
|
||||
billingStatementDO.setBusinessDocumentId(businessDocumentPO.getBusinessDocumentId());
|
||||
billingStatementDO.setBusinessDate(businessDocumentPO.getCreateTime());
|
||||
billingStatementDO.setBillingAmount(businessDocumentPO.getBillAmount());
|
||||
billingStatementDO.setBillingState(1);
|
||||
billingStatementDO.setDataSources(1);
|
||||
billingStatementDO.setCreateBy(loginUser.getUserPo().getUserId());
|
||||
billingStatementDO.setCreateByName(loginUser.getUserPo().getUserName());
|
||||
billingStatementDO.setCreateTime(new Date());
|
||||
billingStatementDO.setBillingFlow(businessDocumentPO.getBusinessFlow());
|
||||
billingStatementDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
billingStatementDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
billingStatementDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
//处理数据
|
||||
handleData(billingStatementDO);
|
||||
return this.insert(billingStatementDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理生成收支流水数据
|
||||
* @param billingStatementDO
|
||||
*/
|
||||
private void handleData(BillingStatementDO billingStatementDO) {
|
||||
//查询合同信息,赋值合同周期信息
|
||||
if(StringUtils.isNotEmpty(billingStatementDO.getContractNumber())){
|
||||
AjaxResult ajaxResult = systemServiceFeign.getInfoByCode(billingStatementDO.getContractNumber());
|
||||
if("200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
ContractManagePO contractManagePO = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), ContractManagePO.class);
|
||||
if(null != contractManagePO){
|
||||
//取值合同详情,对比费用科目,取值计费周期
|
||||
if(contractManagePO.getContractManageDetailPOList()!=null && contractManagePO.getContractManageDetailPOList().size()>0){
|
||||
List<ContractManageDetailPO> contractManageDetailPOList = contractManagePO.getContractManageDetailPOList();
|
||||
String subjectCode = !StringUtils.isNotEmpty(billingStatementDO.getSecondSubjectCode()) ? billingStatementDO.getFirstSubjectCode() : billingStatementDO.getSecondSubjectCode();
|
||||
Date cycleBeginTime = null;
|
||||
Date cycleEndTime = null;
|
||||
for (ContractManageDetailPO contractManageDetailPO : contractManageDetailPOList) {
|
||||
String subjectCodeContract = !StringUtils.isNotEmpty(contractManageDetailPO.getSecondSubjectCode()) ? contractManageDetailPO.getFirstSubjectCode() : contractManageDetailPO.getSecondSubjectCode();
|
||||
if(subjectCodeContract.equals(subjectCode)){
|
||||
Date businessDate = billingStatementDO.getBusinessDate();
|
||||
//根据不同类型获取计费周期
|
||||
if(ObjectUtil.equal(contractManageDetailPO.getBillingAttributesCode(),"1") || ObjectUtil.equal(contractManageDetailPO.getBillingAttributesCode(),"4")){
|
||||
//实时计费、按天计费,赋值为当天
|
||||
cycleBeginTime = businessDate;
|
||||
cycleEndTime = businessDate;
|
||||
}else if(ObjectUtil.equal(contractManageDetailPO.getBillingAttributesCode(),"2")){
|
||||
//按账期计费
|
||||
cycleBeginTime = businessDate;
|
||||
cycleEndTime = contractManagePO.getPaymentDate();
|
||||
}else if(ObjectUtil.equal(contractManageDetailPO.getBillingAttributesCode(),"3")){
|
||||
//按周计费,用businessDate往后推一周的日期
|
||||
cycleBeginTime = businessDate;
|
||||
cycleEndTime = DateUtil.offsetWeek(businessDate,1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
billingStatementDO.setCycleBeginTime(cycleBeginTime);
|
||||
billingStatementDO.setCycleEndTime(cycleEndTime);
|
||||
}
|
||||
billingStatementDO.setContractType(contractManagePO.getContractType());
|
||||
}
|
||||
}
|
||||
}
|
||||
//根据结算对象获取收支类型
|
||||
if(StringUtils.isNotEmpty(billingStatementDO.getSettlementCustomersCode())){
|
||||
SettlementCustomers settlementCustomers = settlementCustomersDomainService.queryByCode(billingStatementDO.getSettlementCustomersCode());
|
||||
if(null != settlementCustomers){
|
||||
if(settlementCustomers.getMainRole()==1){
|
||||
billingStatementDO.setAccountExpenseType(1);
|
||||
}else {
|
||||
billingStatementDO.setAccountExpenseType(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 账单作废,流水状态回滚
|
||||
* @param billingStatementIds
|
||||
* @return
|
||||
*/
|
||||
public Boolean billNullify(Set<Long> billingStatementIds) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
LambdaUpdateWrapper<BillingStatement> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.in(BillingStatement::getBillingStatementId, billingStatementIds)
|
||||
.set(BillingStatement::getBillingState, 2)
|
||||
.set(BillingStatement::getUpdateBy, loginUser.getUserPo().getUserId())
|
||||
.set(BillingStatement::getUpdateByName, loginUser.getUserPo().getUserName())
|
||||
.set(BillingStatement::getUpdateTime, new Date());
|
||||
|
||||
return billingStatementService.update(updateWrapper);
|
||||
}
|
||||
|
||||
|
||||
public Long insertAndReturnId(BillingStatementDO billingStatementDO) {
|
||||
BillingStatement billingStatement = new BillingStatement();
|
||||
BeanUtils.copyProperties(billingStatementDO,billingStatement);
|
||||
billingStatementService.save(billingStatement);
|
||||
return billingStatement.getBillingStatementId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 应收账单-添加明细
|
||||
*/
|
||||
public List<BillingStatementPO> getBillDetailsList(BillingStatementDO billingStatementDO) {
|
||||
//查询当前账单的五大信息:组织信息、结算对象、来源系统、收支类型、账单周期
|
||||
BillManagePO billManagePO = billManageDomainService.getInfo(billingStatementDO.getBillManageId());
|
||||
if(null == billManagePO){
|
||||
throw new ServiceException("账单信息未找到");
|
||||
}
|
||||
billingStatementDO.setSettlementCustomersCode(billManagePO.getSettlementCustomersCode());
|
||||
billingStatementDO.setBelongModuleCode(billManagePO.getBelongModuleCode());
|
||||
billingStatementDO.setAccountExpenseType(billManagePO.getBillType());
|
||||
billingStatementDO.setCycleBeginTime(billManagePO.getCycleBeginTime());
|
||||
billingStatementDO.setCycleEndTime(billManagePO.getCycleEndTime());
|
||||
billingStatementDO.setBillingState(2);
|
||||
startPage();
|
||||
return billingStatementService.queryList(billingStatementDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据账单id,查询流水明细列表
|
||||
* @param billManageId
|
||||
* @return
|
||||
*/
|
||||
public List<BillingStatementPO> getDetailsByManageId(Long billManageId) {
|
||||
return billingStatementService.getDetailsByManageId(billManageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流水综合报表
|
||||
*/
|
||||
public List<BillingStatement> comprehensiveList(QueryWrapper<BillingStatement> queryWrapper) {
|
||||
return billingStatementService.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
package com.mhd.bms.domain.businessDocument.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 业务单据对象 business_document
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-21
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BusinessDocument extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("业务单据记录id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long businessDocumentId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("业务流水")
|
||||
@Excel(name = "业务流水")
|
||||
private String businessFlow;
|
||||
|
||||
@ApiModelProperty("状态(1-未生效,2-已生效,3-已计费,4-已驳回,5-已作废")
|
||||
@Excel(name = "状态", readConverterExp = "状态(1-未生效,2-已生效,3-已计费,4-已驳回,5-已作废")
|
||||
private Integer businessState;
|
||||
|
||||
@ApiModelProperty("来源模块")
|
||||
@Excel(name = "来源模块")
|
||||
private String belongModule;
|
||||
|
||||
@ApiModelProperty("来源模块code")
|
||||
@Excel(name = "来源模块code")
|
||||
private String belongModuleCode;
|
||||
|
||||
@ApiModelProperty("数据来源(1-系统生成,2-手工录入)")
|
||||
@Excel(name = "数据来源", readConverterExp = "1=-系统生成,2-手工录入")
|
||||
private Integer dataSources;
|
||||
|
||||
@ApiModelProperty("单据类型id")
|
||||
@Excel(name = "单据类型id")
|
||||
private Long documentTypeId;
|
||||
|
||||
@ApiModelProperty("单据类型code")
|
||||
@Excel(name = "单据类型code")
|
||||
private String documentTypeCode;
|
||||
|
||||
@ApiModelProperty("单据类型")
|
||||
@Excel(name = "单据类型")
|
||||
private String documentType;
|
||||
|
||||
@ApiModelProperty("原始业务单号")
|
||||
@Excel(name = "原始业务单号")
|
||||
private String originalBusinessNum;
|
||||
|
||||
@ApiModelProperty("项目编码")
|
||||
@Excel(name = "项目编码")
|
||||
private String projectCode;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("合同编号")
|
||||
@Excel(name = "合同编号")
|
||||
private String contractNumber;
|
||||
|
||||
@ApiModelProperty("合同名称")
|
||||
@Excel(name = "合同名称")
|
||||
private String contractName;
|
||||
|
||||
@ApiModelProperty("账单金额")
|
||||
@Excel(name = "账单金额")
|
||||
private BigDecimal billAmount;
|
||||
|
||||
@ApiModelProperty("预计费金额")
|
||||
@Excel(name = "预计费金额")
|
||||
private BigDecimal estimatedCost;
|
||||
|
||||
@ApiModelProperty("一级费用科目code")
|
||||
@Excel(name = "一级费用科目code")
|
||||
private String firstSubjectCode;
|
||||
|
||||
@ApiModelProperty("一级费用科目(结算项)")
|
||||
@Excel(name = "一级费用科目")
|
||||
private String firstSubjectName;
|
||||
|
||||
@ApiModelProperty("二级费用科目code")
|
||||
@Excel(name = "二级费用科目code")
|
||||
private String secondSubjectCode;
|
||||
|
||||
@ApiModelProperty("二级费用科目(结算项)")
|
||||
@Excel(name = "二级费用科目")
|
||||
private String secondSubjectName;
|
||||
|
||||
@ApiModelProperty("结算对象id")
|
||||
@Excel(name = "结算对象id")
|
||||
private Long settlementCustomersId;
|
||||
|
||||
@ApiModelProperty("结算对象code")
|
||||
@Excel(name = "结算对象code")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("结算对象")
|
||||
@Excel(name = "结算对象")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("计费时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "计费时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date billingTime;
|
||||
|
||||
@ApiModelProperty("单据表单json数据")
|
||||
@Excel(name = "单据表单json数据")
|
||||
private String documentFormJson;
|
||||
|
||||
@ApiModelProperty("合同管理id")
|
||||
@Excel(name = "合同管理id", readConverterExp = "合同管理id")
|
||||
private Long contractManageId;
|
||||
|
||||
@ApiModelProperty("项目管理id")
|
||||
@Excel(name = "项目管理id", readConverterExp = "项目管理id")
|
||||
private Long projectManageId;
|
||||
|
||||
@ApiModelProperty("原始流水号")
|
||||
@Excel(name = "原始流水号")
|
||||
private String originalSerialNumber;
|
||||
|
||||
@ApiModelProperty("费用类型code(服务项)")
|
||||
@Excel(name = "费用类型code(服务项)")
|
||||
private String serviceItemsCode;
|
||||
|
||||
@ApiModelProperty("费用类型")
|
||||
@Excel(name = "费用类型")
|
||||
private String serviceItemsName;
|
||||
|
||||
@ApiModelProperty("费用类型id(服务项)")
|
||||
@Excel(name = "费用类型id(服务项)")
|
||||
private Long serviceItemsManageId;
|
||||
|
||||
@ApiModelProperty("单据备注")
|
||||
@Excel(name = "单据备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("审核备注")
|
||||
@Excel(name = "审核备注")
|
||||
private String reviewRemarks;
|
||||
|
||||
@ApiModelProperty("结算方式(1-现金,2-油卡)")
|
||||
private Integer settlementWay;
|
||||
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.mhd.bms.domain.businessDocument.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.businessDocument.entity.BusinessDocument;
|
||||
import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO;
|
||||
import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务单据Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-21
|
||||
*/
|
||||
public interface IBusinessDocumentService extends IService<BusinessDocument>
|
||||
{
|
||||
/**
|
||||
* 分页查询业务单据列表
|
||||
*/
|
||||
public List<BusinessDocumentPO> queryList(BusinessDocumentDO businessDocumentDO);
|
||||
|
||||
/**
|
||||
* 新增业务单据
|
||||
*/
|
||||
public Boolean insert(BusinessDocumentDO businessDocumentDO);
|
||||
|
||||
/**
|
||||
* 修改业务单据
|
||||
*/
|
||||
public Boolean update(BusinessDocumentDO businessDocumentDO);
|
||||
|
||||
/**
|
||||
* 批量删除业务单据
|
||||
*/
|
||||
public Boolean delete(Long[] businessDocumentIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询业务单据
|
||||
*/
|
||||
public BusinessDocumentPO getInfo(Long businessDocumentId);
|
||||
|
||||
BusinessDocumentPO queryByOriginalBusinessNumAndSubjectCode(String originalBusinessNum, String secondSubjectCode);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.mhd.bms.domain.businessDocument.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.businessDocument.entity.BusinessDocument;
|
||||
import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO;
|
||||
import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 业务单据Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-21
|
||||
*/
|
||||
public interface BusinessDocumentMapper extends BaseMapper<BusinessDocument>
|
||||
{
|
||||
/**
|
||||
* 查询业务单据列表
|
||||
*/
|
||||
public List<BusinessDocumentPO> queryList(@Param("businessDocumentDO") BusinessDocumentDO businessDocumentDO);
|
||||
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package com.mhd.bms.domain.businessDocument.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.businessDocument.entity.BusinessDocument;
|
||||
import com.mhd.bms.domain.businessDocument.repository.facade.IBusinessDocumentService;
|
||||
import com.mhd.bms.domain.businessDocument.repository.mapper.BusinessDocumentMapper;
|
||||
import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO;
|
||||
import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务单据Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-21
|
||||
*/
|
||||
@Service
|
||||
public class BusinessDocumentImpl extends ServiceImpl<BusinessDocumentMapper, BusinessDocument> implements IBusinessDocumentService{
|
||||
@Autowired
|
||||
private BusinessDocumentMapper businessDocumentMapper;
|
||||
|
||||
/**
|
||||
* 查询业务单据列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusinessDocumentPO> queryList(BusinessDocumentDO businessDocumentDO)
|
||||
{
|
||||
return businessDocumentMapper.queryList(businessDocumentDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增业务单据
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(BusinessDocumentDO businessDocumentDO) {
|
||||
BusinessDocument businessDocument = new BusinessDocument();
|
||||
BeanUtils.copyProperties(businessDocumentDO,businessDocument);
|
||||
return this.save(businessDocument);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改业务单据
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(BusinessDocumentDO businessDocumentDO) {
|
||||
BusinessDocument businessDocument = new BusinessDocument();
|
||||
BeanUtils.copyProperties(businessDocumentDO,businessDocument);
|
||||
return this.updateById(businessDocument);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除业务单据
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] businessDocumentIds ) {
|
||||
List<BusinessDocument> list = new ArrayList<>();
|
||||
for (Long id : businessDocumentIds) {
|
||||
BusinessDocument businessDocument = new BusinessDocument();
|
||||
businessDocument.setBusinessDocumentId(id);
|
||||
businessDocument.setDelFlag(2);
|
||||
list.add(businessDocument);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改业务单据
|
||||
*/
|
||||
@Override
|
||||
public BusinessDocumentPO getInfo(Long businessDocumentId) {
|
||||
BusinessDocument businessDocument = this.getById(businessDocumentId);
|
||||
BusinessDocumentPO businessDocumentPO = new BusinessDocumentPO();
|
||||
BeanUtils.copyProperties(businessDocument,businessDocumentPO);
|
||||
return businessDocumentPO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据原始业务单号和费用科目code查询
|
||||
*/
|
||||
@Override
|
||||
public BusinessDocumentPO queryByOriginalBusinessNumAndSubjectCode(String originalBusinessNum, String secondSubjectCode) {
|
||||
BusinessDocumentPO businessDocumentPO = new BusinessDocumentPO();
|
||||
LambdaQueryWrapper<BusinessDocument> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(BusinessDocument::getOriginalBusinessNum,originalBusinessNum);
|
||||
lambdaQueryWrapper.eq(BusinessDocument::getSecondSubjectCode,secondSubjectCode).or().eq(BusinessDocument::getFirstSubjectCode,secondSubjectCode);
|
||||
BusinessDocument businessDocument = this.getOne(lambdaQueryWrapper);
|
||||
BeanUtils.copyProperties(businessDocument,businessDocumentPO);
|
||||
return businessDocumentPO;
|
||||
}
|
||||
}
|
||||
+177
@@ -0,0 +1,177 @@
|
||||
package com.mhd.bms.domain.businessDocument.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 业务单据对象 business_document
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-21
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "业务单据对象", description = "业务单据响应对象")
|
||||
public class BusinessDocumentPO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("业务单据记录id")
|
||||
private Long businessDocumentId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("业务流水")
|
||||
@Excel(name = "业务流水")
|
||||
private String businessFlow;
|
||||
|
||||
@ApiModelProperty("状态(1-未生效,2-已生效,3-已计费,4-已驳回,5-已作废")
|
||||
@Excel(name = "状态", readConverterExp = "状态(1-未生效,2-已生效,3-已计费,4-已驳回,5-已作废")
|
||||
private Integer businessState;
|
||||
|
||||
@ApiModelProperty("来源模块")
|
||||
@Excel(name = "来源模块")
|
||||
private String belongModule;
|
||||
|
||||
@ApiModelProperty("来源模块code")
|
||||
@Excel(name = "来源模块code")
|
||||
private String belongModuleCode;
|
||||
|
||||
@ApiModelProperty("数据来源(1-系统生成,2-手工录入)")
|
||||
@Excel(name = "数据来源", readConverterExp = "1=-系统生成,2-手工录入")
|
||||
private Integer dataSources;
|
||||
|
||||
@ApiModelProperty("单据类型id")
|
||||
@Excel(name = "单据类型id")
|
||||
private Long documentTypeId;
|
||||
|
||||
@ApiModelProperty("单据类型code")
|
||||
@Excel(name = "单据类型code")
|
||||
private String documentTypeCode;
|
||||
|
||||
@ApiModelProperty("单据类型")
|
||||
@Excel(name = "单据类型")
|
||||
private String documentType;
|
||||
|
||||
@ApiModelProperty("原始业务单号")
|
||||
@Excel(name = "原始业务单号")
|
||||
private String originalBusinessNum;
|
||||
|
||||
@ApiModelProperty("项目编码")
|
||||
@Excel(name = "项目编码")
|
||||
private String projectCode;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("合同编号")
|
||||
@Excel(name = "合同编号")
|
||||
private String contractNumber;
|
||||
|
||||
@ApiModelProperty("合同名称")
|
||||
@Excel(name = "合同名称")
|
||||
private String contractName;
|
||||
|
||||
@ApiModelProperty("账单金额")
|
||||
@Excel(name = "账单金额")
|
||||
private BigDecimal billAmount;
|
||||
|
||||
@ApiModelProperty("预计费金额")
|
||||
@Excel(name = "预计费金额")
|
||||
private BigDecimal estimatedCost;
|
||||
|
||||
@ApiModelProperty("一级费用科目code")
|
||||
@Excel(name = "一级费用科目code")
|
||||
private String firstSubjectCode;
|
||||
|
||||
@ApiModelProperty("一级费用科目")
|
||||
@Excel(name = "一级费用科目")
|
||||
private String firstSubjectName;
|
||||
|
||||
@ApiModelProperty("二级费用科目code")
|
||||
@Excel(name = "二级费用科目code")
|
||||
private String secondSubjectCode;
|
||||
|
||||
@ApiModelProperty("二级费用科目")
|
||||
@Excel(name = "二级费用科目")
|
||||
private String secondSubjectName;
|
||||
|
||||
@ApiModelProperty("结算对象id")
|
||||
@Excel(name = "结算对象id")
|
||||
private Long settlementCustomersId;
|
||||
|
||||
@ApiModelProperty("结算对象code")
|
||||
@Excel(name = "结算对象code")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("结算对象")
|
||||
@Excel(name = "结算对象")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("计费时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "计费时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date billingTime;
|
||||
|
||||
@ApiModelProperty("单据表单json数据")
|
||||
@Excel(name = "单据表单json数据")
|
||||
private String documentFormJson;
|
||||
|
||||
@ApiModelProperty("合同管理id")
|
||||
@Excel(name = "合同管理id", readConverterExp = "合同管理id")
|
||||
private Long contractManageId;
|
||||
|
||||
@ApiModelProperty("项目管理id")
|
||||
@Excel(name = "项目管理id", readConverterExp = "项目管理id")
|
||||
private Long projectManageId;
|
||||
|
||||
@ApiModelProperty("原始流水号")
|
||||
@Excel(name = "原始流水号")
|
||||
private String originalSerialNumber;
|
||||
|
||||
@ApiModelProperty("费用类型code(服务项)")
|
||||
@Excel(name = "费用类型code(服务项)")
|
||||
private String serviceItemsCode;
|
||||
|
||||
@ApiModelProperty("费用类型")
|
||||
@Excel(name = "费用类型")
|
||||
private String serviceItemsName;
|
||||
|
||||
@ApiModelProperty("费用类型id(服务项)")
|
||||
@Excel(name = "费用类型id(服务项)")
|
||||
private String serviceItemsManageId;
|
||||
|
||||
@ApiModelProperty("单据备注")
|
||||
@Excel(name = "单据备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("审核备注")
|
||||
@Excel(name = "审核备注")
|
||||
private String reviewRemarks;
|
||||
|
||||
@ApiModelProperty("结算方式(1-现金,2-油卡)")
|
||||
private Integer settlementWay;
|
||||
|
||||
@ApiModelProperty("重算金额")
|
||||
private BigDecimal recalculateCost;
|
||||
|
||||
@ApiModelProperty("重算失败原因")
|
||||
private String recalculateCostFailRemark;
|
||||
}
|
||||
+197
@@ -0,0 +1,197 @@
|
||||
package com.mhd.bms.domain.businessDocument.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
* 业务单据对象 business_document
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-21
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BusinessDocumentDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("业务单据记录id")
|
||||
private Long businessDocumentId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("业务流水")
|
||||
@Excel(name = "业务流水")
|
||||
private String businessFlow;
|
||||
|
||||
@ApiModelProperty("状态(1-未生效,2-已生效,3-已计费,4-已驳回,5-已作废")
|
||||
@Excel(name = "状态", readConverterExp = "状态(1-未生效,2-已生效,3-已计费,4-已驳回,5-已作废")
|
||||
private Integer businessState;
|
||||
|
||||
@ApiModelProperty("来源模块")
|
||||
@Excel(name = "来源模块")
|
||||
private String belongModule;
|
||||
|
||||
@ApiModelProperty("来源模块code")
|
||||
@Excel(name = "来源模块code")
|
||||
private String belongModuleCode;
|
||||
|
||||
@ApiModelProperty("数据来源(1-系统生成,2-手工录入)")
|
||||
@Excel(name = "数据来源", readConverterExp = "1=-系统生成,2-手工录入")
|
||||
private Integer dataSources;
|
||||
|
||||
@ApiModelProperty("单据类型id")
|
||||
@Excel(name = "单据类型id")
|
||||
private Long documentTypeId;
|
||||
|
||||
@ApiModelProperty("单据类型code")
|
||||
@Excel(name = "单据类型code")
|
||||
private String documentTypeCode;
|
||||
|
||||
@ApiModelProperty("单据类型")
|
||||
@Excel(name = "单据类型")
|
||||
private String documentType;
|
||||
|
||||
@ApiModelProperty("原始业务单号")
|
||||
@Excel(name = "原始业务单号")
|
||||
private String originalBusinessNum;
|
||||
|
||||
@ApiModelProperty("项目编码")
|
||||
@Excel(name = "项目编码")
|
||||
private String projectCode;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("合同编号")
|
||||
@Excel(name = "合同编号")
|
||||
private String contractNumber;
|
||||
|
||||
@ApiModelProperty("合同名称")
|
||||
@Excel(name = "合同名称")
|
||||
private String contractName;
|
||||
|
||||
@ApiModelProperty("账单金额")
|
||||
@Excel(name = "账单金额")
|
||||
private BigDecimal billAmount;
|
||||
|
||||
@ApiModelProperty("预计费金额")
|
||||
@Excel(name = "预计费金额")
|
||||
private BigDecimal estimatedCost;
|
||||
|
||||
@ApiModelProperty("一级费用科目code")
|
||||
@Excel(name = "一级费用科目code")
|
||||
private String firstSubjectCode;
|
||||
|
||||
@ApiModelProperty("一级费用科目")
|
||||
@Excel(name = "一级费用科目")
|
||||
private String firstSubjectName;
|
||||
|
||||
@ApiModelProperty("二级费用科目code")
|
||||
@Excel(name = "二级费用科目code")
|
||||
private String secondSubjectCode;
|
||||
|
||||
@ApiModelProperty("二级费用科目")
|
||||
@Excel(name = "二级费用科目")
|
||||
private String secondSubjectName;
|
||||
|
||||
@ApiModelProperty("结算对象id")
|
||||
@Excel(name = "结算对象id")
|
||||
private Long settlementCustomersId;
|
||||
|
||||
@ApiModelProperty("结算对象code")
|
||||
@Excel(name = "结算对象code")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("结算对象")
|
||||
@Excel(name = "结算对象")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("计费时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "计费时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date billingTime;
|
||||
|
||||
@ApiModelProperty("单据表单json数据")
|
||||
@Excel(name = "单据表单json数据")
|
||||
private String documentFormJson;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty(name = "创建时间查询条件开始日期")
|
||||
private String createTimeStart;
|
||||
@ApiModelProperty(name = "创建时间查询条件结束日期")
|
||||
private String createTimeEnd;
|
||||
@ApiModelProperty(name = "修改时间查询条件开始日期")
|
||||
private String updateTimeStart;
|
||||
@ApiModelProperty(name = "修改时间查询条件结束日期")
|
||||
private String updateTimeEnd;
|
||||
|
||||
@ApiModelProperty("业务单据记录ids")
|
||||
private String businessDocumentIds;
|
||||
|
||||
@ApiModelProperty("合同管理id")
|
||||
@Excel(name = "合同管理id", readConverterExp = "合同管理id")
|
||||
private Long contractManageId;
|
||||
|
||||
@ApiModelProperty("项目管理id")
|
||||
@Excel(name = "项目管理id", readConverterExp = "项目管理id")
|
||||
private Long projectManageId;
|
||||
|
||||
@ApiModelProperty("原始流水号")
|
||||
@Excel(name = "原始流水号")
|
||||
private String originalSerialNumber;
|
||||
|
||||
@ApiModelProperty("费用类型code(服务项)")
|
||||
@Excel(name = "费用类型code(服务项)")
|
||||
private String serviceItemsCode;
|
||||
|
||||
@ApiModelProperty("费用类型")
|
||||
@Excel(name = "费用类型")
|
||||
private String serviceItemsName;
|
||||
|
||||
@ApiModelProperty("费用类型id(服务项)")
|
||||
@Excel(name = "费用类型id(服务项)")
|
||||
private Long serviceItemsManageId;
|
||||
|
||||
@ApiModelProperty("单据备注")
|
||||
@Excel(name = "单据备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("审核备注")
|
||||
@Excel(name = "审核备注")
|
||||
private String reviewRemarks;
|
||||
|
||||
@ApiModelProperty("结算方式(1-现金,2-油卡)")
|
||||
private Integer settlementWay;
|
||||
|
||||
@ApiModelProperty(name = "业务单据记录id集合")
|
||||
private Set<String> businessDocumentIdSet;
|
||||
|
||||
@ApiModelProperty("结算主体id")
|
||||
private Long settlementEntityId;
|
||||
}
|
||||
+196
@@ -0,0 +1,196 @@
|
||||
package com.mhd.bms.domain.businessDocument.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.mhd.bms.domain.businessDocument.entity.BusinessDocument;
|
||||
import com.mhd.bms.domain.businessDocument.repository.facade.IBusinessDocumentService;
|
||||
import com.mhd.bms.domain.businessDocument.repository.po.BusinessDocumentPO;
|
||||
import com.mhd.bms.domain.businessDocument.repository.todo.BusinessDocumentDO;
|
||||
import com.mhd.bms.interfaces.dto.businessDocument.BusinessDocumentDTO;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
|
||||
import com.mhd.common.core.utils.StringUtils;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 业务单据
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-21
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class BusinessDocumentDomainService {
|
||||
|
||||
@Autowired
|
||||
private IBusinessDocumentService businessDocumentService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询业务单据列表
|
||||
*/
|
||||
public List<BusinessDocumentPO> queryList(BusinessDocumentDO businessDocumentDO) {
|
||||
return businessDocumentService.queryList(businessDocumentDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增业务单据
|
||||
*/
|
||||
public Boolean insert(BusinessDocumentDO businessDocumentDO) {
|
||||
|
||||
return businessDocumentService.insert(businessDocumentDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改业务单据
|
||||
*/
|
||||
public Boolean update(BusinessDocumentDO businessDocumentDO) {
|
||||
return businessDocumentService.update(businessDocumentDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除业务单据
|
||||
*/
|
||||
public Boolean delete(Long[] businessDocumentIds) {
|
||||
return businessDocumentService.delete(businessDocumentIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取业务单据详细信息
|
||||
*/
|
||||
public BusinessDocumentPO getInfo(Long businessDocumentId)
|
||||
{
|
||||
return businessDocumentService.getInfo(businessDocumentId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据id删除业务单据信息
|
||||
*/
|
||||
public Boolean deleteByIds(List<Long> businessDocumentIdLongList) {
|
||||
if(businessDocumentIdLongList != null && businessDocumentIdLongList.size() > 0){
|
||||
LambdaUpdateWrapper<BusinessDocument> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.set(BusinessDocument::getDelFlag,2);
|
||||
updateWrapper.in(BusinessDocument::getBusinessDocumentId,businessDocumentIdLongList);
|
||||
return businessDocumentService.update(updateWrapper);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id作废业务单据信息
|
||||
*/
|
||||
public Boolean nullifyByIds(List<Long> businessDocumentIdLongList) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
if(businessDocumentIdLongList != null && businessDocumentIdLongList.size() > 0){
|
||||
LambdaUpdateWrapper<BusinessDocument> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.set(BusinessDocument::getBusinessState,5);
|
||||
updateWrapper.set(BusinessDocument::getUpdateBy,loginUser.getUserPo().getUserId());
|
||||
updateWrapper.set(BusinessDocument::getUpdateTime,new Date());
|
||||
updateWrapper.set(BusinessDocument::getUpdateByName,loginUser.getUserPo().getUserName());
|
||||
updateWrapper.in(BusinessDocument::getBusinessDocumentId,businessDocumentIdLongList);
|
||||
return businessDocumentService.update(updateWrapper);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据id生效业务单据信息
|
||||
*/
|
||||
public Boolean takeEffectByIds(List<Long> businessDocumentIdLongList) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
if(businessDocumentIdLongList != null && businessDocumentIdLongList.size() > 0){
|
||||
LambdaUpdateWrapper<BusinessDocument> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.set(BusinessDocument::getBusinessState,2);
|
||||
updateWrapper.set(BusinessDocument::getUpdateBy,loginUser.getUserPo().getUserId());
|
||||
updateWrapper.set(BusinessDocument::getUpdateTime,new Date());
|
||||
updateWrapper.set(BusinessDocument::getUpdateByName,loginUser.getUserPo().getUserName());
|
||||
updateWrapper.in(BusinessDocument::getBusinessDocumentId,businessDocumentIdLongList);
|
||||
return businessDocumentService.update(updateWrapper);
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核业务单据
|
||||
*/
|
||||
public Boolean auditByIds(List<Long> businessDocumentIdLongList, BusinessDocumentDTO businessDocumentDTO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
if(businessDocumentIdLongList != null && businessDocumentIdLongList.size() > 0){
|
||||
LambdaUpdateWrapper<BusinessDocument> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
if(businessDocumentDTO.getAuditOperation() == 1){
|
||||
//同意
|
||||
updateWrapper.set(BusinessDocument::getBusinessState,3);
|
||||
}else {
|
||||
//驳回
|
||||
updateWrapper.set(BusinessDocument::getBusinessState,4);
|
||||
}
|
||||
updateWrapper.set(BusinessDocument::getReviewRemarks,businessDocumentDTO.getReviewRemarks());
|
||||
updateWrapper.set(BusinessDocument::getUpdateBy,loginUser.getUserPo().getUserId());
|
||||
updateWrapper.set(BusinessDocument::getUpdateTime,new Date());
|
||||
updateWrapper.set(BusinessDocument::getUpdateByName,loginUser.getUserPo().getUserName());
|
||||
updateWrapper.in(BusinessDocument::getBusinessDocumentId,businessDocumentIdLongList);
|
||||
return businessDocumentService.update(updateWrapper);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Boolean saveBatch(List<BusinessDocument> businessDocumentList) {
|
||||
if(null != businessDocumentList && businessDocumentList.size() > 0){
|
||||
return businessDocumentService.saveBatch(businessDocumentList);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据原始业务单号和科目编码查询
|
||||
*/
|
||||
public BusinessDocumentPO queryByOriginalBusinessNumAndSubjectCode(BusinessDocumentDO businessDocumentDO) {
|
||||
if(StringUtils.isNotEmpty(businessDocumentDO.getOriginalBusinessNum())){
|
||||
throw new ServiceException("原始单号不能为空");
|
||||
}
|
||||
if(StringUtils.isNotEmpty(businessDocumentDO.getSecondSubjectCode())){
|
||||
throw new ServiceException("费用科目不能为空");
|
||||
}
|
||||
return businessDocumentService.queryByOriginalBusinessNumAndSubjectCode(businessDocumentDO.getOriginalBusinessNum(),businessDocumentDO.getSecondSubjectCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或修改业务单据
|
||||
* @param businessDocumentDO
|
||||
*/
|
||||
public Boolean saveOrUpdate(BusinessDocumentDO businessDocumentDO) {
|
||||
BusinessDocument businessDocument = new BusinessDocument();
|
||||
BeanUtils.copyProperties(businessDocumentDO,businessDocument);
|
||||
return businessDocumentService.saveOrUpdate(businessDocument);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量保存业务单据
|
||||
* @param businessDocumentList
|
||||
* @return
|
||||
*/
|
||||
public Boolean saveOrUpdateBatch(List<BusinessDocument> businessDocumentList) {
|
||||
return businessDocumentService.saveOrUpdateBatch(businessDocumentList);
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.mhd.bms.domain.conditionalMapping.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 条件映射管理对象 conditional_mapping
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-08-07
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ConditionalMapping extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("条件映射表id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long conditionalMappingId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("源内容")
|
||||
@Excel(name = "源内容")
|
||||
private String sourceContent;
|
||||
|
||||
@ApiModelProperty("映射后")
|
||||
@Excel(name = "映射后")
|
||||
private String afterMapping;
|
||||
|
||||
@ApiModelProperty("映射类型(1-关键字,2-条件,3-结果)")
|
||||
@Excel(name = "映射类型", readConverterExp = "1=-关键字,2-条件,3-结果")
|
||||
private Integer mappingType;
|
||||
|
||||
@ApiModelProperty("映射语句")
|
||||
@Excel(name = "映射语句")
|
||||
private String mappedStatement;
|
||||
|
||||
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.mhd.bms.domain.conditionalMapping.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.conditionalMapping.entity.ConditionalMapping;
|
||||
import com.mhd.bms.domain.conditionalMapping.repository.po.ConditionalMappingPO;
|
||||
import com.mhd.bms.domain.conditionalMapping.repository.todo.ConditionalMappingDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 条件映射管理Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-08-07
|
||||
*/
|
||||
public interface IConditionalMappingService extends IService<ConditionalMapping>
|
||||
{
|
||||
/**
|
||||
* 分页查询条件映射管理列表
|
||||
*/
|
||||
public List<ConditionalMappingPO> queryList(ConditionalMappingDO conditionalMappingDO);
|
||||
|
||||
/**
|
||||
* 新增条件映射管理
|
||||
*/
|
||||
public Boolean insert(ConditionalMappingDO conditionalMappingDO);
|
||||
|
||||
/**
|
||||
* 修改条件映射管理
|
||||
*/
|
||||
public Boolean update(ConditionalMappingDO conditionalMappingDO);
|
||||
|
||||
/**
|
||||
* 批量删除条件映射管理
|
||||
*/
|
||||
public Boolean delete(Long[] conditionalMappingIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询条件映射管理
|
||||
*/
|
||||
public ConditionalMappingPO getInfo(Long conditionalMappingId);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.mhd.bms.domain.conditionalMapping.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.conditionalMapping.entity.ConditionalMapping;
|
||||
import com.mhd.bms.domain.conditionalMapping.repository.po.ConditionalMappingPO;
|
||||
import com.mhd.bms.domain.conditionalMapping.repository.todo.ConditionalMappingDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 条件映射管理Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-08-07
|
||||
*/
|
||||
public interface ConditionalMappingMapper extends BaseMapper<ConditionalMapping>
|
||||
{
|
||||
/**
|
||||
* 查询条件映射管理列表
|
||||
*/
|
||||
public List<ConditionalMappingPO> queryList(@Param("conditionalMappingDO") ConditionalMappingDO conditionalMappingDO);
|
||||
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.mhd.bms.domain.conditionalMapping.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.conditionalMapping.entity.ConditionalMapping;
|
||||
import com.mhd.bms.domain.conditionalMapping.repository.facade.IConditionalMappingService;
|
||||
import com.mhd.bms.domain.conditionalMapping.repository.mapper.ConditionalMappingMapper;
|
||||
import com.mhd.bms.domain.conditionalMapping.repository.po.ConditionalMappingPO;
|
||||
import com.mhd.bms.domain.conditionalMapping.repository.todo.ConditionalMappingDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 条件映射管理Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-08-07
|
||||
*/
|
||||
@Service
|
||||
public class ConditionalMappingImpl extends ServiceImpl<ConditionalMappingMapper, ConditionalMapping> implements IConditionalMappingService{
|
||||
@Autowired
|
||||
private ConditionalMappingMapper conditionalMappingMapper;
|
||||
|
||||
/**
|
||||
* 查询条件映射管理列表
|
||||
*/
|
||||
@Override
|
||||
public List<ConditionalMappingPO> queryList(ConditionalMappingDO conditionalMappingDO)
|
||||
{
|
||||
return conditionalMappingMapper.queryList(conditionalMappingDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增条件映射管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(ConditionalMappingDO conditionalMappingDO) {
|
||||
ConditionalMapping conditionalMapping = new ConditionalMapping();
|
||||
BeanUtils.copyProperties(conditionalMappingDO,conditionalMapping);
|
||||
return this.save(conditionalMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改条件映射管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(ConditionalMappingDO conditionalMappingDO) {
|
||||
ConditionalMapping conditionalMapping = new ConditionalMapping();
|
||||
BeanUtils.copyProperties(conditionalMappingDO,conditionalMapping);
|
||||
return this.updateById(conditionalMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除条件映射管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] conditionalMappingIds ) {
|
||||
List<ConditionalMapping> list = new ArrayList<>();
|
||||
for (Long id : conditionalMappingIds) {
|
||||
ConditionalMapping conditionalMapping = new ConditionalMapping();
|
||||
conditionalMapping.setConditionalMappingId(id);
|
||||
conditionalMapping.setDelFlag(2);
|
||||
list.add(conditionalMapping);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改条件映射管理
|
||||
*/
|
||||
@Override
|
||||
public ConditionalMappingPO getInfo(Long conditionalMappingId) {
|
||||
ConditionalMapping conditionalMapping = this.getById(conditionalMappingId);
|
||||
ConditionalMappingPO conditionalMappingPO = new ConditionalMappingPO();
|
||||
BeanUtils.copyProperties(conditionalMapping,conditionalMappingPO);
|
||||
return conditionalMappingPO;
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.mhd.bms.domain.conditionalMapping.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 条件映射管理对象 conditional_mapping
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-08-07
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "条件映射管理对象", description = "条件映射管理响应对象")
|
||||
public class ConditionalMappingPO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("条件映射表id")
|
||||
private Long conditionalMappingId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("源内容")
|
||||
@Excel(name = "源内容")
|
||||
private String sourceContent;
|
||||
|
||||
@ApiModelProperty("映射后")
|
||||
@Excel(name = "映射后")
|
||||
private String afterMapping;
|
||||
|
||||
@ApiModelProperty("映射类型(1-关键字,2-条件,3-结果)")
|
||||
@Excel(name = "映射类型", readConverterExp = "1=-关键字,2-条件,3-结果")
|
||||
private Integer mappingType;
|
||||
|
||||
@ApiModelProperty("映射语句")
|
||||
@Excel(name = "映射语句")
|
||||
private String mappedStatement;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.mhd.bms.domain.conditionalMapping.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 条件映射管理对象 conditional_mapping
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-08-07
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ConditionalMappingDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("条件映射表id")
|
||||
private Long conditionalMappingId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("源内容")
|
||||
@Excel(name = "源内容")
|
||||
private String sourceContent;
|
||||
|
||||
@ApiModelProperty("映射后")
|
||||
@Excel(name = "映射后")
|
||||
private String afterMapping;
|
||||
|
||||
@ApiModelProperty("映射类型(1-关键字,2-条件,3-结果)")
|
||||
@Excel(name = "映射类型", readConverterExp = "1=-关键字,2-条件,3-结果")
|
||||
private Integer mappingType;
|
||||
|
||||
@ApiModelProperty("映射语句")
|
||||
@Excel(name = "映射语句")
|
||||
private String mappedStatement;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package com.mhd.bms.domain.conditionalMapping.service;
|
||||
|
||||
import com.mhd.bms.domain.conditionalMapping.repository.facade.IConditionalMappingService;
|
||||
import com.mhd.bms.domain.conditionalMapping.repository.po.ConditionalMappingPO;
|
||||
import com.mhd.bms.domain.conditionalMapping.repository.todo.ConditionalMappingDO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 条件映射管理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-08-07
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ConditionalMappingDomainService {
|
||||
|
||||
@Autowired
|
||||
private IConditionalMappingService conditionalMappingService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询条件映射管理列表
|
||||
*/
|
||||
public List<ConditionalMappingPO> queryList(ConditionalMappingDO conditionalMappingDO) {
|
||||
return conditionalMappingService.queryList(conditionalMappingDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增条件映射管理
|
||||
*/
|
||||
public Boolean insert(ConditionalMappingDO conditionalMappingDO) {
|
||||
|
||||
return conditionalMappingService.insert(conditionalMappingDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改条件映射管理
|
||||
*/
|
||||
public Boolean update(ConditionalMappingDO conditionalMappingDO) {
|
||||
return conditionalMappingService.update(conditionalMappingDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除条件映射管理
|
||||
*/
|
||||
public Boolean delete(Long[] conditionalMappingIds) {
|
||||
return conditionalMappingService.delete(conditionalMappingIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取条件映射管理详细信息
|
||||
*/
|
||||
public ConditionalMappingPO getInfo(Long conditionalMappingId)
|
||||
{
|
||||
return conditionalMappingService.getInfo(conditionalMappingId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.mhd.bms.domain.costCalculation.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 计费参数输出json实体
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillingOutputEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("输出字段")
|
||||
private String outFields;
|
||||
|
||||
@ApiModelProperty("输出计费标识 P1 、P2等")
|
||||
private String outChargingId;
|
||||
|
||||
@ApiModelProperty("字段类型(1-整数,2-浮点数,3-时间)")
|
||||
private Integer fieldsType;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.mhd.bms.domain.costCalculation.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* 计费参数json实体
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillingParamsEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("字段名称")
|
||||
private String fields;
|
||||
|
||||
@ApiModelProperty("计费标识P1、P2")
|
||||
private String chargingId;
|
||||
|
||||
@ApiModelProperty("阶梯类型(1-固定参数,2-无阶梯,3-到达阶梯,4-累进阶梯)")
|
||||
private Integer ladderType;
|
||||
|
||||
@ApiModelProperty("1-左开右闭,2-左闭右开")
|
||||
private Integer ladderRule;
|
||||
|
||||
@ApiModelProperty("阶梯值")
|
||||
private String ladderNum;
|
||||
|
||||
@ApiModelProperty("标志值")
|
||||
private String flagValue;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.mhd.bms.domain.costCalculation.po;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* 计费结果返回实体
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class BillingCostPo {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("原始单号")
|
||||
private String originalBusinessNum;
|
||||
|
||||
@ApiModelProperty("单据类型编码")
|
||||
private String documentTypeCode;
|
||||
|
||||
@ApiModelProperty("费用科目(一级或二级)")
|
||||
private String subjectCode;
|
||||
|
||||
@ApiModelProperty("合同编号")
|
||||
private String contractNumber;
|
||||
|
||||
@ApiModelProperty("预计金额")
|
||||
private BigDecimal computationalCost;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.mhd.bms.domain.documentType.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 单据类型表单json实体
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class DocumentFromEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("字段名称")
|
||||
private String field;
|
||||
|
||||
@ApiModelProperty("字段描述")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty("是否显示 :1是 2否")
|
||||
private Integer disabled;
|
||||
|
||||
@ApiModelProperty("是否必填:1是 2否")
|
||||
private Integer notNull;
|
||||
|
||||
@ApiModelProperty("数据类型 下拉框,日期,日期时间,数字,文本")
|
||||
private String type;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.mhd.bms.domain.documentType.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 单据类型对象 document_type
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class DocumentType extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("单据类型id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long documentTypeId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("类型名称")
|
||||
@Excel(name = "类型名称")
|
||||
private String documentType;
|
||||
|
||||
@ApiModelProperty("类型编码")
|
||||
@Excel(name = "类型编码")
|
||||
private String documentTypeCode;
|
||||
|
||||
@ApiModelProperty("对接系统编码")
|
||||
@Excel(name = "对接系统编码")
|
||||
private String belongModuleCode;
|
||||
|
||||
@ApiModelProperty("对接系统")
|
||||
@Excel(name = "对接系统")
|
||||
private String belongModule;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("参数json数组")
|
||||
@Excel(name = "参数json数组")
|
||||
private String formJson;
|
||||
|
||||
@ApiModelProperty("启用状态(1-启用,2-关闭)")
|
||||
@Excel(name = "启用状态", readConverterExp = "1=-启用,2-关闭")
|
||||
private Integer enablingStatus;
|
||||
|
||||
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.mhd.bms.domain.documentType.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.documentType.entity.DocumentType;
|
||||
import com.mhd.bms.domain.documentType.repository.po.DocumentTypePO;
|
||||
import com.mhd.bms.domain.documentType.repository.todo.DocumentTypeDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单据类型Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
public interface IDocumentTypeService extends IService<DocumentType>
|
||||
{
|
||||
/**
|
||||
* 分页查询单据类型列表
|
||||
*/
|
||||
public List<DocumentTypePO> queryList(DocumentTypeDO documentTypeDO);
|
||||
|
||||
/**
|
||||
* 新增单据类型
|
||||
*/
|
||||
public Boolean insert(DocumentTypeDO documentTypeDO);
|
||||
|
||||
/**
|
||||
* 修改单据类型
|
||||
*/
|
||||
public Boolean update(DocumentTypeDO documentTypeDO);
|
||||
|
||||
/**
|
||||
* 批量删除单据类型
|
||||
*/
|
||||
public Boolean delete(Long[] documentTypeIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询单据类型
|
||||
*/
|
||||
public DocumentTypePO getInfo(Long documentTypeId);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.mhd.bms.domain.documentType.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.documentType.entity.DocumentType;
|
||||
import com.mhd.bms.domain.documentType.repository.po.DocumentTypePO;
|
||||
import com.mhd.bms.domain.documentType.repository.todo.DocumentTypeDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 单据类型Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
public interface DocumentTypeMapper extends BaseMapper<DocumentType>
|
||||
{
|
||||
/**
|
||||
* 查询单据类型列表
|
||||
*/
|
||||
public List<DocumentTypePO> queryList(@Param("documentTypeDO") DocumentTypeDO documentTypeDO);
|
||||
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.mhd.bms.domain.documentType.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.documentType.entity.DocumentType;
|
||||
import com.mhd.bms.domain.documentType.repository.facade.IDocumentTypeService;
|
||||
import com.mhd.bms.domain.documentType.repository.mapper.DocumentTypeMapper;
|
||||
import com.mhd.bms.domain.documentType.repository.po.DocumentTypePO;
|
||||
import com.mhd.bms.domain.documentType.repository.todo.DocumentTypeDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 单据类型Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
@Service
|
||||
public class DocumentTypeImpl extends ServiceImpl<DocumentTypeMapper, DocumentType> implements IDocumentTypeService{
|
||||
@Autowired
|
||||
private DocumentTypeMapper documentTypeMapper;
|
||||
|
||||
/**
|
||||
* 查询单据类型列表
|
||||
*/
|
||||
@Override
|
||||
public List<DocumentTypePO> queryList(DocumentTypeDO documentTypeDO)
|
||||
{
|
||||
return documentTypeMapper.queryList(documentTypeDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增单据类型
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(DocumentTypeDO documentTypeDO) {
|
||||
DocumentType documentType = new DocumentType();
|
||||
BeanUtils.copyProperties(documentTypeDO,documentType);
|
||||
return this.save(documentType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改单据类型
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(DocumentTypeDO documentTypeDO) {
|
||||
DocumentType documentType = new DocumentType();
|
||||
BeanUtils.copyProperties(documentTypeDO,documentType);
|
||||
return this.updateById(documentType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除单据类型
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] documentTypeIds ) {
|
||||
List<DocumentType> list = new ArrayList<>();
|
||||
for (Long id : documentTypeIds) {
|
||||
DocumentType documentType = new DocumentType();
|
||||
documentType.setDocumentTypeId(id);
|
||||
documentType.setDelFlag(2);
|
||||
list.add(documentType);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改单据类型
|
||||
*/
|
||||
@Override
|
||||
public DocumentTypePO getInfo(Long documentTypeId) {
|
||||
DocumentType documentType = this.getById(documentTypeId);
|
||||
DocumentTypePO documentTypePO = new DocumentTypePO();
|
||||
BeanUtils.copyProperties(documentType,documentTypePO);
|
||||
return documentTypePO;
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
package com.mhd.bms.domain.documentType.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 单据类型对象 document_type
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "单据类型对象", description = "单据类型响应对象")
|
||||
public class DocumentTypePO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("单据类型id")
|
||||
private Long documentTypeId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("类型名称")
|
||||
@Excel(name = "类型名称")
|
||||
private String documentType;
|
||||
|
||||
@ApiModelProperty("类型编码")
|
||||
@Excel(name = "类型编码")
|
||||
private String documentTypeCode;
|
||||
|
||||
@ApiModelProperty("对接系统编码")
|
||||
@Excel(name = "对接系统编码")
|
||||
private String belongModuleCode;
|
||||
|
||||
@ApiModelProperty("对接系统")
|
||||
@Excel(name = "对接系统")
|
||||
private String belongModule;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("参数json数组")
|
||||
@Excel(name = "参数json数组")
|
||||
private String formJson;
|
||||
|
||||
@ApiModelProperty("启用状态(1-启用,2-关闭)")
|
||||
@Excel(name = "启用状态", readConverterExp = "1=-启用,2-关闭")
|
||||
private Integer enablingStatus;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package com.mhd.bms.domain.documentType.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
/**
|
||||
* 单据类型对象 document_type
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class DocumentTypeDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("单据类型id")
|
||||
private Long documentTypeId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("类型名称")
|
||||
@Excel(name = "类型名称")
|
||||
private String documentType;
|
||||
|
||||
@ApiModelProperty("类型编码")
|
||||
@Excel(name = "类型编码")
|
||||
private String documentTypeCode;
|
||||
|
||||
@ApiModelProperty("对接系统编码")
|
||||
@Excel(name = "对接系统编码")
|
||||
private String belongModuleCode;
|
||||
|
||||
@ApiModelProperty("对接系统")
|
||||
@Excel(name = "对接系统")
|
||||
private String belongModule;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("参数json数组")
|
||||
@Excel(name = "参数json数组")
|
||||
private String formJson;
|
||||
|
||||
@ApiModelProperty("启用状态(1-启用,2-关闭)")
|
||||
@Excel(name = "启用状态", readConverterExp = "1=-启用,2-关闭")
|
||||
private Integer enablingStatus;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "单据Code集合")
|
||||
private Set<String> documentTypeCodeSet;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty(name = "创建时间查询条件开始日期")
|
||||
private String createTimeStart;
|
||||
@ApiModelProperty(name = "创建时间查询条件结束日期")
|
||||
private String createTimeEnd;
|
||||
|
||||
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
package com.mhd.bms.domain.documentType.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.bms.domain.documentType.entity.DocumentType;
|
||||
import com.mhd.bms.domain.documentType.repository.facade.IDocumentTypeService;
|
||||
import com.mhd.bms.domain.documentType.repository.po.DocumentTypePO;
|
||||
import com.mhd.bms.domain.documentType.repository.todo.DocumentTypeDO;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 单据类型
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-18
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DocumentTypeDomainService {
|
||||
|
||||
@Autowired
|
||||
private IDocumentTypeService documentTypeService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询单据类型列表
|
||||
*/
|
||||
public List<DocumentTypePO> queryList(DocumentTypeDO documentTypeDO) {
|
||||
return documentTypeService.queryList(documentTypeDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增单据类型
|
||||
*/
|
||||
public Boolean insert(DocumentTypeDO documentTypeDO) {
|
||||
|
||||
return documentTypeService.insert(documentTypeDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改单据类型
|
||||
*/
|
||||
public Boolean update(DocumentTypeDO documentTypeDO) {
|
||||
return documentTypeService.update(documentTypeDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除单据类型
|
||||
*/
|
||||
public Boolean delete(Long[] documentTypeIds) {
|
||||
return documentTypeService.delete(documentTypeIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单据类型详细信息
|
||||
*/
|
||||
public DocumentTypePO getInfo(Long documentTypeId)
|
||||
{
|
||||
return documentTypeService.getInfo(documentTypeId);
|
||||
}
|
||||
|
||||
|
||||
public DocumentType queryByCode(String documentTypeCode) {
|
||||
LambdaQueryWrapper<DocumentType> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(DocumentType::getDocumentTypeCode, documentTypeCode);
|
||||
queryWrapper.eq(DocumentType::getTopOrganizationId, SecurityUtils.getLoginUser().getUserPo().getTopOrganizationId());
|
||||
queryWrapper.eq(DocumentType::getDelFlag ,1);
|
||||
return documentTypeService.getOne(queryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.mhd.bms.domain.mappingMethod.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 方法映射对象 mapping_method
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class MappingMethod extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("方法映射表id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long mappingMethodId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("方法名称")
|
||||
@Excel(name = "方法名称")
|
||||
private String methodName;
|
||||
|
||||
@ApiModelProperty("映射方法")
|
||||
@Excel(name = "映射方法")
|
||||
private String mappingMethod;
|
||||
|
||||
@ApiModelProperty("类型(1-内置方法,2-逻辑语句)")
|
||||
@Excel(name = "类型", readConverterExp = "1=-内置方法,2-逻辑语句")
|
||||
private Integer mappingType;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.mhd.bms.domain.mappingMethod.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.mappingMethod.entity.MappingMethod;
|
||||
import com.mhd.bms.domain.mappingMethod.repository.po.MappingMethodPO;
|
||||
import com.mhd.bms.domain.mappingMethod.repository.todo.MappingMethodDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 方法映射Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
public interface IMappingMethodService extends IService<MappingMethod>
|
||||
{
|
||||
/**
|
||||
* 分页查询方法映射列表
|
||||
*/
|
||||
public List<MappingMethodPO> queryList(MappingMethodDO mappingMethodDO);
|
||||
|
||||
/**
|
||||
* 新增方法映射
|
||||
*/
|
||||
public Boolean insert(MappingMethodDO mappingMethodDO);
|
||||
|
||||
/**
|
||||
* 修改方法映射
|
||||
*/
|
||||
public Boolean update(MappingMethodDO mappingMethodDO);
|
||||
|
||||
/**
|
||||
* 批量删除方法映射
|
||||
*/
|
||||
public Boolean delete(Long[] mappingMethodIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询方法映射
|
||||
*/
|
||||
public MappingMethodPO getInfo(Long mappingMethodId);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.mhd.bms.domain.mappingMethod.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.mappingMethod.entity.MappingMethod;
|
||||
import com.mhd.bms.domain.mappingMethod.repository.po.MappingMethodPO;
|
||||
import com.mhd.bms.domain.mappingMethod.repository.todo.MappingMethodDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 方法映射Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
public interface MappingMethodMapper extends BaseMapper<MappingMethod>
|
||||
{
|
||||
/**
|
||||
* 查询方法映射列表
|
||||
*/
|
||||
public List<MappingMethodPO> queryList(@Param("mappingMethodDO") MappingMethodDO mappingMethodDO);
|
||||
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.mhd.bms.domain.mappingMethod.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.mappingMethod.entity.MappingMethod;
|
||||
import com.mhd.bms.domain.mappingMethod.repository.facade.IMappingMethodService;
|
||||
import com.mhd.bms.domain.mappingMethod.repository.mapper.MappingMethodMapper;
|
||||
import com.mhd.bms.domain.mappingMethod.repository.po.MappingMethodPO;
|
||||
import com.mhd.bms.domain.mappingMethod.repository.todo.MappingMethodDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 方法映射Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
@Service
|
||||
public class MappingMethodImpl extends ServiceImpl<MappingMethodMapper, MappingMethod> implements IMappingMethodService{
|
||||
@Autowired
|
||||
private MappingMethodMapper mappingMethodMapper;
|
||||
|
||||
/**
|
||||
* 查询方法映射列表
|
||||
*/
|
||||
@Override
|
||||
public List<MappingMethodPO> queryList(MappingMethodDO mappingMethodDO)
|
||||
{
|
||||
return mappingMethodMapper.queryList(mappingMethodDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增方法映射
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(MappingMethodDO mappingMethodDO) {
|
||||
MappingMethod mappingMethod = new MappingMethod();
|
||||
BeanUtils.copyProperties(mappingMethodDO,mappingMethod);
|
||||
return this.save(mappingMethod);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改方法映射
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(MappingMethodDO mappingMethodDO) {
|
||||
MappingMethod mappingMethod = new MappingMethod();
|
||||
BeanUtils.copyProperties(mappingMethodDO,mappingMethod);
|
||||
return this.updateById(mappingMethod);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除方法映射
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] mappingMethodIds ) {
|
||||
List<MappingMethod> list = new ArrayList<>();
|
||||
for (Long id : mappingMethodIds) {
|
||||
MappingMethod mappingMethod = new MappingMethod();
|
||||
mappingMethod.setMappingMethodId(id);
|
||||
mappingMethod.setDelFlag(2);
|
||||
list.add(mappingMethod);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改方法映射
|
||||
*/
|
||||
@Override
|
||||
public MappingMethodPO getInfo(Long mappingMethodId) {
|
||||
MappingMethod mappingMethod = this.getById(mappingMethodId);
|
||||
MappingMethodPO mappingMethodPO = new MappingMethodPO();
|
||||
BeanUtils.copyProperties(mappingMethod,mappingMethodPO);
|
||||
return mappingMethodPO;
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.mhd.bms.domain.mappingMethod.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 方法映射对象 mapping_method
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "方法映射对象", description = "方法映射响应对象")
|
||||
public class MappingMethodPO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("方法映射表id")
|
||||
private Long mappingMethodId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("方法名称")
|
||||
@Excel(name = "方法名称")
|
||||
private String methodName;
|
||||
|
||||
@ApiModelProperty("映射方法")
|
||||
@Excel(name = "映射方法")
|
||||
private String mappingMethod;
|
||||
|
||||
@ApiModelProperty("类型(1-内置方法,2-逻辑语句)")
|
||||
@Excel(name = "类型", readConverterExp = "1=-内置方法,2-逻辑语句")
|
||||
private Integer mappingType;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package com.mhd.bms.domain.mappingMethod.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 方法映射对象 mapping_method
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class MappingMethodDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("方法映射表id")
|
||||
private Long mappingMethodId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("方法名称")
|
||||
@Excel(name = "方法名称")
|
||||
private String methodName;
|
||||
|
||||
@ApiModelProperty("映射方法")
|
||||
@Excel(name = "映射方法")
|
||||
private String mappingMethod;
|
||||
|
||||
@ApiModelProperty("类型(1-内置方法,2-逻辑语句)")
|
||||
@Excel(name = "类型", readConverterExp = "1=-内置方法,2-逻辑语句")
|
||||
private Integer mappingType;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty("方法映射表ids")
|
||||
private String mappingMethodIds;
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package com.mhd.bms.domain.mappingMethod.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.mhd.bms.domain.mappingMethod.repository.facade.IMappingMethodService;
|
||||
import com.mhd.bms.domain.mappingMethod.repository.po.MappingMethodPO;
|
||||
import com.mhd.bms.domain.mappingMethod.repository.todo.MappingMethodDO;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 方法映射
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-12
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class MappingMethodDomainService {
|
||||
|
||||
@Autowired
|
||||
private IMappingMethodService mappingMethodService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询方法映射列表
|
||||
*/
|
||||
public List<MappingMethodPO> queryList(MappingMethodDO mappingMethodDO) {
|
||||
return mappingMethodService.queryList(mappingMethodDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增方法映射
|
||||
*/
|
||||
public Boolean insert(MappingMethodDO mappingMethodDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
mappingMethodDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
mappingMethodDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
mappingMethodDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
return mappingMethodService.insert(mappingMethodDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改方法映射
|
||||
*/
|
||||
public Boolean update(MappingMethodDO mappingMethodDO) {
|
||||
return mappingMethodService.update(mappingMethodDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除方法映射
|
||||
*/
|
||||
public Boolean delete(Long[] mappingMethodIds) {
|
||||
return mappingMethodService.delete(mappingMethodIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取方法映射详细信息
|
||||
*/
|
||||
public MappingMethodPO getInfo(Long mappingMethodId)
|
||||
{
|
||||
return mappingMethodService.getInfo(mappingMethodId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.mhd.bms.domain.paymentManage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 支付管理对象 payment_manage
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PaymentManage extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("支付管理id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long paymentManageId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("支付方式编码")
|
||||
@Excel(name = "支付方式编码")
|
||||
private String paymentMethodCode;
|
||||
|
||||
@ApiModelProperty("支付方式名称")
|
||||
@Excel(name = "支付方式名称")
|
||||
private String paymentMethod;
|
||||
|
||||
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.mhd.bms.domain.paymentManage.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.paymentManage.entity.PaymentManage;
|
||||
import com.mhd.bms.domain.paymentManage.repository.po.PaymentManagePO;
|
||||
import com.mhd.bms.domain.paymentManage.repository.todo.PaymentManageDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 支付管理Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
public interface IPaymentManageService extends IService<PaymentManage>
|
||||
{
|
||||
/**
|
||||
* 分页查询支付管理列表
|
||||
*/
|
||||
public List<PaymentManagePO> queryList(PaymentManageDO paymentManageDO);
|
||||
|
||||
/**
|
||||
* 新增支付管理
|
||||
*/
|
||||
public Boolean insert(PaymentManageDO paymentManageDO);
|
||||
|
||||
/**
|
||||
* 修改支付管理
|
||||
*/
|
||||
public Boolean update(PaymentManageDO paymentManageDO);
|
||||
|
||||
/**
|
||||
* 批量删除支付管理
|
||||
*/
|
||||
public Boolean delete(Long[] paymentManageIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询支付管理
|
||||
*/
|
||||
public PaymentManagePO getInfo(Long paymentManageId);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.mhd.bms.domain.paymentManage.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.paymentManage.entity.PaymentManage;
|
||||
import com.mhd.bms.domain.paymentManage.repository.po.PaymentManagePO;
|
||||
import com.mhd.bms.domain.paymentManage.repository.todo.PaymentManageDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 支付管理Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
public interface PaymentManageMapper extends BaseMapper<PaymentManage>
|
||||
{
|
||||
/**
|
||||
* 查询支付管理列表
|
||||
*/
|
||||
public List<PaymentManagePO> queryList(PaymentManageDO paymentManageDO);
|
||||
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.mhd.bms.domain.paymentManage.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.paymentManage.entity.PaymentManage;
|
||||
import com.mhd.bms.domain.paymentManage.repository.facade.IPaymentManageService;
|
||||
import com.mhd.bms.domain.paymentManage.repository.mapper.PaymentManageMapper;
|
||||
import com.mhd.bms.domain.paymentManage.repository.po.PaymentManagePO;
|
||||
import com.mhd.bms.domain.paymentManage.repository.todo.PaymentManageDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 支付管理Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
@Service
|
||||
public class PaymentManageImpl extends ServiceImpl<PaymentManageMapper, PaymentManage> implements IPaymentManageService{
|
||||
@Autowired
|
||||
private PaymentManageMapper paymentManageMapper;
|
||||
|
||||
/**
|
||||
* 查询支付管理列表
|
||||
*/
|
||||
@Override
|
||||
public List<PaymentManagePO> queryList(PaymentManageDO paymentManageDO)
|
||||
{
|
||||
return paymentManageMapper.queryList(paymentManageDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增支付管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(PaymentManageDO paymentManageDO) {
|
||||
PaymentManage paymentManage = new PaymentManage();
|
||||
BeanUtils.copyProperties(paymentManageDO,paymentManage);
|
||||
return this.save(paymentManage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改支付管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(PaymentManageDO paymentManageDO) {
|
||||
PaymentManage paymentManage = new PaymentManage();
|
||||
BeanUtils.copyProperties(paymentManageDO,paymentManage);
|
||||
return this.updateById(paymentManage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除支付管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] paymentManageIds ) {
|
||||
List<PaymentManage> list = new ArrayList<>();
|
||||
for (Long id : paymentManageIds) {
|
||||
PaymentManage paymentManage = new PaymentManage();
|
||||
paymentManage.setPaymentManageId(id);
|
||||
paymentManage.setDelFlag(2);
|
||||
list.add(paymentManage);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改支付管理
|
||||
*/
|
||||
@Override
|
||||
public PaymentManagePO getInfo(Long paymentManageId) {
|
||||
PaymentManage paymentManage = this.getById(paymentManageId);
|
||||
PaymentManagePO paymentManagePO = new PaymentManagePO();
|
||||
BeanUtils.copyProperties(paymentManage,paymentManagePO);
|
||||
return paymentManagePO;
|
||||
}
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.mhd.bms.domain.paymentManage.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 支付管理对象 payment_manage
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "支付管理对象", description = "支付管理响应对象")
|
||||
public class PaymentManagePO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("支付管理id")
|
||||
private Long paymentManageId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("支付方式编码")
|
||||
@Excel(name = "支付方式编码")
|
||||
private String paymentMethodCode;
|
||||
|
||||
@ApiModelProperty("支付方式名称")
|
||||
@Excel(name = "支付方式名称")
|
||||
private String paymentMethod;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package com.mhd.bms.domain.paymentManage.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 支付管理对象 payment_manage
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PaymentManageDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("支付管理id")
|
||||
private Long paymentManageId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("支付方式编码")
|
||||
@Excel(name = "支付方式编码")
|
||||
private String paymentMethodCode;
|
||||
|
||||
@ApiModelProperty("支付方式名称")
|
||||
@Excel(name = "支付方式名称")
|
||||
private String paymentMethod;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.mhd.bms.domain.paymentManage.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.bms.domain.paymentManage.entity.PaymentManage;
|
||||
import com.mhd.bms.domain.paymentManage.repository.facade.IPaymentManageService;
|
||||
import com.mhd.bms.domain.paymentManage.repository.po.PaymentManagePO;
|
||||
import com.mhd.bms.domain.paymentManage.repository.todo.PaymentManageDO;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 支付管理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PaymentManageDomainService {
|
||||
|
||||
@Autowired
|
||||
private IPaymentManageService paymentManageService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询支付管理列表
|
||||
*/
|
||||
public List<PaymentManagePO> queryList(PaymentManageDO paymentManageDO) {
|
||||
return paymentManageService.queryList(paymentManageDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增支付管理
|
||||
*/
|
||||
public Boolean insert(PaymentManageDO paymentManageDO) {
|
||||
|
||||
return paymentManageService.insert(paymentManageDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改支付管理
|
||||
*/
|
||||
public Boolean update(PaymentManageDO paymentManageDO) {
|
||||
return paymentManageService.update(paymentManageDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除支付管理
|
||||
*/
|
||||
public Boolean delete(Long[] paymentManageIds) {
|
||||
return paymentManageService.delete(paymentManageIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付管理详细信息
|
||||
*/
|
||||
public PaymentManagePO getInfo(Long paymentManageId)
|
||||
{
|
||||
return paymentManageService.getInfo(paymentManageId);
|
||||
}
|
||||
|
||||
|
||||
public PaymentManage selectByPaymentCode(String paymentCode) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
LambdaQueryWrapper<PaymentManage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PaymentManage::getPaymentMethodCode,paymentCode);
|
||||
queryWrapper.eq(PaymentManage::getDelFlag,1);
|
||||
queryWrapper.eq(PaymentManage::getOrganizationId,loginUser.getUserPo().getOrganizationId());
|
||||
return paymentManageService.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.mhd.bms.domain.paymentOrder.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 付款单对象 payment_order
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-16
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PaymentOrder extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("付款单id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long paymentOrderId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("支付通道code")
|
||||
@Excel(name = "支付通道code")
|
||||
private String paymentChannelCode;
|
||||
|
||||
@ApiModelProperty("支付通道name")
|
||||
@Excel(name = "支付通道name")
|
||||
private String paymentChannelName;
|
||||
|
||||
@ApiModelProperty("付款方式code")
|
||||
@Excel(name = "付款方式code")
|
||||
private String paymentMethodCode;
|
||||
|
||||
@ApiModelProperty("付款方式")
|
||||
@Excel(name = "付款方式")
|
||||
private String paymentMethod;
|
||||
|
||||
@ApiModelProperty("付款人")
|
||||
private String paymentBindingName;
|
||||
|
||||
@ApiModelProperty("付款卡号id")
|
||||
@Excel(name = "付款卡号id")
|
||||
private Long paymentCardId;
|
||||
|
||||
@ApiModelProperty("卡号")
|
||||
@Excel(name = "卡号")
|
||||
private String paymentCard;
|
||||
|
||||
@ApiModelProperty("交易流水")
|
||||
@Excel(name = "交易流水")
|
||||
private String transactionFlow;
|
||||
|
||||
@ApiModelProperty("付款凭证")
|
||||
@Excel(name = "付款凭证")
|
||||
private String receiptVoucher;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String paymentRemark;
|
||||
|
||||
@ApiModelProperty("付款单号")
|
||||
private String paymentOrderNum;
|
||||
|
||||
@ApiModelProperty("结算对象编码")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("结算对象id")
|
||||
private Long settlementCustomersId;
|
||||
|
||||
@ApiModelProperty("结算主体")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("付款状态(1-未转账,2-转账中,3-转账成功,4-转账失败)")
|
||||
private Integer paymentState;
|
||||
|
||||
@ApiModelProperty("结算方式(1-现金,2-油卡)")
|
||||
private Integer settlementWay;
|
||||
|
||||
@ApiModelProperty("付款来源(1-人工付款,2-线上支付)")
|
||||
private Integer paymentSource;
|
||||
|
||||
@ApiModelProperty("开户银行名称")
|
||||
private String bankName;
|
||||
|
||||
@ApiModelProperty("银行卡号")
|
||||
private String bankCardNumber;
|
||||
|
||||
@ApiModelProperty("银行卡预留姓名")
|
||||
private String bankBindingName;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.mhd.bms.domain.paymentOrder.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 付款单详情对象 payment_order_details
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-16
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PaymentOrderDetails extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("付款单id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long paymentOrderDetailsId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("账单编号")
|
||||
@Excel(name = "账单编号")
|
||||
private String billNumber;
|
||||
|
||||
@ApiModelProperty("账单金额")
|
||||
@Excel(name = "账单金额")
|
||||
private BigDecimal billAmount;
|
||||
|
||||
@ApiModelProperty("已付金额")
|
||||
@Excel(name = "已付金额")
|
||||
private BigDecimal billAmountSettlement;
|
||||
|
||||
@ApiModelProperty("本次付款金额")
|
||||
@Excel(name = "本次付款金额")
|
||||
private BigDecimal paymentAmount;
|
||||
|
||||
@ApiModelProperty("剩余未付金额")
|
||||
@Excel(name = "剩余未付金额")
|
||||
private BigDecimal billAmountUnsettledResidue;
|
||||
|
||||
@ApiModelProperty("付款单id")
|
||||
private Long paymentOrderId;
|
||||
|
||||
@ApiModelProperty("账单管理id")
|
||||
private Long billManageId;
|
||||
|
||||
@ApiModelProperty("付款单号")
|
||||
private String paymentOrderNum;
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.mhd.bms.domain.paymentOrder.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.paymentOrder.entity.PaymentOrderDetails;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderDetailsPO;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDetailsDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 付款单详情Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-16
|
||||
*/
|
||||
public interface IPaymentOrderDetailsService extends IService<PaymentOrderDetails>
|
||||
{
|
||||
/**
|
||||
* 分页查询付款单详情列表
|
||||
*/
|
||||
public List<PaymentOrderDetailsPO> queryList(PaymentOrderDetailsDO paymentOrderDetailsDO);
|
||||
|
||||
/**
|
||||
* 新增付款单详情
|
||||
*/
|
||||
public Boolean insert(PaymentOrderDetailsDO paymentOrderDetailsDO);
|
||||
|
||||
/**
|
||||
* 修改付款单详情
|
||||
*/
|
||||
public Boolean update(PaymentOrderDetailsDO paymentOrderDetailsDO);
|
||||
|
||||
/**
|
||||
* 批量删除付款单详情
|
||||
*/
|
||||
public Boolean delete(Long[] paymentOrderDetailsIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询付款单详情
|
||||
*/
|
||||
public PaymentOrderDetailsPO getInfo(Long paymentOrderDetailsId);
|
||||
|
||||
PaymentOrderDetailsPO getInfoByPaymentOrderId(Long paymentOrderId);
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.mhd.bms.domain.paymentOrder.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.paymentOrder.entity.PaymentOrder;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderPO;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 付款单Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-16
|
||||
*/
|
||||
public interface IPaymentOrderService extends IService<PaymentOrder>
|
||||
{
|
||||
/**
|
||||
* 分页查询付款单列表
|
||||
*/
|
||||
public List<PaymentOrderPO> queryList(PaymentOrderDO paymentOrderDO);
|
||||
|
||||
/**
|
||||
* 新增付款单
|
||||
*/
|
||||
public Boolean insert(PaymentOrderDO paymentOrderDO);
|
||||
|
||||
/**
|
||||
* 修改付款单
|
||||
*/
|
||||
public Boolean update(PaymentOrderDO paymentOrderDO);
|
||||
|
||||
/**
|
||||
* 批量删除付款单
|
||||
*/
|
||||
public Boolean delete(Long[] paymentOrderIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询付款单
|
||||
*/
|
||||
public PaymentOrderPO getInfo(Long paymentOrderId);
|
||||
|
||||
List<PaymentOrderPO> getDetailsByBillManageId(Long billManageId);
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.mhd.bms.domain.paymentOrder.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.paymentOrder.entity.PaymentOrderDetails;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderDetailsPO;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDetailsDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 付款单详情Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-16
|
||||
*/
|
||||
public interface PaymentOrderDetailsMapper extends BaseMapper<PaymentOrderDetails>
|
||||
{
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.mhd.bms.domain.paymentOrder.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.paymentOrder.entity.PaymentOrder;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderPO;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 付款单Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-16
|
||||
*/
|
||||
public interface PaymentOrderMapper extends BaseMapper<PaymentOrder>
|
||||
{
|
||||
/**
|
||||
* 查询付款单列表
|
||||
*/
|
||||
public List<PaymentOrderPO> queryList(@Param("paymentOrderDO") PaymentOrderDO paymentOrderDO);
|
||||
|
||||
List<PaymentOrderPO> getDetailsByBillManageId(@Param("billManageId") Long billManageId);
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
package com.mhd.bms.domain.paymentOrder.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.paymentOrder.entity.PaymentOrderDetails;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.facade.IPaymentOrderDetailsService;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.mapper.PaymentOrderDetailsMapper;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderDetailsPO;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDetailsDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 付款单详情Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-16
|
||||
*/
|
||||
@Service
|
||||
public class PaymentOrderDetailsImpl extends ServiceImpl<PaymentOrderDetailsMapper, PaymentOrderDetails> implements IPaymentOrderDetailsService {
|
||||
@Autowired
|
||||
private PaymentOrderDetailsMapper paymentOrderDetailsMapper;
|
||||
|
||||
/**
|
||||
* 查询付款单详情列表
|
||||
*/
|
||||
@Override
|
||||
public List<PaymentOrderDetailsPO> queryList(PaymentOrderDetailsDO paymentOrderDetailsDO)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增付款单详情
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(PaymentOrderDetailsDO paymentOrderDetailsDO) {
|
||||
PaymentOrderDetails paymentOrderDetails = new PaymentOrderDetails();
|
||||
BeanUtils.copyProperties(paymentOrderDetailsDO,paymentOrderDetails);
|
||||
return this.save(paymentOrderDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改付款单详情
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(PaymentOrderDetailsDO paymentOrderDetailsDO) {
|
||||
PaymentOrderDetails paymentOrderDetails = new PaymentOrderDetails();
|
||||
BeanUtils.copyProperties(paymentOrderDetailsDO,paymentOrderDetails);
|
||||
return this.updateById(paymentOrderDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除付款单详情
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] paymentOrderDetailsIds ) {
|
||||
List<PaymentOrderDetails> list = new ArrayList<>();
|
||||
for (Long id : paymentOrderDetailsIds) {
|
||||
PaymentOrderDetails paymentOrderDetails = new PaymentOrderDetails();
|
||||
paymentOrderDetails.setPaymentOrderDetailsId(id);
|
||||
paymentOrderDetails.setDelFlag(2);
|
||||
list.add(paymentOrderDetails);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改付款单详情
|
||||
*/
|
||||
@Override
|
||||
public PaymentOrderDetailsPO getInfo(Long paymentOrderDetailsId) {
|
||||
PaymentOrderDetails paymentOrderDetails = this.getById(paymentOrderDetailsId);
|
||||
PaymentOrderDetailsPO paymentOrderDetailsPO = new PaymentOrderDetailsPO();
|
||||
BeanUtils.copyProperties(paymentOrderDetails,paymentOrderDetailsPO);
|
||||
return paymentOrderDetailsPO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PaymentOrderDetailsPO getInfoByPaymentOrderId(Long paymentOrderId) {
|
||||
PaymentOrderDetailsPO paymentOrderDetailsPO = new PaymentOrderDetailsPO();
|
||||
LambdaQueryWrapper<PaymentOrderDetails> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PaymentOrderDetails::getPaymentOrderId,paymentOrderId);
|
||||
PaymentOrderDetails paymentOrderDetails = this.getOne(queryWrapper);
|
||||
if(paymentOrderDetails != null){
|
||||
BeanUtils.copyProperties(paymentOrderDetails,paymentOrderDetailsPO);
|
||||
}
|
||||
return paymentOrderDetailsPO;
|
||||
}
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package com.mhd.bms.domain.paymentOrder.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.paymentOrder.entity.PaymentOrder;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.facade.IPaymentOrderService;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.mapper.PaymentOrderMapper;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderPO;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 付款单Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-16
|
||||
*/
|
||||
@Service
|
||||
public class PaymentOrderImpl extends ServiceImpl<PaymentOrderMapper, PaymentOrder> implements IPaymentOrderService{
|
||||
@Autowired
|
||||
private PaymentOrderMapper paymentOrderMapper;
|
||||
|
||||
/**
|
||||
* 查询付款单列表
|
||||
*/
|
||||
@Override
|
||||
public List<PaymentOrderPO> queryList(PaymentOrderDO paymentOrderDO)
|
||||
{
|
||||
return paymentOrderMapper.queryList(paymentOrderDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增付款单
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(PaymentOrderDO paymentOrderDO) {
|
||||
PaymentOrder paymentOrder = new PaymentOrder();
|
||||
BeanUtils.copyProperties(paymentOrderDO,paymentOrder);
|
||||
return this.save(paymentOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改付款单
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(PaymentOrderDO paymentOrderDO) {
|
||||
PaymentOrder paymentOrder = new PaymentOrder();
|
||||
BeanUtils.copyProperties(paymentOrderDO,paymentOrder);
|
||||
return this.updateById(paymentOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除付款单
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] paymentOrderIds ) {
|
||||
List<PaymentOrder> list = new ArrayList<>();
|
||||
for (Long id : paymentOrderIds) {
|
||||
PaymentOrder paymentOrder = new PaymentOrder();
|
||||
paymentOrder.setPaymentOrderId(id);
|
||||
paymentOrder.setDelFlag(2);
|
||||
list.add(paymentOrder);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改付款单
|
||||
*/
|
||||
@Override
|
||||
public PaymentOrderPO getInfo(Long paymentOrderId) {
|
||||
PaymentOrder paymentOrder = this.getById(paymentOrderId);
|
||||
PaymentOrderPO paymentOrderPO = new PaymentOrderPO();
|
||||
BeanUtils.copyProperties(paymentOrder,paymentOrderPO);
|
||||
return paymentOrderPO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PaymentOrderPO> getDetailsByBillManageId(Long billManageId) {
|
||||
return paymentOrderMapper.getDetailsByBillManageId(billManageId);
|
||||
}
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.mhd.bms.domain.paymentOrder.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 付款单详情对象 payment_order_details
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-16
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "付款单详情对象", description = "付款单详情响应对象")
|
||||
public class PaymentOrderDetailsPO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("付款单id")
|
||||
private Long paymentOrderDetailsId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("账单编号")
|
||||
@Excel(name = "账单编号")
|
||||
private String billNumber;
|
||||
|
||||
@ApiModelProperty("账单金额")
|
||||
@Excel(name = "账单金额")
|
||||
private BigDecimal billAmount;
|
||||
|
||||
@ApiModelProperty("已付金额")
|
||||
@Excel(name = "已付金额")
|
||||
private BigDecimal billAmountSettlement;
|
||||
|
||||
@ApiModelProperty("本次付款金额")
|
||||
@Excel(name = "本次付款金额")
|
||||
private BigDecimal paymentAmount;
|
||||
|
||||
@ApiModelProperty("剩余未付金额")
|
||||
@Excel(name = "剩余未付金额")
|
||||
private BigDecimal billAmountUnsettledResidue;
|
||||
|
||||
@ApiModelProperty("付款单id")
|
||||
private Long paymentOrderId;
|
||||
|
||||
@ApiModelProperty("账单管理id")
|
||||
private Long billManageId;
|
||||
|
||||
@ApiModelProperty("付款单号")
|
||||
private String paymentOrderNum;
|
||||
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
package com.mhd.bms.domain.paymentOrder.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 付款单对象 payment_order
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-16
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "付款单对象", description = "付款单响应对象")
|
||||
public class PaymentOrderPO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("付款单id")
|
||||
private Long paymentOrderId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("支付通道code")
|
||||
@Excel(name = "支付通道code")
|
||||
private String paymentChannelCode;
|
||||
|
||||
@ApiModelProperty("支付通道name")
|
||||
@Excel(name = "支付通道name")
|
||||
private String paymentChannelName;
|
||||
|
||||
@ApiModelProperty("付款方式code")
|
||||
@Excel(name = "付款方式code")
|
||||
private String paymentMethodCode;
|
||||
|
||||
@ApiModelProperty("付款方式")
|
||||
@Excel(name = "付款方式")
|
||||
private String paymentMethod;
|
||||
|
||||
@ApiModelProperty("付款卡号id")
|
||||
@Excel(name = "付款卡号id")
|
||||
private Long paymentCardId;
|
||||
|
||||
@ApiModelProperty("付款人")
|
||||
private String paymentBindingName;
|
||||
|
||||
@ApiModelProperty("卡号")
|
||||
@Excel(name = "卡号")
|
||||
private String paymentCard;
|
||||
|
||||
@ApiModelProperty("交易流水")
|
||||
@Excel(name = "交易流水")
|
||||
private String transactionFlow;
|
||||
|
||||
@ApiModelProperty("付款凭证")
|
||||
@Excel(name = "付款凭证")
|
||||
private String receiptVoucher;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String paymentRemark;
|
||||
|
||||
@ApiModelProperty("付款单号")
|
||||
private String paymentOrderNum;
|
||||
|
||||
@ApiModelProperty("结算对象编码")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("结算对象id")
|
||||
private Long settlementCustomersId;
|
||||
|
||||
@ApiModelProperty("结算主体")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("付款状态(1-未转账,2-转账中,3-转账成功,4-转账失败)")
|
||||
private Integer paymentState;
|
||||
|
||||
@ApiModelProperty("结算单明细实体")
|
||||
private PaymentOrderDetailsPO paymentOrderDetailsPO;
|
||||
|
||||
@ApiModelProperty("结算方式(1-现金,2-油卡)")
|
||||
private Integer settlementWay;
|
||||
|
||||
@ApiModelProperty("付款来源(1-人工付款,2-线上支付)")
|
||||
private Integer paymentSource;
|
||||
|
||||
@ApiModelProperty("开户银行名称")
|
||||
private String bankName;
|
||||
|
||||
@ApiModelProperty("银行卡号")
|
||||
private String bankCardNumber;
|
||||
|
||||
@ApiModelProperty("银行卡预留姓名")
|
||||
private String bankBindingName;
|
||||
|
||||
@ApiModelProperty("本次付款金额")
|
||||
private BigDecimal paymentAmount;
|
||||
|
||||
@ApiModelProperty("账单编号")
|
||||
private String billNumber;
|
||||
}
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
package com.mhd.bms.domain.paymentOrder.repository.todo;
|
||||
|
||||
import com.mhd.bms.interfaces.dto.paymentOrder.PaymentOrderDetailsDTO;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 付款单对象 payment_order
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-16
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PaymentOrderDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("付款单id")
|
||||
private Long paymentOrderId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("支付通道code")
|
||||
@Excel(name = "支付通道code")
|
||||
private String paymentChannelCode;
|
||||
|
||||
@ApiModelProperty("支付通道name")
|
||||
@Excel(name = "支付通道name")
|
||||
private String paymentChannelName;
|
||||
|
||||
@ApiModelProperty("付款方式code")
|
||||
@Excel(name = "付款方式code")
|
||||
private String paymentMethodCode;
|
||||
|
||||
@ApiModelProperty("付款方式")
|
||||
@Excel(name = "付款方式")
|
||||
private String paymentMethod;
|
||||
|
||||
@ApiModelProperty("付款卡号id")
|
||||
@Excel(name = "付款卡号id")
|
||||
private Long paymentCardId;
|
||||
|
||||
@ApiModelProperty("付款人")
|
||||
private String paymentBindingName;
|
||||
|
||||
@ApiModelProperty("卡号")
|
||||
@Excel(name = "卡号")
|
||||
private String paymentCard;
|
||||
|
||||
@ApiModelProperty("交易流水")
|
||||
@Excel(name = "交易流水")
|
||||
private String transactionFlow;
|
||||
|
||||
@ApiModelProperty("付款凭证")
|
||||
@Excel(name = "付款凭证")
|
||||
private String receiptVoucher;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String paymentRemark;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty("账单管理ids")
|
||||
private String billManageIds;
|
||||
|
||||
@ApiModelProperty(name = "付款账单明细")
|
||||
private List<PaymentOrderDetailsDTO> paymentOrderDetailsDTOList;
|
||||
|
||||
@ApiModelProperty("付款单号")
|
||||
private String paymentOrderNum;
|
||||
|
||||
@ApiModelProperty("结算对象编码")
|
||||
private String settlementCustomersCode;
|
||||
|
||||
@ApiModelProperty("结算对象id")
|
||||
private Long settlementCustomersId;
|
||||
|
||||
@ApiModelProperty("结算主体")
|
||||
private String settlementEntity;
|
||||
|
||||
@ApiModelProperty("付款状态(1-未转账,2-转账中,3-转账成功,4-转账失败)")
|
||||
private Integer paymentState;
|
||||
|
||||
@ApiModelProperty(name = "创建时间查询条件开始日期")
|
||||
private String createTimeStart;
|
||||
@ApiModelProperty(name = "创建时间查询条件结束日期")
|
||||
private String createTimeEnd;
|
||||
|
||||
@ApiModelProperty("结算方式(1-现金,2-油卡)")
|
||||
private Integer settlementWay;
|
||||
|
||||
@ApiModelProperty("付款来源(1-人工付款,2-线上支付)")
|
||||
private Integer paymentSource;
|
||||
|
||||
@ApiModelProperty("开户银行名称")
|
||||
private String bankName;
|
||||
|
||||
@ApiModelProperty("银行卡号")
|
||||
private String bankCardNumber;
|
||||
|
||||
@ApiModelProperty("银行卡预留姓名")
|
||||
private String bankBindingName;
|
||||
|
||||
@ApiModelProperty(name = "支付密码")
|
||||
private String payPassword;
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package com.mhd.bms.domain.paymentOrder.repository.todo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 付款单详情对象 payment_order_details
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-16
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PaymentOrderDetailsDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("付款单id")
|
||||
private Long paymentOrderDetailsId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("账单编号")
|
||||
@Excel(name = "账单编号")
|
||||
private String billNumber;
|
||||
|
||||
@ApiModelProperty("账单金额")
|
||||
@Excel(name = "账单金额")
|
||||
private BigDecimal billAmount;
|
||||
|
||||
@ApiModelProperty("已付金额")
|
||||
@Excel(name = "已付金额")
|
||||
private BigDecimal billAmountSettlement;
|
||||
|
||||
@ApiModelProperty("本次付款金额")
|
||||
@Excel(name = "本次付款金额")
|
||||
private BigDecimal paymentAmount;
|
||||
|
||||
@ApiModelProperty("剩余未付金额")
|
||||
@Excel(name = "剩余未付金额")
|
||||
private BigDecimal billAmountUnsettledResidue;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty("付款单id")
|
||||
private Long paymentOrderId;
|
||||
|
||||
@ApiModelProperty("账单管理id")
|
||||
private Long billManageId;
|
||||
|
||||
@ApiModelProperty("付款单号")
|
||||
private String paymentOrderNum;
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package com.mhd.bms.domain.paymentOrder.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.bms.domain.paymentOrder.entity.PaymentOrderDetails;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.facade.IPaymentOrderDetailsService;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderDetailsPO;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDetailsDO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 付款单详情
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-16
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PaymentOrderDetailsDomainService {
|
||||
|
||||
@Autowired
|
||||
private IPaymentOrderDetailsService paymentOrderDetailsService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询付款单详情列表
|
||||
*/
|
||||
public List<PaymentOrderDetailsPO> queryList(PaymentOrderDetailsDO paymentOrderDetailsDO) {
|
||||
return paymentOrderDetailsService.queryList(paymentOrderDetailsDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增付款单详情
|
||||
*/
|
||||
public Boolean insert(PaymentOrderDetailsDO paymentOrderDetailsDO) {
|
||||
|
||||
return paymentOrderDetailsService.insert(paymentOrderDetailsDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改付款单详情
|
||||
*/
|
||||
public Boolean update(PaymentOrderDetailsDO paymentOrderDetailsDO) {
|
||||
return paymentOrderDetailsService.update(paymentOrderDetailsDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除付款单详情
|
||||
*/
|
||||
public Boolean delete(Long[] paymentOrderDetailsIds) {
|
||||
return paymentOrderDetailsService.delete(paymentOrderDetailsIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取付款单详情详细信息
|
||||
*/
|
||||
public PaymentOrderDetailsPO getInfo(Long paymentOrderDetailsId)
|
||||
{
|
||||
return paymentOrderDetailsService.getInfo(paymentOrderDetailsId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据付款单ID查询付款单详情
|
||||
* @param orderIdSet
|
||||
* @return
|
||||
*/
|
||||
public List<PaymentOrderDetails> queryListByIdSet(Set<Long> orderIdSet) {
|
||||
LambdaQueryWrapper<PaymentOrderDetails> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(PaymentOrderDetails::getPaymentOrderId, orderIdSet);
|
||||
return paymentOrderDetailsService.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
+315
@@ -0,0 +1,315 @@
|
||||
package com.mhd.bms.domain.paymentOrder.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mhd.bms.domain.billManage.entity.BillManage;
|
||||
import com.mhd.bms.domain.billManage.service.BillManageDomainService;
|
||||
import com.mhd.bms.domain.paymentManage.entity.PaymentManage;
|
||||
import com.mhd.bms.domain.paymentManage.service.PaymentManageDomainService;
|
||||
import com.mhd.bms.domain.paymentOrder.entity.PaymentOrder;
|
||||
import com.mhd.bms.domain.paymentOrder.entity.PaymentOrderDetails;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.facade.IPaymentOrderDetailsService;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.facade.IPaymentOrderService;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderDetailsPO;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.po.PaymentOrderPO;
|
||||
import com.mhd.bms.domain.paymentOrder.repository.todo.PaymentOrderDO;
|
||||
import com.mhd.bms.domain.paymentWallet.repository.po.PaymentWalletPO;
|
||||
import com.mhd.bms.domain.paymentWallet.service.PaymentWalletDomainService;
|
||||
import com.mhd.bms.domain.settlementCustomers.entity.SettlementCustomers;
|
||||
import com.mhd.bms.domain.settlementCustomers.service.SettlementCustomersDomainService;
|
||||
import com.mhd.bms.interfaces.dto.paymentOrder.PaymentOrderDetailsDTO;
|
||||
import com.mhd.bms.interfaces.dto.receiptManage.ReceiptDetailDTO;
|
||||
import com.mhd.common.core.domain.po.SysDictDataVo;
|
||||
import com.mhd.common.core.domain.po.UserPo;
|
||||
import com.mhd.common.core.enums.DictCode;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
|
||||
import com.mhd.common.core.utils.OrderSequence;
|
||||
import com.mhd.common.core.utils.StringUtils;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* 付款单
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-16
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PaymentOrderDomainService {
|
||||
|
||||
@Autowired
|
||||
private IPaymentOrderService paymentOrderService;
|
||||
@Autowired
|
||||
private BillManageDomainService billManageDomainService;
|
||||
@Autowired
|
||||
private SettlementCustomersDomainService settlementCustomersDomainService;
|
||||
@Autowired
|
||||
private PaymentManageDomainService paymentManageDomainService;
|
||||
@Autowired
|
||||
private PaymentWalletDomainService paymentWalletDomainService;
|
||||
@Autowired
|
||||
private SystemServiceFeign systemServiceFeign;
|
||||
@Autowired
|
||||
private IPaymentOrderDetailsService paymentOrderDetailsService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询付款单列表
|
||||
*/
|
||||
public List<PaymentOrderPO> queryList(PaymentOrderDO paymentOrderDO) {
|
||||
return paymentOrderService.queryList(paymentOrderDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增付款单
|
||||
*/
|
||||
public Boolean insert(PaymentOrderDO paymentOrderDO) {
|
||||
|
||||
return paymentOrderService.insert(paymentOrderDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改付款单
|
||||
*/
|
||||
public Boolean update(PaymentOrderDO paymentOrderDO) {
|
||||
return paymentOrderService.update(paymentOrderDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除付款单
|
||||
*/
|
||||
public Boolean delete(Long[] paymentOrderIds) {
|
||||
return paymentOrderService.delete(paymentOrderIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取付款单详细信息
|
||||
*/
|
||||
public PaymentOrderPO getInfo(Long paymentOrderId)
|
||||
{
|
||||
return paymentOrderService.getInfo(paymentOrderId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验付款单状态
|
||||
*/
|
||||
public void checkSettlementStatus(PaymentOrderDO paymentOrderDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
Set<String> bills = Stream.of(paymentOrderDO.getBillManageIds()).collect(Collectors.toSet());
|
||||
LambdaQueryWrapper<BillManage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BillManage::getBillManageId,bills);
|
||||
List<BillManage> billManageList = billManageDomainService.queryListLambda(queryWrapper);
|
||||
if(billManageList ==null || billManageList.size()==0){
|
||||
throw new ServiceException("账单信息未找到");
|
||||
}
|
||||
List<PaymentOrderDetailsDTO> paymentOrderDetailsDTOList = paymentOrderDO.getPaymentOrderDetailsDTOList();
|
||||
if(paymentOrderDetailsDTOList == null || paymentOrderDetailsDTOList.size() == 0){
|
||||
throw new ServiceException("付款账单明细不能为空");
|
||||
}
|
||||
billManageList.forEach(billManage -> {
|
||||
if(billManage.getBillType() != 2){
|
||||
throw new ServiceException("账单" + billManage.getBillNumber() + "收付类型错误,请重试");
|
||||
}
|
||||
if (billManage.getBillState() != 3 && billManage.getBillState() != 4) {
|
||||
throw new ServiceException("账单" + billManage.getBillNumber() + "状态错误无法完成付款,请刷新后重试");
|
||||
}
|
||||
//校验金额是否满足付款,判断未收金额是否大于0
|
||||
if (billManage.getBillAmountUnsettled().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new ServiceException("账单" + billManage.getBillNumber() + "未收金额小于等于0,无法完成付款,请刷新后重试");
|
||||
}
|
||||
//校验本次账单付款金额是否大于未收金额
|
||||
PaymentOrderDetailsDTO paymentOrderDetailsDTO = paymentOrderDetailsDTOList.stream().filter(item -> ObjectUtil.equal(billManage.getBillManageId(), item.getBillManageId())).findAny().orElse(null);
|
||||
if(null == paymentOrderDetailsDTO){
|
||||
throw new ServiceException("账单" + billManage.getBillNumber() + "明细未找到");
|
||||
}
|
||||
if (billManage.getBillAmountUnsettled().compareTo(paymentOrderDetailsDTO.getPaymentAmount()) < 0) {
|
||||
throw new ServiceException("账单" + billManage.getBillNumber() + "付款金额大于剩余未收金额,无法完成付款,请刷新后重试");
|
||||
}
|
||||
//校验剩余未收金额是否大于0
|
||||
if (paymentOrderDetailsDTO.getBillAmountUnsettledResidue().compareTo(BigDecimal.ZERO) < 0) {
|
||||
throw new ServiceException("账单" + billManage.getBillNumber() + "剩余未付金额小于0,无法完成付款,请刷新后重试");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量付款
|
||||
*/
|
||||
public Boolean batchPayment(PaymentOrderDO paymentOrderDO) {
|
||||
/*
|
||||
2024年7月16日第一版:每一个账单生成一个付款单
|
||||
*/
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
List<PaymentOrderDetailsDTO> paymentOrderDetailsDTOList = paymentOrderDO.getPaymentOrderDetailsDTOList();
|
||||
if(paymentOrderDetailsDTOList == null || paymentOrderDetailsDTOList.size() == 0){
|
||||
throw new ServiceException("付款账单明细不能为空");
|
||||
}
|
||||
Set<String> bills = Stream.of(paymentOrderDO.getBillManageIds().split(",")).collect(Collectors.toSet());
|
||||
LambdaQueryWrapper<BillManage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BillManage::getBillManageId,bills);
|
||||
List<BillManage> billManageList = billManageDomainService.queryListLambda(queryWrapper);
|
||||
if(billManageList ==null || billManageList.size()==0){
|
||||
throw new ServiceException("账单信息未找到");
|
||||
}
|
||||
paymentOrderDO.setSettlementCustomersCode(billManageList.get(0).getSettlementCustomersCode());
|
||||
//处理数据
|
||||
handleData(paymentOrderDO);
|
||||
paymentOrderDO.setPaymentSource(1);
|
||||
//线下转账,默认转账成功
|
||||
paymentOrderDO.setPaymentState(3);
|
||||
List<PaymentOrder> paymentOrderList = new ArrayList<>();
|
||||
List<PaymentOrderDetails> paymentOrderDetailsList = new ArrayList<>();
|
||||
PaymentOrderDetails common = new PaymentOrderDetails();
|
||||
common.setCreateBy(loginUser.getUserPo().getUserId());
|
||||
common.setCreateTime(new Date());
|
||||
common.setCreateByName(loginUser.getUserPo().getUserName());
|
||||
common.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
common.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
common.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
//循环遍历,每个账单都生成一个付款单
|
||||
for (PaymentOrderDetailsDTO paymentOrderDetailsDTO : paymentOrderDetailsDTOList) {
|
||||
BillManage billManage = billManageList.stream().filter(item -> ObjectUtil.equal(paymentOrderDetailsDTO.getBillManageId(), item.getBillManageId())).findAny().orElse(null);
|
||||
if(null == billManage){
|
||||
throw new ServiceException("账单信息未找到,请重试");
|
||||
}
|
||||
PaymentOrder paymentOrder = new PaymentOrder();
|
||||
BeanUtils.copyProperties(paymentOrderDO,paymentOrder);
|
||||
paymentOrder.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
paymentOrder.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
paymentOrder.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
paymentOrder.setCreateBy(loginUser.getUserPo().getUserId());
|
||||
paymentOrder.setCreateByName(loginUser.getUserPo().getUserName());
|
||||
paymentOrder.setCreateTime(new Date());
|
||||
paymentOrder.setPaymentOrderNum(OrderSequence.getOrderCode("FK"));
|
||||
paymentOrderDetailsDTO.setPaymentOrderNum(paymentOrder.getPaymentOrderNum());
|
||||
PaymentOrderDetails paymentOrderDetails = new PaymentOrderDetails();
|
||||
BeanUtils.copyProperties(common,paymentOrderDetails);
|
||||
paymentOrderDetails.setBillNumber(billManage.getBillNumber());
|
||||
paymentOrderDetails.setBillManageId(billManage.getBillManageId());
|
||||
paymentOrderDetails.setBillAmount(billManage.getBillAmount());
|
||||
paymentOrderDetails.setPaymentAmount(paymentOrderDetailsDTO.getPaymentAmount());
|
||||
//已付金额 = 账单已付金额 + 本次付款金额
|
||||
paymentOrderDetails.setBillAmountSettlement(billManage.getBillAmountSettlement().add(paymentOrderDetailsDTO.getPaymentAmount()));
|
||||
//剩余未付金额 = 账单剩余未付金额 - 本次付款金额
|
||||
paymentOrderDetails.setBillAmountUnsettledResidue(billManage.getBillAmountUnsettled().subtract(paymentOrderDetailsDTO.getPaymentAmount()));
|
||||
paymentOrderDetails.setPaymentOrderNum(paymentOrder.getPaymentOrderNum());
|
||||
paymentOrderList.add(paymentOrder);
|
||||
paymentOrderDetailsList.add(paymentOrderDetails);
|
||||
}
|
||||
if(paymentOrderList.size() > 0){
|
||||
//批量插入付款单
|
||||
Boolean flag = paymentOrderService.saveBatch(paymentOrderList);
|
||||
if(flag){
|
||||
//循环paymentOrderList和paymentOrderDetailsList补充付款单ID
|
||||
for (PaymentOrderDetails paymentOrderDetails : paymentOrderDetailsList) {
|
||||
PaymentOrder paymentOrder = paymentOrderList.stream().filter(item -> ObjectUtil.equal(paymentOrderDetails.getPaymentOrderNum(), item.getPaymentOrderNum())).findAny().orElse(null);
|
||||
if(null != paymentOrder){
|
||||
paymentOrderDetails.setPaymentOrderId(paymentOrder.getPaymentOrderId());
|
||||
}
|
||||
}
|
||||
}
|
||||
//批量插入付款单明细
|
||||
Boolean flagTwo = paymentOrderDetailsService.saveBatch(paymentOrderDetailsList);
|
||||
return flag && flagTwo;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理数据
|
||||
*/
|
||||
private void handleData(PaymentOrderDO paymentOrderDO) {
|
||||
//获取结算对象信息
|
||||
SettlementCustomers settlementCustomers = settlementCustomersDomainService.queryByCode(paymentOrderDO.getSettlementCustomersCode());
|
||||
if (null != settlementCustomers) {
|
||||
paymentOrderDO.setSettlementCustomersCode(settlementCustomers.getSettlementCustomersCode());
|
||||
paymentOrderDO.setSettlementEntity(settlementCustomers.getSettlementEntity());
|
||||
paymentOrderDO.setSettlementCustomersId(settlementCustomers.getSettlementCustomersId());
|
||||
paymentOrderDO.setBankName(settlementCustomers.getBankName());
|
||||
paymentOrderDO.setBankBindingName(settlementCustomers.getBankBindingName());
|
||||
paymentOrderDO.setBankCardNumber(settlementCustomers.getBankCardNumber());
|
||||
}
|
||||
//获取支付通道
|
||||
List<SysDictDataVo> sysDictDataVoList = new ArrayList<>();
|
||||
AjaxResult ajaxResult = systemServiceFeign.selectListByDictType(DictCode.payment_channel.getCode());
|
||||
if("200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
sysDictDataVoList = JSON.parseArray(JSONObject.toJSONString(ajaxResult.get("data")), SysDictDataVo.class);
|
||||
sysDictDataVoList.stream().filter(item -> ObjectUtil.equal(paymentOrderDO.getPaymentChannelCode(), item.getDictValue())).findAny().ifPresent(item -> {
|
||||
paymentOrderDO.setPaymentChannelName(item.getDictLabel());
|
||||
});
|
||||
}
|
||||
//收款方式、收款卡号
|
||||
if(StringUtils.isNotEmpty(paymentOrderDO.getPaymentMethodCode())){
|
||||
//查询收款方式
|
||||
PaymentManage paymentManage = paymentManageDomainService.selectByPaymentCode(paymentOrderDO.getPaymentMethodCode());
|
||||
if(null == paymentManage){
|
||||
throw new ServiceException("收款方式信息未找到");
|
||||
}
|
||||
paymentOrderDO.setPaymentMethod(paymentManage.getPaymentMethod());
|
||||
}
|
||||
if(paymentOrderDO.getPaymentCardId() != null){
|
||||
//查询收款卡号
|
||||
PaymentWalletPO paymentWalletPO = paymentWalletDomainService.getInfo(paymentOrderDO.getPaymentCardId());
|
||||
if(null == paymentWalletPO){
|
||||
throw new ServiceException("收款卡信息未找到");
|
||||
}
|
||||
paymentOrderDO.setPaymentCard(paymentWalletPO.getMainNumber());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id获取付款单
|
||||
*/
|
||||
public PaymentOrderPO getInfoById(Long paymentOrderId) {
|
||||
PaymentOrderPO paymentOrderPO = paymentOrderService.getInfo(paymentOrderId);
|
||||
if(null == paymentOrderPO){
|
||||
throw new ServiceException("付款单详情信息未找到");
|
||||
}
|
||||
PaymentOrderDetailsPO paymentOrderDetailsPO = paymentOrderDetailsService.getInfoByPaymentOrderId(paymentOrderId);
|
||||
paymentOrderPO.setPaymentOrderDetailsPO(paymentOrderDetailsPO);
|
||||
return paymentOrderPO;
|
||||
}
|
||||
|
||||
|
||||
public List<PaymentOrderPO> getDetailsByBillManageId(Long billManageId) {
|
||||
return paymentOrderService.getDetailsByBillManageId(billManageId);
|
||||
}
|
||||
|
||||
public List<PaymentOrder> settlementAnalysisList(QueryWrapper<PaymentOrder> queryWrapper) {
|
||||
return paymentOrderService.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.mhd.bms.domain.paymentWallet.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 支付钱包管理对象 payment_wallet
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PaymentWallet extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("支付钱包管理id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long paymentWalletId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("主体编码(银行卡号、微信openid、支付宝openid等)")
|
||||
@Excel(name = "主体编码", readConverterExp = "银=行卡号、微信openid、支付宝openid等")
|
||||
private String mainNumber;
|
||||
|
||||
@ApiModelProperty("主体名称")
|
||||
@Excel(name = "主体名称")
|
||||
private String mainName;
|
||||
|
||||
@ApiModelProperty("银行名称")
|
||||
@Excel(name = "银行名称")
|
||||
private String bankName;
|
||||
|
||||
@ApiModelProperty("开户行")
|
||||
@Excel(name = "开户行")
|
||||
private String bankDeposi;
|
||||
|
||||
@ApiModelProperty("手机号")
|
||||
@Excel(name = "手机号")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("支付方式编码")
|
||||
@Excel(name = "支付方式编码")
|
||||
private String paymentMethodCode;
|
||||
|
||||
@ApiModelProperty("支付方式名称")
|
||||
@Excel(name = "支付方式名称")
|
||||
private String paymentMethod;
|
||||
|
||||
@ApiModelProperty("支付方式id")
|
||||
@Excel(name = "支付方式id")
|
||||
private Long paymentManageId;
|
||||
|
||||
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.mhd.bms.domain.paymentWallet.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.paymentWallet.entity.PaymentWallet;
|
||||
import com.mhd.bms.domain.paymentWallet.repository.po.PaymentWalletPO;
|
||||
import com.mhd.bms.domain.paymentWallet.repository.todo.PaymentWalletDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 支付钱包管理Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
public interface IPaymentWalletService extends IService<PaymentWallet>
|
||||
{
|
||||
/**
|
||||
* 分页查询支付钱包管理列表
|
||||
*/
|
||||
public List<PaymentWalletPO> queryList(PaymentWalletDO paymentWalletDO);
|
||||
|
||||
/**
|
||||
* 新增支付钱包管理
|
||||
*/
|
||||
public Boolean insert(PaymentWalletDO paymentWalletDO);
|
||||
|
||||
/**
|
||||
* 修改支付钱包管理
|
||||
*/
|
||||
public Boolean update(PaymentWalletDO paymentWalletDO);
|
||||
|
||||
/**
|
||||
* 批量删除支付钱包管理
|
||||
*/
|
||||
public Boolean delete(Long[] paymentWalletIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询支付钱包管理
|
||||
*/
|
||||
public PaymentWalletPO getInfo(Long paymentWalletId);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.mhd.bms.domain.paymentWallet.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.paymentWallet.entity.PaymentWallet;
|
||||
import com.mhd.bms.domain.paymentWallet.repository.po.PaymentWalletPO;
|
||||
import com.mhd.bms.domain.paymentWallet.repository.todo.PaymentWalletDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 支付钱包管理Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-09
|
||||
*/
|
||||
public interface PaymentWalletMapper extends BaseMapper<PaymentWallet>
|
||||
{
|
||||
/**
|
||||
* 查询支付钱包管理列表
|
||||
*/
|
||||
public List<PaymentWalletPO> queryList(PaymentWalletDO paymentWalletDO);
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user