BMS结算主体字段查询显示
This commit is contained in:
@@ -142,6 +142,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="contractManageDO.contractType != null">
|
<if test="contractManageDO.contractType != null">
|
||||||
and contract_type = #{contractManageDO.contractType}
|
and contract_type = #{contractManageDO.contractType}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="contractManageDO.settlementCustomers != null">
|
||||||
|
and settlement_customers like concat('%', #{contractManageDO.settlementCustomers}, '%')
|
||||||
|
</if>
|
||||||
<if test="contractManageDO.settlementCustomersCode != null">
|
<if test="contractManageDO.settlementCustomersCode != null">
|
||||||
and settlement_customers_code = #{contractManageDO.settlementCustomersCode}
|
and settlement_customers_code = #{contractManageDO.settlementCustomersCode}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
+49
-30
@@ -393,41 +393,14 @@ public class BillingStatementDomainService {
|
|||||||
*/
|
*/
|
||||||
private void handleData(BillingStatementDO billingStatementDO) {
|
private void handleData(BillingStatementDO billingStatementDO) {
|
||||||
//查询合同信息,赋值合同周期信息
|
//查询合同信息,赋值合同周期信息
|
||||||
|
//优先通过合同编号获取合同信息
|
||||||
if(StringUtils.isNotEmpty(billingStatementDO.getContractNumber())){
|
if(StringUtils.isNotEmpty(billingStatementDO.getContractNumber())){
|
||||||
AjaxResult ajaxResult = systemServiceFeign.getInfoByCode(billingStatementDO.getContractNumber());
|
AjaxResult ajaxResult = systemServiceFeign.getInfoByCode(billingStatementDO.getContractNumber());
|
||||||
if("200".equals(String.valueOf(ajaxResult.get("code")))){
|
if("200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||||
ContractManagePO contractManagePO = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), ContractManagePO.class);
|
ContractManagePO contractManagePO = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), ContractManagePO.class);
|
||||||
if(null != contractManagePO){
|
if(null != contractManagePO){
|
||||||
//取值合同详情,对比费用科目,取值计费周期
|
//根据合同判断计费流水的周期开始日期和周期结束日期
|
||||||
if(contractManagePO.getContractManageDetailPOList()!=null && contractManagePO.getContractManageDetailPOList().size()>0){
|
setCycleTimeByContract(billingStatementDO, contractManagePO);
|
||||||
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());
|
billingStatementDO.setContractType(contractManagePO.getContractType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -445,6 +418,52 @@ public class BillingStatementDomainService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据合同判断计费流水的周期开始日期和周期结束日期
|
||||||
|
* (1)周期开始日期:根据合同明细的计费属性判断
|
||||||
|
* - 实时计费、按天计费:周期开始日期 = 业务日期
|
||||||
|
* - 按账期计费:周期开始日期 = 业务日期
|
||||||
|
* - 按周计费:周期开始日期 = 业务日期
|
||||||
|
* (2)周期结束日期:根据合同明细的计费属性判断
|
||||||
|
* - 实时计费、按天计费:周期结束日期 = 业务日期
|
||||||
|
* - 按账期计费:周期结束日期 = 合同的出账日期(paymentDate)
|
||||||
|
* - 按周计费:周期结束日期 = 业务日期往后推一周
|
||||||
|
* @param billingStatementDO 计费流水对象
|
||||||
|
* @param contractManagePO 合同管理对象
|
||||||
|
*/
|
||||||
|
private void setCycleTimeByContract(BillingStatementDO billingStatementDO, ContractManagePO 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账单作废,流水状态回滚
|
* 账单作废,流水状态回滚
|
||||||
|
|||||||
Reference in New Issue
Block a user