Merge branch '20221008' into local_20221010
| | |
| | | Map map=umfPayUtil.pay(orderid, DateUtils.getCurrentDateString(),openid,amount); |
| | | return R.ok(map); |
| | | } |
| | | @ApiOperation("无水洗车下单接口") |
| | | @GetMapping("/wsPay") |
| | | public R wsPay(@RequestParam("orderid") String orderid,@RequestParam("openid")String openid,@RequestParam("amount")String amount){ |
| | | Map map=umfPayUtil.pay2(orderid, DateUtils.getCurrentDateString(),openid,amount); |
| | | return R.ok(map); |
| | | } |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import me.chanjar.weixin.common.error.WxErrorException; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 登录 |
| | |
| | | @GetMapping("uu/getQRCode") |
| | | public R uuLogin(@RequestParam("couponId") String couponId) { |
| | | try { |
| | | WxMaQrcodeService qrCodeService = wxMaConfiguration.getMaService("wx118de8a734d269f0").getQrcodeService(); |
| | | byte[] bytes = qrCodeService.createWxaCodeUnlimitBytes("couponId=" + couponId, |
| | | "packageD/pages/user/getCoupon/getCoupon", true, "release", 30, true, null, false); |
| | | return R.ok(String.format("data:image/png;base64,%s", Base64.encode(bytes))); |
| | | //i小懒 |
| | | WxMaQrcodeService wsCodeService = wxMaConfiguration.getMaService("wx98d62711dfbd8425").getQrcodeService(); |
| | | byte[] bytes = wsCodeService.createWxaCodeUnlimitBytes("couponId=" + couponId, |
| | | "/pages/user/getCoupon/getCoupon", true, "release", 30, true, null, false); |
| | | String res = String.format("data:image/png;base64,%s", Base64.encode(bytes)); |
| | | |
| | | //花城 |
| | | WxMaQrcodeService uuCodeService = wxMaConfiguration.getMaService("wx118de8a734d269f0").getQrcodeService(); |
| | | byte[] hcBytes = uuCodeService.createWxaCodeUnlimitBytes("couponId=" + couponId, |
| | | "/packageD/pages/user/getCoupon/getCoupon", true, "release", 30, true, null, false); |
| | | String hcRes = String.format("data:image/png;base64,%s", Base64.encode(hcBytes)); |
| | | |
| | | Map<String,String> retMap = new HashMap<>(); |
| | | retMap.put("ixiaolan",res); |
| | | retMap.put("huacheng",hcRes); |
| | | return R.ok(retMap); |
| | | } catch (Exception e) { |
| | | log.error("generate QRCode failed:" + e.getMessage()); |
| | | return R.fail("generate QRCode failed"); |
| | |
| | | } |
| | | |
| | | } |
| | | @ApiOperation("ws洗车推送") |
| | | @PostMapping("/wsPush") |
| | | public R wsPush(@RequestBody String aesString){ |
| | | try { |
| | | Map<String, String> aesMap= (Map<String, String>) JSON.parse(aesString); |
| | | String desString=MyAESUtil.Decrypt(aesMap.get("aesString"),"Ryo7M3n8loC5Abcd"); |
| | | Map<String,String> desMap= (Map) JSON.parse(desString); |
| | | return userService.wsPush(desMap.get("washer_mobile"),desMap.get("phone"),desMap.get("washer_name"),Integer.parseInt(desMap.get("order_status"))); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.fail("推送失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | | @GetMapping("/settle") |
| | | public R settle(String settleDate){ |
| | |
| | | Map respMap = instance.miniProgramPayMap(reqMapPublic); |
| | | return respMap; |
| | | } |
| | | public Map pay2(String orderid,String merdate,String openid,String amount){ |
| | | Map reqMapPublic = preparePublic2(orderid,merdate,openid,amount,notifyUrl); |
| | | UmfService instance = new UmfServiceImpl("53461",file); |
| | | Map respMap = instance.miniProgramPayMap(reqMapPublic); |
| | | return respMap; |
| | | } |
| | | public Map repay(String orderid,String merdate,String refundNo,String refundAmount,String orgAmount){ |
| | | Map reqMapPublic=prepareRepay(orderid,merdate,refundNo,refundAmount,orgAmount); |
| | | UmfService instance = new UmfServiceImpl("53461",file); |
| | |
| | | return reqMap; |
| | | } |
| | | //小程序支付请求参数 |
| | | public static Map preparePublic2(String orderid,String merdate,String openid,String amount,String notifyUrl) { |
| | | Map reqMap = new HashMap(); |
| | | reqMap.put("mer_id","53461"); |
| | | reqMap.put("notify_url",notifyUrl); |
| | | reqMap.put("goods_inf","无水洗车服务"); |
| | | reqMap.put("order_id",orderid); |
| | | reqMap.put("mer_date",merdate); |
| | | reqMap.put("amount",amount); |
| | | reqMap.put("app_id","wx98d62711dfbd8425"); |
| | | reqMap.put("open_id",openid); |
| | | reqMap.put("scancode_type","WECHAT"); |
| | | return reqMap; |
| | | } |
| | | //小程序支付请求参数 |
| | | public static Map prepareRepay(String orderid,String merdate,String refundNo,String refundAmount,String orgAmount) { |
| | | Map reqMap = new HashMap(); |
| | | reqMap.put("mer_id","53461"); |
| | |
| | | */ |
| | | @GetMapping("/uuPush") |
| | | R uuPush(@RequestParam("washPhone")String washPhone,@RequestParam("phone")String phone,@RequestParam("washName")String washName,@RequestParam("orderStatus")Integer orderStatus); |
| | | |
| | | /** |
| | | * 无水洗车推送 |
| | | * @param washPhone |
| | | * @param phone |
| | | * @param washName |
| | | * @param orderStatus |
| | | * @return |
| | | */ |
| | | @GetMapping("/wsPush") |
| | | R wsPush(@RequestParam("washPhone")String washPhone,@RequestParam("phone")String phone,@RequestParam("washName")String washName,@RequestParam("orderStatus")Integer orderStatus); |
| | | @GetMapping("/communityList") |
| | | R communityList(@RequestParam("name") String name, @RequestParam("id") Long id); |
| | | |
| | |
| | | } |
| | | return accessToken; |
| | | } |
| | | |
| | | public String getWsAccessToken() throws Exception { |
| | | String accessToken = "0"; |
| | | try { |
| | | log.info("获取微信token参数:appid=" + APP_ID + ",appSecret=" + APP_SECRET); |
| | | String accessTokenUrl = ACCESS_TOKEN_URL + "&appid=wx98d62711dfbd8425"+ "&secret=97a2a10b990c2774ed279724337b5337"; |
| | | String result = HttpClientUtil.httpGet(accessTokenUrl, null, null); |
| | | Map<String, Object> resultMap = JSON.parseObject(result, Map.class); |
| | | if (resultMap.containsKey("access_token")) { |
| | | accessToken = resultMap.get("access_token").toString(); |
| | | } |
| | | } catch (IOException ioe) { |
| | | log.error("小程序http请求异常"); |
| | | ioe.printStackTrace(); |
| | | } |
| | | return accessToken; |
| | | } |
| | | /** |
| | | * 获取西区社区通微信token |
| | | * @return 西区社区通微信token |
| | |
| | | return userService.uuPush(washPhone,phone,washName,orderStatus); |
| | | } |
| | | |
| | | /** |
| | | * 无水洗车推送 |
| | | * @param washPhone |
| | | * @param phone |
| | | * @param washName |
| | | * @param orderStatus |
| | | * @return |
| | | */ |
| | | @GetMapping("/wsPush") |
| | | public R wsPush(@RequestParam(value = "washPhone",required = false)String washPhone,@RequestParam("phone")String phone,@RequestParam(value = "washName",required = false)String washName,@RequestParam("orderStatus")Integer orderStatus){ |
| | | return userService.wsPush(washPhone,phone,washName,orderStatus); |
| | | } |
| | | |
| | | @GetMapping("/indexData/getAreaAndStreet") |
| | | public R getAreaAndStreet(){ |
| | | return userService.getAreaAndStreet(); |
| | |
| | | R uuPush(@RequestParam("washPhone")String washPhone,@RequestParam("phone")String phone,@RequestParam("washName")String washName,@RequestParam("orderStatus")Integer orderStatus); |
| | | |
| | | /** |
| | | * 无水洗车通知推送 |
| | | * @param phone |
| | | * @param orderStatus |
| | | * @return |
| | | */ |
| | | R wsPush(@RequestParam("washPhone")String washPhone,@RequestParam("phone")String phone,@RequestParam("washName")String washName,@RequestParam("orderStatus")Integer orderStatus); |
| | | |
| | | /** |
| | | * 获取城镇或村落列表 |
| | | * */ |
| | | R getCommunityList(String name,Long id); |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R wsPush(String washPhone,String phone,String washName,Integer orderStatus) { |
| | | if(StringUtils.isNotEmpty(phone)){ |
| | | SysUserDO sysUserDO=userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getPhone,phone).eq(SysUserDO::getAppId,"wx98d62711dfbd8425").orderByDesc(SysUserDO::getCreateAt).last("limit 1")); |
| | | if(sysUserDO!=null&&StringUtils.isNotEmpty(sysUserDO.getOpenid())){ |
| | | String status=""; |
| | | String accessToken=""; |
| | | WxXCXTempSend util = new WxXCXTempSend(); |
| | | try { |
| | | accessToken = util.getWsAccessToken(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | switch (orderStatus){ |
| | | case 3 : status="已分配车美"; |
| | | WxUtil.sendUuWash3(sysUserDO.getOpenid(),accessToken,status,washName,washPhone,phone,"sNj6m-JBvW6rOokKGDX9X3-XH1AD0GY5_X0jA9JSLwc"); |
| | | break; |
| | | case 4 : status="车美已开始服务"; |
| | | WxUtil.sendUuWash4(sysUserDO.getOpenid(),accessToken,status,washName,washPhone,phone,"Eft5ksvsnOQANy2uNOGY43CC3pb33eDGA_lgCEoxuiw"); |
| | | break; |
| | | case 6 : status="订单确认完成"; |
| | | WxUtil.sendUuWash6(sysUserDO.getOpenid(),accessToken,status,washName,washPhone,phone,"iPS8yrsGDqy76hiP8bIbxkosveoX1xTFhdusSiGp-XM"); |
| | | break; |
| | | case 9 : status="订单已取消"; |
| | | WxUtil.sendUuWash(sysUserDO.getOpenid(),accessToken,status,washName,washPhone,phone,"z_ysGXz9JWBc2rXuYZzVCXKJTyLf0w0WerrohuNoEng"); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | @Override |
| | | public R getCommunityList(String name,Long id) { |
| | | //区级账号名 |