| @@ -33,19 +33,12 @@ import java.util.Date; | |||||
| @Slf4j | @Slf4j | ||||
| @RestController | @RestController | ||||
| public class BaseController { | public class BaseController { | ||||
| @Autowired | |||||
| private boolean isFmOpen; | |||||
| @Autowired | @Autowired | ||||
| private WxMerchantBUserService wxMerchantBUserService; | private WxMerchantBUserService wxMerchantBUserService; | ||||
| @Autowired | @Autowired | ||||
| private WxAppinfoService wxAppinfoService; | private WxAppinfoService wxAppinfoService; | ||||
| @Autowired | |||||
| private FmOpenService openService; | |||||
| @Autowired | |||||
| private CUserTokenService cUserTokenService; | |||||
| @Autowired | @Autowired | ||||
| MaUtil maUtil; | MaUtil maUtil; | ||||
| @@ -3,7 +3,6 @@ package com.iformall.controller; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxMerchantBUser; | import com.iformall.domain.po.WxMerchantBUser; | ||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.pay.WxPayConstant; | import com.iformall.pay.WxPayConstant; | ||||
| import com.iformall.service.PosBrunService; | import com.iformall.service.PosBrunService; | ||||
| @@ -21,6 +20,7 @@ import java.util.Map; | |||||
| @RequestMapping("/api/pos") | @RequestMapping("/api/pos") | ||||
| @Api(description = "POS服务相关接口") | @Api(description = "POS服务相关接口") | ||||
| public class PosController extends BaseController { | public class PosController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| @@ -24,8 +24,8 @@ import io.swagger.annotations.ApiOperation; | |||||
| @AllArgsConstructor | @AllArgsConstructor | ||||
| @Api(description = "POS订单接口") | @Api(description = "POS订单接口") | ||||
| public class PosOrderController extends BaseController { | public class PosOrderController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| private final PosOrderService posOrderService; | private final PosOrderService posOrderService; | ||||
| @@ -21,11 +21,11 @@ import io.swagger.annotations.ApiOperation; | |||||
| @AllArgsConstructor | @AllArgsConstructor | ||||
| @Api(description = "POS支付订单接口") | @Api(description = "POS支付订单接口") | ||||
| public class PosPayOrderController extends BaseController { | public class PosPayOrderController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| private final PosPayOrderService posPayOrderService; | private final PosPayOrderService posPayOrderService; | ||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -1,7 +1,5 @@ | |||||
| package com.iformall.controller; | package com.iformall.controller; | ||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| @@ -29,6 +27,7 @@ import java.util.Map; | |||||
| @Api(description = "账单") | @Api(description = "账单") | ||||
| @RequestMapping("/api/bill") | @RequestMapping("/api/bill") | ||||
| public class WxBillController extends BaseController { | public class WxBillController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| @@ -1,6 +1,5 @@ | |||||
| package com.iformall.controller; | package com.iformall.controller; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| @@ -29,6 +28,7 @@ import java.util.Map; | |||||
| @Api(description = "C端扫B端商户码储值卡支付") | @Api(description = "C端扫B端商户码储值卡支付") | ||||
| @RequestMapping("/api/cardPay") | @RequestMapping("/api/cardPay") | ||||
| public class WxCardPayController extends BaseController { | public class WxCardPayController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| @@ -9,7 +9,6 @@ import com.iformall.enums.EnumCashOutStatus; | |||||
| import com.iformall.enums.EnumPayShare; | import com.iformall.enums.EnumPayShare; | ||||
| import com.iformall.enums.EnumPayWay; | import com.iformall.enums.EnumPayWay; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -17,7 +16,6 @@ import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Date; | |||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| @@ -37,6 +35,7 @@ import org.springframework.web.bind.annotation.*; | |||||
| @RequestMapping("/api/cashout") | @RequestMapping("/api/cashout") | ||||
| @Api(description = "提现相关接口") | @Api(description = "提现相关接口") | ||||
| public class WxCashOutController extends BaseController { | public class WxCashOutController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| @@ -27,6 +27,7 @@ import java.util.List; | |||||
| @RequestMapping("/api/wxCouponChannel") | @RequestMapping("/api/wxCouponChannel") | ||||
| @Api(description = "优惠券投放接口") | @Api(description = "优惠券投放接口") | ||||
| public class WxCouponChannelController extends BaseController { | public class WxCouponChannelController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| @@ -0,0 +1,68 @@ | |||||
| package com.iformall.interceptor; | |||||
| import com.alibaba.fastjson.JSON; | |||||
| import lombok.extern.slf4j.Slf4j; | |||||
| import org.aspectj.lang.ProceedingJoinPoint; | |||||
| import org.aspectj.lang.annotation.Around; | |||||
| import org.aspectj.lang.annotation.Aspect; | |||||
| import org.aspectj.lang.annotation.Pointcut; | |||||
| import org.springframework.context.annotation.Configuration; | |||||
| import org.springframework.web.context.request.RequestAttributes; | |||||
| import org.springframework.web.context.request.RequestContextHolder; | |||||
| import org.springframework.web.context.request.ServletRequestAttributes; | |||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import java.io.BufferedReader; | |||||
| import java.io.IOException; | |||||
| /** | |||||
| * 测试所有controler请求返回信息输出 | |||||
| * @author alascor | |||||
| * | |||||
| */ | |||||
| @Aspect | |||||
| @Configuration | |||||
| @Slf4j | |||||
| public class TestControllerReturnAspect { | |||||
| @Pointcut("execution(* com.iformall.controller.*Controller.*(..))") | |||||
| public void excudeService() { | |||||
| } | |||||
| @Around("excudeService()") | |||||
| public Object doAround(ProceedingJoinPoint pjp) throws Throwable { | |||||
| RequestAttributes ra = RequestContextHolder.getRequestAttributes(); | |||||
| ServletRequestAttributes sra = (ServletRequestAttributes) ra; | |||||
| HttpServletRequest request = sra.getRequest(); | |||||
| String method = request.getMethod(); | |||||
| String uri = request.getRequestURI(); | |||||
| String paraString = JSON.toJSONString(request.getParameterMap()); | |||||
| String requestBody = getBodyRequest(request); | |||||
| //log.info("***************************************************"); | |||||
| //log.info("请求开始, URI: {}, method: {}, params: {}", uri, method, paraString); | |||||
| // result的值就是被拦截方法的返回值 | |||||
| Object result = pjp.proceed(); | |||||
| log.info("开发调试请求结果日志,生产请关闭!!!!>>>>>>>>请求结束,URI: {}, method: {}, params: {},requestBody:{}. 返回值:{} " ,uri, method, paraString,requestBody, JSON.toJSONString(result)); | |||||
| return result; | |||||
| } | |||||
| private String getBodyRequest(HttpServletRequest request) throws IOException { | |||||
| // 直接从HttpServletRequest的Reader流中获取RequestBody | |||||
| BufferedReader reader = request.getReader(); | |||||
| StringBuilder builder = new StringBuilder(); | |||||
| String line = reader.readLine(); | |||||
| while(line != null){ | |||||
| builder.append(line); | |||||
| line = reader.readLine(); | |||||
| } | |||||
| reader.close(); | |||||
| String reqBody = builder.toString(); | |||||
| return reqBody; | |||||
| } | |||||
| } | |||||
| @@ -2962,11 +2962,11 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| List<Long> merchantCouponIds = wxCouponMerchantMapper.findMerchantProductIds(tenantEntity.getTenantId(), merchantIds, null); | List<Long> merchantCouponIds = wxCouponMerchantMapper.findMerchantProductIds(tenantEntity.getTenantId(), merchantIds, null); | ||||
| WxCoupon couponQ = new WxCoupon(); | WxCoupon couponQ = new WxCoupon(); | ||||
| couponQ.updateTenantInfo(tenantEntity); | couponQ.updateTenantInfo(tenantEntity); | ||||
| List<Integer> statusList = new ArrayList<Integer>(); | |||||
| statusList.add(1); | |||||
| statusList.add(2); | |||||
| statusList.add(6); | |||||
| couponQ.setStatusList(statusList); | |||||
| List<Integer> typeList = new ArrayList<Integer>(); | |||||
| typeList.add(EnumCouponType.COUPON_MANJIAN.getCode()); | |||||
| typeList.add(EnumCouponType.COUPON_DAIJIN.getCode()); | |||||
| typeList.add(EnumCouponType.COUPON_MULTIMCH.getCode()); | |||||
| couponQ.setTypes(typeList); | |||||
| List<Long> couponIds = wxCouponMapper.findIdList(couponQ); | List<Long> couponIds = wxCouponMapper.findIdList(couponQ); | ||||
| List<Long> realCouponIds = new ArrayList<Long>(); | List<Long> realCouponIds = new ArrayList<Long>(); | ||||
| if (null != merchantCouponIds) { | if (null != merchantCouponIds) { | ||||
| @@ -308,13 +308,6 @@ | |||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != statusList "> | |||||
| and status in | |||||
| <foreach collection="statusList" index="index" item="statusItem" open="(" separator="," close=")"> | |||||
| #{statusItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != types "> | <if test=" null != types "> | ||||
| and type in | and type in | ||||
| <foreach collection="types" index="index" item="typeItem" open="(" separator="," close=")"> | <foreach collection="types" index="index" item="typeItem" open="(" separator="," close=")"> | ||||