From d752345fb288eed9c53e1fc3ec06174b262fcda3 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Sun, 7 Apr 2024 11:19:55 +0800 Subject: [PATCH] Merge branch 'new-dev' into 2.0-dev # Conflicts: # hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderCreateHandleServiceImpl.java # hai-service/src/main/java/com/hai/openApi/service/impl/ApiOrderServiceImpl.java --- .../controller/Etc/EtcCustomerController.java | 113 +- .../bweb/controller/Etc/OcrController.java | 15 +- .../bweb/controller/FileUploadController.java | 11 + .../bweb/controller/HighTestController.java | 2 +- .../controller/Etc/EtcCustomerController.java | 344 ++++ .../web/controller/OrderPayController.java | 10 +- hai-service/pom.xml | 7 +- .../java/com/hai/common/utils/WxUtils.java | 20 + .../java/com/hai/config/CommonSysConfig.java | 3 + .../main/java/com/hai/config/EtcService.java | 272 ++- .../com/hai/config/WxMaConfiguration.java | 16 +- .../java/com/hai/config/WxOrderConfig.java | 5 + .../com/hai/dao/EtcContractOrderMapper.java | 158 ++ .../hai/dao/EtcContractOrderMapperExt.java | 7 + .../hai/dao/EtcContractOrderSqlProvider.java | 444 +++++ .../java/com/hai/entity/EtcContractOrder.java | 369 ++++ .../hai/entity/EtcContractOrderExample.java | 1533 +++++++++++++++++ .../com/hai/enum_type/EtcProductEnum.java | 45 + .../com/hai/enum_type/EtcVarietyEnum.java | 43 + .../java/com/hai/etc/EtcCarMsgService.java | 47 +- .../java/com/hai/etc/EtcCustMsgService.java | 3 + .../hai/etc/impl/EtcCarMsgServiceImpl.java | 107 +- .../hai/etc/impl/EtcCustMsgServiceImpl.java | 27 + .../java/com/hai/ocr/AliYunOcrService.java | 17 + .../service/OrderCreateHandleService.java | 1 + .../impl/OrderCreateHandleServiceImpl.java | 26 + .../impl/OrderPaySuccessServiceImpl.java | 40 + .../order/service/impl/OrderServiceImpl.java | 6 + .../hai/order/type/OrderChildGoodsType.java | 1 + .../com/hai/order/type/OrderProductType.java | 1 + .../java/com/hai/order/type/PlatformType.java | 1 + .../java/com/hai/order/utils/OrderUtil.java | 16 + .../hai/service/impl/HighGasServiceImpl.java | 18 + .../resources/dev/commonConfig.properties | 7 +- .../prod-9401/commonConfig.properties | 7 +- .../resources/prod/commonConfig.properties | 5 + 36 files changed, 3647 insertions(+), 100 deletions(-) create mode 100644 hai-cweb/src/main/java/com/cweb/controller/Etc/EtcCustomerController.java create mode 100644 hai-service/src/main/java/com/hai/dao/EtcContractOrderMapper.java create mode 100644 hai-service/src/main/java/com/hai/dao/EtcContractOrderMapperExt.java create mode 100644 hai-service/src/main/java/com/hai/dao/EtcContractOrderSqlProvider.java create mode 100644 hai-service/src/main/java/com/hai/entity/EtcContractOrder.java create mode 100644 hai-service/src/main/java/com/hai/entity/EtcContractOrderExample.java create mode 100644 hai-service/src/main/java/com/hai/enum_type/EtcProductEnum.java create mode 100644 hai-service/src/main/java/com/hai/enum_type/EtcVarietyEnum.java diff --git a/hai-bweb/src/main/java/com/bweb/controller/Etc/EtcCustomerController.java b/hai-bweb/src/main/java/com/bweb/controller/Etc/EtcCustomerController.java index 8d1838b5..c4beacab 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/Etc/EtcCustomerController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/Etc/EtcCustomerController.java @@ -15,6 +15,7 @@ import com.hai.etc.EtcCarMsgService; import com.hai.etc.EtcCustMsgService; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; +import com.hai.service.CommonService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -23,10 +24,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @RestController @RequestMapping(value="/etcCustomer") @@ -44,6 +42,9 @@ public class EtcCustomerController { @Resource private EtcCarMsgService etcCarMsgService; + @Resource + private CommonService commonService; + @RequestMapping(value = "/getEtcCustList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询用户列表") @@ -56,7 +57,7 @@ public class EtcCustomerController { SessionObject sessionObject = userCenter.getSessionObject(request); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); - Map map = new HashMap<>(5); + Map map = new HashMap<>(); map.put("userId", userInfoModel.getSecUser().getId()); map.put("custName", custName); @@ -92,8 +93,18 @@ public class EtcCustomerController { etcCustMsg.setUpdateTime(new Date()); etcCustMsg.setStatus(0); + Map mapUser = new HashMap<>(); + + mapUser.put("phone" , etcCustMsg.getPhone()); + + EtcCustMsg custMsg = etcCustMsgService.findEtcCustByMap(mapUser); + + if (custMsg != null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前用户已存在,请勿重复提交!"); + } + etcCustMsgService.insertEtcCust(etcCustMsg); - return ResponseMsgUtil.success("成功"); + return ResponseMsgUtil.success(etcCustMsg.getId()); } catch (Exception e) { log.error("BsMsgController --> insertMsg() error!", e); @@ -121,6 +132,7 @@ public class EtcCustomerController { try { if (etcCustMsg == null + || etcCustMsg.getId() == null || etcCustMsg.getBankPhone() == null || etcCustMsg.getAccountNo() == null || etcCustMsg.getAddress() == null @@ -134,7 +146,26 @@ public class EtcCustomerController { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } + Map mapUser = new HashMap<>(); + + mapUser.put("custIdNo" , etcCustMsg.getCustIdNo()); + + EtcCustMsg custMsgNo = etcCustMsgService.findEtcCustByMap(mapUser); + + if (custMsgNo != null) { + if (!Objects.equals(custMsgNo.getId(), etcCustMsg.getId()) && Objects.equals(etcCustMsg.getCustIdNo(), custMsgNo.getCustIdNo())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "身份证号已经存在!"); + } + } + + EtcCustMsg custMsg = etcCustMsgService.findEtcCustById(etcCustMsg.getId()); + + etcCustMsg.setUserId(custMsg.getUserId()); + etcCustMsg.setUserName(custMsg.getUserName()); + etcCustMsg.setPhone(custMsg.getPhone()); + etcCustMsg.setCustId(custMsg.getCustId()); etcCustMsg.setUpdateTime(new Date()); + etcCustMsg.setCreateTime(custMsg.getCreateTime()); etcCustMsgService.updateEtcCust(etcCustMsg); return ResponseMsgUtil.success("成功"); @@ -147,7 +178,7 @@ public class EtcCustomerController { @RequestMapping(value = "editCarMsg" , method = RequestMethod.POST) @ResponseBody - @ApiOperation(value = "编辑基本信息") + @ApiOperation(value = "编辑车辆信息") public ResponseData editCarMsg(@RequestBody EtcCarMsg etcCarMsg , HttpServletRequest request) { try { @@ -170,14 +201,38 @@ public class EtcCustomerController { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } + if (etcCarMsg.getId() != null) { + EtcCarMsg carMsg = etcCarMsgService.findEtcCarById(etcCarMsg.getId()); + etcCarMsg.setCreateTime(carMsg.getCreateTime()); + etcCarMsg.setVehId(carMsg.getVehId()); + } else { + etcCarMsg.setCreateTime(new Date()); + } + + Map map = new HashMap<>(); + + map.put("vehPlateNo" , etcCarMsg.getVehPlateNo()); + map.put("vehPlateColor" , etcCarMsg.getVehPlateColor()); + + EtcCarMsg carMsg = etcCarMsgService.findEtcCarByMap(map); + + if (carMsg != null) { + etcCarMsg.setId(carMsg.getId()); + } + + + // 查询车辆类型 + SecDictionary carType = commonService.mappingSysCode("CAR_TYPE", etcCarMsg.getVehType()); + etcCarMsg.setUserId(userInfoModel.getSecUser().getId()); + etcCarMsg.setVehTypeName(carType.getCodeName()); etcCarMsg.setUserName(userInfoModel.getSecUser().getUserName()); etcCarMsg.setUpdateTime(new Date()); etcCarMsg.setVehStatus(11); etcCarMsgService.insertEtcCar(etcCarMsg); - return ResponseMsgUtil.success("成功"); + return ResponseMsgUtil.success(etcCarMsg.getExt1()); } catch (Exception e) { log.error("BsMsgController --> insertMsg() error!", e); @@ -196,11 +251,28 @@ public class EtcCustomerController { SessionObject sessionObject = userCenter.getSessionObject(request); UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); - Map map = new HashMap<>(5); + Map map = new HashMap<>(); map.put("userId", userInfoModel.getSecUser().getId()); map.put("vehPlateNo", vehPlateNo); + List list = etcCarMsgService.getEtcCarList(map); + + for (EtcCarMsg etcCarMsg :list) { + JSONObject car = EtcService.getVehStatus(etcCarMsg); + if (car.getString("errCode").equals("0")) { + + if (car.getJSONObject("result").getInteger("vehStatus") == 11) { + etcCarMsg.setVehStatus(13); + } else { + etcCarMsg.setVehStatus(car.getJSONObject("result").getInteger("vehStatus")); + } + etcCarMsg.setPayStatus(car.getJSONObject("result").getInteger("payStatus")); + etcCarMsg.setSignStatus(car.getJSONObject("result").getInteger("signStatus")); + etcCarMsg.setExt2(car.getJSONObject("result").getString("docException")); + } + } + return ResponseMsgUtil.success(etcCarMsgService.getEtcCarList(map)); } catch (Exception e) { @@ -251,6 +323,9 @@ public class EtcCustomerController { JSONObject object = EtcService.checkRealNameCode(etcCustMsg.getCustId() , verifyCode); if (object.getString("errCode").equals("0")) { + etcCustMsg.setStatus(2); + etcCustMsg.setUpdateTime(new Date()); + etcCustMsgService.updateEtcCust(etcCustMsg); return ResponseMsgUtil.success("请求成功!"); } @@ -262,6 +337,10 @@ public class EtcCustomerController { } } + + + + @RequestMapping(value = "/findByCarMsg", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据id查询详情") @@ -276,4 +355,20 @@ public class EtcCustomerController { } } + @RequestMapping(value = "/getVehStatus", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据id查询详情") + public ResponseData getVehStatus(@RequestParam(value = "id", required = true) Long id) { + try { + + EtcCarMsg carMsg = etcCarMsgService.findEtcCarById(id); + + return ResponseMsgUtil.success(EtcService.getVehStatus(carMsg)); + + } catch (Exception e) { + log.error("HighUserController --> findByUserId() error!", e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-bweb/src/main/java/com/bweb/controller/Etc/OcrController.java b/hai-bweb/src/main/java/com/bweb/controller/Etc/OcrController.java index 942531b4..fccc0fa8 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/Etc/OcrController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/Etc/OcrController.java @@ -25,9 +25,6 @@ public class OcrController { private static Logger log = LoggerFactory.getLogger(OcrController.class); - @Resource - private UserCenter userCenter; - @RequestMapping(value="/recognizeIdCard",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "身份证识别") @@ -75,4 +72,16 @@ public class OcrController { return ResponseMsgUtil.exception(e); } } + + @RequestMapping(value="/recognizeVehicleLicense",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "行驶证识别") + public ResponseData recognizeVehicleLicense(@RequestParam(name = "url", required = true) String url) { + try { + return ResponseMsgUtil.success(AliYunOcrService.recognizeVehicleLicense(CommonSysConst.getSysConfig().getFilesystem()+ url)); + } catch (Exception e) { + log.error("recognizeBusinessLicense error!",e); + return ResponseMsgUtil.exception(e); + } + } } diff --git a/hai-bweb/src/main/java/com/bweb/controller/FileUploadController.java b/hai-bweb/src/main/java/com/bweb/controller/FileUploadController.java index de31ca5f..0adea92d 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/FileUploadController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/FileUploadController.java @@ -7,6 +7,7 @@ import com.hai.model.ResponseData; import com.hai.service.FileUploadService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import net.coobird.thumbnailator.Thumbnails; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.*; @@ -18,7 +19,9 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.File; +import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.InputStream; import java.util.*; @RestController @@ -69,6 +72,14 @@ public class FileUploadController { out.write(file.getBytes()); out.flush(); fileNames.add(childPath + "/" + fileName); + + // 图片压缩 + InputStream fis = new FileInputStream(destDirName + File.separator + fileName); + System.out.println("图片上传大小" + fis.available()); + if (fis.available() > 500000) { + Thumbnails.of(new FileInputStream(destDirName + File.separator + fileName)).scale(0.5).toFile(new File(destDirName + File.separator + fileName)); + } + System.out.println("图片上传日志" + childPath + "/" + fileName); } catch (Exception e) { log.error(e.getMessage(), e); } finally { diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java index 9261ee54..4c266a0d 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java @@ -1 +1 @@ - package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.entity.*; import com.hai.enum_type.GasOilPriceStatusEnum; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResponseData; import com.hai.openApi.config.BlxConfig; import com.hai.openApi.service.ApiOrderService; import com.hai.order.service.OrderService; import com.hai.order.type.OrderProductType; import com.hai.order.type.OrderRefundOpUserType; import com.hai.order.utils.OrderUtil; import com.hai.pay.channel.huipay.config.HuiConfig; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; 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 BsOrderRebateService bsOrderRebateService; @Resource private PetroConfig petroConfig; @Resource private HighGoldRecService highGoldRecService; @Resource private OrderService orderService; @Resource private HighUserCardService highUserCardService; @Resource private HighOrderService highOrderService; @Resource private HighUserService highUserService; @Resource private HighGasService gasService; @Resource private HighMerchantService highMerchantService; @Resource private HighMerchantStoreService highMerchantStoreService; @Resource private HighGasOilPriceService highGasOilPriceService; @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private HuiConfig huiConfig; @Resource private CommonService commonService; @Resource private HighOilCardOrderService highOilCardOrderService; @Resource private HighGasOrderService gasOrderService; @Resource private ShellGroupService shellGroupService; @Resource private HighMerchantStoreService merchantStoreService; @Resource private ApiOrderService apiOrderService; @Resource private ApiMerchantsService apiMerchantsService; @Resource private BlxConfig blxConfig; @Resource private HighGasOilGunNoService gasOilGunNoService; @RequestMapping(value = "/gasSyncPayment", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "重庆壳牌推送") public ResponseData gasSyncPayment(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighGasOrder order = gasOrderService.getDetailByOrderNo(orderNo); if (order != null) { // 查询油站 HighMerchantStore store = merchantStoreService.getDetailById(order.getStoreId()); if (store == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店"); } return ResponseMsgUtil.success( // 推送加好油 shellGroupService.gasSyncPayment(order.getOrderNo(), store.getStoreKey(), order.getPayTime(), order.getGasRefuelPrice(), order.getGasOilNo(), order.getGasGunNo(), order.getPayPrice(), order.getTotalDeductionPrice() ) ); } return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> gasSyncPayment() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡消费记录") public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "businessType", required = true) String businessType, @RequestParam(name = "cardNo", required = true) String cardNo, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } JSONArray array = HuiLianTongUnionCardConfig.resolveResponse(consumptionRecord.getString("data")).getJSONArray( "records"); return ResponseMsgUtil.success(array); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/createOrder", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "创建订单") public ResponseData createOrder(@RequestBody JSONObject object) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230394901"); mapPost.put("timetable" , new Date().getTime()); mapPost.put("orderNo" , OrderUtil.generateOrderNo()); mapPost.put("productType" , object.getString("productType")); mapPost.put("content" , object.getJSONObject("content").toString()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "B94B5E62807FA56A7260AB581D8A1B48", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://1.95.43.71:9902/v1/order/createOrder" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/payOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付订单") public ResponseData payOrder(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); mapPost.put("merchId" , "20230394901"); mapPost.put("mchOrderNo" , mchOrderNo); Map map = new HashMap<>(); map.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); map.put("merchId" , "20230394901"); map.put("mchOrderNo" , mchOrderNo); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/order/orderPay" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryOrderDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询订单详情") public ResponseData queryOrderDetail(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); mapPost.put("mchOrderNo" , mchOrderNo); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); map.put("mchOrderNo" , mchOrderNo); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/order/queryOrderDetail" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/deposit", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡充值") public ResponseData deposit(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); HighChildOrder highChildOrder = order.getHighChildOrderList().get(0); if (order.getOrderStatus() != 2) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); } // 汇联通充值 String goodsDesc = "汇联通充值"+order.getPayPrice()+"元"; String tranDesc = ""; String businessType = "ghk_deposit"; String orderNoAgain = OrderUtil.generateOrderNo(); order.setOrderStatus(Integer.valueOf(3)); order.setRemarks("工会卡再次充值订单号" + orderNoAgain); highOrderService.updateOrder(order); // 汇联通卡充值 JSONObject deposit = HuiLianTongUnionCardConfig.deposit(orderNoAgain, highChildOrder.getGoodsSpecName(), order.getPayPrice(), businessType, order.getPaySerialNo(), goodsDesc); return ResponseMsgUtil.success( HuiLianTongUnionCardConfig.resolveResponse(deposit.getString("data"))); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardByCardNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据卡号查询汇联通工会卡详情") public ResponseData getHuiLianTongCardByCardNo(@RequestParam(name = "cardNo", required = true) String cardNo) { try { // 查询工会卡 JSONObject cardInfo = HuiLianTongUnionCardConfig.queryBalance(cardNo); JSONObject resolveResponse = HuiLianTongUnionCardConfig.resolveResponse(cardInfo.getString("data")); return ResponseMsgUtil.success(resolveResponse); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardByCardNo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/consumption", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡支付") public ResponseData consumption(@RequestParam(name = "payRealPrice", required = true) BigDecimal payRealPrice, @RequestParam(name = "cardNo", required = true) String cardNo) { try { String goodsDesc = ""; String tranDesc = ""; String instCode = "11101652"; String businessType = "hisen_consume"; // 工会卡支付 JSONObject consumption = HuiLianTongUnionCardConfig.consumption(OrderUtil.generateOrderNo(), cardNo, payRealPrice, businessType, instCode, goodsDesc, tranDesc); 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("HighUserCardController --> getHuiLianTongCardByCardNo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/refundOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡退款") public ResponseData refundOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order.getOrderStatus() != 2) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); } orderService.refundOrder(order, OrderProductType.getDataByType(order.getProductType()).getName() + "退款",OrderRefundOpUserType.TYPE1, null, "系统自动退款"); if (order.getProductType().equals(4)) { HighUser user = highUserService.findByUserId(order.getMemId()); // 获取应退款积分 int integralNum = order.getTotalPrice().multiply(new BigDecimal(100)).intValue(); if ( integralNum> user.getGold()) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "积分数量不足"); } String remark = "订单" + order.getOrderNo() + "退还积分:" + integralNum; // 积分退款 highUserService.goldHandle(user.getId(), integralNum,2, 3, order.getId() , remark , order.getOrderNo()); } return ResponseMsgUtil.success("退款成功"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/externalOrderRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "对外订单退款") public ResponseData externalOrderRefund(@RequestParam(name = "paySerialNo", required = true) String paySerialNo, @RequestParam(name = "WxMchId", required = true) String WxMchId, @RequestParam(name = "payRealPrice", required = true) String payRealPrice) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); mapPost.put("merchId" , "20230394901"); mapPost.put("paySerialNo" , paySerialNo); mapPost.put("wxMchId" , WxMchId); mapPost.put("payRealPrice" , payRealPrice); mapPost.put("refundPrice" , payRealPrice); Map map = new HashMap<>(); map.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); map.put("merchId" , "20230394901"); map.put("paySerialNo" , paySerialNo); map.put("wxMchId" , WxMchId); map.put("payRealPrice" , payRealPrice); map.put("refundPrice" , payRealPrice); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/order/externalOrderRefund" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getBlxCouponBalance", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询停车券") public ResponseData getBlxCouponBalance(@RequestParam(name = "phone", required = true) String phone) { try { highUserCardService.getBlxCouponBalance(phone); return ResponseMsgUtil.success("object"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryJsParking", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询捷顺停车场") public ResponseData queryJsParking(@RequestParam(name = "gps", required = true) String gps) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("gps" , gps); mapPost.put("range" , "1000"); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/queryJsParking" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getUserCouponPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询捷顺停车场") public ResponseData getUserCouponPage(@RequestParam(name = "phone", required = true) String phone) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("phone" , phone); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/getUserCouponPage" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryJsOrderList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询车牌订单列表信息") public ResponseData queryJsOrderList(@RequestParam(name = "carNo", required = true) String carNo, @RequestParam(name = "orderStatus", required = true) String orderStatus) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("orderStatus" , orderStatus); mapPost.put("carNo" , carNo); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/queryJsOrderList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/sendCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发放券") public ResponseData sendCoupon(@RequestParam(name = "couponCode", required = true) String couponCode, @RequestParam(name = "receiverCount", required = true) String receiverCount, @RequestParam(name = "receiverPhone", required = true) String receiverPhone) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/getCouponList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/preorder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发起支付") public ResponseData preorder() { try { JSONObject object = new JSONObject(); object.put("outTradeNo" , "HUI" + OrderUtil.generateOrderNo()); object.put("transType" , "JSAPI"); object.put("payMode" , "WECHAT"); object.put("totalAmount" , "0.01"); object.put("profitSharing" , 0); object.put("subject" , "测试"); object.put("userId" , "oUGn_4unIjp90MY-oEXluY4laDrQ"); return ResponseMsgUtil.success(huiConfig.preorder(object)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryGasInfoListByPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油门店") public ResponseData queryGasInfoListByPage() { try { HighMerchantModel merchant = highMerchantService.getMerchantById(39L); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000); JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class); for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue();i++) { JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; for (Object gasObject : jsonArray) { JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject)); HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId")); JSONArray gasGunList = object.getJSONArray("gasGunList"); if (store != null) { store.setType(1); store.setSourceType(2); store.setMerchantId(merchant.getId()); store.setCompanyId(merchant.getCompanyId()); store.setStoreKey(object.getString("gasId")); store.setStoreName(object.getString("gasName")); store.setStoreLogo(object.getString("gasLogoSmall")); store.setRegionId(object.getLong("provinceCode")); store.setRegionName(object.getString("provinceName")); store.setAddress(object.getString("gasAddress")); store.setLongitude(object.getString("gasAddressLongitude")); store.setLatitude(object.getString("gasAddressLatitude")); store.setStatus(object.getInteger("gasStatus")); store.setPrestoreType(0); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); store.setExt1(object.getString("gasSourceId")); highMerchantStoreService.updateMerchantStoreDetail(store); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("oilNo")); if (highGasOilPrice == null) { highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceCost(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceCost(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); } highGasOilPriceService.editGasOilPrice(highGasOilPrice); for (Object o : gasGunList) { JSONObject gunNoObject = (JSONObject) o; HighGasOilGunNo gasOilGunNo = gasOilGunNoService.getDetailByStoreAndGunNo(highGasOilPrice.getMerchantStoreId(), gunNoObject.getString("gunNo")); if (gasOilGunNo == null) { gasOilGunNo = new HighGasOilGunNo(); gasOilGunNo.setGasOilPriceId(highGasOilPrice.getId()); gasOilGunNo.setStoreId(highGasOilPrice.getMerchantStoreId()); gasOilGunNo.setOilNo(highGasOilPrice.getOilNo()); gasOilGunNo.setOilNoName(highGasOilPrice.getOilNoName()); gasOilGunNo.setOilType(highGasOilPrice.getOilType()); gasOilGunNo.setOilTypeName(highGasOilPrice.getOilTypeName()); gasOilGunNo.setGunNo(gunNoObject.getString("gunNo")); gasOilGunNo.setStatus(1); gasOilGunNoService.editGunNo(gasOilGunNo); } } } } else { highMerchantStore = new HighMerchantStore(); highMerchantStore.setType(1); highMerchantStore.setSourceType(2); highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setCompanyId(merchant.getCompanyId()); highMerchantStore.setStoreKey(object.getString("gasId")); highMerchantStore.setStoreName(object.getString("gasName")); highMerchantStore.setStoreLogo(object.getString("gasLogoSmall")); highMerchantStore.setRegionId(object.getLong("provinceCode")); highMerchantStore.setRegionName(object.getString("provinceName")); highMerchantStore.setAddress(object.getString("gasAddress")); highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); highMerchantStore.setStatus(1); highMerchantStore.setPrestoreType(0); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setExt1(object.getString("gasSourceId")); HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); highMerchantStoreService.insertMerchantStore(merchantStoreModel); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceCost(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); highGasOilPriceService.editGasOilPrice(highGasOilPrice); for (Object o : gasGunList) { JSONObject gunNoObject = (JSONObject) o; HighGasOilGunNo gasOilGunNo = gasOilGunNoService.getDetailByStoreAndGunNo(highGasOilPrice.getMerchantStoreId(), gunNoObject.getString("gunNo")); if (gasOilGunNo == null) { gasOilGunNo = new HighGasOilGunNo(); gasOilGunNo.setGasOilPriceId(highGasOilPrice.getId()); gasOilGunNo.setStoreId(highGasOilPrice.getMerchantStoreId()); gasOilGunNo.setOilNo(highGasOilPrice.getOilNo()); gasOilGunNo.setOilNoName(highGasOilPrice.getOilNoName()); gasOilGunNo.setOilType(highGasOilPrice.getOilType()); gasOilGunNo.setOilTypeName(highGasOilPrice.getOilTypeName()); gasOilGunNo.setGunNo(gunNoObject.getString("gunNo")); gasOilGunNo.setStatus(1); gasOilGunNoService.editGunNo(gasOilGunNo); } } } } } } return ResponseMsgUtil.success("完成"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/test", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "测试") public ResponseData test(@RequestParam(name = "no", required = true) String no) { try { JSONObject jsonObject = DianConfig.getGasInfoByGasId(no); return ResponseMsgUtil.success(jsonObject); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getGasInfoAll", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取全量油站") public ResponseData getGasInfoAll() { try { HighMerchantModel merchant = highMerchantService.getMerchantById(39L); JSONObject jsonObject = DianConfig.getGasInfoAll(); JSONArray resultObject = jsonObject.getObject("result", JSONArray.class); for (int i = 0; i < resultObject.size();i++) { Object objectData = resultObject.get(i); JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(objectData)); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("jyzid")); SecRegion region = commonService.getRegionsByName(object.getString("province")); if (store != null) { store.setType(1); store.setSourceType(6); store.setMerchantId(merchant.getId()); store.setCompanyId(merchant.getCompanyId()); store.setStoreKey(object.getString("jyzid")); store.setStoreName(object.getString("mingcheng")); store.setStoreLogo(object.getString("tupian")); store.setRegionId(region.getRegionId()); store.setRegionName(object.getString("province")); store.setAddress(object.getString("dizhi")); store.setLongitude(object.getString("lng")); store.setLatitude(object.getString("lat")); store.setStatus(object.getInteger("zhuangtai")); store.setPrestoreType(0); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); store.setExt1(object.getString("gasSourceId")); highMerchantStoreService.updateMerchantStoreDetail(store); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("youhao")); if (highGasOilPrice == null) { highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("youhao")); highGasOilPrice.setOilNoName(oilPriceObject.getString("youhao") + "#"); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油"); highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("youhao")); highGasOilPrice.setOilNoName( oilPriceObject.getString("youhao") + "#"); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油"); } highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } else { highMerchantStore = new HighMerchantStore(); highMerchantStore.setType(1); highMerchantStore.setSourceType(6); highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setCompanyId(merchant.getCompanyId()); highMerchantStore.setStoreKey(object.getString("jyzid")); highMerchantStore.setStoreName(object.getString("mingcheng")); highMerchantStore.setStoreLogo(object.getString("tupian")); highMerchantStore.setRegionId(region.getRegionId()); highMerchantStore.setRegionName(object.getString("province")); highMerchantStore.setAddress(object.getString("dizhi")); highMerchantStore.setLongitude(object.getString("lng")); highMerchantStore.setLatitude(object.getString("lat")); highMerchantStore.setStatus(1); highMerchantStore.setPrestoreType(0); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setExt1(object.getString("gasSourceId")); HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); highMerchantStoreService.insertMerchantStore(merchantStoreModel); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("youhao")); highGasOilPrice.setOilNoName(oilPriceObject.getString("youhao") + "#"); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油"); highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } } return ResponseMsgUtil.success(jsonObject); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getOrderPay", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getOrderPay") public ResponseData getOrderPay(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOilCardOrder highOilCardOrder = highOilCardOrderService.findOrder(orderNo); highOilCardOrder.setStatus(2); JSONObject object = KytcService.getOrderPay(highOilCardOrder.getThirdOrderNo() , highOilCardOrder.getPrice() , highOilCardOrder.getCardNo()); highOilCardOrder.setExt1(object.toJSONString()); highOilCardOrderService.updateOilCardOrder(highOilCardOrder); return ResponseMsgUtil.success("成功"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getOrderInfo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getOrderInfo") public ResponseData getOrderInfo(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOilCardOrder highOilCardOrder = highOilCardOrderService.findOrder(orderNo); JSONObject object = KytcService.getOrderInfo(highOilCardOrder.getThirdOrderNo()); highOilCardOrder.setExt2(object.toJSONString()); if (object.getBoolean("State") == true) { JSONObject jsonObject = object.getJSONObject("Data"); if (jsonObject.getInteger("OilOrderState") == 2) { highOilCardOrder.setStatus(3); HighOrder highOrder = highOrderService.getOrderByOrderNo(highOilCardOrder.getOrderNo()); highOrder.setOrderStatus(3); highOrder.getHighChildOrderList().get(0).setChildOrderStatus(3); highOrderService.updateOrder(highOrder); } } highOilCardOrderService.updateOilCardOrder(highOilCardOrder); return ResponseMsgUtil.success("成功"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getLogisticsMsg", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取物流") public ResponseData getLogisticsMsg(@RequestParam(name = "no", required = true) String no) { try { JSONObject jsonObjects = CommonConfig.getLogisticsMsg(no); return ResponseMsgUtil.success(jsonObjects); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } // @RequestMapping(value = "/synCouponRule", method = RequestMethod.GET) // @ResponseBody // @ApiOperation(value = "获取卡券") // public ResponseData synCouponRule() { // try { // return ResponseMsgUtil.success(PetroConfig.synCouponRule()); // } catch (Exception e) { // log.error("HighOrderController --> getBackendToken() error!", e); // return ResponseMsgUtil.exception(e); // } // } // @RequestMapping(value = "/getCoupon", method = RequestMethod.GET) // @ResponseBody // @ApiOperation(value = "卡券下单") // public ResponseData getCoupon() { // try { // // JSONObject jsonObject = PetroConfig.getCoupon("16000443991501" , "18090580471" , OrderUtil.generateOrderNo()); // String data = PetroConfig.decrypt(jsonObject.getString("biz_content")); // JSONObject object = JSONObject.parseObject(data); // // return ResponseMsgUtil.success(object); // } catch (Exception e) { // log.error("HighOrderController --> getBackendToken() error!", e); // return ResponseMsgUtil.exception(e); // } // } @RequestMapping(value = "/deleteOilNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "删除油品") public ResponseData deleteOilNo() { try { gasService.deleteOilNo(); return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getJiaHaoYouAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "加好油油站刷新") public ResponseData getJiaHaoYouAllStation() { try { gasService.getJiaHaoYouAllStation(); return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getDianAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "点点网络") public ResponseData getDianAllStation() { try { gasService.getDianAllStation(); return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() err1or!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/integralRebateOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "积分返利") public ResponseData integralRebateOrder() { try { // 查询满足初步返利条件订单 List order = highOrderService.integralRebateOrder(); for (HighOrder highOrder : order) { // 查询是否存在积分记录 Map map = new HashMap<>(); map.put("goldType", 1); map.put("resType", 4); map.put("userId", highOrder.getMemId()); map.put("resId", highOrder.getId()); List goldRecs = highGoldRecService.getGoldRec(map); // 判断是否重复赠送积分 if (goldRecs.size() == 0) { bsOrderRebateService.insertOrderRebate(highOrder); } highOrder.setWhetherRebate(true); highOrderService.updateOrderDetail(highOrder); } return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() err1or!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getApiCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取卡券") public ResponseData getApiCoupon() { try { // 查询满足初步返利条件订单 List order = highOrderService.integralRebateOrder(); for (HighOrder highOrder : order) { // 查询是否存在积分记录 Map map = new HashMap<>(); map.put("goldType", 1); map.put("resType", 4); map.put("userId", highOrder.getMemId()); map.put("resId", highOrder.getId()); List goldRecs = highGoldRecService.getGoldRec(map); // 判断是否重复赠送积分 if (goldRecs.size() == 0) { bsOrderRebateService.insertOrderRebate(highOrder); } highOrder.setWhetherRebate(true); highOrderService.updateOrderDetail(highOrder); } return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() err1or!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/couponDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据订单号查询中石油卡券详情") public ResponseData couponDetail(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("mchOrderNo" , mchOrderNo); mapPost.put("timetable" , new Date().getTime()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/apiCoupon/getCheckCode" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getCouponList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取卡券") public ResponseData getCouponList() { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230394901"); mapPost.put("timetable" , new Date().getTime()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "B94B5E62807FA56A7260AB581D8A1B48", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/apiCoupon/getCouponList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/refundApi", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付退款") public ResponseData refundApi(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { ApiOrder apiOrder = apiOrderService.findByOrderNo(mchOrderNo , null); // 查询APi ApiMerchants apiMerchants = apiMerchantsService.findByMchId(apiOrder.getMchId()); Map mapPost = new HashMap<>(); mapPost.put("merchId" , apiMerchants.getMchId()); mapPost.put("mchOrderNo" , mchOrderNo); // mapPost.put("timetable" , new Date().getTime()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, apiMerchants.getApiKey(), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/order/refund" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/checkAccountBalance", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询余额") public ResponseData checkAccountBalance() { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20240133101"); // mapPost.put("mchOrderNo" , mchOrderNo); mapPost.put("timetable" , new Date().getTime()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "1F43EEC88D0F99FC201D81143F9EED85", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/apiMerchants/checkAccountBalance" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getStationStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询油站") public ResponseData getStationStore() { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20240133101"); // mapPost.put("mchOrderNo" , mchOrderNo); // mapPost.put("timetable" , new Date().getTime()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "1F43EEC88D0F99FC201D81143F9EED85", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/refuelOnline/getStationStore" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/decryptPetroConfig", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解码") public ResponseData decryptPetroConfig(@RequestParam(name = "content", required = true) String content) { try { PetroConfig.init(1); String data = PetroConfig.decrypt(content); JSONObject object = JSONObject.parseObject(data); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/synCouponRule", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "synCouponRule") public ResponseData synCouponRule() { try { PetroConfig.init(2); JSONObject jsonObject = petroConfig.synCouponRule(); String data = PetroConfig.decrypt(jsonObject.getString("jsonResult")); JSONArray jsonArray = JSONArray.parseArray(data); return ResponseMsgUtil.success(jsonArray); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getCoupon") public ResponseData getCoupon(@RequestParam(name = "code", required = true) String code) { try { PetroConfig.init(2); // 发放卡券 JSONObject jsonObject = petroConfig.getCoupon(code ,"18090580471"); String data = PetroConfig.decrypt(jsonObject.getString("jsonResult")); JSONObject object = JSONObject.parseObject(data); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/decrypt", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "decrypt") public ResponseData decrypt(@RequestParam(name = "jsonResult", required = true) String jsonResult) { try { PetroConfig.init(2); String data = PetroConfig.decrypt(jsonResult); JSONObject object = JSONObject.parseObject(data); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/jNiuGoodsList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "jNiuGoodsList") public ResponseData jNiuGoodsList() { try { JSONObject object = RechargeConfig.jNiuGoodsList(); JSONArray array = object.getJSONArray("data"); List list = new ArrayList<>(); for (int i = 0; i < array.size(); i++) { JSONObject jsonObject = array.getJSONObject(i); JSONArray jsonArray = jsonObject.getJSONArray("goodsOption"); for (int j = 0; j < jsonArray.size(); j++) { JSONObject goodsOption = jsonArray.getJSONObject(j); JSONArray childArray = goodsOption.getJSONArray("child"); for (int t = 0; t < childArray.size(); t++) { JSONObject child = childArray.getJSONObject(j); JSONObject data = new JSONObject(); data.put("title" , jsonObject.getString("sort_title") + goodsOption.getString("name")); data.put("goodsId" , child.getString("goods_id")); data.put("goodsOptionId" , child.getString("goods_option_id")); data.put("platPrice" , child.getString("plat_price")); data.put("officialPrice" , child.getString("official_price")); list.add(data); } } } return ResponseMsgUtil.success(list); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderByJn", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "rechargeOrderByJn") public ResponseData rechargeOrderByJn() { try { JSONObject object = new JSONObject(); object.put("orderNo", OrderUtil.generateOrderNo()); object.put("option_id", "632"); object.put("phone", "18090580471"); JSONObject returnObject = RechargeConfig.rechargeOrderByJn(object); return ResponseMsgUtil.success(returnObject); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/checkOrderByJn", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "checkOrderByJn") public ResponseData checkOrderByJn(@RequestParam(name = "order_no", required = true) String order_no) { try { JSONObject object = new JSONObject(); object.put("orderNo" , order_no); int status = 0; JSONObject jsonObject = RechargeConfig.checkOrderByJn(object); if (jsonObject.getJSONObject("data") != null) { JSONObject objectData= jsonObject.getJSONObject("data"); // // 10充值中 20充值完成 -10 充值失败 // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 if (objectData.getInteger("status") == 10) { status = 0; } else if (objectData.getInteger("status") == 20) { status = 1; } else if (objectData.getInteger("status") == -10) { status = 2; } } return ResponseMsgUtil.success(status); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getListRechargeOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getListRechargeOrder") public ResponseData getListRechargeOrder(@RequestParam(name = "order_no", required = true) String order_no) { try { log.info("处理话费订单定时任务开始"); Map map = new HashMap<>(); map.put("payStatus", String.valueOf(102)); map.put("rechargeStatus", String.valueOf(201)); List orderList = outRechargeOrderService.getListRechargeOrder(map); log.info("处理话费订单条数:" + orderList.size()); if (orderList.size() > 0) { for (OutRechargeOrder order : orderList) { try { outRechargeOrderService.prepaidRechargeHandle(order); } catch (Exception e) { log.info("话费定时任务订单业务出现异常", e); } } } return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/etcOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "etcOrder") public ResponseData etcOrder() { try { String mobile = "18090580471"; Map map = new TreeMap<>(); map.put("requestId" , System.nanoTime()); map.put("channelCode" , CommonSysConst.getSysConfig().getEtcChannelCode()); map.put("timestamp" , new Date().getTime() / 1000); map.put("productNo" , "GZETCFXQD_GZETCCSCP"); map.put("mobile" , RSAUtil.encryptBASE64(RSAUtil.encryptByPublicKey(mobile.getBytes(StandardCharsets.UTF_8), CommonSysConst.getSysConfig().getEtcPublicKey()))); map.put("num" , 1); map.put("thirdOrderId" , OrderUtil.generateOrderNo()); String s = StringUtils.join(map.values(), ""); String sign = RSAUtil.sign(s.getBytes(), CommonSysConst.getSysConfig().getEtcPrivateKey()); map.put("sign", sign); return ResponseMsgUtil.success(petroConfig.etcOrder(map)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/couJointDist", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "商户派发电子券") public ResponseData couJointDist(@RequestParam(name = "order_no", required = true) String order_no) { try { // 购买卡券 JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(order_no); // 解密 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 = "/getCarNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询车牌订单号") public ResponseData getCarNo(@RequestParam(name = "carNo", required = true) String carNo) { try { JSONObject jsonObject = new JSONObject(); jsonObject.put("carNo" , carNo); jsonObject.put("orderStatus" , "03"); JSONObject data = blxConfig.queryJsOrderList(jsonObject); return ResponseMsgUtil.success(data); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/getGasDetailByStoreKey",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据门店key 查询") public ResponseData getGasDetailByStoreKey(@RequestParam(name = "storeKey", required = true) String storeKey) { try { JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(storeKey); return ResponseMsgUtil.success(jsonObject.get("result")); } catch (Exception e) { log.error("HighGasController -> getGasDetailByStoreKey() error!",e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file + package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.*; import com.hai.config.*; import com.hai.entity.*; import com.hai.enum_type.GasOilPriceStatusEnum; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResponseData; import com.hai.openApi.config.BlxConfig; import com.hai.openApi.service.ApiOrderService; import com.hai.order.service.OrderService; import com.hai.order.type.OrderProductType; import com.hai.order.type.OrderRefundOpUserType; import com.hai.order.utils.OrderUtil; import com.hai.pay.channel.huipay.config.HuiConfig; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; 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 BsOrderRebateService bsOrderRebateService; @Resource private PetroConfig petroConfig; @Resource private HighGoldRecService highGoldRecService; @Resource private OrderService orderService; @Resource private HighUserCardService highUserCardService; @Resource private HighOrderService highOrderService; @Resource private HighUserService highUserService; @Resource private HighGasService gasService; @Resource private HighMerchantService highMerchantService; @Resource private HighMerchantStoreService highMerchantStoreService; @Resource private HighGasOilPriceService highGasOilPriceService; @Resource private OutRechargeOrderService outRechargeOrderService; @Resource private HuiConfig huiConfig; @Resource private CommonService commonService; @Resource private HighOilCardOrderService highOilCardOrderService; @Resource private HighGasOrderService gasOrderService; @Resource private ShellGroupService shellGroupService; @Resource private HighMerchantStoreService merchantStoreService; @Resource private ApiOrderService apiOrderService; @Resource private ApiMerchantsService apiMerchantsService; @Resource private BlxConfig blxConfig; @Resource private HighGasOilGunNoService gasOilGunNoService; @RequestMapping(value = "/gasSyncPayment", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "重庆壳牌推送") public ResponseData gasSyncPayment(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighGasOrder order = gasOrderService.getDetailByOrderNo(orderNo); if (order != null) { // 查询油站 HighMerchantStore store = merchantStoreService.getDetailById(order.getStoreId()); if (store == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店"); } return ResponseMsgUtil.success( // 推送加好油 shellGroupService.gasSyncPayment(order.getOrderNo(), store.getStoreKey(), order.getPayTime(), order.getGasRefuelPrice(), order.getGasOilNo(), order.getGasGunNo(), order.getPayPrice(), order.getTotalDeductionPrice() ) ); } return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> gasSyncPayment() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询汇联通工会卡消费记录") public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "businessType", required = true) String businessType, @RequestParam(name = "cardNo", required = true) String cardNo, @RequestParam(name = "sdate", required = true) Long sdate, @RequestParam(name = "edate", required = true) Long edate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.queryConsumptionRecordByBusiness(businessType, cardNo, sdate, edate, pageNum, pageSize); if (StringUtils.isBlank(consumptionRecord.getString("data"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_ERROR, ""); } JSONArray array = HuiLianTongUnionCardConfig.resolveResponse(consumptionRecord.getString("data")).getJSONArray( "records"); return ResponseMsgUtil.success(array); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/createOrder", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "创建订单") public ResponseData createOrder(@RequestBody JSONObject object) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230394901"); mapPost.put("timetable" , new Date().getTime()); mapPost.put("orderNo" , OrderUtil.generateOrderNo()); mapPost.put("productType" , object.getString("productType")); mapPost.put("content" , object.getJSONObject("content").toString()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "B94B5E62807FA56A7260AB581D8A1B48", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://1.95.43.71:9902/v1/order/createOrder" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/payOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付订单") public ResponseData payOrder(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); mapPost.put("merchId" , "20230394901"); mapPost.put("mchOrderNo" , mchOrderNo); Map map = new HashMap<>(); map.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); map.put("merchId" , "20230394901"); map.put("mchOrderNo" , mchOrderNo); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/order/orderPay" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryOrderDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询订单详情") public ResponseData queryOrderDetail(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); mapPost.put("merchId" , "20230258302"); mapPost.put("mchOrderNo" , mchOrderNo); Map map = new HashMap<>(); map.put("apiKey" , "0C7897EA3BD96156A5881618FF2FF645"); map.put("merchId" , "20230258302"); map.put("mchOrderNo" , mchOrderNo); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/order/queryOrderDetail" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/deposit", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡充值") public ResponseData deposit(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); HighChildOrder highChildOrder = order.getHighChildOrderList().get(0); if (order.getOrderStatus() != 2) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); } // 汇联通充值 String goodsDesc = "汇联通充值"+order.getPayPrice()+"元"; String tranDesc = ""; String businessType = "ghk_deposit"; String orderNoAgain = OrderUtil.generateOrderNo(); order.setOrderStatus(Integer.valueOf(3)); order.setRemarks("工会卡再次充值订单号" + orderNoAgain); highOrderService.updateOrder(order); // 汇联通卡充值 JSONObject deposit = HuiLianTongUnionCardConfig.deposit(orderNoAgain, highChildOrder.getGoodsSpecName(), order.getPayPrice(), businessType, order.getPaySerialNo(), goodsDesc); return ResponseMsgUtil.success( HuiLianTongUnionCardConfig.resolveResponse(deposit.getString("data"))); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getHuiLianTongCardByCardNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据卡号查询汇联通工会卡详情") public ResponseData getHuiLianTongCardByCardNo(@RequestParam(name = "cardNo", required = true) String cardNo) { try { // 查询工会卡 JSONObject cardInfo = HuiLianTongUnionCardConfig.queryBalance(cardNo); JSONObject resolveResponse = HuiLianTongUnionCardConfig.resolveResponse(cardInfo.getString("data")); return ResponseMsgUtil.success(resolveResponse); } catch (Exception e) { log.error("HighUserCardController --> getHuiLianTongCardByCardNo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/consumption", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡支付") public ResponseData consumption(@RequestParam(name = "payRealPrice", required = true) BigDecimal payRealPrice, @RequestParam(name = "cardNo", required = true) String cardNo) { try { String goodsDesc = ""; String tranDesc = ""; String instCode = "11101652"; String businessType = "hisen_consume"; // 工会卡支付 JSONObject consumption = HuiLianTongUnionCardConfig.consumption(OrderUtil.generateOrderNo(), cardNo, payRealPrice, businessType, instCode, goodsDesc, tranDesc); 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("HighUserCardController --> getHuiLianTongCardByCardNo() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/refundOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "工会卡退款") public ResponseData refundOrder(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOrder order = highOrderService.getOrderByOrderNo(orderNo); if (order.getOrderStatus() != 2) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误"); } orderService.refundOrder(order, OrderProductType.getDataByType(order.getProductType()).getName() + "退款",OrderRefundOpUserType.TYPE1, null, "系统自动退款"); if (order.getProductType().equals(4)) { HighUser user = highUserService.findByUserId(order.getMemId()); // 获取应退款积分 int integralNum = order.getTotalPrice().multiply(new BigDecimal(100)).intValue(); if ( integralNum> user.getGold()) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "积分数量不足"); } String remark = "订单" + order.getOrderNo() + "退还积分:" + integralNum; // 积分退款 highUserService.goldHandle(user.getId(), integralNum,2, 3, order.getId() , remark , order.getOrderNo()); } return ResponseMsgUtil.success("退款成功"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/externalOrderRefund", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "对外订单退款") public ResponseData externalOrderRefund(@RequestParam(name = "paySerialNo", required = true) String paySerialNo, @RequestParam(name = "WxMchId", required = true) String WxMchId, @RequestParam(name = "payRealPrice", required = true) String payRealPrice) { try { Map mapPost = new HashMap<>(); mapPost.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); mapPost.put("merchId" , "20230394901"); mapPost.put("paySerialNo" , paySerialNo); mapPost.put("wxMchId" , WxMchId); mapPost.put("payRealPrice" , payRealPrice); mapPost.put("refundPrice" , payRealPrice); Map map = new HashMap<>(); map.put("apiKey" , "B94B5E62807FA56A7260AB581D8A1B48"); map.put("merchId" , "20230394901"); map.put("paySerialNo" , paySerialNo); map.put("wxMchId" , WxMchId); map.put("payRealPrice" , payRealPrice); map.put("refundPrice" , payRealPrice); System.out.println(map); mapPost.put("sign" , WxUtils.generateSignApi(map, MapUtils.getString(map, "apiKey"), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/order/externalOrderRefund" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getBlxCouponBalance", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询停车券") public ResponseData getBlxCouponBalance(@RequestParam(name = "phone", required = true) String phone) { try { highUserCardService.getBlxCouponBalance(phone); return ResponseMsgUtil.success("object"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryJsParking", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询捷顺停车场") public ResponseData queryJsParking(@RequestParam(name = "gps", required = true) String gps) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("gps" , gps); mapPost.put("range" , "1000"); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/queryJsParking" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getUserCouponPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询捷顺停车场") public ResponseData getUserCouponPage(@RequestParam(name = "phone", required = true) String phone) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("phone" , phone); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/getUserCouponPage" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryJsOrderList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询车牌订单列表信息") public ResponseData queryJsOrderList(@RequestParam(name = "carNo", required = true) String carNo, @RequestParam(name = "orderStatus", required = true) String orderStatus) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("orderStatus" , orderStatus); mapPost.put("carNo" , carNo); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/blxCoupon/queryJsOrderList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/sendCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发放券") public ResponseData sendCoupon(@RequestParam(name = "couponCode", required = true) String couponCode, @RequestParam(name = "receiverCount", required = true) Integer receiverCount, @RequestParam(name = "orderNo", required = true) String orderNo, @RequestParam(name = "receiverPhone", required = true) String receiverPhone) { try { // 下单请求 JSONObject rechargeObject = HuiLianTongConfig.recharge(orderNo, receiverCount, couponCode, receiverPhone); if (!rechargeObject.getString("respCode").equals("0000")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败"); } JSONObject response = HuiLianTongUnionCardConfig.resolveResponse(rechargeObject.getString("data")); // 购买卡券 JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(response.getJSONObject("data").getString("rechargeOrderId")); if (returnParam != null && returnParam.getString("respCode").equals("0000")) { // 解密 JSONObject jsonObject = HuiLianTongUnionCardConfig.resolveResponse(returnParam.getString("data")); JSONArray dataArray = JSONObject.parseObject(jsonObject.getString("data"), JSONArray.class); return ResponseMsgUtil.success(dataArray); } else { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "下单失败"); } } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/preorder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "发起支付") public ResponseData preorder() { try { JSONObject object = new JSONObject(); object.put("outTradeNo" , "HUI" + OrderUtil.generateOrderNo()); object.put("transType" , "JSAPI"); object.put("payMode" , "WECHAT"); object.put("totalAmount" , "0.01"); object.put("profitSharing" , 0); object.put("subject" , "测试"); object.put("userId" , "oUGn_4unIjp90MY-oEXluY4laDrQ"); return ResponseMsgUtil.success(huiConfig.preorder(object)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/queryGasInfoListByPage", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询团油门店") public ResponseData queryGasInfoListByPage() { try { HighMerchantModel merchant = highMerchantService.getMerchantById(39L); if (merchant == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); } JSONObject jsonObjectP = TuanYouConfig.queryGasInfoListByPage(1, 1000); JSONObject resultObjectP = jsonObjectP.getObject("result", JSONObject.class); for (int i = 1; i <= resultObjectP.getInteger("totalPageNum").intValue();i++) { JSONObject jsonObject = TuanYouConfig.queryGasInfoListByPage(i, 1000); JSONObject resultObject = jsonObject.getObject("result", JSONObject.class); JSONArray jsonArray = resultObject.getJSONArray("gasInfoList"); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; for (Object gasObject : jsonArray) { JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(gasObject)); HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("gasId")); JSONArray gasGunList = object.getJSONArray("gasGunList"); if (store != null) { store.setType(1); store.setSourceType(2); store.setMerchantId(merchant.getId()); store.setCompanyId(merchant.getCompanyId()); store.setStoreKey(object.getString("gasId")); store.setStoreName(object.getString("gasName")); store.setStoreLogo(object.getString("gasLogoSmall")); store.setRegionId(object.getLong("provinceCode")); store.setRegionName(object.getString("provinceName")); store.setAddress(object.getString("gasAddress")); store.setLongitude(object.getString("gasAddressLongitude")); store.setLatitude(object.getString("gasAddressLatitude")); store.setStatus(object.getInteger("gasStatus")); store.setPrestoreType(0); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); store.setExt1(object.getString("gasSourceId")); highMerchantStoreService.updateMerchantStoreDetail(store); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("oilNo")); if (highGasOilPrice == null) { highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceCost(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceCost(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); } highGasOilPriceService.editGasOilPrice(highGasOilPrice); for (Object o : gasGunList) { JSONObject gunNoObject = (JSONObject) o; HighGasOilGunNo gasOilGunNo = gasOilGunNoService.getDetailByStoreAndGunNo(highGasOilPrice.getMerchantStoreId(), gunNoObject.getString("gunNo")); if (gasOilGunNo == null) { gasOilGunNo = new HighGasOilGunNo(); gasOilGunNo.setGasOilPriceId(highGasOilPrice.getId()); gasOilGunNo.setStoreId(highGasOilPrice.getMerchantStoreId()); gasOilGunNo.setOilNo(highGasOilPrice.getOilNo()); gasOilGunNo.setOilNoName(highGasOilPrice.getOilNoName()); gasOilGunNo.setOilType(highGasOilPrice.getOilType()); gasOilGunNo.setOilTypeName(highGasOilPrice.getOilTypeName()); gasOilGunNo.setGunNo(gunNoObject.getString("gunNo")); gasOilGunNo.setStatus(1); gasOilGunNoService.editGunNo(gasOilGunNo); } } } } else { highMerchantStore = new HighMerchantStore(); highMerchantStore.setType(1); highMerchantStore.setSourceType(2); highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setCompanyId(merchant.getCompanyId()); highMerchantStore.setStoreKey(object.getString("gasId")); highMerchantStore.setStoreName(object.getString("gasName")); highMerchantStore.setStoreLogo(object.getString("gasLogoSmall")); highMerchantStore.setRegionId(object.getLong("provinceCode")); highMerchantStore.setRegionName(object.getString("provinceName")); highMerchantStore.setAddress(object.getString("gasAddress")); highMerchantStore.setLongitude(object.getString("gasAddressLongitude")); highMerchantStore.setLatitude(object.getString("gasAddressLatitude")); highMerchantStore.setStatus(1); highMerchantStore.setPrestoreType(0); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setExt1(object.getString("gasSourceId")); HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); highMerchantStoreService.insertMerchantStore(merchantStoreModel); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("oilNo")); highGasOilPrice.setOilNoName(oilPriceObject.getString("oilNoName")); highGasOilPrice.setPriceCost(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceOfficial")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oilType")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oilTypeName")); highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); highGasOilPriceService.editGasOilPrice(highGasOilPrice); for (Object o : gasGunList) { JSONObject gunNoObject = (JSONObject) o; HighGasOilGunNo gasOilGunNo = gasOilGunNoService.getDetailByStoreAndGunNo(highGasOilPrice.getMerchantStoreId(), gunNoObject.getString("gunNo")); if (gasOilGunNo == null) { gasOilGunNo = new HighGasOilGunNo(); gasOilGunNo.setGasOilPriceId(highGasOilPrice.getId()); gasOilGunNo.setStoreId(highGasOilPrice.getMerchantStoreId()); gasOilGunNo.setOilNo(highGasOilPrice.getOilNo()); gasOilGunNo.setOilNoName(highGasOilPrice.getOilNoName()); gasOilGunNo.setOilType(highGasOilPrice.getOilType()); gasOilGunNo.setOilTypeName(highGasOilPrice.getOilTypeName()); gasOilGunNo.setGunNo(gunNoObject.getString("gunNo")); gasOilGunNo.setStatus(1); gasOilGunNoService.editGunNo(gasOilGunNo); } } } } } } return ResponseMsgUtil.success("完成"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/test", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "测试") public ResponseData test(@RequestParam(name = "no", required = true) String no) { try { JSONObject jsonObject = DianConfig.getGasInfoByGasId(no); return ResponseMsgUtil.success(jsonObject); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getGasInfoAll", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取全量油站") public ResponseData getGasInfoAll() { try { HighMerchantModel merchant = highMerchantService.getMerchantById(39L); JSONObject jsonObject = DianConfig.getGasInfoAll(); JSONArray resultObject = jsonObject.getObject("result", JSONArray.class); for (int i = 0; i < resultObject.size();i++) { Object objectData = resultObject.get(i); JSONObject object = JSONObject.parseObject(JSONObject.toJSONString(objectData)); HighMerchantStore highMerchantStore; HighGasOilPrice highGasOilPrice; HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreByKey(object.getString("jyzid")); SecRegion region = commonService.getRegionsByName(object.getString("province")); if (store != null) { store.setType(1); store.setSourceType(6); store.setMerchantId(merchant.getId()); store.setCompanyId(merchant.getCompanyId()); store.setStoreKey(object.getString("jyzid")); store.setStoreName(object.getString("mingcheng")); store.setStoreLogo(object.getString("tupian")); store.setRegionId(region.getRegionId()); store.setRegionName(object.getString("province")); store.setAddress(object.getString("dizhi")); store.setLongitude(object.getString("lng")); store.setLatitude(object.getString("lat")); store.setStatus(object.getInteger("zhuangtai")); store.setPrestoreType(0); store.setOperatorId(0L); store.setOperatorName("系统创建"); store.setUpdateTime(new Date()); store.setExt1(object.getString("gasSourceId")); highMerchantStoreService.updateMerchantStoreDetail(store); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); // 查询门店油号 highGasOilPrice = highGasOilPriceService.getGasOilPriceByStoreAndOilNo(store.getId(), oilPriceObject.getString("youhao")); if (highGasOilPrice == null) { highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("youhao")); highGasOilPrice.setOilNoName(oilPriceObject.getString("youhao") + "#"); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油"); highGasOilPrice.setStatus(GasOilPriceStatusEnum.status1.getStatus()); } else { highGasOilPrice.setMerchantStoreId(store.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("youhao")); highGasOilPrice.setOilNoName( oilPriceObject.getString("youhao") + "#"); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油"); } highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } else { highMerchantStore = new HighMerchantStore(); highMerchantStore.setType(1); highMerchantStore.setSourceType(6); highMerchantStore.setMerchantId(merchant.getId()); highMerchantStore.setCompanyId(merchant.getCompanyId()); highMerchantStore.setStoreKey(object.getString("jyzid")); highMerchantStore.setStoreName(object.getString("mingcheng")); highMerchantStore.setStoreLogo(object.getString("tupian")); highMerchantStore.setRegionId(region.getRegionId()); highMerchantStore.setRegionName(object.getString("province")); highMerchantStore.setAddress(object.getString("dizhi")); highMerchantStore.setLongitude(object.getString("lng")); highMerchantStore.setLatitude(object.getString("lat")); highMerchantStore.setStatus(1); highMerchantStore.setPrestoreType(0); highMerchantStore.setOperatorId(0L); highMerchantStore.setOperatorName("系统创建"); highMerchantStore.setCreateTime(new Date()); highMerchantStore.setUpdateTime(new Date()); highMerchantStore.setExt1(object.getString("gasSourceId")); HighMerchantStoreModel merchantStoreModel = new HighMerchantStoreModel(); BeanUtils.copyProperties(highMerchantStore, merchantStoreModel); highMerchantStoreService.insertMerchantStore(merchantStoreModel); JSONArray oilPriceList = object.getJSONArray("oilPriceList"); for (Object oilPrice : oilPriceList) { JSONObject oilPriceObject = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); highGasOilPrice = new HighGasOilPrice(); highGasOilPrice.setMerchantStoreId(merchantStoreModel.getId()); highGasOilPrice.setOilNo(oilPriceObject.getString("youhao")); highGasOilPrice.setOilNoName(oilPriceObject.getString("youhao") + "#"); highGasOilPrice.setPriceVip(oilPriceObject.getBigDecimal("priceVip")); highGasOilPrice.setPriceGun(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setPriceOfficial(oilPriceObject.getBigDecimal("priceGun")); highGasOilPrice.setOilType(oilPriceObject.getInteger("oiltype")); highGasOilPrice.setOilTypeName(oilPriceObject.getString("oiltype").equals("1") ? "汽油": "柴油"); highGasOilPriceService.editGasOilPrice(highGasOilPrice); } } } return ResponseMsgUtil.success(jsonObject); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getOrderPay", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getOrderPay") public ResponseData getOrderPay(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOilCardOrder highOilCardOrder = highOilCardOrderService.findOrder(orderNo); highOilCardOrder.setStatus(2); JSONObject object = KytcService.getOrderPay(highOilCardOrder.getThirdOrderNo() , highOilCardOrder.getPrice() , highOilCardOrder.getCardNo()); highOilCardOrder.setExt1(object.toJSONString()); highOilCardOrderService.updateOilCardOrder(highOilCardOrder); return ResponseMsgUtil.success("成功"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getOrderInfo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getOrderInfo") public ResponseData getOrderInfo(@RequestParam(name = "orderNo", required = true) String orderNo) { try { HighOilCardOrder highOilCardOrder = highOilCardOrderService.findOrder(orderNo); JSONObject object = KytcService.getOrderInfo(highOilCardOrder.getThirdOrderNo()); highOilCardOrder.setExt2(object.toJSONString()); if (object.getBoolean("State") == true) { JSONObject jsonObject = object.getJSONObject("Data"); if (jsonObject.getInteger("OilOrderState") == 2) { highOilCardOrder.setStatus(3); HighOrder highOrder = highOrderService.getOrderByOrderNo(highOilCardOrder.getOrderNo()); highOrder.setOrderStatus(3); highOrder.getHighChildOrderList().get(0).setChildOrderStatus(3); highOrderService.updateOrder(highOrder); } } highOilCardOrderService.updateOilCardOrder(highOilCardOrder); return ResponseMsgUtil.success("成功"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getLogisticsMsg", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取物流") public ResponseData getLogisticsMsg(@RequestParam(name = "no", required = true) String no) { try { JSONObject jsonObjects = CommonConfig.getLogisticsMsg(no); return ResponseMsgUtil.success(jsonObjects); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } // @RequestMapping(value = "/synCouponRule", method = RequestMethod.GET) // @ResponseBody // @ApiOperation(value = "获取卡券") // public ResponseData synCouponRule() { // try { // return ResponseMsgUtil.success(PetroConfig.synCouponRule()); // } catch (Exception e) { // log.error("HighOrderController --> getBackendToken() error!", e); // return ResponseMsgUtil.exception(e); // } // } // @RequestMapping(value = "/getCoupon", method = RequestMethod.GET) // @ResponseBody // @ApiOperation(value = "卡券下单") // public ResponseData getCoupon() { // try { // // JSONObject jsonObject = PetroConfig.getCoupon("16000443991501" , "18090580471" , OrderUtil.generateOrderNo()); // String data = PetroConfig.decrypt(jsonObject.getString("biz_content")); // JSONObject object = JSONObject.parseObject(data); // // return ResponseMsgUtil.success(object); // } catch (Exception e) { // log.error("HighOrderController --> getBackendToken() error!", e); // return ResponseMsgUtil.exception(e); // } // } @RequestMapping(value = "/deleteOilNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "删除油品") public ResponseData deleteOilNo() { try { gasService.deleteOilNo(); return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getJiaHaoYouAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "加好油油站刷新") public ResponseData getJiaHaoYouAllStation() { try { gasService.getJiaHaoYouAllStation(); return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getDianAllStation", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "点点网络") public ResponseData getDianAllStation() { try { gasService.getDianAllStation(); return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() err1or!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/integralRebateOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "积分返利") public ResponseData integralRebateOrder() { try { // 查询满足初步返利条件订单 List order = highOrderService.integralRebateOrder(); for (HighOrder highOrder : order) { // 查询是否存在积分记录 Map map = new HashMap<>(); map.put("goldType", 1); map.put("resType", 4); map.put("userId", highOrder.getMemId()); map.put("resId", highOrder.getId()); List goldRecs = highGoldRecService.getGoldRec(map); // 判断是否重复赠送积分 if (goldRecs.size() == 0) { bsOrderRebateService.insertOrderRebate(highOrder); } highOrder.setWhetherRebate(true); highOrderService.updateOrderDetail(highOrder); } return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() err1or!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getApiCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取卡券") public ResponseData getApiCoupon() { try { // 查询满足初步返利条件订单 List order = highOrderService.integralRebateOrder(); for (HighOrder highOrder : order) { // 查询是否存在积分记录 Map map = new HashMap<>(); map.put("goldType", 1); map.put("resType", 4); map.put("userId", highOrder.getMemId()); map.put("resId", highOrder.getId()); List goldRecs = highGoldRecService.getGoldRec(map); // 判断是否重复赠送积分 if (goldRecs.size() == 0) { bsOrderRebateService.insertOrderRebate(highOrder); } highOrder.setWhetherRebate(true); highOrderService.updateOrderDetail(highOrder); } return ResponseMsgUtil.success("1231243"); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() err1or!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/couponDetail", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据订单号查询中石油卡券详情") public ResponseData couponDetail(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230258302"); mapPost.put("mchOrderNo" , mchOrderNo); mapPost.put("timetable" , new Date().getTime()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "0C7897EA3BD96156A5881618FF2FF645", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("http://localhost:9902/v1/apiCoupon/getCheckCode" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getCouponList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取卡券") public ResponseData getCouponList() { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20230394901"); mapPost.put("timetable" , new Date().getTime()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "B94B5E62807FA56A7260AB581D8A1B48", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/apiCoupon/getCouponList" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/refundApi", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "支付退款") public ResponseData refundApi(@RequestParam(name = "mchOrderNo", required = true) String mchOrderNo) { try { ApiOrder apiOrder = apiOrderService.findByOrderNo(mchOrderNo , null); // 查询APi ApiMerchants apiMerchants = apiMerchantsService.findByMchId(apiOrder.getMchId()); Map mapPost = new HashMap<>(); mapPost.put("merchId" , apiMerchants.getMchId()); mapPost.put("mchOrderNo" , mchOrderNo); // mapPost.put("timetable" , new Date().getTime()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, apiMerchants.getApiKey(), WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/order/refund" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/checkAccountBalance", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询余额") public ResponseData checkAccountBalance() { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20240133101"); // mapPost.put("mchOrderNo" , mchOrderNo); mapPost.put("timetable" , new Date().getTime()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "1F43EEC88D0F99FC201D81143F9EED85", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/apiMerchants/checkAccountBalance" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getStationStore", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询油站") public ResponseData getStationStore() { try { Map mapPost = new HashMap<>(); mapPost.put("merchId" , "20240133101"); // mapPost.put("mchOrderNo" , mchOrderNo); // mapPost.put("timetable" , new Date().getTime()); mapPost.put("sign" , WxUtils.generateSignApi(mapPost, "1F43EEC88D0F99FC201D81143F9EED85", WXPayConstants.SignType.MD5)); return ResponseMsgUtil.success(HttpsUtils.doPost("https://hsg.dctpay.com/v1/refuelOnline/getStationStore" , mapPost , new HashMap<>())); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/decryptPetroConfig", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解码") public ResponseData decryptPetroConfig(@RequestParam(name = "content", required = true) String content) { try { PetroConfig.init(1); String data = PetroConfig.decrypt(content); JSONObject object = JSONObject.parseObject(data); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/synCouponRule", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "synCouponRule") public ResponseData synCouponRule() { try { PetroConfig.init(2); JSONObject jsonObject = petroConfig.synCouponRule(); String data = PetroConfig.decrypt(jsonObject.getString("jsonResult")); JSONArray jsonArray = JSONArray.parseArray(data); return ResponseMsgUtil.success(jsonArray); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getCoupon") public ResponseData getCoupon(@RequestParam(name = "code", required = true) String code) { try { PetroConfig.init(2); // 发放卡券 JSONObject jsonObject = petroConfig.getCoupon(code ,"18090580471"); String data = PetroConfig.decrypt(jsonObject.getString("jsonResult")); JSONObject object = JSONObject.parseObject(data); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/decrypt", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "decrypt") public ResponseData decrypt(@RequestParam(name = "jsonResult", required = true) String jsonResult) { try { PetroConfig.init(2); String data = PetroConfig.decrypt(jsonResult); JSONObject object = JSONObject.parseObject(data); return ResponseMsgUtil.success(object); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/jNiuGoodsList", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "jNiuGoodsList") public ResponseData jNiuGoodsList() { try { JSONObject object = RechargeConfig.jNiuGoodsList(); JSONArray array = object.getJSONArray("data"); List list = new ArrayList<>(); for (int i = 0; i < array.size(); i++) { JSONObject jsonObject = array.getJSONObject(i); JSONArray jsonArray = jsonObject.getJSONArray("goodsOption"); for (int j = 0; j < jsonArray.size(); j++) { JSONObject goodsOption = jsonArray.getJSONObject(j); JSONArray childArray = goodsOption.getJSONArray("child"); for (int t = 0; t < childArray.size(); t++) { JSONObject child = childArray.getJSONObject(j); JSONObject data = new JSONObject(); data.put("title" , jsonObject.getString("sort_title") + goodsOption.getString("name")); data.put("goodsId" , child.getString("goods_id")); data.put("goodsOptionId" , child.getString("goods_option_id")); data.put("platPrice" , child.getString("plat_price")); data.put("officialPrice" , child.getString("official_price")); list.add(data); } } } return ResponseMsgUtil.success(list); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/rechargeOrderByJn", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "rechargeOrderByJn") public ResponseData rechargeOrderByJn() { try { JSONObject object = new JSONObject(); object.put("orderNo", OrderUtil.generateOrderNo()); object.put("option_id", "632"); object.put("phone", "18090580471"); JSONObject returnObject = RechargeConfig.rechargeOrderByJn(object); return ResponseMsgUtil.success(returnObject); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/checkOrderByJn", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "checkOrderByJn") public ResponseData checkOrderByJn(@RequestParam(name = "order_no", required = true) String order_no) { try { JSONObject object = new JSONObject(); object.put("orderNo" , order_no); int status = 0; JSONObject jsonObject = RechargeConfig.checkOrderByJn(object); if (jsonObject.getJSONObject("data") != null) { JSONObject objectData= jsonObject.getJSONObject("data"); // // 10充值中 20充值完成 -10 充值失败 // -1取消,0充值中 ,1充值成功,2充值失败,3部分成功 if (objectData.getInteger("status") == 10) { status = 0; } else if (objectData.getInteger("status") == 20) { status = 1; } else if (objectData.getInteger("status") == -10) { status = 2; } } return ResponseMsgUtil.success(status); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/getListRechargeOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "getListRechargeOrder") public ResponseData getListRechargeOrder(@RequestParam(name = "order_no", required = true) String order_no) { try { log.info("处理话费订单定时任务开始"); Map map = new HashMap<>(); map.put("payStatus", String.valueOf(102)); map.put("rechargeStatus", String.valueOf(201)); List orderList = outRechargeOrderService.getListRechargeOrder(map); log.info("处理话费订单条数:" + orderList.size()); if (orderList.size() > 0) { for (OutRechargeOrder order : orderList) { try { outRechargeOrderService.prepaidRechargeHandle(order); } catch (Exception e) { log.info("话费定时任务订单业务出现异常", e); } } } return ResponseMsgUtil.success(""); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/etcOrder", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "etcOrder") public ResponseData etcOrder() { try { String mobile = "18090580471"; Map map = new TreeMap<>(); map.put("requestId" , System.nanoTime()); map.put("channelCode" , CommonSysConst.getSysConfig().getEtcChannelCode()); map.put("timestamp" , new Date().getTime() / 1000); map.put("productNo" , "GZETCFXQD_GZETCCSCP"); map.put("mobile" , RSAUtil.encryptBASE64(RSAUtil.encryptByPublicKey(mobile.getBytes(StandardCharsets.UTF_8), CommonSysConst.getSysConfig().getEtcPublicKey()))); map.put("num" , 1); map.put("thirdOrderId" , OrderUtil.generateOrderNo()); String s = StringUtils.join(map.values(), ""); String sign = RSAUtil.sign(s.getBytes(), CommonSysConst.getSysConfig().getEtcPrivateKey()); map.put("sign", sign); return ResponseMsgUtil.success(petroConfig.etcOrder(map)); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/couJointDist", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "商户派发电子券") public ResponseData couJointDist(@RequestParam(name = "order_no", required = true) String order_no) { try { // 购买卡券 JSONObject returnParam = HuiLianTongConfig.costRechargeOrder(order_no); // 解密 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 = "/getCarNo", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询车牌订单号") public ResponseData getCarNo(@RequestParam(name = "carNo", required = true) String carNo) { try { JSONObject jsonObject = new JSONObject(); jsonObject.put("carNo" , carNo); jsonObject.put("orderStatus" , "03"); JSONObject data = blxConfig.queryJsOrderList(jsonObject); return ResponseMsgUtil.success(data); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/getGasDetailByStoreKey",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据门店key 查询") public ResponseData getGasDetailByStoreKey(@RequestParam(name = "storeKey", required = true) String storeKey) { try { JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(storeKey); return ResponseMsgUtil.success(jsonObject.get("result")); } catch (Exception e) { log.error("HighGasController -> getGasDetailByStoreKey() error!",e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-cweb/src/main/java/com/cweb/controller/Etc/EtcCustomerController.java b/hai-cweb/src/main/java/com/cweb/controller/Etc/EtcCustomerController.java new file mode 100644 index 00000000..bc05a8ea --- /dev/null +++ b/hai-cweb/src/main/java/com/cweb/controller/Etc/EtcCustomerController.java @@ -0,0 +1,344 @@ +package com.cweb.controller.Etc; + +import com.alibaba.fastjson.JSONObject; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.security.SessionObject; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.config.EtcService; +import com.hai.entity.EtcCarMsg; +import com.hai.entity.EtcContractOrder; +import com.hai.entity.EtcCustMsg; +import com.hai.entity.SecDictionary; +import com.hai.etc.EtcCarMsgService; +import com.hai.etc.EtcCustMsgService; +import com.hai.model.HighUserModel; +import com.hai.model.ResponseData; +import com.hai.model.UserInfoModel; +import com.hai.service.CommonService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +@RestController +@RequestMapping(value="/etcCustomer") +@Api(value="etc客户信息") +public class EtcCustomerController { + + Logger log = LoggerFactory.getLogger(EtcCustomerController.class); + + @Resource + private UserCenter userCenter; + + @Resource + private EtcCustMsgService etcCustMsgService; + + @Resource + private EtcCarMsgService etcCarMsgService; + + @RequestMapping(value = "/getEtcCarMsgList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询车辆列表") + public ResponseData getEtcCarList( + HttpServletRequest request + ) { + try { + + SessionObject sessionObject = userCenter.getSessionObject(request); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + + + + Map mapUser = new HashMap<>(); + + mapUser.put("phone" , userInfoModel.getHighUser().getPhone()); + mapUser.put("status" , 2); + + EtcCustMsg etcCustMsg = etcCustMsgService.findEtcCustByMap(mapUser); + + if (etcCustMsg == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未查询到任何车辆!"); + } + + Map map = new HashMap<>(); + map.put("custId" , etcCustMsg.getCustId()); + + return ResponseMsgUtil.success(etcCarMsgService.getEtcCarList(map)); + + } catch (Exception e) { + log.error("BsMsgController --> getMsgByList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getEtcContractOrderList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询合同订单列表") + public ResponseData getEtcContractOrderList( + @RequestParam(value = "signStatus", required = false) String signStatus, HttpServletRequest request + ) { + try { + + SessionObject sessionObject = userCenter.getSessionObject(request); + HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); + + Map mapUser = new HashMap<>(); + + mapUser.put("phone" , userInfoModel.getHighUser().getPhone()); + mapUser.put("status" , 2); + + EtcCustMsg etcCustMsg = etcCustMsgService.findEtcCustByMap(mapUser); + + if (etcCustMsg == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未查询到合同!"); + } + + Map map = new HashMap<>(); + + map.put("custId" , etcCustMsg.getCustId()); + map.put("signStatus" , signStatus); + map.put("status" , 1); + + return ResponseMsgUtil.success(etcCarMsgService.getEtcContractOrderList(map)); + + } catch (Exception e) { + log.error("BsMsgController --> getMsgByList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/findContractOrderById", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询合同订单详情") + public ResponseData findContractOrderById( + @RequestParam(value = "id", required = false) Long id + ) { + try { + + return ResponseMsgUtil.success(etcCarMsgService.findContractOrderById(id)); + + } catch (Exception e) { + log.error("BsMsgController --> getMsgByList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/sendSignVerifyCode", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "签约验证码发送接口") + public ResponseData sendSignVerifyCode(@RequestParam(value = "id", required = true) Long id) { + try { + + + EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(id); + + if (contractOrder == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态错误!"); + } + + JSONObject object = EtcService.sendSignVerifyCode(contractOrder.getCustId()); + + if (object.getString("errCode").equals("0")) { + return ResponseMsgUtil.success("请求成功!"); + } + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg")); + + } catch (Exception e) { + log.error("HighUserController --> findByUserId() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/checkSignVerifyCode", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "签约验证码核验接口") + public ResponseData checkSignVerifyCode(@RequestParam(value = "id", required = true) Long id , + @RequestParam(value = "signImg", required = true) String signImg , + @RequestParam(value = "verifyCode", required = true) String verifyCode ) { + try { + + EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(id); + + if (contractOrder == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态错误!"); + } + + contractOrder.setSignImg(signImg); + contractOrder.setUpdateTime(new Date()); + + etcCarMsgService.updateContractOrder(contractOrder); + + JSONObject object = EtcService.checkSignVerifyCode(contractOrder.getCustId() , verifyCode); + + if (object.getString("errCode").equals("0")) { + + Map mapCar = new HashMap<>(); + mapCar.put("vehId" , contractOrder.getVehId()); + mapCar.put("custId" , contractOrder.getCustId()); + + EtcCarMsg carMsg = etcCarMsgService.findEtcCarByMap(mapCar); + + carMsg.setSignStatus(1); + carMsg.setUpdateTime(new Date()); + carMsg.setVehStatus(15); + + etcCarMsgService.updateEtcCar(carMsg); + + contractOrder.setSignStatus(1); + etcCarMsgService.updateContractOrder(contractOrder); + + return ResponseMsgUtil.success("请求成功!"); + } + + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg")); + + } catch (Exception e) { + log.error("HighUserController --> findByUserId() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getSignContractTemplate", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取签约合同模板") + public ResponseData getSignContractTemplate(@RequestParam(value = "contractId", required = true) Long contractId ) { + try { + + EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(contractId); + + if (contractOrder == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态错误!"); + } + + JSONObject object = EtcService.getSignContractTemplate(contractOrder.getCustId() , contractOrder.getProductId() , contractOrder.getCardVarietyId()); + + if (object.getString("errCode").equals("0")) { + JSONObject jsonObject = (JSONObject) object.getJSONArray("result").get(0); + return ResponseMsgUtil.success(jsonObject.getString("url")); + } + + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg")); + + } catch (Exception e) { + log.error("HighUserController --> findByUserId() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/checkNeedSign", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查看是否需要签约代扣") + public ResponseData checkNeedSign(@RequestParam(value = "contractId", required = true) Long contractId, + @RequestParam(value = "type", required = true) Integer type) { + try { + + + EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(contractId); + + if (type == 1) { + JSONObject object = EtcService.checkNeedSignWechatWithhold( contractOrder.getProductId() , contractOrder.getCardVarietyId()); + if (object.getString("errCode").equals("0")) { + return ResponseMsgUtil.success(object.getJSONObject("result")); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg")); + } + + } else { + JSONObject object = EtcService.checkSignWithhold( contractOrder.getCustId()); + if (object.getString("errCode").equals("0")) { + if (object.getJSONObject("result").getBoolean("isSign")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "已签约"); + } + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, object.getString("errMsg")); + } + } + + return ResponseMsgUtil.success(true); + + } catch (Exception e) { + log.error("HighUserController --> findByUserId() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/sendSignWithholdCode", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "签约银行卡代扣发送验证码") + public ResponseData sendSignWithholdCode(@RequestBody JSONObject object, HttpServletRequest request) { + try { + + if (object.getString("custId") == null || + object.getString("cardNo") == null || + object.getInteger("bankCardType") == null || + object.getString("mobileNo") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "信息不全!"); + } + + if (object.getInteger("bankCardType") == 2 ) { + if (object.getString("cardExpired") == null || + object.getString("cardCvv2") == null ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "信用卡信息不全!"); + } + } + + JSONObject jsonObject = EtcService.sendSignWithholdCode(object); + if (jsonObject.getString("errCode").equals("0")) { + + return ResponseMsgUtil.success(jsonObject.getJSONObject("result").getString("verifyCodeNo")); + } + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("errMsg")); + + } catch (Exception e) { + log.error("HighUserController --> findByUserId() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/signWithhold", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "签约银行卡代扣") + public ResponseData signWithhold(@RequestBody JSONObject object, HttpServletRequest request) { + try { + + if (object.getString("custId") == null || + object.getString("cardNo") == null || + object.getInteger("bankCardType") == null || + object.getString("bankName") == null || + object.getString("verifyCodeNo") == null || + object.getString("verifyCode") == null || + object.getString("mobileNo") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "信息不全!"); + } + + if (object.getInteger("bankCardType") == 2 ) { + if (object.getString("cardExpired") == null || + object.getString("cardCvv2") == null ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "信用卡信息不全!"); + } + } + + JSONObject jsonObject = EtcService.signWithhold(object); + if (jsonObject.getString("errCode").equals("0")) { + return ResponseMsgUtil.success("请求成功"); + } + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("errMsg")); + + } catch (Exception e) { + log.error("HighUserController --> findByUserId() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + + +} diff --git a/hai-order/src/main/java/com/web/controller/OrderPayController.java b/hai-order/src/main/java/com/web/controller/OrderPayController.java index bc9824c5..c0d88bb4 100644 --- a/hai-order/src/main/java/com/web/controller/OrderPayController.java +++ b/hai-order/src/main/java/com/web/controller/OrderPayController.java @@ -150,7 +150,13 @@ public class OrderPayController { } else { weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_QYX_MINI); // 黔印象小程序 } - } else { + } else if (PlatformType.TYPE3.getNumber().equals(body.getInteger("platformType"))) { + if (openIdType != null && openIdType.equals(2)) { + weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_HSG_MP); // 黔印象公众号 + } else { + weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_ZXJZ_MINI); // 黔印象小程序 + } + }else { if (openIdType != null && openIdType.equals(2)) { weChatPayReqInfo.setSub_appid(WxOrderConfig.APPID_HSG_MP); // 商户号公众号 } else { @@ -375,6 +381,8 @@ public class OrderPayController { } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE17.getNumber())) { weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195); + } else if (order.getProductType().equals(OrderProductType.PRODUCT_TYPE20.getNumber())) { + weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1614670195); } else { weChatPayReqInfo.setSub_mch_id(WxOrderConfig.MCH_ID_1609882817); } diff --git a/hai-service/pom.xml b/hai-service/pom.xml index d17a9112..a69b2fa4 100644 --- a/hai-service/pom.xml +++ b/hai-service/pom.xml @@ -351,6 +351,7 @@ junit junit + com.github.wechatpay-apiv3 @@ -358,11 +359,7 @@ 0.4.9 - - com.huaweicloud.sdk - huaweicloud-sdk-sis - 3.1.42 - + org.springframework spring-test diff --git a/hai-service/src/main/java/com/hai/common/utils/WxUtils.java b/hai-service/src/main/java/com/hai/common/utils/WxUtils.java index 6c1acf67..65a46321 100644 --- a/hai-service/src/main/java/com/hai/common/utils/WxUtils.java +++ b/hai-service/src/main/java/com/hai/common/utils/WxUtils.java @@ -667,4 +667,24 @@ public class WxUtils { } + public static String generateSignByEtc(Map map , String key) throws Exception { + Set keySet = map.keySet(); + String[] keyArray = keySet.toArray(new String[keySet.size()]); + Arrays.sort(keyArray); + StringBuilder sb = new StringBuilder(); + for (String k : keyArray) { + if (k.equals(WXPayConstants.FIELD_SIGN) || k.equals("key")) { + continue; + } + if (map.get(k) != null) // 参数值为空,则不参与签名 + { + sb.append(k).append("=").append(map.get(k)).append("&"); + } + } + sb.append("key=").append(key); + + return sb.toString(); + + } + } diff --git a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java index 1c489248..84b77c21 100644 --- a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java +++ b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java @@ -132,6 +132,9 @@ public class CommonSysConfig { private String wxQyxAppId; private String wxQyxAppSecret; + private String wxZxjzAppId; + private String wxZxjzAppSecret; + private String wxH5AppId; private String wxH5AppSecret; diff --git a/hai-service/src/main/java/com/hai/config/EtcService.java b/hai-service/src/main/java/com/hai/config/EtcService.java index ae8253ce..ef336a03 100644 --- a/hai-service/src/main/java/com/hai/config/EtcService.java +++ b/hai-service/src/main/java/com/hai/config/EtcService.java @@ -8,6 +8,10 @@ import com.hai.entity.EtcCustMsg; import org.apache.commons.codec.digest.DigestUtils; import org.springframework.context.annotation.Configuration; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -33,27 +37,27 @@ public class EtcService { */ public static JSONObject submitCustInfo(EtcCustMsg etcCustMsg) throws Exception { // 组装数据 - Map map = new HashMap<>(); + JSONObject map = new JSONObject(); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); - map.put("timestamps", System.currentTimeMillis()); + map.put("timestamps", String.valueOf(String.valueOf(System.currentTimeMillis()))); JSONObject jsonObject = new JSONObject(); jsonObject.put("custName" , etcCustMsg.getCustName()); jsonObject.put("custIdNo" , etcCustMsg.getCustIdNo()); jsonObject.put("accountNo" , etcCustMsg.getAccountNo()); jsonObject.put("bankName" , etcCustMsg.getBankName()); jsonObject.put("address" , etcCustMsg.getAddress()); - jsonObject.put("phone" , etcCustMsg.getPhone()); + jsonObject.put("phone" , etcCustMsg.getBankPhone()); jsonObject.put("custAgentIdFront" , convertToBase64(etcCustMsg.getCustAgentIdFront())); jsonObject.put("custAgentIdBack" , convertToBase64(etcCustMsg.getCustAgentIdBront())); jsonObject.put("bankCard" , convertToBase64(etcCustMsg.getCustAgentIdBront())); if (etcCustMsg.getCustId() != null) { jsonObject.put("custId" , etcCustMsg.getCustId()); } - String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey()); - - map.put("body" , jsonObject); + map.put("body" , jsonObject.toJSONString()); + String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey()); map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); - return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/submitCustInfo" , map); + + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/submitCustInfo" , map); } /** @@ -66,9 +70,9 @@ public class EtcService { */ public static JSONObject submitVehInfo(EtcCarMsg etcCarMsg) throws Exception { // 组装数据 - Map map = new HashMap<>(); + JSONObject map = new JSONObject(); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); - map.put("timestamps", System.currentTimeMillis()); + map.put("timestamps", String.valueOf(System.currentTimeMillis())); JSONObject jsonObject = new JSONObject(); jsonObject.put("productId" , etcCarMsg.getProductId()); jsonObject.put("custId" , etcCarMsg.getCustId()); @@ -80,18 +84,21 @@ public class EtcService { vehInfoListObject.put("vehPlateColor" , etcCarMsg.getVehPlateColor()); vehInfoListObject.put("vehType" , etcCarMsg.getVehType()); vehInfoListObject.put("wheelsNum" , etcCarMsg.getWheelsNum()); - jsonObject.put("drivLicMainFro" , convertToBase64(etcCarMsg.getDrivlicMainFro())); - jsonObject.put("drivLicSubFro" , convertToBase64(etcCarMsg.getDrivlicSubFro())); - jsonObject.put("headStockPhoto" , convertToBase64(etcCarMsg.getHeadStockPhoto())); + vehInfoListObject.put("drivLicMainFro" , convertToBase64(etcCarMsg.getDrivlicMainFro())); + vehInfoListObject.put("drivLicSubFro" , convertToBase64(etcCarMsg.getDrivlicSubFro())); + vehInfoListObject.put("headStockPhoto" , convertToBase64(etcCarMsg.getHeadStockPhoto())); if (etcCarMsg.getVehId() != null) { - jsonObject.put("vehId" , etcCarMsg.getVehId()); + vehInfoListObject.put("vehId" , etcCarMsg.getVehId()); } - String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey()); + vehInfoList.add(vehInfoListObject); + + jsonObject.put("vehInfoList" , vehInfoList); - map.put("body" , jsonObject); + map.put("body" , jsonObject.toJSONString()); + String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey()); map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); - return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/submitVehInfo" , map); + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/submitVehInfo" , map); } @@ -105,18 +112,18 @@ public class EtcService { */ public static JSONObject getVehStatus(EtcCarMsg etcCarMsg) throws Exception { // 组装数据 - Map map = new HashMap<>(); + JSONObject map = new JSONObject(); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); - map.put("timestamps", System.currentTimeMillis()); + map.put("timestamps", String.valueOf(System.currentTimeMillis())); JSONObject jsonObject = new JSONObject(); jsonObject.put("custId" , etcCarMsg.getCustId()); jsonObject.put("vehId" , etcCarMsg.getVehId()); - String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey()); - - map.put("body" , jsonObject); + map.put("body" , jsonObject.toJSONString()); + String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey()); map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); - return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/getVehStatus" , map); + + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/getVehStatus" , map); } /** @@ -129,17 +136,17 @@ public class EtcService { */ public static JSONObject sendRealNameCode(String custId) throws Exception { // 组装数据 - Map map = new HashMap<>(); + JSONObject map = new JSONObject(); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); - map.put("timestamps", System.currentTimeMillis()); + map.put("timestamps", String.valueOf(System.currentTimeMillis())); JSONObject jsonObject = new JSONObject(); jsonObject.put("custId" , custId); - String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey()); - - map.put("body" , jsonObject); + map.put("body" , jsonObject.toJSONString()); + String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey()); map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); - return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/sendRealNameCode" , map); + + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/sendRealNameCode" , map); } /** @@ -152,18 +159,18 @@ public class EtcService { */ public static JSONObject checkRealNameCode(String custId , String verifyCode) throws Exception { // 组装数据 - Map map = new HashMap<>(); + JSONObject map = new JSONObject(); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); - map.put("timestamps", System.currentTimeMillis()); + map.put("timestamps", String.valueOf(System.currentTimeMillis())); JSONObject jsonObject = new JSONObject(); jsonObject.put("custId" , custId); jsonObject.put("verifyCode" , verifyCode); - String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey()); - - map.put("body" , jsonObject); + map.put("body" , jsonObject.toJSONString()); + String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey()); map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); - return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/checkRealNameCode" , map); + + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/checkRealNameCode" , map); } /** @@ -177,34 +184,182 @@ public class EtcService { */ public static JSONObject sendSignVerifyCode(String custId) throws Exception { // 组装数据 - Map map = new HashMap<>(); + JSONObject map = new JSONObject(); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); - map.put("timestamps", System.currentTimeMillis()); + map.put("timestamps", String.valueOf(System.currentTimeMillis())); JSONObject jsonObject = new JSONObject(); jsonObject.put("custId" , custId); - String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey()); - - map.put("body" , jsonObject); + map.put("body" , jsonObject.toJSONString()); + String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey()); map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); - return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/sendSignVerifyCode" , map); + + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/sendSignVerifyCode" , map); } + /** + * @Author Sum1Dream + * @Name checkSignVerifyCode + * @Description // 签约验证码核验接口 + * @Date 15:34 2024/3/28 + * @Param custId + * @Param verifyCode + * @return com.alibaba.fastjson.JSONObject + */ public static JSONObject checkSignVerifyCode(String custId , String verifyCode) throws Exception { // 组装数据 - Map map = new HashMap<>(); + JSONObject map = new JSONObject(); map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); - map.put("timestamps", System.currentTimeMillis()); + map.put("timestamps", String.valueOf(System.currentTimeMillis())); JSONObject jsonObject = new JSONObject(); jsonObject.put("custId" , custId); jsonObject.put("verifyCode" , verifyCode); - String sign = WxUtils.generateSignKytc(jsonObject , CommonSysConst.getSysConfig().getNdKey()); + map.put("body" , jsonObject.toJSONString()); + String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey()); + map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); + + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/checkSignVerifyCode" , map); + } - map.put("body" , jsonObject); + /** + * @Author Sum1Dream + * @Name getSignContractTemplate + * @Description // 获取合同模版 + * @Date 14:31 2024/4/1 + * @Param custId + * @Param productId + * @Param cardVarietyId + * @return com.alibaba.fastjson.JSONObject + */ + public static JSONObject getSignContractTemplate(String custId , Integer productId , Integer cardVarietyId) throws Exception { + // 组装数据 + JSONObject map = new JSONObject(); + map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); + map.put("timestamps", String.valueOf(System.currentTimeMillis())); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("custId" , custId); + jsonObject.put("productId" , productId); + jsonObject.put("cardVarietyId" , cardVarietyId); + + map.put("body" , jsonObject.toJSONString()); + String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey()); map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); - return HttpsUtils.doGet(CommonSysConst.getSysConfig().getDiandianwPostUrl()+"/api/v1/checkSignVerifyCode" , map); + + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/getSignContractTemplate" , map); + } + + /** + * @Author Sum1Dream + * @Name checkNeedSignWechatWithhold + * @Description //查看是否需要签约微信代扣 + * @Date 14:31 2024/4/1 + * @Param custId + * @Param productId + * @Param cardVarietyId + * @return com.alibaba.fastjson.JSONObject + */ + public static JSONObject checkNeedSignWechatWithhold(Integer productId , Integer cardVarietyId) throws Exception { + // 组装数据 + JSONObject map = new JSONObject(); + map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); + map.put("timestamps", String.valueOf(System.currentTimeMillis())); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("productId" , productId); + jsonObject.put("cardVarietyId" , cardVarietyId); + + map.put("body" , jsonObject.toJSONString()); + String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey()); + map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); + + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/checkNeedSignWechatWithhold" , map); + } + + /** + * @Author Sum1Dream + * @Name checkSignWithhold + * @Description // 是否已签约银行卡代扣 + * @Date 14:42 2024/4/1 + * @Param productId + * @Param cardVarietyId + * @return com.alibaba.fastjson.JSONObject + */ + public static JSONObject checkSignWithhold(String custId) throws Exception { + // 组装数据 + JSONObject map = new JSONObject(); + map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); + map.put("timestamps", String.valueOf(System.currentTimeMillis())); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("custId" , custId); + + map.put("body" , jsonObject.toJSONString()); + String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey()); + map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); + + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/checkSignWithhold" , map); + } + + /** + * @Author Sum1Dream + * @Name sendSignWithholdCode + * @Description // 签约银行卡代扣发送验证码 + * @Date 14:45 2024/4/1 + * @Param object + * @return com.alibaba.fastjson.JSONObject + */ + public static JSONObject sendSignWithholdCode(JSONObject object) throws Exception { + // 组装数据 + JSONObject map = new JSONObject(); + map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); + map.put("timestamps", String.valueOf(System.currentTimeMillis())); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("custId" , object.getString("custId")); + jsonObject.put("cardNo" , object.getString("cardNo")); + jsonObject.put("mobileNo" , object.getString("mobileNo")); + jsonObject.put("idNo" , object.getString("idNo")); + jsonObject.put("holderName" , object.getString("holderName")); + jsonObject.put("cardExpired" , object.getString("cardExpired")); + jsonObject.put("cardCvv2" , object.getString("cardCvv2")); + + map.put("body" , jsonObject.toJSONString()); + String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey()); + map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); + + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/sendSignWithholdCode" , map); + } + + /** + * @Author Sum1Dream + * @Name signWithhold + * @Description // 签约银行卡代扣 + * @Date 14:52 2024/4/1 + * @Param object + * @return com.alibaba.fastjson.JSONObject + */ + public static JSONObject signWithhold(JSONObject object) throws Exception { + // 组装数据 + JSONObject map = new JSONObject(); + map.put("orgCode" , CommonSysConst.getSysConfig().getNdOrgCode()); + map.put("timestamps", String.valueOf(System.currentTimeMillis())); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("custId" , object.getString("custId")); + jsonObject.put("bankCardType" , object.getInteger("bankCardType")); + jsonObject.put("bankName" , object.getString("bankName")); + jsonObject.put("cardNo" , object.getString("cardNo")); + jsonObject.put("mobileNo" , object.getString("mobileNo")); + jsonObject.put("idNo" , object.getString("idNo")); + jsonObject.put("holderName" , object.getString("holderName")); + jsonObject.put("cardExpired" , object.getString("cardExpired")); + jsonObject.put("cardCvv2" , object.getString("cardCvv2")); + jsonObject.put("verifyCodeNo" , object.getString("verifyCodeNo")); + jsonObject.put("verifyCode" , object.getString("verifyCode")); + + map.put("body" , jsonObject.toJSONString()); + String sign = WxUtils.generateSignByEtc(map , CommonSysConst.getSysConfig().getNdKey()); + map.put("sign" , DigestUtils.md5Hex((sign).getBytes())); + + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getNdPostUrl()+"/api/v1/signWithhold" , map); } /** @@ -215,16 +370,23 @@ public class EtcService { * @Param imagePath * @return java.lang.String */ - public static String convertToBase64(String imagePath) { - String base64Image = ""; - try { - Path path = Paths.get( CommonSysConst.getSysConfig().getFileUrl() + imagePath); - byte[] imageBytes = Files.readAllBytes(path); - base64Image = Base64.getEncoder().encodeToString(imageBytes); - } catch (Exception e) { - e.printStackTrace(); - } - return base64Image; + public static String convertToBase64(String imagePath) throws IOException { + // 读取图片文件到字节数组 + Path path = new File(CommonSysConst.getSysConfig().getFileUrl() + imagePath).toPath(); + byte[] imageBytes = Files.readAllBytes(path); + + // 将字节数组转换为Base64编码的字符串 + String base64ImageString = Base64.getEncoder().encodeToString(imageBytes); + + // 获取文件扩展名作为数据格式 + String dataFormat = imagePath.substring(imagePath.lastIndexOf('.') + 1); + + // 构建最终的Base64字符串,包含数据格式 + String base64WithDataFormat = "data:image/" + dataFormat + ";base64," + base64ImageString; + + return base64WithDataFormat; + + } diff --git a/hai-service/src/main/java/com/hai/config/WxMaConfiguration.java b/hai-service/src/main/java/com/hai/config/WxMaConfiguration.java index 785f1a80..0c963df9 100644 --- a/hai-service/src/main/java/com/hai/config/WxMaConfiguration.java +++ b/hai-service/src/main/java/com/hai/config/WxMaConfiguration.java @@ -12,6 +12,7 @@ public class WxMaConfiguration { private static WxMaService maService; private static WxMaService maQyxService; + private static WxMaService maZxjzService; public static WxMaService getMaService() { if (maService == null) { @@ -22,16 +23,18 @@ public class WxMaConfiguration { } public static WxMaService getMaService(Integer type) { - if (maService == null || maQyxService == null) { + if (maService == null || maQyxService == null || maZxjzService == null) { throw new IllegalArgumentException(String.format("未找到对应的配置,请核实!")); } - // type 1:嗨森逛小程序参数 2:黔印象小程序参数 + // type 1:嗨森逛小程序参数 2:黔印象小程序参数 3.智行九州 if (type == 1) { return maService; + } else if (type == 2) { + return maQyxService; } - return maQyxService; + return maZxjzService; } @PostConstruct @@ -49,6 +52,13 @@ public class WxMaConfiguration { maQyxService = new WxMaServiceImpl(); maQyxService.setWxMaConfig(qyxConfig); + + WxMaDefaultConfigImpl zxjzConfig = new WxMaDefaultConfigImpl(); + zxjzConfig.setAppid(CommonSysConst.getSysConfig().getWxZxjzAppId()); + zxjzConfig.setSecret(CommonSysConst.getSysConfig().getWxZxjzAppSecret()); + + maZxjzService = new WxMaServiceImpl(); + maZxjzService.setWxMaConfig(zxjzConfig); } } diff --git a/hai-service/src/main/java/com/hai/config/WxOrderConfig.java b/hai-service/src/main/java/com/hai/config/WxOrderConfig.java index a849d34f..4777db1d 100644 --- a/hai-service/src/main/java/com/hai/config/WxOrderConfig.java +++ b/hai-service/src/main/java/com/hai/config/WxOrderConfig.java @@ -100,6 +100,11 @@ public class WxOrderConfig { */ public static final String APPID_QYX_MINI = "wx5e0cac96ea91c01f"; + /** + * 智行九州小程序APPID + */ + public static final String APPID_ZXJZ_MINI = "wxc872cb59b56681a7"; + public static OrderRefundModel orderToRefund(String paySerialNo,BigDecimal totalFee,BigDecimal refundFee) throws Exception { Map param = new HashMap<>(); param.put("appid", "wx637bd6f7314daa46"); diff --git a/hai-service/src/main/java/com/hai/dao/EtcContractOrderMapper.java b/hai-service/src/main/java/com/hai/dao/EtcContractOrderMapper.java new file mode 100644 index 00000000..dc971f15 --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/EtcContractOrderMapper.java @@ -0,0 +1,158 @@ +package com.hai.dao; + +import com.hai.entity.EtcContractOrder; +import com.hai.entity.EtcContractOrderExample; +import java.util.List; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Options; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Results; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.Update; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface EtcContractOrderMapper extends EtcContractOrderMapperExt { + @SelectProvider(type=EtcContractOrderSqlProvider.class, method="countByExample") + long countByExample(EtcContractOrderExample example); + + @DeleteProvider(type=EtcContractOrderSqlProvider.class, method="deleteByExample") + int deleteByExample(EtcContractOrderExample example); + + @Delete({ + "delete from etc_contract_order", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into etc_contract_order (phone, contract_no, ", + "cust_id, veh_id, product_id, ", + "card_variety_id, product_name, ", + "card_variety_name, sign_img, ", + "create_time, update_time, ", + "`status`, pay_status, ", + "sign_status, op_id, ", + "op_name, ext_1, ext_2, ", + "ext_3)", + "values (#{phone,jdbcType=VARCHAR}, #{contractNo,jdbcType=VARCHAR}, ", + "#{custId,jdbcType=VARCHAR}, #{vehId,jdbcType=VARCHAR}, #{productId,jdbcType=INTEGER}, ", + "#{cardVarietyId,jdbcType=INTEGER}, #{productName,jdbcType=VARCHAR}, ", + "#{cardVarietyName,jdbcType=VARCHAR}, #{signImg,jdbcType=VARCHAR}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{status,jdbcType=INTEGER}, #{payStatus,jdbcType=INTEGER}, ", + "#{signStatus,jdbcType=INTEGER}, #{opId,jdbcType=BIGINT}, ", + "#{opName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", + "#{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(EtcContractOrder record); + + @InsertProvider(type=EtcContractOrderSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(EtcContractOrder record); + + @SelectProvider(type=EtcContractOrderSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR), + @Result(column="contract_no", property="contractNo", jdbcType=JdbcType.VARCHAR), + @Result(column="cust_id", property="custId", jdbcType=JdbcType.VARCHAR), + @Result(column="veh_id", property="vehId", jdbcType=JdbcType.VARCHAR), + @Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER), + @Result(column="card_variety_id", property="cardVarietyId", jdbcType=JdbcType.INTEGER), + @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR), + @Result(column="card_variety_name", property="cardVarietyName", jdbcType=JdbcType.VARCHAR), + @Result(column="sign_img", property="signImg", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER), + @Result(column="sign_status", property="signStatus", jdbcType=JdbcType.INTEGER), + @Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT), + @Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectByExample(EtcContractOrderExample example); + + @Select({ + "select", + "id, phone, contract_no, cust_id, veh_id, product_id, card_variety_id, product_name, ", + "card_variety_name, sign_img, create_time, update_time, `status`, pay_status, ", + "sign_status, op_id, op_name, ext_1, ext_2, ext_3", + "from etc_contract_order", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR), + @Result(column="contract_no", property="contractNo", jdbcType=JdbcType.VARCHAR), + @Result(column="cust_id", property="custId", jdbcType=JdbcType.VARCHAR), + @Result(column="veh_id", property="vehId", jdbcType=JdbcType.VARCHAR), + @Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER), + @Result(column="card_variety_id", property="cardVarietyId", jdbcType=JdbcType.INTEGER), + @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR), + @Result(column="card_variety_name", property="cardVarietyName", jdbcType=JdbcType.VARCHAR), + @Result(column="sign_img", property="signImg", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER), + @Result(column="sign_status", property="signStatus", jdbcType=JdbcType.INTEGER), + @Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT), + @Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + EtcContractOrder selectByPrimaryKey(Long id); + + @UpdateProvider(type=EtcContractOrderSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") EtcContractOrder record, @Param("example") EtcContractOrderExample example); + + @UpdateProvider(type=EtcContractOrderSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") EtcContractOrder record, @Param("example") EtcContractOrderExample example); + + @UpdateProvider(type=EtcContractOrderSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(EtcContractOrder record); + + @Update({ + "update etc_contract_order", + "set phone = #{phone,jdbcType=VARCHAR},", + "contract_no = #{contractNo,jdbcType=VARCHAR},", + "cust_id = #{custId,jdbcType=VARCHAR},", + "veh_id = #{vehId,jdbcType=VARCHAR},", + "product_id = #{productId,jdbcType=INTEGER},", + "card_variety_id = #{cardVarietyId,jdbcType=INTEGER},", + "product_name = #{productName,jdbcType=VARCHAR},", + "card_variety_name = #{cardVarietyName,jdbcType=VARCHAR},", + "sign_img = #{signImg,jdbcType=VARCHAR},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "`status` = #{status,jdbcType=INTEGER},", + "pay_status = #{payStatus,jdbcType=INTEGER},", + "sign_status = #{signStatus,jdbcType=INTEGER},", + "op_id = #{opId,jdbcType=BIGINT},", + "op_name = #{opName,jdbcType=VARCHAR},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(EtcContractOrder record); +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/EtcContractOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/EtcContractOrderMapperExt.java new file mode 100644 index 00000000..5b3afa9d --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/EtcContractOrderMapperExt.java @@ -0,0 +1,7 @@ +package com.hai.dao; + +/** + * mapper扩展类 + */ +public interface EtcContractOrderMapperExt { +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/dao/EtcContractOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/EtcContractOrderSqlProvider.java new file mode 100644 index 00000000..c6700cad --- /dev/null +++ b/hai-service/src/main/java/com/hai/dao/EtcContractOrderSqlProvider.java @@ -0,0 +1,444 @@ +package com.hai.dao; + +import com.hai.entity.EtcContractOrder; +import com.hai.entity.EtcContractOrderExample.Criteria; +import com.hai.entity.EtcContractOrderExample.Criterion; +import com.hai.entity.EtcContractOrderExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class EtcContractOrderSqlProvider { + + public String countByExample(EtcContractOrderExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("etc_contract_order"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(EtcContractOrderExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("etc_contract_order"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(EtcContractOrder record) { + SQL sql = new SQL(); + sql.INSERT_INTO("etc_contract_order"); + + if (record.getPhone() != null) { + sql.VALUES("phone", "#{phone,jdbcType=VARCHAR}"); + } + + if (record.getContractNo() != null) { + sql.VALUES("contract_no", "#{contractNo,jdbcType=VARCHAR}"); + } + + if (record.getCustId() != null) { + sql.VALUES("cust_id", "#{custId,jdbcType=VARCHAR}"); + } + + if (record.getVehId() != null) { + sql.VALUES("veh_id", "#{vehId,jdbcType=VARCHAR}"); + } + + if (record.getProductId() != null) { + sql.VALUES("product_id", "#{productId,jdbcType=INTEGER}"); + } + + if (record.getCardVarietyId() != null) { + sql.VALUES("card_variety_id", "#{cardVarietyId,jdbcType=INTEGER}"); + } + + if (record.getProductName() != null) { + sql.VALUES("product_name", "#{productName,jdbcType=VARCHAR}"); + } + + if (record.getCardVarietyName() != null) { + sql.VALUES("card_variety_name", "#{cardVarietyName,jdbcType=VARCHAR}"); + } + + if (record.getSignImg() != null) { + sql.VALUES("sign_img", "#{signImg,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getPayStatus() != null) { + sql.VALUES("pay_status", "#{payStatus,jdbcType=INTEGER}"); + } + + if (record.getSignStatus() != null) { + sql.VALUES("sign_status", "#{signStatus,jdbcType=INTEGER}"); + } + + if (record.getOpId() != null) { + sql.VALUES("op_id", "#{opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.VALUES("op_name", "#{opName,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(EtcContractOrderExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("phone"); + sql.SELECT("contract_no"); + sql.SELECT("cust_id"); + sql.SELECT("veh_id"); + sql.SELECT("product_id"); + sql.SELECT("card_variety_id"); + sql.SELECT("product_name"); + sql.SELECT("card_variety_name"); + sql.SELECT("sign_img"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("`status`"); + sql.SELECT("pay_status"); + sql.SELECT("sign_status"); + sql.SELECT("op_id"); + sql.SELECT("op_name"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("etc_contract_order"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + EtcContractOrder record = (EtcContractOrder) parameter.get("record"); + EtcContractOrderExample example = (EtcContractOrderExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("etc_contract_order"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getPhone() != null) { + sql.SET("phone = #{record.phone,jdbcType=VARCHAR}"); + } + + if (record.getContractNo() != null) { + sql.SET("contract_no = #{record.contractNo,jdbcType=VARCHAR}"); + } + + if (record.getCustId() != null) { + sql.SET("cust_id = #{record.custId,jdbcType=VARCHAR}"); + } + + if (record.getVehId() != null) { + sql.SET("veh_id = #{record.vehId,jdbcType=VARCHAR}"); + } + + if (record.getProductId() != null) { + sql.SET("product_id = #{record.productId,jdbcType=INTEGER}"); + } + + if (record.getCardVarietyId() != null) { + sql.SET("card_variety_id = #{record.cardVarietyId,jdbcType=INTEGER}"); + } + + if (record.getProductName() != null) { + sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}"); + } + + if (record.getCardVarietyName() != null) { + sql.SET("card_variety_name = #{record.cardVarietyName,jdbcType=VARCHAR}"); + } + + if (record.getSignImg() != null) { + sql.SET("sign_img = #{record.signImg,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getPayStatus() != null) { + sql.SET("pay_status = #{record.payStatus,jdbcType=INTEGER}"); + } + + if (record.getSignStatus() != null) { + sql.SET("sign_status = #{record.signStatus,jdbcType=INTEGER}"); + } + + if (record.getOpId() != null) { + sql.SET("op_id = #{record.opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("etc_contract_order"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("phone = #{record.phone,jdbcType=VARCHAR}"); + sql.SET("contract_no = #{record.contractNo,jdbcType=VARCHAR}"); + sql.SET("cust_id = #{record.custId,jdbcType=VARCHAR}"); + sql.SET("veh_id = #{record.vehId,jdbcType=VARCHAR}"); + sql.SET("product_id = #{record.productId,jdbcType=INTEGER}"); + sql.SET("card_variety_id = #{record.cardVarietyId,jdbcType=INTEGER}"); + sql.SET("product_name = #{record.productName,jdbcType=VARCHAR}"); + sql.SET("card_variety_name = #{record.cardVarietyName,jdbcType=VARCHAR}"); + sql.SET("sign_img = #{record.signImg,jdbcType=VARCHAR}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("pay_status = #{record.payStatus,jdbcType=INTEGER}"); + sql.SET("sign_status = #{record.signStatus,jdbcType=INTEGER}"); + sql.SET("op_id = #{record.opId,jdbcType=BIGINT}"); + sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + EtcContractOrderExample example = (EtcContractOrderExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(EtcContractOrder record) { + SQL sql = new SQL(); + sql.UPDATE("etc_contract_order"); + + if (record.getPhone() != null) { + sql.SET("phone = #{phone,jdbcType=VARCHAR}"); + } + + if (record.getContractNo() != null) { + sql.SET("contract_no = #{contractNo,jdbcType=VARCHAR}"); + } + + if (record.getCustId() != null) { + sql.SET("cust_id = #{custId,jdbcType=VARCHAR}"); + } + + if (record.getVehId() != null) { + sql.SET("veh_id = #{vehId,jdbcType=VARCHAR}"); + } + + if (record.getProductId() != null) { + sql.SET("product_id = #{productId,jdbcType=INTEGER}"); + } + + if (record.getCardVarietyId() != null) { + sql.SET("card_variety_id = #{cardVarietyId,jdbcType=INTEGER}"); + } + + if (record.getProductName() != null) { + sql.SET("product_name = #{productName,jdbcType=VARCHAR}"); + } + + if (record.getCardVarietyName() != null) { + sql.SET("card_variety_name = #{cardVarietyName,jdbcType=VARCHAR}"); + } + + if (record.getSignImg() != null) { + sql.SET("sign_img = #{signImg,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getPayStatus() != null) { + sql.SET("pay_status = #{payStatus,jdbcType=INTEGER}"); + } + + if (record.getSignStatus() != null) { + sql.SET("sign_status = #{signStatus,jdbcType=INTEGER}"); + } + + if (record.getOpId() != null) { + sql.SET("op_id = #{opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.SET("op_name = #{opName,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, EtcContractOrderExample example, boolean includeExamplePhrase) { + if (example == null) { + return; + } + + String parmPhrase1; + String parmPhrase1_th; + String parmPhrase2; + String parmPhrase2_th; + String parmPhrase3; + String parmPhrase3_th; + if (includeExamplePhrase) { + parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } else { + parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } + + StringBuilder sb = new StringBuilder(); + List oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/EtcContractOrder.java b/hai-service/src/main/java/com/hai/entity/EtcContractOrder.java new file mode 100644 index 00000000..5e2fb77b --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/EtcContractOrder.java @@ -0,0 +1,369 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * etc_contract_order + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class EtcContractOrder implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 客户手机号码 + */ + private String phone; + + /** + * 合同编码 + */ + private String contractNo; + + /** + * 用户信息ID + */ + private String custId; + + /** + * 车辆id + */ + private String vehId; + + /** + * 产品id + */ + private Integer productId; + + /** + * 卡种id + */ + private Integer cardVarietyId; + + /** + * 产品名称 + */ + private String productName; + + /** + * 卡种 + */ + private String cardVarietyName; + + /** + * 签名图片 + */ + private String signImg; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 状态 0 删除 1:正常 + */ + private Integer status; + + /** + * 支付状态:1:未支付,2:已支付 + */ + private Integer payStatus; + + /** + * 签约状态:1已签约, 0:未签约 + */ + private Integer signStatus; + + /** + * 操作人 + */ + private Long opId; + + /** + * 操作人名称 + */ + private String opName; + + /** + * ext_1 + */ + private String ext1; + + /** + * ext_2 + */ + private String ext2; + + /** + * ext_3 + */ + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getContractNo() { + return contractNo; + } + + public void setContractNo(String contractNo) { + this.contractNo = contractNo; + } + + public String getCustId() { + return custId; + } + + public void setCustId(String custId) { + this.custId = custId; + } + + public String getVehId() { + return vehId; + } + + public void setVehId(String vehId) { + this.vehId = vehId; + } + + public Integer getProductId() { + return productId; + } + + public void setProductId(Integer productId) { + this.productId = productId; + } + + public Integer getCardVarietyId() { + return cardVarietyId; + } + + public void setCardVarietyId(Integer cardVarietyId) { + this.cardVarietyId = cardVarietyId; + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName; + } + + public String getCardVarietyName() { + return cardVarietyName; + } + + public void setCardVarietyName(String cardVarietyName) { + this.cardVarietyName = cardVarietyName; + } + + public String getSignImg() { + return signImg; + } + + public void setSignImg(String signImg) { + this.signImg = signImg; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getPayStatus() { + return payStatus; + } + + public void setPayStatus(Integer payStatus) { + this.payStatus = payStatus; + } + + public Integer getSignStatus() { + return signStatus; + } + + public void setSignStatus(Integer signStatus) { + this.signStatus = signStatus; + } + + public Long getOpId() { + return opId; + } + + public void setOpId(Long opId) { + this.opId = opId; + } + + public String getOpName() { + return opName; + } + + public void setOpName(String opName) { + this.opName = opName; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + EtcContractOrder other = (EtcContractOrder) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone())) + && (this.getContractNo() == null ? other.getContractNo() == null : this.getContractNo().equals(other.getContractNo())) + && (this.getCustId() == null ? other.getCustId() == null : this.getCustId().equals(other.getCustId())) + && (this.getVehId() == null ? other.getVehId() == null : this.getVehId().equals(other.getVehId())) + && (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId())) + && (this.getCardVarietyId() == null ? other.getCardVarietyId() == null : this.getCardVarietyId().equals(other.getCardVarietyId())) + && (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName())) + && (this.getCardVarietyName() == null ? other.getCardVarietyName() == null : this.getCardVarietyName().equals(other.getCardVarietyName())) + && (this.getSignImg() == null ? other.getSignImg() == null : this.getSignImg().equals(other.getSignImg())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getPayStatus() == null ? other.getPayStatus() == null : this.getPayStatus().equals(other.getPayStatus())) + && (this.getSignStatus() == null ? other.getSignStatus() == null : this.getSignStatus().equals(other.getSignStatus())) + && (this.getOpId() == null ? other.getOpId() == null : this.getOpId().equals(other.getOpId())) + && (this.getOpName() == null ? other.getOpName() == null : this.getOpName().equals(other.getOpName())) + && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) + && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) + && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode()); + result = prime * result + ((getContractNo() == null) ? 0 : getContractNo().hashCode()); + result = prime * result + ((getCustId() == null) ? 0 : getCustId().hashCode()); + result = prime * result + ((getVehId() == null) ? 0 : getVehId().hashCode()); + result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode()); + result = prime * result + ((getCardVarietyId() == null) ? 0 : getCardVarietyId().hashCode()); + result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode()); + result = prime * result + ((getCardVarietyName() == null) ? 0 : getCardVarietyName().hashCode()); + result = prime * result + ((getSignImg() == null) ? 0 : getSignImg().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getPayStatus() == null) ? 0 : getPayStatus().hashCode()); + result = prime * result + ((getSignStatus() == null) ? 0 : getSignStatus().hashCode()); + result = prime * result + ((getOpId() == null) ? 0 : getOpId().hashCode()); + result = prime * result + ((getOpName() == null) ? 0 : getOpName().hashCode()); + result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); + result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); + result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", phone=").append(phone); + sb.append(", contractNo=").append(contractNo); + sb.append(", custId=").append(custId); + sb.append(", vehId=").append(vehId); + sb.append(", productId=").append(productId); + sb.append(", cardVarietyId=").append(cardVarietyId); + sb.append(", productName=").append(productName); + sb.append(", cardVarietyName=").append(cardVarietyName); + sb.append(", signImg=").append(signImg); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", status=").append(status); + sb.append(", payStatus=").append(payStatus); + sb.append(", signStatus=").append(signStatus); + sb.append(", opId=").append(opId); + sb.append(", opName=").append(opName); + sb.append(", ext1=").append(ext1); + sb.append(", ext2=").append(ext2); + sb.append(", ext3=").append(ext3); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/EtcContractOrderExample.java b/hai-service/src/main/java/com/hai/entity/EtcContractOrderExample.java new file mode 100644 index 00000000..ebf95849 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/EtcContractOrderExample.java @@ -0,0 +1,1533 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class EtcContractOrderExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public EtcContractOrderExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andPhoneIsNull() { + addCriterion("phone is null"); + return (Criteria) this; + } + + public Criteria andPhoneIsNotNull() { + addCriterion("phone is not null"); + return (Criteria) this; + } + + public Criteria andPhoneEqualTo(String value) { + addCriterion("phone =", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotEqualTo(String value) { + addCriterion("phone <>", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneGreaterThan(String value) { + addCriterion("phone >", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneGreaterThanOrEqualTo(String value) { + addCriterion("phone >=", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneLessThan(String value) { + addCriterion("phone <", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneLessThanOrEqualTo(String value) { + addCriterion("phone <=", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneLike(String value) { + addCriterion("phone like", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotLike(String value) { + addCriterion("phone not like", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneIn(List values) { + addCriterion("phone in", values, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotIn(List values) { + addCriterion("phone not in", values, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneBetween(String value1, String value2) { + addCriterion("phone between", value1, value2, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotBetween(String value1, String value2) { + addCriterion("phone not between", value1, value2, "phone"); + return (Criteria) this; + } + + public Criteria andContractNoIsNull() { + addCriterion("contract_no is null"); + return (Criteria) this; + } + + public Criteria andContractNoIsNotNull() { + addCriterion("contract_no is not null"); + return (Criteria) this; + } + + public Criteria andContractNoEqualTo(String value) { + addCriterion("contract_no =", value, "contractNo"); + return (Criteria) this; + } + + public Criteria andContractNoNotEqualTo(String value) { + addCriterion("contract_no <>", value, "contractNo"); + return (Criteria) this; + } + + public Criteria andContractNoGreaterThan(String value) { + addCriterion("contract_no >", value, "contractNo"); + return (Criteria) this; + } + + public Criteria andContractNoGreaterThanOrEqualTo(String value) { + addCriterion("contract_no >=", value, "contractNo"); + return (Criteria) this; + } + + public Criteria andContractNoLessThan(String value) { + addCriterion("contract_no <", value, "contractNo"); + return (Criteria) this; + } + + public Criteria andContractNoLessThanOrEqualTo(String value) { + addCriterion("contract_no <=", value, "contractNo"); + return (Criteria) this; + } + + public Criteria andContractNoLike(String value) { + addCriterion("contract_no like", value, "contractNo"); + return (Criteria) this; + } + + public Criteria andContractNoNotLike(String value) { + addCriterion("contract_no not like", value, "contractNo"); + return (Criteria) this; + } + + public Criteria andContractNoIn(List values) { + addCriterion("contract_no in", values, "contractNo"); + return (Criteria) this; + } + + public Criteria andContractNoNotIn(List values) { + addCriterion("contract_no not in", values, "contractNo"); + return (Criteria) this; + } + + public Criteria andContractNoBetween(String value1, String value2) { + addCriterion("contract_no between", value1, value2, "contractNo"); + return (Criteria) this; + } + + public Criteria andContractNoNotBetween(String value1, String value2) { + addCriterion("contract_no not between", value1, value2, "contractNo"); + return (Criteria) this; + } + + public Criteria andCustIdIsNull() { + addCriterion("cust_id is null"); + return (Criteria) this; + } + + public Criteria andCustIdIsNotNull() { + addCriterion("cust_id is not null"); + return (Criteria) this; + } + + public Criteria andCustIdEqualTo(String value) { + addCriterion("cust_id =", value, "custId"); + return (Criteria) this; + } + + public Criteria andCustIdNotEqualTo(String value) { + addCriterion("cust_id <>", value, "custId"); + return (Criteria) this; + } + + public Criteria andCustIdGreaterThan(String value) { + addCriterion("cust_id >", value, "custId"); + return (Criteria) this; + } + + public Criteria andCustIdGreaterThanOrEqualTo(String value) { + addCriterion("cust_id >=", value, "custId"); + return (Criteria) this; + } + + public Criteria andCustIdLessThan(String value) { + addCriterion("cust_id <", value, "custId"); + return (Criteria) this; + } + + public Criteria andCustIdLessThanOrEqualTo(String value) { + addCriterion("cust_id <=", value, "custId"); + return (Criteria) this; + } + + public Criteria andCustIdLike(String value) { + addCriterion("cust_id like", value, "custId"); + return (Criteria) this; + } + + public Criteria andCustIdNotLike(String value) { + addCriterion("cust_id not like", value, "custId"); + return (Criteria) this; + } + + public Criteria andCustIdIn(List values) { + addCriterion("cust_id in", values, "custId"); + return (Criteria) this; + } + + public Criteria andCustIdNotIn(List values) { + addCriterion("cust_id not in", values, "custId"); + return (Criteria) this; + } + + public Criteria andCustIdBetween(String value1, String value2) { + addCriterion("cust_id between", value1, value2, "custId"); + return (Criteria) this; + } + + public Criteria andCustIdNotBetween(String value1, String value2) { + addCriterion("cust_id not between", value1, value2, "custId"); + return (Criteria) this; + } + + public Criteria andVehIdIsNull() { + addCriterion("veh_id is null"); + return (Criteria) this; + } + + public Criteria andVehIdIsNotNull() { + addCriterion("veh_id is not null"); + return (Criteria) this; + } + + public Criteria andVehIdEqualTo(String value) { + addCriterion("veh_id =", value, "vehId"); + return (Criteria) this; + } + + public Criteria andVehIdNotEqualTo(String value) { + addCriterion("veh_id <>", value, "vehId"); + return (Criteria) this; + } + + public Criteria andVehIdGreaterThan(String value) { + addCriterion("veh_id >", value, "vehId"); + return (Criteria) this; + } + + public Criteria andVehIdGreaterThanOrEqualTo(String value) { + addCriterion("veh_id >=", value, "vehId"); + return (Criteria) this; + } + + public Criteria andVehIdLessThan(String value) { + addCriterion("veh_id <", value, "vehId"); + return (Criteria) this; + } + + public Criteria andVehIdLessThanOrEqualTo(String value) { + addCriterion("veh_id <=", value, "vehId"); + return (Criteria) this; + } + + public Criteria andVehIdLike(String value) { + addCriterion("veh_id like", value, "vehId"); + return (Criteria) this; + } + + public Criteria andVehIdNotLike(String value) { + addCriterion("veh_id not like", value, "vehId"); + return (Criteria) this; + } + + public Criteria andVehIdIn(List values) { + addCriterion("veh_id in", values, "vehId"); + return (Criteria) this; + } + + public Criteria andVehIdNotIn(List values) { + addCriterion("veh_id not in", values, "vehId"); + return (Criteria) this; + } + + public Criteria andVehIdBetween(String value1, String value2) { + addCriterion("veh_id between", value1, value2, "vehId"); + return (Criteria) this; + } + + public Criteria andVehIdNotBetween(String value1, String value2) { + addCriterion("veh_id not between", value1, value2, "vehId"); + return (Criteria) this; + } + + public Criteria andProductIdIsNull() { + addCriterion("product_id is null"); + return (Criteria) this; + } + + public Criteria andProductIdIsNotNull() { + addCriterion("product_id is not null"); + return (Criteria) this; + } + + public Criteria andProductIdEqualTo(Integer value) { + addCriterion("product_id =", value, "productId"); + return (Criteria) this; + } + + public Criteria andProductIdNotEqualTo(Integer value) { + addCriterion("product_id <>", value, "productId"); + return (Criteria) this; + } + + public Criteria andProductIdGreaterThan(Integer value) { + addCriterion("product_id >", value, "productId"); + return (Criteria) this; + } + + public Criteria andProductIdGreaterThanOrEqualTo(Integer value) { + addCriterion("product_id >=", value, "productId"); + return (Criteria) this; + } + + public Criteria andProductIdLessThan(Integer value) { + addCriterion("product_id <", value, "productId"); + return (Criteria) this; + } + + public Criteria andProductIdLessThanOrEqualTo(Integer value) { + addCriterion("product_id <=", value, "productId"); + return (Criteria) this; + } + + public Criteria andProductIdIn(List values) { + addCriterion("product_id in", values, "productId"); + return (Criteria) this; + } + + public Criteria andProductIdNotIn(List values) { + addCriterion("product_id not in", values, "productId"); + return (Criteria) this; + } + + public Criteria andProductIdBetween(Integer value1, Integer value2) { + addCriterion("product_id between", value1, value2, "productId"); + return (Criteria) this; + } + + public Criteria andProductIdNotBetween(Integer value1, Integer value2) { + addCriterion("product_id not between", value1, value2, "productId"); + return (Criteria) this; + } + + public Criteria andCardVarietyIdIsNull() { + addCriterion("card_variety_id is null"); + return (Criteria) this; + } + + public Criteria andCardVarietyIdIsNotNull() { + addCriterion("card_variety_id is not null"); + return (Criteria) this; + } + + public Criteria andCardVarietyIdEqualTo(Integer value) { + addCriterion("card_variety_id =", value, "cardVarietyId"); + return (Criteria) this; + } + + public Criteria andCardVarietyIdNotEqualTo(Integer value) { + addCriterion("card_variety_id <>", value, "cardVarietyId"); + return (Criteria) this; + } + + public Criteria andCardVarietyIdGreaterThan(Integer value) { + addCriterion("card_variety_id >", value, "cardVarietyId"); + return (Criteria) this; + } + + public Criteria andCardVarietyIdGreaterThanOrEqualTo(Integer value) { + addCriterion("card_variety_id >=", value, "cardVarietyId"); + return (Criteria) this; + } + + public Criteria andCardVarietyIdLessThan(Integer value) { + addCriterion("card_variety_id <", value, "cardVarietyId"); + return (Criteria) this; + } + + public Criteria andCardVarietyIdLessThanOrEqualTo(Integer value) { + addCriterion("card_variety_id <=", value, "cardVarietyId"); + return (Criteria) this; + } + + public Criteria andCardVarietyIdIn(List values) { + addCriterion("card_variety_id in", values, "cardVarietyId"); + return (Criteria) this; + } + + public Criteria andCardVarietyIdNotIn(List values) { + addCriterion("card_variety_id not in", values, "cardVarietyId"); + return (Criteria) this; + } + + public Criteria andCardVarietyIdBetween(Integer value1, Integer value2) { + addCriterion("card_variety_id between", value1, value2, "cardVarietyId"); + return (Criteria) this; + } + + public Criteria andCardVarietyIdNotBetween(Integer value1, Integer value2) { + addCriterion("card_variety_id not between", value1, value2, "cardVarietyId"); + return (Criteria) this; + } + + public Criteria andProductNameIsNull() { + addCriterion("product_name is null"); + return (Criteria) this; + } + + public Criteria andProductNameIsNotNull() { + addCriterion("product_name is not null"); + return (Criteria) this; + } + + public Criteria andProductNameEqualTo(String value) { + addCriterion("product_name =", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameNotEqualTo(String value) { + addCriterion("product_name <>", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameGreaterThan(String value) { + addCriterion("product_name >", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameGreaterThanOrEqualTo(String value) { + addCriterion("product_name >=", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameLessThan(String value) { + addCriterion("product_name <", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameLessThanOrEqualTo(String value) { + addCriterion("product_name <=", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameLike(String value) { + addCriterion("product_name like", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameNotLike(String value) { + addCriterion("product_name not like", value, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameIn(List values) { + addCriterion("product_name in", values, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameNotIn(List values) { + addCriterion("product_name not in", values, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameBetween(String value1, String value2) { + addCriterion("product_name between", value1, value2, "productName"); + return (Criteria) this; + } + + public Criteria andProductNameNotBetween(String value1, String value2) { + addCriterion("product_name not between", value1, value2, "productName"); + return (Criteria) this; + } + + public Criteria andCardVarietyNameIsNull() { + addCriterion("card_variety_name is null"); + return (Criteria) this; + } + + public Criteria andCardVarietyNameIsNotNull() { + addCriterion("card_variety_name is not null"); + return (Criteria) this; + } + + public Criteria andCardVarietyNameEqualTo(String value) { + addCriterion("card_variety_name =", value, "cardVarietyName"); + return (Criteria) this; + } + + public Criteria andCardVarietyNameNotEqualTo(String value) { + addCriterion("card_variety_name <>", value, "cardVarietyName"); + return (Criteria) this; + } + + public Criteria andCardVarietyNameGreaterThan(String value) { + addCriterion("card_variety_name >", value, "cardVarietyName"); + return (Criteria) this; + } + + public Criteria andCardVarietyNameGreaterThanOrEqualTo(String value) { + addCriterion("card_variety_name >=", value, "cardVarietyName"); + return (Criteria) this; + } + + public Criteria andCardVarietyNameLessThan(String value) { + addCriterion("card_variety_name <", value, "cardVarietyName"); + return (Criteria) this; + } + + public Criteria andCardVarietyNameLessThanOrEqualTo(String value) { + addCriterion("card_variety_name <=", value, "cardVarietyName"); + return (Criteria) this; + } + + public Criteria andCardVarietyNameLike(String value) { + addCriterion("card_variety_name like", value, "cardVarietyName"); + return (Criteria) this; + } + + public Criteria andCardVarietyNameNotLike(String value) { + addCriterion("card_variety_name not like", value, "cardVarietyName"); + return (Criteria) this; + } + + public Criteria andCardVarietyNameIn(List values) { + addCriterion("card_variety_name in", values, "cardVarietyName"); + return (Criteria) this; + } + + public Criteria andCardVarietyNameNotIn(List values) { + addCriterion("card_variety_name not in", values, "cardVarietyName"); + return (Criteria) this; + } + + public Criteria andCardVarietyNameBetween(String value1, String value2) { + addCriterion("card_variety_name between", value1, value2, "cardVarietyName"); + return (Criteria) this; + } + + public Criteria andCardVarietyNameNotBetween(String value1, String value2) { + addCriterion("card_variety_name not between", value1, value2, "cardVarietyName"); + return (Criteria) this; + } + + public Criteria andSignImgIsNull() { + addCriterion("sign_img is null"); + return (Criteria) this; + } + + public Criteria andSignImgIsNotNull() { + addCriterion("sign_img is not null"); + return (Criteria) this; + } + + public Criteria andSignImgEqualTo(String value) { + addCriterion("sign_img =", value, "signImg"); + return (Criteria) this; + } + + public Criteria andSignImgNotEqualTo(String value) { + addCriterion("sign_img <>", value, "signImg"); + return (Criteria) this; + } + + public Criteria andSignImgGreaterThan(String value) { + addCriterion("sign_img >", value, "signImg"); + return (Criteria) this; + } + + public Criteria andSignImgGreaterThanOrEqualTo(String value) { + addCriterion("sign_img >=", value, "signImg"); + return (Criteria) this; + } + + public Criteria andSignImgLessThan(String value) { + addCriterion("sign_img <", value, "signImg"); + return (Criteria) this; + } + + public Criteria andSignImgLessThanOrEqualTo(String value) { + addCriterion("sign_img <=", value, "signImg"); + return (Criteria) this; + } + + public Criteria andSignImgLike(String value) { + addCriterion("sign_img like", value, "signImg"); + return (Criteria) this; + } + + public Criteria andSignImgNotLike(String value) { + addCriterion("sign_img not like", value, "signImg"); + return (Criteria) this; + } + + public Criteria andSignImgIn(List values) { + addCriterion("sign_img in", values, "signImg"); + return (Criteria) this; + } + + public Criteria andSignImgNotIn(List values) { + addCriterion("sign_img not in", values, "signImg"); + return (Criteria) this; + } + + public Criteria andSignImgBetween(String value1, String value2) { + addCriterion("sign_img between", value1, value2, "signImg"); + return (Criteria) this; + } + + public Criteria andSignImgNotBetween(String value1, String value2) { + addCriterion("sign_img not between", value1, value2, "signImg"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andPayStatusIsNull() { + addCriterion("pay_status is null"); + return (Criteria) this; + } + + public Criteria andPayStatusIsNotNull() { + addCriterion("pay_status is not null"); + return (Criteria) this; + } + + public Criteria andPayStatusEqualTo(Integer value) { + addCriterion("pay_status =", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusNotEqualTo(Integer value) { + addCriterion("pay_status <>", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusGreaterThan(Integer value) { + addCriterion("pay_status >", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("pay_status >=", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusLessThan(Integer value) { + addCriterion("pay_status <", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusLessThanOrEqualTo(Integer value) { + addCriterion("pay_status <=", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusIn(List values) { + addCriterion("pay_status in", values, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusNotIn(List values) { + addCriterion("pay_status not in", values, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusBetween(Integer value1, Integer value2) { + addCriterion("pay_status between", value1, value2, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusNotBetween(Integer value1, Integer value2) { + addCriterion("pay_status not between", value1, value2, "payStatus"); + return (Criteria) this; + } + + public Criteria andSignStatusIsNull() { + addCriterion("sign_status is null"); + return (Criteria) this; + } + + public Criteria andSignStatusIsNotNull() { + addCriterion("sign_status is not null"); + return (Criteria) this; + } + + public Criteria andSignStatusEqualTo(Integer value) { + addCriterion("sign_status =", value, "signStatus"); + return (Criteria) this; + } + + public Criteria andSignStatusNotEqualTo(Integer value) { + addCriterion("sign_status <>", value, "signStatus"); + return (Criteria) this; + } + + public Criteria andSignStatusGreaterThan(Integer value) { + addCriterion("sign_status >", value, "signStatus"); + return (Criteria) this; + } + + public Criteria andSignStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("sign_status >=", value, "signStatus"); + return (Criteria) this; + } + + public Criteria andSignStatusLessThan(Integer value) { + addCriterion("sign_status <", value, "signStatus"); + return (Criteria) this; + } + + public Criteria andSignStatusLessThanOrEqualTo(Integer value) { + addCriterion("sign_status <=", value, "signStatus"); + return (Criteria) this; + } + + public Criteria andSignStatusIn(List values) { + addCriterion("sign_status in", values, "signStatus"); + return (Criteria) this; + } + + public Criteria andSignStatusNotIn(List values) { + addCriterion("sign_status not in", values, "signStatus"); + return (Criteria) this; + } + + public Criteria andSignStatusBetween(Integer value1, Integer value2) { + addCriterion("sign_status between", value1, value2, "signStatus"); + return (Criteria) this; + } + + public Criteria andSignStatusNotBetween(Integer value1, Integer value2) { + addCriterion("sign_status not between", value1, value2, "signStatus"); + return (Criteria) this; + } + + public Criteria andOpIdIsNull() { + addCriterion("op_id is null"); + return (Criteria) this; + } + + public Criteria andOpIdIsNotNull() { + addCriterion("op_id is not null"); + return (Criteria) this; + } + + public Criteria andOpIdEqualTo(Long value) { + addCriterion("op_id =", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotEqualTo(Long value) { + addCriterion("op_id <>", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdGreaterThan(Long value) { + addCriterion("op_id >", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdGreaterThanOrEqualTo(Long value) { + addCriterion("op_id >=", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdLessThan(Long value) { + addCriterion("op_id <", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdLessThanOrEqualTo(Long value) { + addCriterion("op_id <=", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdIn(List values) { + addCriterion("op_id in", values, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotIn(List values) { + addCriterion("op_id not in", values, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdBetween(Long value1, Long value2) { + addCriterion("op_id between", value1, value2, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotBetween(Long value1, Long value2) { + addCriterion("op_id not between", value1, value2, "opId"); + return (Criteria) this; + } + + public Criteria andOpNameIsNull() { + addCriterion("op_name is null"); + return (Criteria) this; + } + + public Criteria andOpNameIsNotNull() { + addCriterion("op_name is not null"); + return (Criteria) this; + } + + public Criteria andOpNameEqualTo(String value) { + addCriterion("op_name =", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotEqualTo(String value) { + addCriterion("op_name <>", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameGreaterThan(String value) { + addCriterion("op_name >", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameGreaterThanOrEqualTo(String value) { + addCriterion("op_name >=", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLessThan(String value) { + addCriterion("op_name <", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLessThanOrEqualTo(String value) { + addCriterion("op_name <=", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLike(String value) { + addCriterion("op_name like", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotLike(String value) { + addCriterion("op_name not like", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameIn(List values) { + addCriterion("op_name in", values, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotIn(List values) { + addCriterion("op_name not in", values, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameBetween(String value1, String value2) { + addCriterion("op_name between", value1, value2, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotBetween(String value1, String value2) { + addCriterion("op_name not between", value1, value2, "opName"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/enum_type/EtcProductEnum.java b/hai-service/src/main/java/com/hai/enum_type/EtcProductEnum.java new file mode 100644 index 00000000..0898edfb --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/EtcProductEnum.java @@ -0,0 +1,45 @@ +package com.hai.enum_type; + +import java.util.Objects; + +public enum EtcProductEnum { + productName23(23, "e信通" ), + productName26(26, "e达通" ), + productName45(45, "阳光行S" ), + + ; + + private Integer number; + + private String name; + + + EtcProductEnum(int number, String name) { + this.number = number; + this.name = name; + + } + + public static String getNameByType(Integer type) { + for (EtcProductEnum ele : values()) { + if (Objects.equals(type,ele.getNumber())) { + return ele.getName(); + } + } + return null; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getName() { + return name; + } + + +} diff --git a/hai-service/src/main/java/com/hai/enum_type/EtcVarietyEnum.java b/hai-service/src/main/java/com/hai/enum_type/EtcVarietyEnum.java new file mode 100644 index 00000000..5686d71b --- /dev/null +++ b/hai-service/src/main/java/com/hai/enum_type/EtcVarietyEnum.java @@ -0,0 +1,43 @@ +package com.hai.enum_type; + +import java.util.Objects; + +public enum EtcVarietyEnum { + varietyName2(2, "龙通卡" ), + varietyName6(6, "九州卡" ), + ; + + private Integer number; + + private String name; + + + EtcVarietyEnum(int number, String name) { + this.number = number; + this.name = name; + + } + + public static String getNameByType(Integer type) { + for (EtcVarietyEnum ele : values()) { + if (Objects.equals(type,ele.getNumber())) { + return ele.getName(); + } + } + return null; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getName() { + return name; + } + + +} diff --git a/hai-service/src/main/java/com/hai/etc/EtcCarMsgService.java b/hai-service/src/main/java/com/hai/etc/EtcCarMsgService.java index 1bf93a17..280fc906 100644 --- a/hai-service/src/main/java/com/hai/etc/EtcCarMsgService.java +++ b/hai-service/src/main/java/com/hai/etc/EtcCarMsgService.java @@ -2,6 +2,7 @@ package com.hai.etc; import com.hai.entity.BlxCarInfo; import com.hai.entity.EtcCarMsg; +import com.hai.entity.EtcContractOrder; import com.hai.entity.EtcCustMsg; import java.util.List; @@ -26,14 +27,6 @@ public interface EtcCarMsgService { */ void insertEtcCar(EtcCarMsg etcCarMsg) throws Exception; - /** - * @Author Sum1Dream - * @Name updateCar - * @Description // 更新车辆信息 - * @Date 11:29 2023/9/5 - * @Param carInfo - * @return void - */ void updateEtcCar(EtcCarMsg etcCarMsg); /** @@ -66,7 +59,45 @@ public interface EtcCarMsgService { */ EtcCarMsg findEtcCarById(Long id); + /** + * @Author Sum1Dream + * @Name insertContractOrder + * @Description // 新增 + * @Date 10:30 2024/4/1 + * @Param etcContractOrder + * @return com.hai.entity.EtcContractOrder + */ + void insertContractOrder(EtcContractOrder etcContractOrder); + + /** + * @Author Sum1Dream + * @Name updateContractOrder + * @Description // 修改 + * @Date 10:33 2024/4/1 + * @Param etcContractOrder + * @return com.hai.entity.EtcContractOrder + */ + void updateContractOrder(EtcContractOrder etcContractOrder); + /** + * @Author Sum1Dream + * @Name getEtcContractOrderList + * @Description //TODO + * @Date 11:02 2024/4/1 + * @Param map + * @return java.util.List + */ + List getEtcContractOrderList(Map map); + + /** + * @Author Sum1Dream + * @Name findContractOrderById + * @Description // 查询 + * @Date 11:02 2024/4/1 + * @Param id + * @return com.hai.entity.EtcCarMsg + */ + EtcContractOrder findContractOrderById(Long id); } diff --git a/hai-service/src/main/java/com/hai/etc/EtcCustMsgService.java b/hai-service/src/main/java/com/hai/etc/EtcCustMsgService.java index fce4a975..1cd76f87 100644 --- a/hai-service/src/main/java/com/hai/etc/EtcCustMsgService.java +++ b/hai-service/src/main/java/com/hai/etc/EtcCustMsgService.java @@ -63,6 +63,9 @@ public interface EtcCustMsgService { * @return com.hai.entity.BlxCustInfo */ EtcCustMsg findEtcCustById(Long id); + + + } diff --git a/hai-service/src/main/java/com/hai/etc/impl/EtcCarMsgServiceImpl.java b/hai-service/src/main/java/com/hai/etc/impl/EtcCarMsgServiceImpl.java index c2607622..854c6d7f 100644 --- a/hai-service/src/main/java/com/hai/etc/impl/EtcCarMsgServiceImpl.java +++ b/hai-service/src/main/java/com/hai/etc/impl/EtcCarMsgServiceImpl.java @@ -3,11 +3,12 @@ package com.hai.etc.impl; import com.alibaba.fastjson.JSONObject; import com.hai.config.EtcService; import com.hai.dao.EtcCarMsgMapper; -import com.hai.entity.EtcCarMsg; -import com.hai.entity.EtcCarMsgExample; -import com.hai.entity.EtcCustMsg; -import com.hai.entity.EtcCustMsgExample; +import com.hai.dao.EtcContractOrderMapper; +import com.hai.entity.*; +import com.hai.enum_type.EtcProductEnum; +import com.hai.enum_type.EtcVarietyEnum; import com.hai.etc.EtcCarMsgService; +import com.hai.order.utils.OrderUtil; import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; @@ -22,32 +23,56 @@ public class EtcCarMsgServiceImpl implements EtcCarMsgService { @Resource private EtcCarMsgMapper etcCarMsgMapper; + @Resource + private EtcContractOrderMapper etcContractOrderMapper; + @Override public void insertEtcCar(EtcCarMsg etcCarMsg) throws Exception { // 提交车辆审核 JSONObject jsonObject = EtcService.submitVehInfo(etcCarMsg); if (jsonObject.getString("errCode").equals("0")) { JSONObject object = (JSONObject) jsonObject.getJSONArray("result").get(0); - etcCarMsg.setVehId(object.getString("custId")); + etcCarMsg.setVehId(object.getString("vehId")); JSONObject car = EtcService.getVehStatus(etcCarMsg); if (car.getString("errCode").equals("0")) { - etcCarMsg.setVehStatus(car.getJSONObject("result").getInteger("vehStatus")); + + etcCarMsg.setVehStatus(13); etcCarMsg.setPayStatus(car.getJSONObject("result").getInteger("payStatus")); etcCarMsg.setSignStatus(car.getJSONObject("result").getInteger("signStatus")); - etcCarMsg.setExt2(car.getJSONObject("result").getString("docException")); + + // 添加合同信息 + EtcContractOrder contractOrder = new EtcContractOrder(); + contractOrder.setContractNo(OrderUtil.generateContractNo()); + contractOrder.setCreateTime(new Date()); + contractOrder.setCustId(etcCarMsg.getCustId()); + contractOrder.setProductId(etcCarMsg.getProductId()); + contractOrder.setCardVarietyId(etcCarMsg.getCardVarietyId()); + contractOrder.setProductName(EtcProductEnum.getNameByType(etcCarMsg.getProductId())); + contractOrder.setCardVarietyName(EtcVarietyEnum.getNameByType(etcCarMsg.getCardVarietyId())); + contractOrder.setVehId(etcCarMsg.getVehId()); + contractOrder.setPayStatus(1); + contractOrder.setSignStatus(0); + + insertContractOrder(contractOrder); + } etcCarMsg.setExt3(car.getString("errMsg")); + etcCarMsg.setExt2(car.toJSONString()); } etcCarMsg.setExt1(jsonObject.getString("errMsg")); - etcCarMsgMapper.insert(etcCarMsg); + + if (etcCarMsg.getId() != null) { + etcCarMsgMapper.updateByPrimaryKey(etcCarMsg); + } else { + etcCarMsgMapper.insert(etcCarMsg); + } } @Override public void updateEtcCar(EtcCarMsg etcCarMsg) { - etcCarMsgMapper.updateByPrimaryKey(etcCarMsg); - + etcCarMsgMapper.updateByPrimaryKey(etcCarMsg); } @Override @@ -61,6 +86,9 @@ public class EtcCarMsgServiceImpl implements EtcCarMsgService { if (MapUtils.getString(map , "vehPlateNo") != null) { criteria.andVehPlateNoEqualTo(MapUtils.getString(map , "vehPlateNo")); } + if (MapUtils.getString(map , "custId") != null) { + criteria.andCustIdEqualTo(MapUtils.getString(map , "custId")); + } return etcCarMsgMapper.selectByExample(example); } @@ -68,8 +96,30 @@ public class EtcCarMsgServiceImpl implements EtcCarMsgService { @Override public EtcCarMsg findEtcCarByMap(Map map) { - EtcCustMsgExample example = new EtcCustMsgExample(); - EtcCustMsgExample.Criteria criteria = example.createCriteria(); + EtcCarMsgExample example = new EtcCarMsgExample(); + EtcCarMsgExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getLong(map , "userId") != null) { + criteria.andUserIdEqualTo(MapUtils.getLong(map , "userId")); + } + if (MapUtils.getString(map , "vehPlateNo") != null) { + criteria.andVehPlateNoEqualTo(MapUtils.getString(map , "vehPlateNo")); + } + if (MapUtils.getInteger(map , "vehPlateColor") != null) { + criteria.andVehPlateColorEqualTo(MapUtils.getInteger(map , "vehPlateColor")); + } + if (MapUtils.getString(map , "custId") != null) { + criteria.andCustIdEqualTo(MapUtils.getString(map , "custId")); + } + if (MapUtils.getString(map , "vehId") != null) { + criteria.andVehIdEqualTo(MapUtils.getString(map , "vehId")); + } + + List list = etcCarMsgMapper.selectByExample(example); + + if (!list.isEmpty()) { + return list.get(0); + } return null; } @@ -78,4 +128,37 @@ public class EtcCarMsgServiceImpl implements EtcCarMsgService { public EtcCarMsg findEtcCarById(Long id) { return etcCarMsgMapper.selectByPrimaryKey(id); } + + @Override + public void insertContractOrder(EtcContractOrder etcContractOrder) { + etcContractOrderMapper.insert(etcContractOrder); + } + + @Override + public void updateContractOrder(EtcContractOrder etcContractOrder) { + etcContractOrderMapper.updateByPrimaryKey(etcContractOrder); + } + + @Override + public List getEtcContractOrderList(Map map) { + EtcContractOrderExample example = new EtcContractOrderExample(); + EtcContractOrderExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getString(map , "phone") != null) { + criteria.andPhoneEqualTo(MapUtils.getString(map , "phone")); + } + if (MapUtils.getInteger(map , "signStatus") != null) { + criteria.andSignStatusEqualTo(MapUtils.getInteger(map , "signStatus")); + } + if (MapUtils.getString(map , "custId") != null) { + criteria.andCustIdEqualTo(MapUtils.getString(map , "custId")); + } + + return etcContractOrderMapper.selectByExample(example); + } + + @Override + public EtcContractOrder findContractOrderById(Long id) { + return etcContractOrderMapper.selectByPrimaryKey(id); + } } diff --git a/hai-service/src/main/java/com/hai/etc/impl/EtcCustMsgServiceImpl.java b/hai-service/src/main/java/com/hai/etc/impl/EtcCustMsgServiceImpl.java index 2a7a663c..7cd98e88 100644 --- a/hai-service/src/main/java/com/hai/etc/impl/EtcCustMsgServiceImpl.java +++ b/hai-service/src/main/java/com/hai/etc/impl/EtcCustMsgServiceImpl.java @@ -1,5 +1,6 @@ package com.hai.etc.impl; +import com.alibaba.druid.sql.visitor.functions.If; import com.alibaba.fastjson.JSONObject; import com.hai.config.EtcService; import com.hai.dao.EtcCustMsgMapper; @@ -62,6 +63,32 @@ public class EtcCustMsgServiceImpl implements EtcCustMsgService { @Override public EtcCustMsg findEtcCustByMap(Map map) { + + EtcCustMsgExample example = new EtcCustMsgExample(); + EtcCustMsgExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getLong(map , "userId") != null) { + criteria.andUserIdEqualTo(MapUtils.getLong(map , "userId")); + } + if (MapUtils.getString(map , "custName") != null) { + criteria.andCustNameEqualTo(MapUtils.getString(map , "custName")); + } + if (MapUtils.getString(map , "phone") != null) { + criteria.andPhoneEqualTo(MapUtils.getString(map , "phone")); + } + if (MapUtils.getInteger(map , "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(map , "status")); + } + if (MapUtils.getString(map , "custIdNo") != null) { + criteria.andCustIdNoEqualTo(MapUtils.getString(map , "custIdNo")); + } + + List list = etcCustMsgMapper.selectByExample(example); + + if (list.size() > 0) { + return list.get(0); + } + return null; } diff --git a/hai-service/src/main/java/com/hai/ocr/AliYunOcrService.java b/hai-service/src/main/java/com/hai/ocr/AliYunOcrService.java index 61850acc..872c71ae 100644 --- a/hai-service/src/main/java/com/hai/ocr/AliYunOcrService.java +++ b/hai-service/src/main/java/com/hai/ocr/AliYunOcrService.java @@ -94,4 +94,21 @@ public class AliYunOcrService { } return null; } + + /** + * 行驶证识别 + * @param url 访问地址 + * @return + */ + public static RecognizeVehicleLicenseResponseBody recognizeVehicleLicense(String url) { + try { + Client client = createClient(); + RecognizeVehicleLicenseRequest request = new RecognizeVehicleLicenseRequest().setUrl(url); + RecognizeVehicleLicenseResponse response = client.recognizeVehicleLicense(request); + return response.getBody(); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } } diff --git a/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java b/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java index 4a178d39..04de6481 100644 --- a/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java +++ b/hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java @@ -140,5 +140,6 @@ public interface OrderCreateHandleService { HighChildOrder petroCoupon(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception; HighChildOrder cpPetroCoupon(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception; + HighChildOrder etcUser(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception; } diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java index 394155b8..9b1e5819 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java @@ -1326,4 +1326,30 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { return childOrder; } + + @Override + public HighChildOrder etcUser(HighOrder order, CreateOrderChildModel createOrderChildModel) throws Exception { + HighChildOrder childOrder = new HighChildOrder(); + childOrder.setOrderNo(order.getOrderNo()); + childOrder.setMemId(order.getMemId()); + childOrder.setMemName(order.getMemName()); + childOrder.setMemPhone(order.getMemPhone()); + childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo()); + childOrder.setGoodsType(OrderChildGoodsType.TYPE20.getNumber()); + childOrder.setGoodsId(createOrderChildModel.getGoodsId()); + childOrder.setGoodsName("ETC用户办理"); + childOrder.setGoodsSpecName("ETC用户办理"); + childOrder.setGoodsPrice(createOrderChildModel.getGoodsPrice()); + childOrder.setGoodsActualPrice(childOrder.getGoodsPrice()); + childOrder.setSaleCount(createOrderChildModel.getSaleCount()); + childOrder.setGiveawayType(false); + childOrder.setChildOrderStatus(OrderChildStatus.STATUS1.getNumber()); + childOrder.setTotalPrice(childOrder.getGoodsPrice()); + childOrder.setTotalActualPrice(childOrder.getGoodsPrice()); + childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice())); + childOrder.setPraiseStatus(0); + childOrder.setCreateTime(new Date()); + + return childOrder; + } } diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java index a84d5d21..55f60d67 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java @@ -11,6 +11,8 @@ import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.enum_type.*; +import com.hai.etc.EtcCarMsgService; +import com.hai.etc.EtcCustMsgService; import com.hai.goods.service.GoodsOrderExtService; import com.hai.goods.service.GoodsPresentService; import com.hai.group.GroupCodeService; @@ -149,6 +151,14 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { @Resource private HighGasOrderPushMapper highGasOrderPushMapper; + @Resource + private HighDiscountPackageService highDiscountPackageService; + + @Resource + private EtcCarMsgService etcCarMsgService; + + @Resource + private SecConfigService secConfigService; @Override @@ -282,6 +292,8 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { petroCoupon(order , childOrder); } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE19.getNumber())) { cpPetroCoupon(order , childOrder); + } else if (childOrder.getGoodsType().equals(OrderChildGoodsType.TYPE20.getNumber())) { + etcUser(order); } } } @@ -785,4 +797,32 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { } + private void etcUser(HighOrder order) throws Exception { + + EtcContractOrder contractOrder = etcCarMsgService.findContractOrderById(order.getHighChildOrderList().get(0).getGoodsId()); + + contractOrder.setPayStatus(2); + contractOrder.setUpdateTime(new Date()); + + etcCarMsgService.updateContractOrder(contractOrder); + + Map mapCar = new HashMap<>(); + mapCar.put("vehId" , contractOrder.getVehId()); + mapCar.put("custId" , contractOrder.getCustId()); + + EtcCarMsg carMsg = etcCarMsgService.findEtcCarByMap(mapCar); + + carMsg.setUpdateTime(new Date()); + carMsg.setPayStatus(2); + etcCarMsgService.updateEtcCar(carMsg); + + // 查询赠送优惠券 + SecConfig secConfig = secConfigService.findByCodeType("GIVE_DISCOUNT_PACKAGE"); + + // 赠送优惠券 + highDiscountPackageService.giveAway(Long.parseLong(secConfig.getCodeValue()) , order.getMemPhone() , 2 , order.getMemId().toString()); + + + } + } diff --git a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java index e208fc94..4e1ead96 100644 --- a/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java @@ -389,6 +389,12 @@ public class OrderServiceImpl implements OrderService { order.setProductType(OrderProductType.PRODUCT_TYPE19.getNumber()); order.setSecUserId(childOrder.getId()); order.setTitle("重庆中石油卡券"); + } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE20.getNumber())) { + HighChildOrder childOrder = orderCreateHandleService.etcUser(order , child); + childOrderList.add(childOrder); + order.setProductType(OrderProductType.PRODUCT_TYPE20.getNumber()); + order.setSecUserId(childOrder.getId()); + order.setTitle("ETC用户办理"); } else { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知业务类型"); diff --git a/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java b/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java index 5d589d35..b0bd4bea 100644 --- a/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java +++ b/hai-service/src/main/java/com/hai/order/type/OrderChildGoodsType.java @@ -27,6 +27,7 @@ public enum OrderChildGoodsType { TYPE17(17, "团购套餐"), TYPE18(18, "中石油卡券"), TYPE19(19, "重庆中石油卡券"), + TYPE20(20, "ETC用户办理"), ; private Integer number; diff --git a/hai-service/src/main/java/com/hai/order/type/OrderProductType.java b/hai-service/src/main/java/com/hai/order/type/OrderProductType.java index ef984ed6..91d19bf3 100644 --- a/hai-service/src/main/java/com/hai/order/type/OrderProductType.java +++ b/hai-service/src/main/java/com/hai/order/type/OrderProductType.java @@ -30,6 +30,7 @@ public enum OrderProductType { PRODUCT_TYPE17(17, "团购套餐" , "orderLogo/coupon.png", ""), PRODUCT_TYPE18(18, "中石油卡券" , "orderLogo/coupon.png", "PETRO_COUPON"), PRODUCT_TYPE19(19, "重庆中石油卡券" , "orderLogo/coupon.png", "CQ_PETRO_COUPON"), + PRODUCT_TYPE20(20, "ETC用户办理" , "orderLogo/coupon.png", "ETC_USER"), PRODUCT_TYPE101(101, "惠支付" , "orderLogo/pay.png", "PAY"), PRODUCT_TYPE102(102, "门店活动" , "orderLogo/store_activity.png", "STORE_ACTIVITY"), ; diff --git a/hai-service/src/main/java/com/hai/order/type/PlatformType.java b/hai-service/src/main/java/com/hai/order/type/PlatformType.java index db8b7cd2..eec071fc 100644 --- a/hai-service/src/main/java/com/hai/order/type/PlatformType.java +++ b/hai-service/src/main/java/com/hai/order/type/PlatformType.java @@ -5,6 +5,7 @@ import java.util.Objects; public enum PlatformType { TYPE1(1, "嗨森逛"), TYPE2(2, "黔印象"), + TYPE3(3, "智行九州"), ; private Integer number; diff --git a/hai-service/src/main/java/com/hai/order/utils/OrderUtil.java b/hai-service/src/main/java/com/hai/order/utils/OrderUtil.java index b8b3bce9..3342b318 100644 --- a/hai-service/src/main/java/com/hai/order/utils/OrderUtil.java +++ b/hai-service/src/main/java/com/hai/order/utils/OrderUtil.java @@ -62,6 +62,22 @@ public class OrderUtil { } } + /** + * 生成合同订单订单号 + * @return + * @throws Exception + */ + public static String generateContractNo(){ + try { + // 5位随机数 + 1位线程生成数 + String randomNum = (new Random().nextInt(8999) + 1000) + IDGenerator.nextId(1); + // 生成订单号 + return DateUtil.date2String(new Date(),"yyyyMMdd") + randomNum; + } catch (Exception e) { + return null; + } + } + /** * 生成子订单号 * @return diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java index d3329a68..cef7c97e 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGasServiceImpl.java @@ -57,6 +57,9 @@ public class HighGasServiceImpl implements HighGasService { @Resource private CommonService commonService; + @Resource + private HighMerchantStoreService merchantStoreService; + @Override public void getJiaHaoYouAllStation() throws Exception { HighMerchantModel merchant = highMerchantService.getDetailByKey("HF0801103821"); @@ -818,6 +821,21 @@ public class HighGasServiceImpl implements HighGasService { gasOilPrice.setStatus(0); highGasOilPriceService.editGasOilPrice(gasOilPrice); } + + Map param = new HashMap<>(); + param.put("sourceType", 2); + param.put("regionId", "500000"); + param.put("storeName", "壳牌"); + param.put("status", 1); + List merchantStoreList = merchantStoreService.getMerchantStoreList(param); + + for (HighMerchantStore merchantStore : merchantStoreList) { + merchantStore.setUpdateTime(new Date()); + merchantStore.setStatus(0); + merchantStoreService.updateMerchantStoreDetail(merchantStore); + } + + } diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index a686eb0b..2b47f294 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -122,8 +122,8 @@ unionRsaKey=891f6775fba7f12cc23df7c75e02b39b891f6775fba7f12c #url fileUrl=/home/project/hsg/filesystem/ -#fileUrl=/Volumes/work/filesystem/ - +#fileUrl=D:/work/img/ +# #wx wxAppId=wx8d49e2f83025229d wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df @@ -131,6 +131,9 @@ wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df wxQyxAppId=wx5e0cac96ea91c01f wxQyxAppSecret=9889fff2283e249199a9f6afb32f6136 +wxZxjzAppId=wxc872cb59b56681a7 +wxZxjzAppSecret=9ef7ef25aea61b06e47f349032a74f6a + wxH5AppId=wxa075e8509802f826 wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5 diff --git a/hai-service/src/main/resources/prod-9401/commonConfig.properties b/hai-service/src/main/resources/prod-9401/commonConfig.properties index 4dbf42b5..1e110b88 100644 --- a/hai-service/src/main/resources/prod-9401/commonConfig.properties +++ b/hai-service/src/main/resources/prod-9401/commonConfig.properties @@ -148,4 +148,9 @@ ScPetroAesKey = AptFsUgpgAij3evH7rm4ubTKu5viSx9U GzPetroUrl = http://140.143.82.223:1588/gz GzPetroAppid = F0bdoJRwt GzPetroAppKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98 -GzPetroAesKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98 \ No newline at end of file +GzPetroAesKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98 + +#NUODE +NdPostUrl = https://nuode.qianbao18.com/nuode-module-supplier/ +NdOrgCode = 414a3d16-30f9-40d1-a2cd-b06066b38708 +NdKey= 4a6a6836-42f5-4ead-8629-ca1265bfb98c \ No newline at end of file diff --git a/hai-service/src/main/resources/prod/commonConfig.properties b/hai-service/src/main/resources/prod/commonConfig.properties index a405626a..a8e76d18 100644 --- a/hai-service/src/main/resources/prod/commonConfig.properties +++ b/hai-service/src/main/resources/prod/commonConfig.properties @@ -154,3 +154,8 @@ GzPetroUrl = http://140.143.82.223:1588/gz GzPetroAppid = F0bdoJRwt GzPetroAppKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98 GzPetroAesKey = pIyhCbA61wwyyU371QUSnBKqbWvO8Q98 + +#NUODE +NdPostUrl = https://nuode.qianbao18.com/nuode-module-supplier/ +NdOrgCode = 414a3d16-30f9-40d1-a2cd-b06066b38708 +NdKey= 4a6a6836-42f5-4ead-8629-ca1265bfb98c \ No newline at end of file