17640 | |||||
4352 |
distributionBase=GRADLE_USER_HOME | distributionBase=GRADLE_USER_HOME | ||||
distributionPath=wrapper/dists | distributionPath=wrapper/dists | ||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip | |||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | |||||
zipStoreBase=GRADLE_USER_HOME | zipStoreBase=GRADLE_USER_HOME | ||||
zipStorePath=wrapper/dists | zipStorePath=wrapper/dists |
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | ||||
import org.springframework.data.jpa.repository.Query; | import org.springframework.data.jpa.repository.Query; | ||||
import java.time.LocalDate; | |||||
import java.util.Date; | |||||
import java.util.List; | |||||
public interface AflServerFeeRefundRepo extends AbstractJpaRepo<AflServerFeeRefund, String>, | public interface AflServerFeeRefundRepo extends AbstractJpaRepo<AflServerFeeRefund, String>, | ||||
JpaRepository<AflServerFeeRefund, String> , | JpaRepository<AflServerFeeRefund, String> , | ||||
JpaSpecificationExecutor<AflServerFeeRefund>{ | JpaSpecificationExecutor<AflServerFeeRefund>{ |
package com.qtzl.alterSales.dao.repo.jpa.third; | package com.qtzl.alterSales.dao.repo.jpa.third; | ||||
import com.qtzl.alterSales.dao.entity.third.EtcApplyOrder; | import com.qtzl.alterSales.dao.entity.third.EtcApplyOrder; | ||||
import com.qtzl.alterSales.dao.excelVO.head.serviceFee50.ExcelHead50ServiceFeeVO; | |||||
import org.springframework.data.jpa.repository.JpaRepository; | import org.springframework.data.jpa.repository.JpaRepository; | ||||
import org.springframework.data.jpa.repository.Query; | import org.springframework.data.jpa.repository.Query; | ||||
import org.springframework.data.repository.query.Param; | |||||
import java.time.LocalDateTime; | |||||
import java.util.Date; | import java.util.Date; | ||||
import java.util.List; | import java.util.List; | ||||
@Override | @Override | ||||
public String handleInternal(String filename, Report50ServiceFeeQueryRequest request) throws ServiceHandleException, IOException { | public String handleInternal(String filename, Report50ServiceFeeQueryRequest request) throws ServiceHandleException, IOException { | ||||
logger.info("报表-50元服务费"); | |||||
// 处理参数 | // 处理参数 | ||||
if(StringUtils.isEmpty(request.getSubMchId())) { | if(StringUtils.isEmpty(request.getSubMchId())) { | ||||
request.setSubMchId(this.subMchId); | request.setSubMchId(this.subMchId); |
public Report50ServiceFeeQueryHandler(AflReportFromServiceFeeDataRepo aflReportFromServiceFeeDataRepo) { | public Report50ServiceFeeQueryHandler(AflReportFromServiceFeeDataRepo aflReportFromServiceFeeDataRepo) { | ||||
super(AfterSalesCmd.REPORTEXPORT50SERVICEFEEQUERY, Report50ServiceFeeQueryPageRequest.class); | super(AfterSalesCmd.REPORTEXPORT50SERVICEFEEQUERY, Report50ServiceFeeQueryPageRequest.class); | ||||
this.aflReportFromServiceFeeDataRepo = aflReportFromServiceFeeDataRepo; | |||||
} | } | ||||
@Override | @Override | ||||
try { | try { | ||||
String jsonStr = JSONUtil.toJsonStr(request); | String jsonStr = JSONUtil.toJsonStr(request); | ||||
logger.info("报表-50元服务费报表导出查询,请求参数:{}", jsonStr); | logger.info("报表-50元服务费报表导出查询,请求参数:{}", jsonStr); | ||||
Integer year = request.getYear(); | |||||
Integer month = request.getMonth(); | |||||
if (year == null && month == null) { | |||||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("参数年月不可为空"); | |||||
} | |||||
Pageable pageable = PageRequest.of(request.getPageNo() - 1, request.getPageSize()); | Pageable pageable = PageRequest.of(request.getPageNo() - 1, request.getPageSize()); | ||||
Specification<AflReportServiceFeeData> specification = getSpecification(request); | Specification<AflReportServiceFeeData> specification = getSpecification(request); | ||||
return JsonUtils.toJsonStr(response); | return JsonUtils.toJsonStr(response); | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
logger.error("选装-根据日期查询发行数据(人车卡签信息):{}", e.getMessage()); | |||||
logger.error("选装-50元服务费报表导出查询:{}", e.getMessage()); | |||||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("操作失败"); | throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("操作失败"); | ||||
} | } | ||||
} | } |
private String naturalDate; | private String naturalDate; | ||||
private Integer startDate; | |||||
private Integer endDate; | |||||
public String getNaturalDate() { | public String getNaturalDate() { | ||||
return naturalDate; | return naturalDate; | ||||
} | } | ||||
public void setNaturalDate(String naturalDate) { | public void setNaturalDate(String naturalDate) { | ||||
this.naturalDate = naturalDate; | this.naturalDate = naturalDate; | ||||
} | } | ||||
public Integer getStartDate() { | |||||
return startDate; | |||||
} | |||||
public void setStartDate(Integer startDate) { | |||||
this.startDate = startDate; | |||||
} | |||||
public Integer getEndDate() { | |||||
return endDate; | |||||
} | |||||
public void setEndDate(Integer endDate) { | |||||
this.endDate = endDate; | |||||
} | |||||
} | } |
*/ | */ | ||||
public class FssPaccountFinalbillFindPageRequest extends JpaPageableDataRequest<AflPaccountReceivableBillVo> { | public class FssPaccountFinalbillFindPageRequest extends JpaPageableDataRequest<AflPaccountReceivableBillVo> { | ||||
/** 自然日 */ | |||||
private Integer accountDate ; | |||||
/** | |||||
* 自然日 | |||||
*/ | |||||
private Integer accountDate; | |||||
private Integer startDate; | |||||
private Integer endDate; | |||||
@Override | @Override | ||||
public HqlBuilder toSelectHql() { | public HqlBuilder toSelectHql() { | ||||
// HqlBuilder builder = new HqlBuilder(" SELECT new com.qtzl.alterSales.manager.vo.FssPaccountFinalbillVo(naturalDate, SUM(payCount), SUM(payAmount) , SUM(refundCount), SUM(refundAmount) ) from FssPaccountFinalbill GROUP BY naturalDate "); | // HqlBuilder builder = new HqlBuilder(" SELECT new com.qtzl.alterSales.manager.vo.FssPaccountFinalbillVo(naturalDate, SUM(payCount), SUM(payAmount) , SUM(refundCount), SUM(refundAmount) ) from FssPaccountFinalbill GROUP BY naturalDate "); | ||||
HqlBuilder builder = new HqlBuilder(" SELECT new com.qtzl.alterSales.manager.vo.AflPaccountReceivableBillVo(accountDate, SUM(payCount), SUM(payAmount) , SUM(refundCount), SUM(refundAmount) ) from AflPaccountReceivableBill GROUP BY accountDate "); | |||||
HqlBuilder builder = new HqlBuilder(" SELECT new com.qtzl.alterSales.manager.vo.AflPaccountReceivableBillVo(accountDate, SUM(payCount), SUM(payAmount) , SUM(refundCount), SUM(refundAmount) ) from AflPaccountReceivableBill GROUP BY accountDate "); | |||||
appendParam(builder); | appendParam(builder); | ||||
builder.append( " ORDER BY accountDate DESC "); | |||||
builder.append(" ORDER BY accountDate DESC "); | |||||
return builder; | return builder; | ||||
} | } | ||||
private void appendParam(HqlBuilder builder) { | private void appendParam(HqlBuilder builder) { | ||||
if (accountDate!=null){ | |||||
builder.append(" having accountDate = :accountDate", accountDate); | |||||
if (null == accountDate && null == startDate && null == endDate) { | |||||
return; | |||||
} | |||||
builder.append(" having "); | |||||
boolean flag = false; | |||||
if (null != accountDate) { | |||||
builder.append(" accountDate = :accountDate", accountDate); | |||||
flag = true; | |||||
} | |||||
if (null != startDate) { | |||||
builder.append(flag ? " and accountDate >= :startDate" : " accountDate >= :startDate ", startDate); | |||||
flag = true; | |||||
} | |||||
if (null != endDate) { | |||||
builder.append(flag ? " and accountDate <= :endDate" : " accountDate <= :endDate ", endDate); | |||||
} | } | ||||
} | } | ||||
public void setAccountDate(Integer accountDate) { | public void setAccountDate(Integer accountDate) { | ||||
this.accountDate = accountDate; | this.accountDate = accountDate; | ||||
} | } | ||||
public Integer getStartDate() { | |||||
return startDate; | |||||
} | |||||
public void setStartDate(Integer startDate) { | |||||
this.startDate = startDate; | |||||
} | |||||
public Integer getEndDate() { | |||||
return endDate; | |||||
} | |||||
public void setEndDate(Integer endDate) { | |||||
this.endDate = endDate; | |||||
} | |||||
} | } |
FssPaccountFinalbillVo fssPaccountFinalbillVo = new FssPaccountFinalbillVo(); | FssPaccountFinalbillVo fssPaccountFinalbillVo = new FssPaccountFinalbillVo(); | ||||
BeanUtil.copyProperties(aflPaccountReceivableBillVo,fssPaccountFinalbillVo); | BeanUtil.copyProperties(aflPaccountReceivableBillVo,fssPaccountFinalbillVo); | ||||
String payDate = getPayDate(aflPaccountReceivableBillVo.getAccountDate().toString()); | String payDate = getPayDate(aflPaccountReceivableBillVo.getAccountDate().toString()); | ||||
log.info("时间类型转换中:"+payDate); | |||||
fssPaccountFinalbillVo.setNaturalDate(payDate); | fssPaccountFinalbillVo.setNaturalDate(payDate); | ||||
return fssPaccountFinalbillVo; | return fssPaccountFinalbillVo; | ||||
} | } | ||||
private String getPayDate(String payDate){ | private String getPayDate(String payDate){ | ||||
log.info("时间类型转换中:"+payDate); | |||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); | SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); | ||||
formatter.setLenient(false); | formatter.setLenient(false); | ||||
Date newDate=null; | Date newDate=null; | ||||
} | } | ||||
formatter = new SimpleDateFormat("yyyy-MM-dd"); | formatter = new SimpleDateFormat("yyyy-MM-dd"); | ||||
String format = formatter.format(newDate); | String format = formatter.format(newDate); | ||||
log.info("时间类型转换成功:"+format); | |||||
return format; | return format; | ||||
} | } | ||||
import com.qtzl.alterSales.manager.enums.AflBydDashboardPushStateEnum; | import com.qtzl.alterSales.manager.enums.AflBydDashboardPushStateEnum; | ||||
import com.qtzl.alterSales.manager.enums.BlackListReson; | import com.qtzl.alterSales.manager.enums.BlackListReson; | ||||
import com.qtzl.alterSales.manager.enums.BlacklistOpType; | import com.qtzl.alterSales.manager.enums.BlacklistOpType; | ||||
import com.qtzl.alterSales.manager.handler.ActivateDataModelVoFindByDayHandler; | |||||
import com.qtzl.alterSales.manager.handler.AflServerFeeRefundExportHandler; | |||||
import com.qtzl.alterSales.manager.handler.AflReportExport50ServiceFeeHandler; | |||||
import com.qtzl.alterSales.manager.handler.AflReportExportIncomeCostHandler; | |||||
import com.qtzl.alterSales.manager.handler.FssPaccountPayResultFindByPayIdHandler; | |||||
import com.qtzl.alterSales.manager.model.protocol.sales.ActivateDataFindByDayRequest; | |||||
import com.qtzl.alterSales.manager.model.protocol.sales.AflServerFeeRefundPageRequest; | |||||
import com.qtzl.alterSales.manager.model.protocol.sales.ChoiceBillsPayRequest; | |||||
import com.qtzl.alterSales.manager.model.protocol.sales.FssPaccountPayResultFindByPayIdRequest; | |||||
import com.qtzl.alterSales.manager.handler.*; | |||||
import com.qtzl.alterSales.manager.model.protocol.sales.*; | import com.qtzl.alterSales.manager.model.protocol.sales.*; | ||||
import com.qtzl.alterSales.manager.model.protocol.sales.report.Report50ServiceFeeQueryRequest; | import com.qtzl.alterSales.manager.model.protocol.sales.report.Report50ServiceFeeQueryRequest; | ||||
import com.qtzl.alterSales.manager.quartz.AflCancelOrderTask; | import com.qtzl.alterSales.manager.quartz.AflCancelOrderTask; | ||||
import com.qtzl.alterSales.manager.quartz.AflPapersDesensitizationTask; | import com.qtzl.alterSales.manager.quartz.AflPapersDesensitizationTask; | ||||
import com.qtzl.alterSales.manager.quartz.BydDashboardResultTask; | import com.qtzl.alterSales.manager.quartz.BydDashboardResultTask; | ||||
import com.qtzl.alterSales.manager.rabbit.RabbitUnifiedProduction; | import com.qtzl.alterSales.manager.rabbit.RabbitUnifiedProduction; | ||||
import com.qtzl.alterSales.manager.service.AflBydDashboardService; | |||||
import com.qtzl.alterSales.manager.service.AflBydExceptionManager; | |||||
import com.qtzl.alterSales.manager.service.AflMchConfigManager; | |||||
import com.qtzl.alterSales.manager.service.AflMchStatisticsLogService; | |||||
import com.qtzl.alterSales.manager.service.ChoiceBillsOperationService; | |||||
import com.qtzl.alterSales.manager.service.*; | |||||
import com.qtzl.alterSales.manager.service.byd.BydService; | import com.qtzl.alterSales.manager.service.byd.BydService; | ||||
import com.qtzl.alterSales.manager.service.byd.vo.BydDashBoardResponse; | import com.qtzl.alterSales.manager.service.byd.vo.BydDashBoardResponse; | ||||
import com.qtzl.alterSales.manager.service.byd.vo.BydPushDataResultRequest; | import com.qtzl.alterSales.manager.service.byd.vo.BydPushDataResultRequest; | ||||
System.out.println("=====" + export); | System.out.println("=====" + export); | ||||
} | } | ||||
@Resource | |||||
private AflReportExport50ServiceFeeHandler aflReportExport50ServiceFeeHandler; | |||||
@Test | |||||
public void reportExcel() throws ServiceHandleException, IOException { | |||||
Report50ServiceFeeQueryRequest request = new Report50ServiceFeeQueryRequest(); | |||||
request.setYear(2024); | |||||
request.setMonth(10); | |||||
String s = aflReportExport50ServiceFeeHandler.handleInternal(null, request); | |||||
System.out.println("======" + s); | |||||
} | |||||
@Resource | |||||
private AflReportExportIncomeCostHandler aflReportExportIncomeCostHandler; | |||||
@Test | |||||
public void reportExcel2() throws ServiceHandleException, IOException { | |||||
AflReportExportIncomeCostRequest request = new AflReportExportIncomeCostRequest(); | |||||
request.setYear(2024); | |||||
request.setMonth(10); | |||||
String s = aflReportExportIncomeCostHandler.handleInternal(null, request); | |||||
System.out.println("======" + s); | |||||
} | |||||
// @Resource | |||||
// private AflReportExport50ServiceFeeHandler aflReportExport50ServiceFeeHandler; | |||||
// @Test | |||||
// public void reportExcel() throws ServiceHandleException, IOException { | |||||
// Report50ServiceFeeQueryRequest request = new Report50ServiceFeeQueryRequest(); | |||||
// request.setYear(2024); | |||||
// request.setMonth(10); | |||||
// | |||||
// String s = aflReportExport50ServiceFeeHandler.handleInternal(null, request); | |||||
// System.out.println("======" + s); | |||||
// } | |||||
// | |||||
// @Resource | |||||
// private AflReportExportIncomeCostHandler aflReportExportIncomeCostHandler; | |||||
// | |||||
// @Test | |||||
// public void reportExcel2() throws ServiceHandleException, IOException { | |||||
// AflReportExportIncomeCostRequest request = new AflReportExportIncomeCostRequest(); | |||||
// request.setYear(2024); | |||||
// request.setMonth(10); | |||||
// | |||||
// String s = aflReportExportIncomeCostHandler.handleInternal(null, request); | |||||
// System.out.println("======" + s); | |||||
// } | |||||
} | } |