@@ -24,8 +24,17 @@ public interface FssPaccountRefundRepo extends AbstractJpaRepo<FssPaccountRefund | |||
* 每天统计每个渠道退费金额 | |||
* @return 每天统计每个渠道退费金额 | |||
*/ | |||
@Query(nativeQuery = true,value = "SELECT DATE_FORMAT(R.insert_time, '%Y-%m-%d') AS stat_date,COALESCE(P.agent_id, 'OTHER') AS channel_id,COUNT(*) AS total_count,SUM(R.refund_Amt) AS total_refund_amt,COALESCE(A.agency_name, 'OTHER') AS agency_name FROM fss_paccount_refund R LEFT JOIN fss_paccount_pay P ON R.pay_Id = P.pay_Id LEFT JOIN afl_agency_mch_rel A ON P.agent_id = A.agency_id\n" + | |||
"WHERE R.insert_time >= CURDATE() - INTERVAL 1 DAY AND R.insert_time < CURDATE() AND R.status = 1 GROUP BY channel_id,agency_name ORDER BY channel_id") | |||
//@Query(nativeQuery = true,value = "SELECT DATE_FORMAT(R.insert_time, '%Y-%m-%d') AS stat_date,COALESCE(P.agent_id, 'OTHER') AS channel_id,COUNT(*) AS total_count,SUM(R.refund_Amt) AS total_refund_amt,COALESCE(A.agency_name, 'OTHER') AS agency_name FROM fss_paccount_refund R LEFT JOIN fss_paccount_pay P ON R.pay_Id = P.pay_Id LEFT JOIN afl_agency_mch_rel A ON P.agent_id = A.agency_id\n" + | |||
// "WHERE R.insert_time >= CURDATE() - INTERVAL 1 DAY AND R.insert_time < CURDATE() AND R.status = 1 GROUP BY channel_id,agency_name ORDER BY channel_id") | |||
//List<Object[]> findRefundStatsGroupByChannelId(); | |||
/** | |||
* lh 对 渠道编号是 52010188999 的,全部累加到 52010188930 | |||
* 每天统计每个渠道退费金额 | |||
* @return 每天统计每个渠道退费金额 | |||
*/ | |||
@Query(nativeQuery = true,value = "SELECT DATE_FORMAT(R.insert_time, '%Y-%m-%d') AS stat_date,CASE WHEN P.agent_id = '52010188999' THEN '52010188930' ELSE COALESCE(P.agent_id, 'OTHER') END AS channel_id,COUNT(*) AS total_count,SUM(R.refund_Amt) AS total_refund_amt,COALESCE(A.agency_name, 'OTHER') AS agency_name FROM fss_paccount_refund R LEFT JOIN fss_paccount_pay P ON R.pay_Id = P.pay_Id \n" + | |||
"LEFT JOIN afl_agency_mch_rel A ON P.agent_id = A.agency_id WHERE R.insert_time >= CURDATE() - INTERVAL 1 DAY AND R.insert_time < CURDATE() AND R.status = 1 GROUP BY channel_id, agency_name ORDER BY channel_id") | |||
List<Object[]> findRefundStatsGroupByChannelId(); | |||
@Query(value = " select SUM(fpr.refund_Amt) from fss_paccount_refund fpr left join fss_paccount_pay fpp on fpr.pay_id=fpp.pay_id " + |
@@ -3,7 +3,6 @@ package com.qtzl.alterSales.manager.handler.refund; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.common.pub.BeanTools; | |||
import com.qtzl.alterSales.dao.entity.second.refund.RefundStats; | |||
import com.qtzl.alterSales.dao.repo.jpa.primary.FssPaccountRefundRepo; | |||
import com.qtzl.alterSales.dao.repo.jpa.primary.page.FssPaccountRefundSpecifications; | |||
import com.qtzl.alterSales.dao.repo.jpa.second.refund.RefundStatsRepo; | |||
import com.qtzl.alterSales.manager.abstracts.AbstractAfterSalesManager; | |||
@@ -100,8 +99,6 @@ public class RefundStatisticsPageHandler extends AbstractAfterSalesManager<Refun | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("操作失败"); | |||
} | |||
} | |||
@Resource | |||
private FssPaccountRefundRepo fssPaccountRefundRepo; | |||
/** | |||
* 导出退费数据 | |||
@@ -191,7 +188,7 @@ public class RefundStatisticsPageHandler extends AbstractAfterSalesManager<Refun | |||
private Specification<RefundStats> createSpecification(RefundStatisticsPageRequest request) { | |||
List<Specification<RefundStats>> specs = new ArrayList<>(); | |||
// 发行方编号 | |||
specs.add(Optional.ofNullable(request.getChannelId()) | |||
specs.add(Optional.ofNullable(request.getQdId()) | |||
.map(FssPaccountRefundSpecifications::withChannelId) | |||
.orElse(Specification.where(null))); | |||
@@ -1,21 +1,18 @@ | |||
package com.qtzl.alterSales.manager.model.protocol.refund; | |||
import com.qtzl.alterSales.manager.model.protocol.AbstractAfterSalesPageRequest; | |||
import com.qtzl.alterSales.manager.model.protocol.AbstractSampleRequest; | |||
import com.qtzl.alterSales.manager.model.protocol.refund.annotaion.AllowedValues; | |||
import com.txffp.api.core.manager.comm.annotation.Api; | |||
import org.springframework.util.ObjectUtils; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.Pattern; | |||
import java.time.LocalDateTime; | |||
import java.time.format.DateTimeFormatter; | |||
/** | |||
* 人工审核 发起退款 | |||
* @author lihao | |||
*/ | |||
@Api(cmdClazz = FssPaccountRefundCmd.class, cmd = "AUDITTOREFUND") | |||
public class RefundAuditRequest extends AbstractAfterSalesPageRequest<RefundAuditResponse> { | |||
public class RefundAuditRequest extends AbstractSampleRequest<RefundAuditResponse> { | |||
/** | |||
* 退款申请id | |||
@@ -24,7 +21,7 @@ public class RefundAuditRequest extends AbstractAfterSalesPageRequest<RefundAudi | |||
private String id; | |||
/** | |||
* 审核结果 1 通过 2 驳回 | |||
* 审核结果 3 通过 2 驳回 | |||
*/ | |||
@NotBlank(message = "审核结果不能为空") | |||
@AllowedValues(value = "2,3", message = "值必须为[2,3]") |
@@ -2,6 +2,7 @@ package com.qtzl.alterSales.manager.model.protocol.refund; | |||
import com.qtzl.alterSales.manager.model.protocol.AbstractAfterSalesPageResponse; | |||
import com.qtzl.alterSales.manager.model.protocol.AbstractSampleResponse; | |||
import com.qtzl.alterSales.manager.model.protocol.refund.config.RefundIsAuditModel; | |||
/** | |||
@@ -9,15 +10,6 @@ import com.qtzl.alterSales.manager.model.protocol.refund.config.RefundIsAuditMod | |||
* @author lihao | |||
* @date 2023/12/13 | |||
*/ | |||
public class RefundAuditResponse extends AbstractAfterSalesPageResponse<RefundIsAuditModel> { | |||
public class RefundAuditResponse extends AbstractSampleResponse<RefundIsAuditModel> { | |||
private boolean hasData; | |||
public boolean isHasData() { | |||
return hasData; | |||
} | |||
public void setHasData(boolean hasData) { | |||
this.hasData = hasData; | |||
} | |||
} |
@@ -21,7 +21,7 @@ public class RefundStatisticsPageRequest extends AbstractAfterSalesPageRequest<R | |||
/** | |||
* 渠道编号 | |||
*/ | |||
private String channelId; | |||
private String qdId; | |||
/** | |||
* 开始统计时间 | |||
@@ -45,15 +45,15 @@ public class RefundStatisticsPageRequest extends AbstractAfterSalesPageRequest<R | |||
@NotBlank(message = "导入或查询_操作不能为空,可选值(EXPORT/QUERY)") | |||
private String exportOrQuery; | |||
public String getChannelId() { | |||
return channelId; | |||
public String getQdId() { | |||
return qdId; | |||
} | |||
public void setChannelId(String channelId) { | |||
if (!ObjectUtils.isEmpty(channelId)) { | |||
channelId = channelId.trim(); | |||
public void setQdId(String qdId) { | |||
if (!ObjectUtils.isEmpty(qdId)) { | |||
qdId = qdId.trim(); | |||
} | |||
this.channelId = channelId; | |||
this.qdId = qdId; | |||
} | |||
public String getExportOrQuery() { |