|
@@ -1,5 +1,6 @@
|
|
|
package com.zcxk.rmcp.pay.service.impl.pay;
|
|
|
|
|
|
+import com.bz.zoneiot.core.utils.DateUtil;
|
|
|
import com.zcxk.rmcp.pay.commom.exception.ServiceException;
|
|
|
import com.zcxk.rmcp.pay.commom.model.AjaxMessage;
|
|
|
import com.zcxk.rmcp.pay.commom.model.Pagination;
|
|
@@ -12,6 +13,8 @@ import com.zcxk.rmcp.pay.dto.pay.BaseClosingAccountInfoDto;
|
|
|
import com.zcxk.rmcp.pay.dto.pay.PayRechargeaccountDto;
|
|
|
import com.zcxk.rmcp.pay.dto.pay.PayTransactiondetails;
|
|
|
import com.zcxk.rmcp.pay.dto.pay.PayTransactiondetailsDto;
|
|
|
+import com.zcxk.rmcp.pay.entity.pay.MeasurementInstance;
|
|
|
+import com.zcxk.rmcp.pay.service.pay.MeasurementSettlementService;
|
|
|
import com.zcxk.rmcp.pay.service.pay.PayPayReceivedService;
|
|
|
import com.zcxk.rmcp.pay.service.pay.PayTransactiondetailsService;
|
|
|
import com.github.pagehelper.Page;
|
|
@@ -20,12 +23,14 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.BigInteger;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.ZoneId;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -49,6 +54,8 @@ public class PayTransactiondetailsServiceImp implements PayTransactiondetailsSer
|
|
|
PayPayReceivedService payPayReceivedService;
|
|
|
@Resource
|
|
|
BaseClosingAccountInfoMapper baseClosingAccountInfoMapper;
|
|
|
+ @Resource
|
|
|
+ MeasurementSettlementService measurementSettlementService;
|
|
|
|
|
|
|
|
|
public void insert(PayTransactiondetails payTransactiondetails) {
|
|
@@ -183,27 +190,22 @@ public class PayTransactiondetailsServiceImp implements PayTransactiondetailsSer
|
|
|
public Pagination<PayTransactiondetailsDto> selectTransactionPageList(PayTransactiondetailsDto payTransactiondetailsDto, int pageNum, int pageSize){
|
|
|
LoginUser loginUser = UserUtil.getCurrentUser();
|
|
|
|
|
|
- //站点为空则加入用户站点查询
|
|
|
- if( loginUser !=null){
|
|
|
- //站点权限
|
|
|
- payTransactiondetailsDto.setSiteId(loginUser.getSiteId());
|
|
|
- //客户权限
|
|
|
- payTransactiondetailsDto.setCustomerId(loginUser.getCustomerId());
|
|
|
- payTransactiondetailsDto.setTenantId(loginUser.getTenantId());
|
|
|
- //数据权限
|
|
|
- //payTransactiondetailsDto.setProgramItems(loginUser.getDataPermissionMap().get(loginUser.getSiteId()));
|
|
|
- }
|
|
|
+
|
|
|
//有机构
|
|
|
if(payTransactiondetailsDto.getAgentbranchId() != null){
|
|
|
- BaseClosingAccountInfoDto baseClosingAccountInfoDto = baseClosingAccountInfoMapper.getLastClosingAccount(loginUser.getSiteId(),loginUser.getCustomerId());
|
|
|
- if(baseClosingAccountInfoDto == null){
|
|
|
- return new Pagination<>(new Page<>());
|
|
|
+
|
|
|
+ List<MeasurementInstance> billingPeriod = measurementSettlementService.findBillingPeriod(loginUser.getCompanyId(), loginUser.getDepartmentId());
|
|
|
+ if(!CollectionUtils.isEmpty(billingPeriod)){
|
|
|
+ MeasurementInstance measurementInstance = billingPeriod.get(0);
|
|
|
+ payTransactiondetailsDto.setYear(DateUtil.getYear(measurementInstance.getBillingPeriod()));
|
|
|
+ payTransactiondetailsDto.setMonth(DateUtil.getMonth(measurementInstance.getBillingPeriod()));
|
|
|
}
|
|
|
- payTransactiondetailsDto.setYear(baseClosingAccountInfoDto.getYear());
|
|
|
- payTransactiondetailsDto.setMonth(baseClosingAccountInfoDto.getMonth());
|
|
|
+
|
|
|
}
|
|
|
//分页
|
|
|
PageHelper.startPage(pageNum,pageSize);
|
|
|
+ payTransactiondetailsDto.setTenantId(loginUser.getTenantId());
|
|
|
+ payTransactiondetailsDto.setUserCondition(loginUser.getUserCondition());
|
|
|
return new Pagination<>(payTransactiondetailsMapper.selectTransactionList(payTransactiondetailsDto));
|
|
|
}
|
|
|
public Pagination<PayTransactiondetailsDto> getTransactionListForAgenttrans(PayTransactiondetailsDto payTransactiondetailsDto, int pageNum, int pageSize){
|