| @@ -25,6 +25,8 @@ import org.springframework.web.bind.annotation.RestController; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.HashMap; | |||
| import java.util.Map; | |||
| @RestController | |||
| @RequestMapping("aliCircle") | |||
| @@ -53,6 +55,27 @@ public class AliBusinessCircleOrderController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("统计接口") | |||
| @GetMapping("statistics") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| @SystemControllerLog(description = "-统计") | |||
| public ResultData statistics(@ModelAttribute AliBusinessCircleOrder circleOrder) { | |||
| logger.debug("[" + getIpAddr() + "] AliBusinessCircleOrderController::statistics"); | |||
| if (null == circleOrder) { | |||
| circleOrder = new AliBusinessCircleOrder(); | |||
| } | |||
| circleOrder.updateTenantInfo(getTenantInfo()); | |||
| Integer sumPayAmount = aliBusinessCircleOrderService.sumCirclePayment(circleOrder); | |||
| Integer sumRefundAmount = aliBusinessCircleOrderService.sumCircleRefundAmount(circleOrder); | |||
| Map resultMap = new HashMap(); | |||
| resultMap.put("sumPayAmount",sumPayAmount); | |||
| resultMap.put("sumRefundAmount",sumRefundAmount); | |||
| return new ResultData(resultMap); | |||
| } | |||
| @ApiOperation("详情接口") | |||
| @GetMapping("detail") | |||
| @ApiImplicitParams({ | |||
| @@ -21,6 +21,8 @@ import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.HashMap; | |||
| import java.util.Map; | |||
| @RestController | |||
| @RequestMapping("wxCircle") | |||
| @@ -49,6 +51,27 @@ public class WxBusinessCircleOrderController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("统计接口") | |||
| @GetMapping("statistics") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| @SystemControllerLog(description = "-统计") | |||
| public ResultData statistics(@ModelAttribute WxBusinessCircleOrder circleOrder) { | |||
| logger.debug("[" + getIpAddr() + "] AliBusinessCircleOrderController::statistics"); | |||
| if (null == circleOrder) { | |||
| circleOrder = new WxBusinessCircleOrder(); | |||
| } | |||
| circleOrder.updateTenantInfo(getTenantInfo()); | |||
| Integer sumPayAmount = wxBusinessCircleOrderService.sumCirclePayment(circleOrder); | |||
| Integer sumRefundAmount = wxBusinessCircleOrderService.sumCircleRefundAmount(circleOrder); | |||
| Map resultMap = new HashMap(); | |||
| resultMap.put("sumPayAmount",sumPayAmount); | |||
| resultMap.put("sumRefundAmount",sumRefundAmount); | |||
| return new ResultData(resultMap); | |||
| } | |||
| @ApiOperation("详情接口") | |||
| @GetMapping("detail") | |||
| @ApiImplicitParams({ | |||
| @@ -5,7 +5,6 @@ import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.AliBusinessCircleOrder; | |||
| import com.iformall.domain.po.WxThirdPartyOrders; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.enums.EnumThirdOrderType; | |||
| @@ -26,6 +25,8 @@ import org.springframework.web.bind.annotation.RestController; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.HashMap; | |||
| import java.util.Map; | |||
| @RestController | |||
| @RequestMapping("thirdCircle") | |||
| @@ -54,6 +55,27 @@ public class WxThirdPartyOrdersController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("统计接口") | |||
| @GetMapping("statistics") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| @SystemControllerLog(description = "-统计") | |||
| public ResultData statistics(@ModelAttribute WxThirdPartyOrders circleOrder) { | |||
| logger.debug("[" + getIpAddr() + "] AliBusinessCircleOrderController::statistics"); | |||
| if (null == circleOrder) { | |||
| circleOrder = new WxThirdPartyOrders(); | |||
| } | |||
| circleOrder.updateTenantInfo(getTenantInfo()); | |||
| Integer sumPayAmount = wxThirdPartyOrdersOrderService.sumCirclePayment(circleOrder); | |||
| Integer sumRefundAmount = wxThirdPartyOrdersOrderService.sumCircleRefundAmount(circleOrder); | |||
| Map resultMap = new HashMap(); | |||
| resultMap.put("sumPayAmount",sumPayAmount); | |||
| resultMap.put("sumRefundAmount",sumRefundAmount); | |||
| return new ResultData(resultMap); | |||
| } | |||
| @ApiOperation("详情接口") | |||
| @GetMapping("detail") | |||
| @ApiImplicitParams({ | |||
| @@ -45,4 +45,6 @@ public interface AliBusinessCircleOrderMapper extends CommonMapper<AliBusinessCi | |||
| void updateOrderStatus(AliBusinessCircleOrder record); | |||
| Integer sumCirclePayment(BusinessCircleBase record); | |||
| Integer sumCircleRefundAmount(BusinessCircleBase circleOrder); | |||
| } | |||
| @@ -48,4 +48,6 @@ public interface WxBusinessCircleOrderMapper extends CommonMapper<WxBusinessCirc | |||
| void updateOrderStatus(WxBusinessCircleOrder record); | |||
| Integer sumCirclePayment(BusinessCircleBase record); | |||
| Integer sumCircleRefundAmount(BusinessCircleBase circleOrder); | |||
| } | |||
| @@ -2,6 +2,7 @@ package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.BusinessCircleBase; | |||
| import com.iformall.domain.po.WxThirdPartyOrders; | |||
| import com.iformall.domain.vo.WxThirdPartyOrdersVo; | |||
| @@ -43,4 +44,8 @@ public interface WxThirdPartyOrdersMapper extends CommonMapper<WxThirdPartyOrder | |||
| */ | |||
| void updateOrderStatus(WxThirdPartyOrders record); | |||
| Integer sumCirclePayment(BusinessCircleBase record); | |||
| Integer sumCircleRefundAmount(BusinessCircleBase circleOrder); | |||
| } | |||
| @@ -55,4 +55,6 @@ public interface AliBusinessCircleOrderService { | |||
| void exportData(AliBusinessCircleOrder circleOrder, HttpServletRequest request, HttpServletResponse response); | |||
| Integer sumCirclePayment(BusinessCircleBase circleOrder); | |||
| Integer sumCircleRefundAmount(BusinessCircleBase circleOrder); | |||
| } | |||
| @@ -58,5 +58,7 @@ public interface WxBusinessCircleOrderService { | |||
| void exportData(WxBusinessCircleOrder circleOrder, HttpServletRequest request, HttpServletResponse response); | |||
| Integer sumCirclePayment(BusinessCircleBase circleOrder); | |||
| Integer sumCirclePayment(BusinessCircleBase circleOrder); | |||
| Integer sumCircleRefundAmount(BusinessCircleBase circleOrder); | |||
| } | |||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.BusinessCircleBase; | |||
| import com.iformall.domain.po.WxThirdPartyOrders; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumThirdOrderType; | |||
| @@ -60,4 +61,8 @@ public interface WxThirdPartyOrdersService { | |||
| void exportData(WxThirdPartyOrders circleOrder, HttpServletRequest request, HttpServletResponse response); | |||
| void exportDataVo(WxThirdPartyOrders circleOrder, HttpServletRequest request, HttpServletResponse response); | |||
| Integer sumCirclePayment(BusinessCircleBase circleOrder); | |||
| Integer sumCircleRefundAmount(BusinessCircleBase circleOrder); | |||
| } | |||
| @@ -76,6 +76,8 @@ public class WxPayOrderServiceHelper { | |||
| return EnumPayStatus.PAY_STATUS_WAIT.getCode(); | |||
| }else if ("PAYERROR".equals(trade_state)) { | |||
| return EnumPayStatus.PAY_STATUS_FAIL.getCode(); | |||
| }else if ("FAIL".equals(trade_state)) { | |||
| return EnumPayStatus.PAY_STATUS_FAIL.getCode(); | |||
| } | |||
| throw new MallinkException(ErrorCode.PAY_ORDER_ERROR.getCode(), "订单查询微信支付状态非法["+trade_state+"]"+payOrderNo); | |||
| }else { | |||
| @@ -365,4 +365,10 @@ public class AliBusinessCircleOrderServiceImpl implements AliBusinessCircleOrder | |||
| return sumCirclePayment==null?0:sumCirclePayment; | |||
| } | |||
| @Override | |||
| public Integer sumCircleRefundAmount(BusinessCircleBase circleOrder) { | |||
| Integer sumCircleRefundAmount = aliBusinessCircleOrderMapper.sumCircleRefundAmount(circleOrder); | |||
| return sumCircleRefundAmount==null?0:sumCircleRefundAmount; | |||
| } | |||
| } | |||
| @@ -378,5 +378,11 @@ public class WxBusinessCircleOrderServiceImpl implements WxBusinessCircleOrderSe | |||
| return sumCirclePayment==null?0:sumCirclePayment; | |||
| } | |||
| @Override | |||
| public Integer sumCircleRefundAmount(BusinessCircleBase circleOrder) { | |||
| Integer sumCircleRefundAmount = wxBusinessCircleOrderMapper.sumCircleRefundAmount(circleOrder); | |||
| return sumCircleRefundAmount==null?0:sumCircleRefundAmount; | |||
| } | |||
| } | |||
| @@ -462,4 +462,16 @@ public class WxThirdPartyOrdersServiceImpl implements WxThirdPartyOrdersService | |||
| List<WxThirdPartyOrdersVo> list = wxThirdPartyOrdersMapper.findListVo(circleOrder); | |||
| excelService.exportExcel(list, null, "第三方积分抵扣", WxThirdPartyOrdersVo.class, "第三方积分抵扣.xlsx", response, false); | |||
| } | |||
| @Override | |||
| public Integer sumCirclePayment(BusinessCircleBase circleOrder) { | |||
| Integer sumCirclePayment = wxThirdPartyOrdersMapper.sumCirclePayment(circleOrder); | |||
| return sumCirclePayment==null?0:sumCirclePayment; | |||
| } | |||
| @Override | |||
| public Integer sumCircleRefundAmount(BusinessCircleBase circleOrder) { | |||
| Integer sumCircleRefundAmount = wxThirdPartyOrdersMapper.sumCircleRefundAmount(circleOrder); | |||
| return sumCircleRefundAmount==null?0:sumCircleRefundAmount; | |||
| } | |||
| } | |||
| @@ -127,7 +127,7 @@ | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.AliBusinessCircleOrder" resultMap="BaseResultMap"> | |||
| @@ -135,6 +135,7 @@ | |||
| <include refid="allColumns"/> | |||
| from ali_business_circle_order | |||
| <include refid="dynamicWhereConditions"/> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </select> | |||
| <select id="getById" parameterType="com.iformall.domain.po.AliBusinessCircleOrder" resultMap="BaseResultMap"> | |||
| @@ -216,22 +217,16 @@ | |||
| select | |||
| IFNULL(SUM(`pay_amount`),0) as sum_pay_amount | |||
| from ali_business_circle_order | |||
| where 1=1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != merchantId "> | |||
| and `merchant_id` = #{merchantId} | |||
| </if> | |||
| <if test=" null != startTime "> | |||
| and `time_end` >= #{startTime} | |||
| </if> | |||
| <if test=" null != endTime"> | |||
| and `time_end` < #{endTime} | |||
| </if> | |||
| <include refid="dynamicWhereConditions"/> | |||
| and is_refund = 0 | |||
| </select> | |||
| <select id="sumCircleRefundAmount" parameterType="com.iformall.domain.po.BusinessCircleBase" resultType="Integer"> | |||
| select | |||
| IFNULL(SUM(`refund_amount`),0) as sum_refund_amount | |||
| from ali_business_circle_order | |||
| <include refid="dynamicWhereConditions"/> | |||
| and is_refund = 1 | |||
| </select> | |||
| </mapper> | |||
| @@ -148,7 +148,7 @@ | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxBusinessCircleOrder" resultMap="BaseResultMap"> | |||
| @@ -156,6 +156,7 @@ | |||
| <include refid="allColumns"/> | |||
| from wx_business_circle_order | |||
| <include refid="dynamicWhereConditions"/> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </select> | |||
| <select id="getById" parameterType="com.iformall.domain.po.WxBusinessCircleOrder" resultMap="BaseResultMap"> | |||
| @@ -244,27 +245,20 @@ | |||
| where `id` = #{id} and `tenant_id` = #{tenantId} | |||
| </update> | |||
| <select id="sumCirclePayment" parameterType="com.iformall.domain.po.BusinessCircleBase" resultType="Integer"> | |||
| select | |||
| IFNULL(SUM(`pay_amount`),0) as sum_pay_amount | |||
| from wx_business_circle_order | |||
| where 1=1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != merchantId "> | |||
| and `merchant_id` = #{merchantId} | |||
| </if> | |||
| <if test=" null != startTime "> | |||
| and `time_end` >= #{startTime} | |||
| </if> | |||
| <if test=" null != endTime"> | |||
| and `time_end` < #{endTime} | |||
| </if> | |||
| <include refid="dynamicWhereConditions"/> | |||
| and is_refund = 0 | |||
| </select> | |||
| <select id="sumCircleRefundAmount" parameterType="com.iformall.domain.po.BusinessCircleBase" resultType="Integer"> | |||
| select | |||
| IFNULL(SUM(`refund_amount`),0) as sum_refund_amount | |||
| from wx_business_circle_order | |||
| <include refid="dynamicWhereConditions"/> | |||
| and is_refund = 1 | |||
| </select> | |||
| </mapper> | |||
| @@ -147,7 +147,7 @@ | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxThirdPartyOrders" resultMap="BaseResultMap"> | |||
| @@ -155,6 +155,7 @@ | |||
| <include refid="allColumns"/> | |||
| from wx_third_party_orders | |||
| <include refid="dynamicWhereConditions"/> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </select> | |||
| <select id="findListVo" parameterType="com.iformall.domain.po.WxThirdPartyOrders" resultType="com.iformall.domain.vo.WxThirdPartyOrdersVo"> | |||
| @@ -242,4 +243,20 @@ | |||
| where `id` = #{id} and `tenant_id` = #{tenantId} | |||
| </update> | |||
| <select id="sumCirclePayment" parameterType="com.iformall.domain.po.BusinessCircleBase" resultType="Integer"> | |||
| select | |||
| IFNULL(SUM(`pay_amount`),0) as sum_pay_amount | |||
| from wx_third_party_orders | |||
| <include refid="dynamicWhereConditions"/> | |||
| and is_refund = 0 | |||
| </select> | |||
| <select id="sumCircleRefundAmount" parameterType="com.iformall.domain.po.BusinessCircleBase" resultType="Integer"> | |||
| select | |||
| IFNULL(SUM(`refund_amount`),0) as sum_refund_amount | |||
| from wx_third_party_orders | |||
| <include refid="dynamicWhereConditions"/> | |||
| and is_refund = 1 | |||
| </select> | |||
| </mapper> | |||