From 639b38f89b78b43c680dd6dd08f57edb3cb43d61 Mon Sep 17 00:00:00 2001 From: hu177768073 <177768073@qq.com> Date: Tue, 24 Sep 2024 13:42:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/cweb/controller/HighTestController.java | 2 +- .../src/main/java/com/hai/config/ShellGroupService.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java index 82745409..78ebea8f 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java @@ -1 +1 @@ -package com.cweb.controller; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cweb.config.SysConst; import com.hai.common.Base64Util; import com.hai.common.QRCodeGenerator; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.enum_type.LoginPlatform; import com.hai.enum_type.MerchantStoreSourceType; import com.hai.model.*; import com.hai.pay.channel.huift.TradeService; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContexts; import org.apache.http.util.EntityUtils; import org.bouncycastle.util.encoders.UrlBase64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.util.IdGenerator; import org.springframework.web.bind.annotation.*; import sun.nio.cs.StreamEncoder; import javax.annotation.Resource; import javax.net.ssl.SSLContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.security.KeyStore; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private PayloService payloService; @Resource private HighGasService gasService; @Resource private HighUserService userService; @Resource private HighOrderService orderService; @Resource private HighMerchantStoreService merchantStoreService; @RequestMapping(value = "/invalidCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "重庆CNPC电子券作废") public ResponseData invalidCoupon(@RequestParam(name = "couponNo", required = true) String couponNo, @RequestParam(name = "random", required = false) String random) { try { return ResponseMsgUtil.success(ChongQingCNPCService.invalidCoupon(couponNo, null)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/costRechargeOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "costRechargeOrder") public ResponseData costRechargeOrder() { try { JSONObject returnParam = JSONObject.parseObject("{\"respMessage\":\"ok\",\"data\":\"Gbkl57c3fEBg+E3HfPuQ55SDLVyAf2Ys3VN1cifAfXIoT1gnbFR0Nfupa+4sowIdXJ67nC57v4Oi\\nVTimfZ1NiLLnhV9Ip3O3LewpnKqdhJh56X7oeY/ZnCEc/I7SWsTgv1Mol+ZVYxNjFD41RM4NWcxR\\nNYjA4iAIgJaFnLhaaj0aBqz5R4dM5c+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8p7I87+GM+5ab3\\nSK8isyi/1atB/RPSAwEqVatbF6I8COm+HkFU8VZkVYvADBlggNSeIo1Cq/IppSaq+Z1jvsqq+IfE\\n93P/dFIHG79PprphtnSR8qin1/gy/CpUoICQbyBsSV+hQB1PqKs6iiNLB9Pft2ZBAg6axft7Ehph\\no53UmYTqvnbN/hzX0O4EiSvaSBkrdu9F12gVImK3qQVCWO2YCYkZSD9myPsTY5xKd8BU4+diUcRs\\nRkwH7UoTcgtQic3UZwBL8wfjlBKwXNYI/lvdu7iG1R67oS0/EeEb050jpIYa2mpGBRxe8YxLg/od\\ncxBXCrX5k/J+/CgMPEpM6+AX/CKwOZ3J+RaWtrExJLMwOEGf14T0KdxgX2FzxFUyUkWuNmWLjJs/\\nBjpCjwMVusY819raZWLfgDJO6bf56G2nk0A4rxCrtGCQy5ziEu04k635sIJ2tzBgrwtIgvkvGsTB\\n7ryBk5pt1R635zkDpLP0H0aai0KepzEXnclFGooP6BhOh82BA5K2iXvcOQ4hfnqIF9RYAzs/8jg9\\nC/366udb8X6aCN9xu4oiyHgvFSoL4kIetE1sj0fRPldWcZVAL84Z2kM1Ho40pvkaQO+eFjET/7fa\\ndEtTq7DJYFXL2ZNVO5NXtN0PEQWfiv6NjnT0mA==\",\"sign\":\"092D1C30297952E42D02C44681BE0FA4\",\"respCode\":\"0000\",\"responseId\":\"1722851470478\"}"); // 解密 JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data")); JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class); return ResponseMsgUtil.success(dataArray); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/hltCardRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "汇联通卡退款") public ResponseData hltCardRefund() { try { String refundOrderNo = "R240807134052188"; String paySerialNo = "240801075734765689"; JSONObject refund = HuiLianTongUnionCardConfig.refund(refundOrderNo, paySerialNo); if(!refund.getString("respCode").equals("0000")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR,refund.getString("respMessage")); } JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(refund.getString("data")); if (consumptionResult.getBoolean("success") != true) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "交易失败!"+consumptionResult.getString("message")); } return ResponseMsgUtil.success(consumptionResult); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @Resource private MqttProviderConfig mqttProviderConfig; @Resource private HighGasOrderService gasOrderService; @RequestMapping(value = "/mqttpublish", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "mqttpublish") public ResponseData mqttpublish() { try { HighGasOrder gasOrder = gasOrderService.getDetailByOrderNo("HF2022080713272355608"); JSONObject param = new JSONObject(); param.put("id", System.currentTimeMillis()); param.put("type", 5); //param.put("vType", 0); //param.put("vMessage", "嗨加油新订单,加油金额"+gasOrder.getGasRefuelPrice()+"元,请注意查收"); JSONArray contents = new JSONArray(); // 标题 JSONObject title = new JSONObject(); title.put("cont", "嗨加油"); title.put("type", "title"); contents.add(title); // 油站名称 JSONObject merName = new JSONObject(); merName.put("cont", gasOrder.getStoreName() + "(补打)"); merName.put("type", "text"); merName.put("align", "center"); merName.put("bold", true); contents.add(merName); // 存根 JSONObject stub = new JSONObject(); stub.put("cont", "(收银员存根)"); stub.put("type", "text"); stub.put("align", "center"); contents.add(stub); // 分割线 JSONObject divLine1 = new JSONObject(); divLine1.put("cont", ""); divLine1.put("type", "div_star"); contents.add(divLine1); // 订单号 JSONObject orderNo = new JSONObject(); orderNo.put("cont", "流水:" + gasOrder.getOrderNo()); orderNo.put("type", "text"); contents.add(orderNo); // 分割线 JSONObject divLine2 = new JSONObject(); divLine2.put("cont", ""); divLine2.put("type", "div_star"); contents.add(divLine2); // 打印时间 JSONObject printTime = new JSONObject(); printTime.put("cont", "打印时间:" + DateUtil.date2String(new Date(), DateUtil.Y_M_D_HMS)); printTime.put("type", "text"); contents.add(printTime); // 支付时间 JSONObject payTime = new JSONObject(); payTime.put("cont", "支付时间:" + DateUtil.date2String(gasOrder.getPayTime(), DateUtil.Y_M_D_HMS)); payTime.put("type", "text"); contents.add(payTime); // 电话 JSONObject userPhone = new JSONObject(); userPhone.put("cont", "电话:" + (StringUtils.isNotBlank(gasOrder.getMemPhone())?gasOrder.getMemPhone().substring(0, 3) + "****" + gasOrder.getMemPhone().substring(7):"")); userPhone.put("type", "text"); contents.add(userPhone); // 来源 JSONObject source = new JSONObject(); source.put("cont", "来源:" + "嗨加油"); source.put("type", "text"); contents.add(source); // 枪号 JSONObject gunNo = new JSONObject(); gunNo.put("cont", "油枪:" + gasOrder.getGasGunNo()+"号"); gunNo.put("type", "text"); contents.add(gunNo); // 油品 JSONObject oilNo = new JSONObject(); oilNo.put("cont", "油品:" + gasOrder.getGasOilNo()+"#"); oilNo.put("type", "text"); contents.add(oilNo); // 升数 JSONObject oilLiters = new JSONObject(); oilLiters.put("cont", "升数:" + gasOrder.getGasOilLiters()+"升"); oilLiters.put("type", "text"); contents.add(oilLiters); // 升数描述 JSONObject oilLitersDesc = new JSONObject(); oilLitersDesc.put("cont", "实际加油升数以油站加油机为准!"); oilLitersDesc.put("type", "text"); contents.add(oilLitersDesc); // 分割线 JSONObject divLine3 = new JSONObject(); divLine3.put("cont", ""); divLine3.put("type", "div_star"); contents.add(divLine3); // 加油金额标题 JSONObject refuelPriceTitle = new JSONObject(); refuelPriceTitle.put("cont", "加油金额"); refuelPriceTitle.put("type", "text"); refuelPriceTitle.put("size", "11"); contents.add(refuelPriceTitle); // 加油金额 JSONObject refuelPrice = new JSONObject(); refuelPrice.put("cont", "¥" + gasOrder.getGasRefuelPrice() + "元"); refuelPrice.put("type", "text"); refuelPrice.put("size", "11"); contents.add(refuelPrice); // 分割线 JSONObject divLine4 = new JSONObject(); divLine4.put("cont", ""); divLine4.put("type", "div_star"); contents.add(divLine4); // 小票底部 JSONObject receiptBottom = new JSONObject(); receiptBottom.put("cont", "开心又省钱;来“ 嗨森逛 ”"); receiptBottom.put("type", "text"); receiptBottom.put("align", "center"); contents.add(receiptBottom); JSONObject cut = new JSONObject(); cut.put("cont", "1"); cut.put("type", "cut"); contents.add(cut); param.put("contents", contents); mqttProviderConfig.publish(1, false, "SW242300044/submsg", param.toJSONString()); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/ycShellPageQueryAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "订单退款") public ResponseData ycShellPageQueryAllStation() { try { return ResponseMsgUtil.success(payloService.ycShellPageQueryAllStation(1, 50)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/HuiLianTongConfigPayOrderByCouNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "") public ResponseData HuiLianTongConfigPayOrderByCouNo(@RequestParam(name = "couNo", required = true) String couNo) { try { JSONObject jsonObject = HuiLianTongConfig.getPayOrderByCouNo(couNo); if (jsonObject.getString("respCode").equals("0000")) { JSONObject data = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data")); return ResponseMsgUtil.success(data); } else { log.error("getRechargeProduct error!", "查询失败!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "查询失败"); } } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getPayloAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "paylo油站") public ResponseData getPayloAllStation(HttpServletRequest request) { try { gasService.getPayloAllStation(); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @Resource private TradeService tradeService; @RequestMapping(value = "/huiftTrade", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "huiftTrade") public ResponseData huiftTrade(HttpServletRequest request) { try { // return ResponseMsgUtil.success(tradeService.thirdPreOrder(orderService.getOrderByOrderNo("2024040215535447310"))); return ResponseMsgUtil.success(tradeService.thirdPayResult("P17124793186600955280")); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/loginBySilence", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "【H5】根据手机号登录") public ResponseData loginBySilence(@RequestParam(value = "phone", required = true) String phone , HttpServletRequest request, HttpServletResponse response) { try { // 客户端 LoginPlatform platform = LoginPlatform.getDataByType("H5"); if (platform == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知客户端"); } return ResponseMsgUtil.success(userService.loginAndRegister(platform, phone, null, new HashMap<>(), request, response)); } catch (Exception e) { return ResponseMsgUtil.exception(e); } } @Resource private HighQzOrderService highQzOrderService; @RequestMapping(value = "/getCinemaOrderByOrderNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getCinemaOrderByOrderNo") public ResponseData getCinemaOrderByOrderNo(HttpServletRequest request, HttpServletResponse response) { try { return ResponseMsgUtil.success(QianZhuConfig.getCinemaOrderByOrderNo("20240429164821205766001")); // return ResponseMsgUtil.success(highQzOrderService.assemblyQzOrder("20240429164821205766001", "CINEMA")); } catch (Exception e) { return ResponseMsgUtil.exception(e); } } public static void main(String[] args) throws Exception { // 读取json文件内容 BufferedReader reader = new BufferedReader(new FileReader("C:/Users/hurui/Desktop/无标题.json")); StringBuilder jsonContent = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { jsonContent.append(line); } reader.close(); // 解析json字符串 JSONArray dataList = JSONObject.parseObject(jsonContent.toString()).getJSONArray("RECORDS"); for (Object obj : dataList) { JSONObject data = (JSONObject) obj; // 生成二维码 String qrCodeImg = data.getString("store_key")+".png"; String qrCodeUrl = "D:/qrCode/" + qrCodeImg; //参数 String param = "https://hsg.dctpay.com/hsgH5?accountId=000000&gasKey="+data.getString("store_key")+"&code="; QRCodeGenerator.generateQRCodeImage(param, 350, 350, qrCodeUrl); } } } \ No newline at end of file +package com.cweb.controller; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.cweb.config.SysConst; import com.hai.common.Base64Util; import com.hai.common.QRCodeGenerator; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.enum_type.LoginPlatform; import com.hai.enum_type.MerchantStoreSourceType; import com.hai.model.*; import com.hai.pay.channel.huift.TradeService; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContexts; import org.apache.http.util.EntityUtils; import org.bouncycastle.util.encoders.UrlBase64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.util.IdGenerator; import org.springframework.web.bind.annotation.*; import sun.nio.cs.StreamEncoder; import javax.annotation.Resource; import javax.net.ssl.SSLContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.security.KeyStore; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private PayloService payloService; @Resource private HighGasService gasService; @Resource private HighUserService userService; @Resource private HighOrderService orderService; @Resource private HighMerchantStoreService merchantStoreService; @RequestMapping(value = "/invalidCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "重庆CNPC电子券作废") public ResponseData invalidCoupon(@RequestParam(name = "couponNo", required = true) String couponNo, @RequestParam(name = "random", required = false) String random) { try { return ResponseMsgUtil.success(ChongQingCNPCService.invalidCoupon(couponNo, null)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/costRechargeOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "costRechargeOrder") public ResponseData costRechargeOrder() { try { JSONObject returnParam = JSONObject.parseObject("{\"respMessage\":\"ok\",\"data\":\"Gbkl57c3fEBg+E3HfPuQ55SDLVyAf2Ys3VN1cifAfXIoT1gnbFR0Nfupa+4sowIdXJ67nC57v4Oi\\nVTimfZ1NiLLnhV9Ip3O3LewpnKqdhJh56X7oeY/ZnCEc/I7SWsTgv1Mol+ZVYxNjFD41RM4NWcxR\\nNYjA4iAIgJaFnLhaaj0aBqz5R4dM5c+bCTnqwAd4a6s5umDZJLtSPJAdpfsV4l/WtnhMYTjCrYO8\\nGgKuHwQ17gCOzLwy8K9ZnZAuMtHHMFGNavjAAdmIsNMnkbRfbMkdMFw9nti/uKciSvpRIfsmFzNf\\nEXtpbqCbcbzneGzb7Nfwf6/0cItdxCzwM/rJs/QuCwJbGTVCxwoR8hf3M/pjYANIB7WhjHvt+vIT\\nh4F0njU+OXiPCI/WKi4hyNpebkZPhp5ZPTTnYck+Jr+ZAZjp86JmoQfC1n6rZXbOpeekXt2VODtr\\nsv7AQVRBZSBwNqL90WsuFqEM+nnNg11S6fmZF4GE27GwSUaXIE6pMAtKjv+OrSiKg0Ew6Ekf+XR5\\nF9SoEEaVZqEXBl5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UyUkWuNmWLjJs/\\nBjpCjwMVusY819raZWLfgDJO6bf56G2nk0A4rxCrtGCQy5ziEu04k635sIJ2tzBgrwtIgvkvGsTB\\n7ryBk5pt1R635zkDpLP0H0aai0KepzEXnclFGooP6BhOh82BA5K2iXvcOQ4hfnqIF9RYAzs/8jg9\\nC/366udb8X6aCN9xu4oiyHgvFSoL4kIetE1sj0fRPldWcZVAL84Z2kM1Ho40pvkaQO+eFjET/7fa\\ndEtTq7DJYFXL2ZNVO5NXtN0PEQWfiv6NjnT0mA==\",\"sign\":\"092D1C30297952E42D02C44681BE0FA4\",\"respCode\":\"0000\",\"responseId\":\"1722851470478\"}"); // 解密 JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data")); JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class); return ResponseMsgUtil.success(dataArray); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/hltCardRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "汇联通卡退款") public ResponseData hltCardRefund() { try { /* String refundOrderNo = "R240822152713981838"; String paySerialNo = "240822152713981838"; JSONObject refund = HuiLianTongUnionCardConfig.refund(refundOrderNo, paySerialNo); if(!refund.getString("respCode").equals("0000")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR,refund.getString("respMessage")); } JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(refund.getString("data")); if (consumptionResult.getBoolean("success") != true) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "交易失败!"+consumptionResult.getString("message")); }*/ String orderNo = "240802154320375547"; String cardNo = "8800030115015104107"; BigDecimal payPrice = new BigDecimal("39.25"); JSONObject consumption = HuiLianTongUnionCardConfig.consumption(orderNo,cardNo, payPrice, "HiSen_phg_goods", "11101608","商品商家已发货,客户已签收。补扣款","商品商家已发货,客户已签收。补扣款"); if (!consumption.getString("respCode").equals("0000")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage")); } // 响应参数 JSONObject consumptionResult = HuiLianTongUnionCardConfig.resolveResponse(consumption.getString("data")); if (consumptionResult.getBoolean("success") != true) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message")); } return ResponseMsgUtil.success(consumptionResult); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @Resource private MqttProviderConfig mqttProviderConfig; @Resource private HighGasOrderService gasOrderService; @RequestMapping(value = "/mqttpublish", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "mqttpublish") public ResponseData mqttpublish() { try { HighGasOrder gasOrder = gasOrderService.getDetailByOrderNo("HF2022080713272355608"); JSONObject param = new JSONObject(); param.put("id", System.currentTimeMillis()); param.put("type", 5); //param.put("vType", 0); //param.put("vMessage", "嗨加油新订单,加油金额"+gasOrder.getGasRefuelPrice()+"元,请注意查收"); JSONArray contents = new JSONArray(); // 标题 JSONObject title = new JSONObject(); title.put("cont", "嗨加油"); title.put("type", "title"); contents.add(title); // 油站名称 JSONObject merName = new JSONObject(); merName.put("cont", gasOrder.getStoreName() + "(补打)"); merName.put("type", "text"); merName.put("align", "center"); merName.put("bold", true); contents.add(merName); // 存根 JSONObject stub = new JSONObject(); stub.put("cont", "(收银员存根)"); stub.put("type", "text"); stub.put("align", "center"); contents.add(stub); // 分割线 JSONObject divLine1 = new JSONObject(); divLine1.put("cont", ""); divLine1.put("type", "div_star"); contents.add(divLine1); // 订单号 JSONObject orderNo = new JSONObject(); orderNo.put("cont", "流水:" + gasOrder.getOrderNo()); orderNo.put("type", "text"); contents.add(orderNo); // 分割线 JSONObject divLine2 = new JSONObject(); divLine2.put("cont", ""); divLine2.put("type", "div_star"); contents.add(divLine2); // 打印时间 JSONObject printTime = new JSONObject(); printTime.put("cont", "打印时间:" + DateUtil.date2String(new Date(), DateUtil.Y_M_D_HMS)); printTime.put("type", "text"); contents.add(printTime); // 支付时间 JSONObject payTime = new JSONObject(); payTime.put("cont", "支付时间:" + DateUtil.date2String(gasOrder.getPayTime(), DateUtil.Y_M_D_HMS)); payTime.put("type", "text"); contents.add(payTime); // 电话 JSONObject userPhone = new JSONObject(); userPhone.put("cont", "电话:" + (StringUtils.isNotBlank(gasOrder.getMemPhone())?gasOrder.getMemPhone().substring(0, 3) + "****" + gasOrder.getMemPhone().substring(7):"")); userPhone.put("type", "text"); contents.add(userPhone); // 来源 JSONObject source = new JSONObject(); source.put("cont", "来源:" + "嗨加油"); source.put("type", "text"); contents.add(source); // 枪号 JSONObject gunNo = new JSONObject(); gunNo.put("cont", "油枪:" + gasOrder.getGasGunNo()+"号"); gunNo.put("type", "text"); contents.add(gunNo); // 油品 JSONObject oilNo = new JSONObject(); oilNo.put("cont", "油品:" + gasOrder.getGasOilNo()+"#"); oilNo.put("type", "text"); contents.add(oilNo); // 升数 JSONObject oilLiters = new JSONObject(); oilLiters.put("cont", "升数:" + gasOrder.getGasOilLiters()+"升"); oilLiters.put("type", "text"); contents.add(oilLiters); // 升数描述 JSONObject oilLitersDesc = new JSONObject(); oilLitersDesc.put("cont", "实际加油升数以油站加油机为准!"); oilLitersDesc.put("type", "text"); contents.add(oilLitersDesc); // 分割线 JSONObject divLine3 = new JSONObject(); divLine3.put("cont", ""); divLine3.put("type", "div_star"); contents.add(divLine3); // 加油金额标题 JSONObject refuelPriceTitle = new JSONObject(); refuelPriceTitle.put("cont", "加油金额"); refuelPriceTitle.put("type", "text"); refuelPriceTitle.put("size", "11"); contents.add(refuelPriceTitle); // 加油金额 JSONObject refuelPrice = new JSONObject(); refuelPrice.put("cont", "¥" + gasOrder.getGasRefuelPrice() + "元"); refuelPrice.put("type", "text"); refuelPrice.put("size", "11"); contents.add(refuelPrice); // 分割线 JSONObject divLine4 = new JSONObject(); divLine4.put("cont", ""); divLine4.put("type", "div_star"); contents.add(divLine4); // 小票底部 JSONObject receiptBottom = new JSONObject(); receiptBottom.put("cont", "开心又省钱;来“ 嗨森逛 ”"); receiptBottom.put("type", "text"); receiptBottom.put("align", "center"); contents.add(receiptBottom); JSONObject cut = new JSONObject(); cut.put("cont", "1"); cut.put("type", "cut"); contents.add(cut); param.put("contents", contents); mqttProviderConfig.publish(1, false, "SW242300044/submsg", param.toJSONString()); return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/ycShellPageQueryAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "订单退款") public ResponseData ycShellPageQueryAllStation() { try { return ResponseMsgUtil.success(payloService.ycShellPageQueryAllStation(1, 50)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/HuiLianTongConfigPayOrderByCouNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "") public ResponseData HuiLianTongConfigPayOrderByCouNo(@RequestParam(name = "couNo", required = true) String couNo) { try { JSONObject jsonObject = HuiLianTongConfig.getPayOrderByCouNo(couNo); if (jsonObject.getString("respCode").equals("0000")) { JSONObject data = HuiLianTongUnionCardConfig.resolveResponse(jsonObject.getString("data")); return ResponseMsgUtil.success(data); } else { log.error("getRechargeProduct error!", "查询失败!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "查询失败"); } } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getPayloAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "paylo油站") public ResponseData getPayloAllStation(HttpServletRequest request) { try { gasService.getPayloAllStation(); return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @Resource private TradeService tradeService; @RequestMapping(value = "/huiftTrade", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "huiftTrade") public ResponseData huiftTrade(HttpServletRequest request) { try { // return ResponseMsgUtil.success(tradeService.thirdPreOrder(orderService.getOrderByOrderNo("2024040215535447310"))); return ResponseMsgUtil.success(tradeService.thirdPayResult("P17124793186600955280")); } catch (Exception e) { log.error("HighOrderController --> unionStagingPay() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/loginBySilence", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "【H5】根据手机号登录") public ResponseData loginBySilence(@RequestParam(value = "phone", required = true) String phone , HttpServletRequest request, HttpServletResponse response) { try { // 客户端 LoginPlatform platform = LoginPlatform.getDataByType("H5"); if (platform == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知客户端"); } return ResponseMsgUtil.success(userService.loginAndRegister(platform, phone, null, new HashMap<>(), request, response)); } catch (Exception e) { return ResponseMsgUtil.exception(e); } } @Resource private HighQzOrderService highQzOrderService; @RequestMapping(value = "/getCinemaOrderByOrderNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getCinemaOrderByOrderNo") public ResponseData getCinemaOrderByOrderNo(HttpServletRequest request, HttpServletResponse response) { try { return ResponseMsgUtil.success(QianZhuConfig.getCinemaOrderByOrderNo("20240429164821205766001")); // return ResponseMsgUtil.success(highQzOrderService.assemblyQzOrder("20240429164821205766001", "CINEMA")); } catch (Exception e) { return ResponseMsgUtil.exception(e); } } public static void main(String[] args) throws Exception { // 读取json文件内容 BufferedReader reader = new BufferedReader(new FileReader("C:/Users/hurui/Desktop/无标题.json")); StringBuilder jsonContent = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { jsonContent.append(line); } reader.close(); // 解析json字符串 JSONArray dataList = JSONObject.parseObject(jsonContent.toString()).getJSONArray("RECORDS"); for (Object obj : dataList) { JSONObject data = (JSONObject) obj; // 生成二维码 String qrCodeImg = data.getString("store_key")+".png"; String qrCodeUrl = "D:/qrCode/" + qrCodeImg; //参数 String param = "https://hsg.dctpay.com/hsgH5?accountId=000000&gasKey="+data.getString("store_key")+"&code="; QRCodeGenerator.generateQRCodeImage(param, 350, 350, qrCodeUrl); } } } \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/config/ShellGroupService.java b/hai-service/src/main/java/com/hai/config/ShellGroupService.java index 11dc8354..887c6a9b 100644 --- a/hai-service/src/main/java/com/hai/config/ShellGroupService.java +++ b/hai-service/src/main/java/com/hai/config/ShellGroupService.java @@ -86,13 +86,13 @@ public class ShellGroupService { param.put("stationCode", stationCode); param.put("orderType", "OIL"); param.put("finishTime", DateUtil.date2String(finishTime, "yyyy-MM-dd HH:mm:ss")); - param.put("channelFavourAmount", channelFavourAmount); + // param.put("channelFavourAmount", channelFavourAmount); Map tradeOilOrder = new HashMap<>(); tradeOilOrder.put("amount", oilPrice); tradeOilOrder.put("code", oilCode); tradeOilOrder.put("oilGun", oilGun); - tradeOilOrder.put("channelSettlementAmount", settlementAmount); + tradeOilOrder.put("channelSettlementAmount", oilPrice); param.put("tradeOilOrder", JSONObject.toJSONString(tradeOilOrder)); return request(orderNo.replace("HF",""), "gas_sync_payment_notify", param); } catch (Exception e) {