| | |
| | | import com.dsh.account.service.RechargeRecordsService; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.service.UserIntegralChangesService; |
| | | import com.dsh.account.util.PayMoneyUtil; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import com.dsh.account.util.TokenUtil; |
| | | import com.dsh.account.util.ToolUtil; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 使用福利 控制器 |
| | |
| | | private UserIntegralChangesService uicService; |
| | | |
| | | private final SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<List<Goods>> pointsMallList(MallRequest request) { |
| | | // try { |
| | | System.out.println("======request========" + request); |
| | | return ResultUtil.success(tauService.queryAppUserIntegral(request)); |
| | | // }catch (Exception e){ |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | } |
| | | |
| | | |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public synchronized ResultUtil productRedemptionOperation(GoodsExchangeVo exchangeType) { |
| | | public ResultUtil productRedemptionOperation(GoodsExchangeVo exchangeType) { |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if (null == userIdFormRedis) { |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coupon/weChatPaymentCouponCallback") |
| | | public void weChatPaymentCouponCallback(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request); |
| | | if(null != map){ |
| | | String code = map.get("out_trade_no"); |
| | | String trade_no = map.get("transaction_id"); |
| | | String result = map.get("result"); |
| | | ResultUtil resultUtil = tauService.paymentCouponCallback(code, trade_no); |
| | | if(resultUtil.getCode() == 200){ |
| | | PrintWriter out = response.getWriter(); |
| | | out.print(result); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coupon/aliPaymentCouponCallback") |
| | | public void aliPaymentCouponCallback(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | if(null != map){ |
| | | String code = map.get("out_trade_no"); |
| | | String trade_no = map.get("trade_no"); |
| | | ResultUtil resultUtil = tauService.paymentCouponCallback(code, trade_no); |
| | | if(resultUtil.getCode() == 200){ |
| | | PrintWriter out = response.getWriter(); |
| | | out.print("success"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(value = "记录id", name = "detailsId", required = true, dataType = "string"), |
| | | }) |
| | | public ResultUtil<PointDetailsVo> redemptionDetails(Long detailsId) { |
| | | // try { |
| | | PointDetailsVo pointDetailsVo = uicService.queryRedemptionDetails(detailsId); |
| | | pointDetailsVo.getPics().remove(0); |
| | | return ResultUtil.success(pointDetailsVo); |
| | | // }catch (Exception e){ |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | } |
| | | |
| | | |