diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java new file mode 100644 index 00000000..1159a6d9 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGasController.java @@ -0,0 +1,235 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageInfo; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.utils.CoordCommonUtil; +import com.hai.common.utils.PageUtil; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.config.TuanYouConfig; +import com.hai.entity.HighOrder; +import com.hai.model.ResponseData; +import com.hai.service.HighGasOilPriceService; +import com.hai.service.HighOrderService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Controller +@RequestMapping(value = "/highGas") +@Api(value = "团油业务接口") +public class HighGasController { + + private static Logger log = LoggerFactory.getLogger(HighGasController.class); + + @Resource + private HighGasOilPriceService highGasOilPriceService; + + @Resource + private HighOrderService highOrderService; + + @RequestMapping(value="/getGasStoreList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询加油站列表") + public ResponseData getGasStoreList(@RequestParam(name = "storeName", required = false) String storeName, + @RequestParam(name = "distance", required = true) Integer distanceRecent, + @RequestParam(name = "regionId", required = true) Long regionId, + @RequestParam(name = "oilNoName", required = true) String oilNoName, + @RequestParam(name = "longitude", required = true) String longitude, + @RequestParam(name = "latitude", required = true) String latitude, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize + ) { + try { + if (StringUtils.isBlank(storeName)) { + storeName = null; + } + List> storeList = highGasOilPriceService.getStoreListByOilNo(storeName,regionId, oilNoName); + for (Map store : storeList) { + double distance = CoordCommonUtil.getDistance(Double.valueOf(store.get("latitude").toString()), Double.valueOf(store.get("longitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude)); + store.put("distance", Math.round(distance/100d)/10d); + } + List> distance = storeList.stream().sorted(Comparator.comparingDouble(entry -> Double.valueOf(entry.get("distance").toString()))).collect(Collectors.toList()); + Iterator> iterator = distance.iterator(); + while (iterator.hasNext()) { + if ((int)Math.round(Double.valueOf(iterator.next().get("distance").toString())) > distanceRecent.intValue()) { + iterator.remove(); + } + } + return ResponseMsgUtil.success(PageUtil.initPageInfoObj(pageNum,distance.size(),pageSize,new PageInfo<>(distance))); + + } catch (Exception e) { + log.error("HighGasController -> getGasDetailByStoreKey() 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, + @RequestParam(name = "longitude", required = true) String longitude, + @RequestParam(name = "latitude", required = true) String latitude) { + try { + + JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(storeKey); + if (jsonObject != null && jsonObject.getString("code").equals("200")) { + JSONObject result = jsonObject.getJSONObject("result"); + double distance = CoordCommonUtil.getDistance(Double.valueOf(result.get("gasAddressLatitude").toString()), Double.valueOf(result.get("gasAddressLongitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude)); + result.put("distance", Math.round(distance/100d)/10d); + return ResponseMsgUtil.success(jsonObject.get("result")); + } + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到加油站信息"); + + } catch (Exception e) { + log.error("HighGasController -> getGasDetailByStoreKey() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getGasPriceDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据门店key和油号 查询油价") + public ResponseData getGasPriceDetail(@RequestParam(name = "storeKey", required = true) String storeKey, + @RequestParam(name = "oilNo", required = true) String oilNo) { + try { + + JSONObject jsonObject = TuanYouConfig.queryCompanyPriceDetail(storeKey,oilNo); + if (jsonObject != null && jsonObject.getString("code").equals("200")) { + if(jsonObject.getJSONArray("result").size() == 0) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到价格信息"); + } + return ResponseMsgUtil.success(jsonObject.get("result")); + } + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到价格信息"); + + } catch (Exception e) { + log.error("HighGasController -> getGasPriceDetail() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/refuelingOrderRefund",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "订单退款") + public ResponseData refuelingOrderRefund(@RequestBody JSONObject body) { + try { + + if(body == null && body.getLong("orderId") == null && StringUtils.isBlank(body.getString("refundContent"))) { + log.error("HighOrderController --> refuelingOrderRefund() error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + HighOrder order = highOrderService.getOrderById(body.getLong("orderId")); + if(order == null) { + log.error("HighOrderController --> refuelingOrderRefund() error!", "未找到订单信息"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单信息"); + } + // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款 + if (order.getOrderStatus() != 2) { + log.error("HighOrderController --> refuelingOrderRefund() error!", "提交退款审核失败,订单不处于已支付"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "提交退款审核失败,订单不处于已支付"); + } + + JSONObject object = TuanYouConfig.refuelingOrderRefund(order.getMemPhone(), order.getOrderNo(), body.getString("refundContent")); + if (object == null || !object.getString("code").equals("200")) { + log.error("HighOrderController --> refuelingOrderRefund() error!", "提交退款审核失败," + object.getString("message")); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "提交退款审核失败," + object.getString("message")); + } + + order.setOrderStatus(6); + highOrderService.updateOrderDetail(order); + return ResponseMsgUtil.success("退款审核中"); + + } catch (Exception e) { + log.error("HighGasController -> refuelingOrderRefund() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + /* @RequestMapping(value="/refuelingOrderPush",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "推送订单") + public ResponseData refuelingOrderPush() { + try { + + Map map = new HashMap<>(); + map.put("gasId", "CS000116576"); + map.put("oilNo", "92"); + map.put("gunNo", 1); + BigDecimal priceGun = new BigDecimal("6"); + BigDecimal priceVip = new BigDecimal("4.9"); + //BigDecimal priceGun = new BigDecimal("5.58"); + //BigDecimal priceVip = new BigDecimal("5.58"); + map.put("priceGun", priceGun); // 枪单价 + map.put("priceVip", priceVip); // 优惠价 + map.put("driverPhone", "17726395120"); + map.put("thirdSerialNo", new Date().getTime()); + + + BigDecimal refuelingAmount = new BigDecimal("1200").divide(priceGun,2,BigDecimal.ROUND_HALF_UP).multiply(priceVip).setScale(2,BigDecimal.ROUND_HALF_UP); + map.put("refuelingAmount", refuelingAmount); + JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(map); + if (orderPushObject == null || !orderPushObject.getString("code").equals("200")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "提交订单,出现了未知错误"); + } + JSONObject result = orderPushObject.getJSONObject("result"); + return ResponseMsgUtil.success(result.getString("orderNo")); + //return ResponseMsgUtil.success(map); + + + } catch (Exception e) { + log.error("HighGasController -> refuelingOrderPush() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryThirdOrderDretail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询订单信息") + public ResponseData queryThirdOrderDretail() { + try { + + + return ResponseMsgUtil.success(TuanYouConfig.queryThirdOrderDretail("1624611159129")); + //return ResponseMsgUtil.success(map); + + + } catch (Exception e) { + log.error("HighGasController -> queryThirdOrderDretail() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/test",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "测试") + public ResponseData test() { + try { + + String data = "{\"data\":\"ui2KbK5jpLtw7YaA52uSt1TzDpaE5OjeW5O6xg+saM4nN4aVnpoT1aTgJwQt/DuNSbs7LrX6q1B0cpW5T531ltYl1ERxyKXqZyMKBNWzDFuB5QSww22VGfypchGNm+oW\",\"timestamp\":1624611912047,\"companyCode\":\"208241666939552\"}"; + + JSONObject jsonObject = JSONObject.parseObject(data, JSONObject.class); + //return ResponseMsgUtil.success(AESEncodeUtil.aesDecryptByBytes(AESEncodeUtil.base64Decode(jsonObject.getString("data")), SysConst.getSysConfig().getTuanYouAppSecret())); + return ResponseMsgUtil.success(CommonSysConst.getSysConfig().getTuanYouUrl()); + + } catch (Exception e) { + log.error("HighGasController -> queryThirdOrderDretail() error!",e); + return ResponseMsgUtil.exception(e); + } + }*/ + +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java index 72438da5..904a0054 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java @@ -242,4 +242,56 @@ public class HighOrderController { return ResponseMsgUtil.exception(e); } } + + + @RequestMapping(value = "/getGasOrderList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询加油订单列表") + public ResponseData getGasOrderList(@RequestParam(name = "companyId", required = false) Long companyId, + @RequestParam(name = "merchantId", required = false) Long merchantId, + @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "paySerialNo", required = false) String paySerialNo, + @RequestParam(name = "payModel", required = false) Integer payModel, + @RequestParam(name = "payType", required = false) Integer payType, + @RequestParam(name = "orderStatus", required = false) Integer orderStatus, + @RequestParam(name = "payTimeS", required = false) Long payTimeS, + @RequestParam(name = "payTimeE", required = false) Long payTimeE, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, + HttpServletRequest request) { + try { + + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + + Map map = new HashMap<>(); + // 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商 + if(userInfoModel.getSecUser().getObjectType() == 0) { + map.put("companyId", companyId); + + } else if (userInfoModel.getSecUser().getObjectType() == 1) { + map.put("companyId", userInfoModel.getBsCompany().getId()); + map.put("merchantId", merchantId); + + } else if (userInfoModel.getSecUser().getObjectType() == 2) { + map.put("merchantId", userInfoModel.getMerchant().getId()); + } + + map.put("orderNo", orderNo); + map.put("paySerialNo", paySerialNo); + map.put("payModel", payModel); + map.put("payType", payType); + map.put("orderStatus", orderStatus); + map.put("payTimeS", payTimeS); + map.put("payTimeE", payTimeE); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highOrderService.getGasOrderModelList(map))); + + } catch (Exception e) { + log.error("HighOrderController --> getGasOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } } + diff --git a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java index 9092780b..57235c73 100644 --- a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -111,6 +111,9 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/test/*") .excludePathPatterns("/highGas/*") .excludePathPatterns("/wechat/*") + .excludePathPatterns("/tuanyou/*") + .excludePathPatterns("/common/*") + .excludePathPatterns("/tPig/*") ; } diff --git a/hai-cweb/src/main/java/com/cweb/config/SysConfig.java b/hai-cweb/src/main/java/com/cweb/config/SysConfig.java index 18b5dd92..85afdd30 100644 --- a/hai-cweb/src/main/java/com/cweb/config/SysConfig.java +++ b/hai-cweb/src/main/java/com/cweb/config/SysConfig.java @@ -17,10 +17,6 @@ public class SysConfig { private String wxH5AppId; private String wxH5AppSecret; - private String tuanYouUrl; - private String tuanYouAppKey; - private String tuanYouAppSecret; - private String wxApiKey; private String wxMchId; private String wxMchAppId; @@ -30,14 +26,6 @@ public class SysConfig { private String couponCodePath; private String notifyUrl; - public String getTuanYouUrl() { - return tuanYouUrl; - } - - public void setTuanYouUrl(String tuanYouUrl) { - this.tuanYouUrl = tuanYouUrl; - } - public String getFileUrl() { return fileUrl; } @@ -62,52 +50,36 @@ public class SysConfig { this.wxAppSecret = wxAppSecret; } - public String getWxApiKey() { - return wxApiKey; - } - - public void setWxApiKey(String wxApiKey) { - this.wxApiKey = wxApiKey; - } - - public String getWxMchId() { - return wxMchId; - } - - public void setWxMchId(String wxMchId) { - this.wxMchId = wxMchId; - } - - public String getWxUnifiedOrderUrl() { - return wxUnifiedOrderUrl; + public String getWxH5AppId() { + return wxH5AppId; } - public void setWxUnifiedOrderUrl(String wxUnifiedOrderUrl) { - this.wxUnifiedOrderUrl = wxUnifiedOrderUrl; + public void setWxH5AppId(String wxH5AppId) { + this.wxH5AppId = wxH5AppId; } - public String getNotifyUrl() { - return notifyUrl; + public String getWxH5AppSecret() { + return wxH5AppSecret; } - public void setNotifyUrl(String notifyUrl) { - this.notifyUrl = notifyUrl; + public void setWxH5AppSecret(String wxH5AppSecret) { + this.wxH5AppSecret = wxH5AppSecret; } - public String getCouponCodePath() { - return couponCodePath; + public String getWxApiKey() { + return wxApiKey; } - public void setCouponCodePath(String couponCodePath) { - this.couponCodePath = couponCodePath; + public void setWxApiKey(String wxApiKey) { + this.wxApiKey = wxApiKey; } - public String getWxSubMchId() { - return wxSubMchId; + public String getWxMchId() { + return wxMchId; } - public void setWxSubMchId(String wxSubMchId) { - this.wxSubMchId = wxSubMchId; + public void setWxMchId(String wxMchId) { + this.wxMchId = wxMchId; } public String getWxMchAppId() { @@ -126,35 +98,35 @@ public class SysConfig { this.wxSubAppId = wxSubAppId; } - public String getWxH5AppId() { - return wxH5AppId; + public String getWxSubMchId() { + return wxSubMchId; } - public void setWxH5AppId(String wxH5AppId) { - this.wxH5AppId = wxH5AppId; + public void setWxSubMchId(String wxSubMchId) { + this.wxSubMchId = wxSubMchId; } - public String getWxH5AppSecret() { - return wxH5AppSecret; + public String getWxUnifiedOrderUrl() { + return wxUnifiedOrderUrl; } - public void setWxH5AppSecret(String wxH5AppSecret) { - this.wxH5AppSecret = wxH5AppSecret; + public void setWxUnifiedOrderUrl(String wxUnifiedOrderUrl) { + this.wxUnifiedOrderUrl = wxUnifiedOrderUrl; } - public String getTuanYouAppKey() { - return tuanYouAppKey; + public String getCouponCodePath() { + return couponCodePath; } - public void setTuanYouAppKey(String tuanYouAppKey) { - this.tuanYouAppKey = tuanYouAppKey; + public void setCouponCodePath(String couponCodePath) { + this.couponCodePath = couponCodePath; } - public String getTuanYouAppSecret() { - return tuanYouAppSecret; + public String getNotifyUrl() { + return notifyUrl; } - public void setTuanYouAppSecret(String tuanYouAppSecret) { - this.tuanYouAppSecret = tuanYouAppSecret; + public void setNotifyUrl(String notifyUrl) { + this.notifyUrl = notifyUrl; } } diff --git a/hai-cweb/src/main/java/com/cweb/controller/CommonController.java b/hai-cweb/src/main/java/com/cweb/controller/CommonController.java new file mode 100644 index 00000000..111b3d5c --- /dev/null +++ b/hai-cweb/src/main/java/com/cweb/controller/CommonController.java @@ -0,0 +1,222 @@ +package com.cweb.controller; + +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.BsCompany; +import com.hai.entity.SecConfig; +import com.hai.model.ResponseData; +import com.hai.service.BsCompanyService; +import com.hai.service.CommonService; +import com.hai.service.SecConfigService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +@RestController +@RequestMapping(value="/common") +@Api(value="共用接口") +public class CommonController { + + Logger log = LoggerFactory.getLogger(CommonController.class); + + @Resource + private CommonService commonService; + + @Resource + private SecConfigService secConfigService; + + @Resource + private BsCompanyService bsCompanyService; + + + @RequestMapping(value="/getDredgeProvince",method= RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询已开通的省份") + public ResponseData getDredgeProvince(){ + try { + List list = bsCompanyService.getCompany(new HashMap<>()); + List> mapList = new ArrayList<>(); + Map map; + if (list.size() > 0) { + for (BsCompany company : list) { + map = new HashMap<>(); + if (StringUtils.isNotBlank(company.getRegionId())) { + map.put("regionId", company.getRegionId()); + map.put("regionName", commonService.getRegionName(Long.parseLong(company.getRegionId()))); + map.put("companyId", company.getId()); + mapList.add(map); + } + } + } + return ResponseMsgUtil.success(mapList); + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getRegionsByParentId",method= RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "分级查询区域信息") + public ResponseData getRegionsByParentId(@RequestParam(name = "regionId", required = false) Long regionId){ + try { + if (regionId == null){ + return ResponseMsgUtil.success(commonService.getCities()); + } + return ResponseMsgUtil.success(commonService.getRegionsByParentId(regionId)); + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getParentInfosByRegionId",method= RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询父级区域信息") + public ResponseData getParentInfosByRegionId(@RequestParam(name = "regionId", required = true) Long regionId) { + try { + return ResponseMsgUtil.success(commonService.getParentInfoByRegionId(regionId)); + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getRegionsById",method= RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询区域详细信息") + public ResponseData getRegionsById(@RequestParam(name = "regionId", required = true) Long regionId){ + try { + return ResponseMsgUtil.success(commonService.getRegionsById(regionId)); + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value="/getDictionaries",method= RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询数据字典") + public ResponseData getDictionaries(){ + try { + return ResponseMsgUtil.success(commonService.getDictionaries()); + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + + + + @RequestMapping(value="/getDictionaryByCodeType",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据 码值类型 查询数据字典") + public ResponseData getDictionaryByCodeType(@RequestParam(name = "codeType", required = true) String codeType) { + try { + + return ResponseMsgUtil.success(commonService.getDictionarys(codeType)); + + } catch (Exception e) { + log.error("CommonController --> getDictionaryByCodeType() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/mappingSysNameOl",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据 码值类型 查询数据字典") + public ResponseData mappingSysNameOl(@RequestParam(name = "codeType", required = true) String codeType) { + try { + + return ResponseMsgUtil.success(commonService.mappingSysNameOl(codeType)); + + } catch (Exception e) { + log.error("CommonController --> getDictionaryByCodeType() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getDictionaryByCodeTypeOl",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据 码值类型 查询数据字典") + public ResponseData getDictionaryByCodeTypeOl(@RequestParam(name = "codeType", required = true) String codeType) { + try { + + return ResponseMsgUtil.success(secConfigService.findByCodeType(codeType)); + + } catch (Exception e) { + log.error("CommonController --> getDictionaryByCodeType() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/updateDictionary",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据 码值类型 查询数据字典") + public ResponseData updateDictionary( + @RequestParam(name = "codeType", required = true) String codeType, + @RequestParam(name = "codeValue", required = true) String codeValue + ) { + try { + + SecConfig secConfig = secConfigService.findByCodeType(codeType); + secConfig.setCodeValue(codeValue); + secConfigService.updateSecConfig(secConfig); + + return ResponseMsgUtil.success("修改成功"); + } catch (Exception e) { + log.error("CommonController --> getDictionaryByCodeType() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value="/getDictionaryByCodeTypeAndExt",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据 码值类型 查询数据字典") + public ResponseData getDictionaryByCodeTypeAndExt(@RequestParam(name = "codeType", required = true) String codeType, String ext1) { + try { + + return ResponseMsgUtil.success(commonService.getDictionarysAndExt(codeType,ext1)); + + } catch (Exception e) { + log.error("CommonController --> getDictionaryByCodeType() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getIdAndNameByCodeType",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据 码值类型 查询数据字典的id和name") + public ResponseData getIdAndNameByCodeType(@RequestParam(name = "codeType", required = true) String codeType) { + try { + + return ResponseMsgUtil.success(commonService.getIdAndName(codeType)); + + } catch (Exception e) { + log.error("CommonController --> getIdAndNameByCodeType() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getDictionaryByCodeTypeAndValue",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据码值类型及value查询数据字典") + public ResponseData getDictionaryByCodeType(@RequestParam(name = "codeType", required = true) String codeType, + @RequestParam(name = "codeValue", required = true) String codeValue) { + try { + + return ResponseMsgUtil.success(commonService.mappingSysCode(codeType,codeValue)); + + } catch (Exception e) { + log.error("CommonController --> getDictionaryByCodeTypeAndValue() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java index 10eeba06..2e854ac6 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGasController.java @@ -1,7 +1,6 @@ package com.cweb.controller; import com.alibaba.fastjson.JSONObject; -import com.cweb.config.TuanYouConfig; import com.github.pagehelper.PageInfo; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; @@ -9,20 +8,24 @@ import com.hai.common.exception.SysCode; import com.hai.common.utils.CoordCommonUtil; import com.hai.common.utils.PageUtil; import com.hai.common.utils.ResponseMsgUtil; +import com.hai.config.CommonSysConst; +import com.hai.config.TuanYouConfig; +import com.hai.dao.HighGasOrderPushMapper; +import com.hai.entity.HighGasOrderPush; +import com.hai.entity.HighOrder; import com.hai.model.ResponseData; import com.hai.service.HighGasOilPriceService; +import com.hai.service.HighOrderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -35,6 +38,13 @@ public class HighGasController { @Resource private HighGasOilPriceService highGasOilPriceService; + + @Resource + private HighOrderService highOrderService; + + @Resource + private HighGasOrderPushMapper highGasOrderPushMapper; + @RequestMapping(value="/getGasStoreList",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询加油站列表") @@ -74,11 +84,16 @@ public class HighGasController { @RequestMapping(value="/getGasDetailByStoreKey",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据门店key 查询") - public ResponseData getGasDetailByStoreKey(@RequestParam(name = "storeKey", required = true) String storeKey) { + public ResponseData getGasDetailByStoreKey(@RequestParam(name = "storeKey", required = true) String storeKey, + @RequestParam(name = "longitude", required = true) String longitude, + @RequestParam(name = "latitude", required = true) String latitude) { try { JSONObject jsonObject = TuanYouConfig.queryGasInfoByGasId(storeKey); if (jsonObject != null && jsonObject.getString("code").equals("200")) { + JSONObject result = jsonObject.getJSONObject("result"); + double distance = CoordCommonUtil.getDistance(Double.valueOf(result.get("gasAddressLatitude").toString()), Double.valueOf(result.get("gasAddressLongitude").toString()), Double.valueOf(latitude), Double.valueOf(longitude)); + result.put("distance", Math.round(distance/100d)/10d); return ResponseMsgUtil.success(jsonObject.get("result")); } throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到加油站信息"); @@ -111,4 +126,127 @@ public class HighGasController { } } + @RequestMapping(value="/refuelingOrderRefund",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "订单退款") + public ResponseData refuelingOrderRefund(@RequestBody JSONObject body) { + try { + + if(body == null && body.getLong("orderId") == null && StringUtils.isBlank(body.getString("refundContent"))) { + log.error("HighOrderController --> refuelingOrderRefund() error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + HighOrder order = highOrderService.getOrderById(body.getLong("orderId")); + if(order == null) { + log.error("HighOrderController --> refuelingOrderRefund() error!", "未找到订单信息"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单信息"); + } + // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款 + if (order.getOrderStatus() != 2) { + log.error("HighOrderController --> refuelingOrderRefund() error!", "提交退款审核失败,订单不处于已支付"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "提交退款审核失败,订单不处于已支付"); + } + + JSONObject object = TuanYouConfig.refuelingOrderRefund(order.getMemPhone(), order.getOrderNo(), body.getString("refundContent")); + if (object == null || !object.getString("code").equals("200")) { + log.error("HighOrderController --> refuelingOrderRefund() error!", "提交退款审核失败," + object.getString("message")); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "提交退款审核失败," + object.getString("message")); + } + + order.setOrderStatus(6); + highOrderService.updateOrderDetail(order); + return ResponseMsgUtil.success("退款审核中"); + + } catch (Exception e) { + log.error("HighGasController -> refuelingOrderRefund() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/refuelingOrderPush",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "推送订单") + public ResponseData refuelingOrderPush() { + try { + + // {"app_key":"208241666939552","gunNo":"1","refuelingAmount":"1.02","thirdSerialNo":"HF2021062716143174807","sign":"83c7e8f70b984a04b937b28b8652aded","driverPhone":"15583658692","gasId":"CS000116587","priceVip":"7.31","oilNo":"90","timestamp":1624781755439,"priceGun":"7.31"}" + + String dataStr = "{\"result\": { \"orderNo\": \"CS00011658721062717132106\"},\"code\": 200, \"message\": \"OK\" }"; + Map map = new HashMap<>(); + map.put("gasId", "CS000116587"); + map.put("oilNo", "90"); + map.put("gunNo", 1); + BigDecimal priceGun = new BigDecimal("7.31"); + BigDecimal priceVip = new BigDecimal("7.31"); + // BigDecimal priceGun = new BigDecimal("5.58"); + // BigDecimal priceVip = new BigDecimal("5.40"); + map.put("priceGun", priceGun); // 枪单价 + map.put("priceVip", priceVip); // 优惠价 + map.put("driverPhone", "15583658692"); + map.put("thirdSerialNo", new Date().getTime()); + BigDecimal refuelingAmount = new BigDecimal("1").divide(priceGun,10,BigDecimal.ROUND_DOWN).multiply(priceVip).setScale(2,BigDecimal.ROUND_HALF_UP); + map.put("refuelingAmount", refuelingAmount); + /*JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(map); + if (orderPushObject == null || !orderPushObject.getString("code").equals("200")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "提交订单,出现了未知错误"); + } + JSONObject result = orderPushObject.getJSONObject("result");*/ + //return ResponseMsgUtil.success(TuanYouConfig.refuelingOrderPush(map)); + JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(map); + // 推送团油订单记录 + HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); + highGasOrderPush.setCreateTime(new Date()); + highGasOrderPush.setCode(orderPushObject.getString("code")); + highGasOrderPush.setRequestContent(JSONObject.toJSONString(map)); + highGasOrderPush.setReturnContent(orderPushObject.toJSONString()); + highGasOrderPushMapper.insert(highGasOrderPush); + + if (orderPushObject != null && orderPushObject.getString("code").equals("200")) { + return ResponseMsgUtil.success(orderPushObject.getJSONObject("result").getString("orderNo")); + } + return ResponseMsgUtil.success(map); + + + } catch (Exception e) { + log.error("HighGasController -> refuelingOrderPush() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryThirdOrderDretail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询订单信息") + public ResponseData queryThirdOrderDretail() { + try { + + + return ResponseMsgUtil.success(TuanYouConfig.queryThirdOrderDretail("1624611159129")); + //return ResponseMsgUtil.success(map); + + + } catch (Exception e) { + log.error("HighGasController -> queryThirdOrderDretail() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/test",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "测试") + public ResponseData test() { + try { + + String data = "{\"data\":\"ui2KbK5jpLtw7YaA52uSt1TzDpaE5OjeW5O6xg+saM4nN4aVnpoT1aTgJwQt/DuNSbs7LrX6q1B0cpW5T531ltYl1ERxyKXqZyMKBNWzDFuB5QSww22VGfypchGNm+oW\",\"timestamp\":1624611912047,\"companyCode\":\"208241666939552\"}"; + + JSONObject jsonObject = JSONObject.parseObject(data, JSONObject.class); + //return ResponseMsgUtil.success(AESEncodeUtil.aesDecryptByBytes(AESEncodeUtil.base64Decode(jsonObject.getString("data")), SysConst.getSysConfig().getTuanYouAppSecret())); + return ResponseMsgUtil.success(CommonSysConst.getSysConfig().getTuanYouUrl()); + + } catch (Exception e) { + log.error("HighGasController -> queryThirdOrderDretail() error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighMerchantStoreController.java b/hai-cweb/src/main/java/com/cweb/controller/HighMerchantStoreController.java index 1e687f58..20e84d62 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighMerchantStoreController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighMerchantStoreController.java @@ -144,6 +144,7 @@ public class HighMerchantStoreController { Map map = new HashMap<>(); map.put("companyId", bsCompany.getId()); map.put("status", 1); + map.put("ext1", true); return ResponseMsgUtil.success(highMerchantService.getMerchantList(map)); } return ResponseMsgUtil.success(new ArrayList<>()); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index 4c08dc7e..89023f4f 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -1,5 +1,6 @@ package com.cweb.controller; +import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hai.common.exception.ErrorCode; @@ -10,13 +11,15 @@ import com.hai.common.security.UserCenter; import com.hai.common.utils.DateUtil; import com.hai.common.utils.IDGenerator; import com.hai.common.utils.ResponseMsgUtil; +import com.hai.config.TuanYouConfig; import com.hai.entity.*; -import com.hai.model.HighCouponModel; +import com.hai.model.HighMerchantStoreModel; import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -49,6 +52,9 @@ public class HighOrderController { @Resource private HighCouponService highCouponService; + @Resource + private HighMerchantStoreService highMerchantStoreService; + @Resource private HighCouponCodeService highCouponCodeService; @@ -88,13 +94,14 @@ public class HighOrderController { } BigDecimal totalPrice = new BigDecimal("0"); + BigDecimal totalActualPrice = new BigDecimal("0"); for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { if (childOrder.getGoodsType() == null || childOrder.getGoodsId() == null || childOrder.getSaleCount() == null) { log.error("HighOrderController --> addOrder() error!", "参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } - // 商品类型 1:卡卷 2:金币充值 + // 商品类型 1:卡卷 2:金币充值 3:团油【加油站】 if (childOrder.getGoodsType() == 1) { if (childOrder.getSaleCount() != 1) { log.error("HighOrderController --> addOrder() error!", "卡卷只能购买一张"); @@ -135,6 +142,7 @@ public class HighOrderController { log.error("HighOrderController --> addOrder() error!", "卡卷库存数量不足"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COUPON_STOCK_INSUFFICIENT, ""); } + childOrder.setGoodsActualPrice(childOrder.getGoodsPrice()); childOrder.setGoodsName(coupon.getCouponName()); childOrder.setGoodsImg(coupon.getCouponImg()); childOrder.setGoodsSpecName("默认"); @@ -151,12 +159,44 @@ public class HighOrderController { log.error("HighOrderController --> addOrder() error!", "未找到用户"); throw ErrorHelp.genException(SysCode.System, ErrorCode.UN_MEMBER_ERROR, ""); } - + highOrder.setPayType(2); // 第三方平台 + childOrder.setGoodsActualPrice(childOrder.getGoodsPrice()); childOrder.setGoodsName(user.getName()); childOrder.setGoodsImg(user.getHeaderImg()); childOrder.setGoodsSpecName("默认"); } + if (childOrder.getGoodsType() == 3) { + if (childOrder.getGoodsPrice() == null || StringUtils.isBlank(childOrder.getGasGunNo()) || StringUtils.isBlank(childOrder.getGasOilNo())) { + log.error("HighOrderController --> addOrder() error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询门店 + HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(childOrder.getGoodsId()); + if (store == null) { + log.error("HighOrderController --> addOrder() error!", "未找到门店信息"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店信息"); + } + highOrder.setPayType(2); // 第三方平台 + + // 获取当前加油价格 + JSONObject jsonObject = TuanYouConfig.queryCompanyPriceDetail(store.getStoreKey(), childOrder.getGasOilNo()); + if (jsonObject == null || !jsonObject.getString("code").equals("200")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到加油价格"); + } + if(jsonObject.getJSONArray("result").size() == 0) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未获取到加油价格"); + } + JSONObject priceDetail = JSONObject.parseObject(JSONObject.toJSONString(jsonObject.getJSONArray("result").get(0)), JSONObject.class); + childOrder.setGoodsName(store.getStoreName()); + childOrder.setGoodsImg(store.getStoreLogo()); + childOrder.setGasPriceGun(priceDetail.getBigDecimal("priceGun")); + childOrder.setGasPriceVip(priceDetail.getBigDecimal("priceVip")); + childOrder.setGoodsActualPrice(new BigDecimal(childOrder.getGoodsPrice().toString()).divide(childOrder.getGasPriceGun(),10,BigDecimal.ROUND_DOWN).multiply(childOrder.getGasPriceVip()).setScale(2,BigDecimal.ROUND_HALF_UP)); + childOrder.setGoodsSpecName("默认"); + childOrder.setTotalPrice(childOrder.getGoodsPrice().multiply(new BigDecimal(childOrder.getSaleCount().toString()))); + } + childOrder.setMemId(userInfoModel.getHighUser().getId()); childOrder.setTotalPrice(childOrder.getGoodsPrice().multiply(new BigDecimal(childOrder.getSaleCount().toString()))); childOrder.setGiveawayType(false); // 是否是赠品 0:否 1:是 @@ -165,10 +205,12 @@ public class HighOrderController { // 累计订单价格 totalPrice = totalPrice.add(childOrder.getTotalPrice()); + totalActualPrice = totalActualPrice.add(childOrder.getGoodsActualPrice()); } highOrder.setTotalPrice(totalPrice); - highOrder.setPayPrice(highOrder.getTotalPrice()); + highOrder.setPayPrice(totalActualPrice); + highOrder.setDeductionPrice(highOrder.getTotalPrice().subtract(totalActualPrice)); // 是否使用了优惠券 if (highDiscountUserRel != null) { @@ -332,7 +374,7 @@ public class HighOrderController { @ResponseBody @ApiOperation(value = "获取用户订单") public ResponseData getUserOrderList( - @RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "status", required = false) String status, @RequestParam(name = "orderNo", required = false) String orderNo, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java index 8112ee9c..13e09baf 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighTestController.java @@ -1,21 +1,15 @@ package com.cweb.controller; -import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.cweb.config.TuanYouConfig; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; 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.*; +import com.hai.config.TuanYouConfig; import com.hai.entity.*; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; -import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.service.*; import io.swagger.annotations.Api; @@ -23,18 +17,11 @@ import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; /** * @Auther: 胡锐 diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java new file mode 100644 index 00000000..812d0739 --- /dev/null +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/TuanYouController.java @@ -0,0 +1,97 @@ +package com.cweb.controller.pay; + +import com.alibaba.fastjson.JSONObject; +import com.hai.common.security.AESEncodeUtil; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.config.CommonSysConst; +import com.hai.config.WxOrderConfig; +import com.hai.dao.HighGasOrderRefundMapper; +import com.hai.entity.HighGasOrderRefund; +import com.hai.entity.HighOrder; +import com.hai.model.OrderRefundModel; +import com.hai.service.HighOrderService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.math.BigDecimal; +import java.security.*; +import java.util.*; + +@Controller +@RequestMapping(value = "/tuanyou") +@Api(value = "团油回调") +public class TuanYouController { + + private static Logger log = LoggerFactory.getLogger(TuanYouController.class); + + @Resource + private HighOrderService highOrderService; + + @Resource + private HighGasOrderRefundMapper highGasOrderRefundMapper; + + + @RequestMapping(value = "/orderPaymentNotify", method = RequestMethod.POST) + @ApiOperation(value = "订单支付回调") + public void orderPaymentNotify(HttpServletRequest request, HttpServletResponse response) { + try { + + + } catch (Exception e) { + log.error("WechatPayController --> wechatNotify() error!", e); + } + } + + + @RequestMapping(value = "/orderRefundNotify", method = RequestMethod.POST) + @ApiOperation(value = "订单退款回调") + @ResponseBody + public void orderRefundNotify(@RequestBody String reqBodyStr,HttpServletRequest request, HttpServletResponse response) { + try { + log.info(reqBodyStr); + HighGasOrderRefund highGasOrderRefund = new HighGasOrderRefund(); + highGasOrderRefund.setCreateTime(new Date()); + highGasOrderRefund.setReturnContent(reqBodyStr); + highGasOrderRefundMapper.insert(highGasOrderRefund); + + JSONObject dataObject = JSONObject.parseObject(reqBodyStr, JSONObject.class); + String dataStr = AESEncodeUtil.aesDecryptByBytes(AESEncodeUtil.base64Decode(dataObject.getString("data")), CommonSysConst.getSysConfig().getTuanYouAppSecret()); + JSONObject object = JSONObject.parseObject(dataStr); + + // 查询订单 + HighOrder order = highOrderService.getOrderByOrderNo(object.getString("thirdOrderNo")); + + // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款 + if (order != null && order.getOrderStatus() == 6) { + // 退单结果 true:成功 false:失败 + if (object.getBoolean("refundResult") == true && order != null) { + OrderRefundModel orderRefundModel = WxOrderConfig.orderToRefund(order.getPaySerialNo(), order.getPayRealPrice(), order.getPayRealPrice()); + if(orderRefundModel.getResult_code().equals("SUCCESS")) { + order.setOrderStatus(4); + order.setRefundTime(new Date()); + highOrderService.updateOrderDetail(order); + } + } else if (!object.getBoolean("refundResult") == true && order != null) { + order.setOrderStatus(7); + order.setRefusalRefundContent(object.getString("refundFailReason")); + highOrderService.updateOrderDetail(order); + } + } + response.setCharacterEncoding("UTF-8"); + response.setContentType("text/html;charset=utf-8"); + PrintWriter writer= response.getWriter(); + writer.write("success"); + + } catch (Exception e) { + log.error("WechatPayController --> wechatNotify() error!", e); + } + } +} diff --git a/hai-cweb/src/main/java/com/cweb/controller/tPigController.java b/hai-cweb/src/main/java/com/cweb/controller/tPigController.java new file mode 100644 index 00000000..aab90485 --- /dev/null +++ b/hai-cweb/src/main/java/com/cweb/controller/tPigController.java @@ -0,0 +1,75 @@ +package com.cweb.controller; + +import com.alipay.api.domain.Data; +import com.cweb.config.SysConst; +import com.hai.common.pay.util.sdk.WXPayConstants; +import com.hai.common.security.SessionObject; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.HttpsUtils; +import com.hai.common.utils.MD5Util; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.common.utils.WxUtils; +import com.hai.entity.HighUser; +import com.hai.model.HighUserModel; +import com.hai.model.ResponseData; +import com.hai.service.HighUserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + + +@Controller +@RequestMapping(value = "/tPig") +@Api(value = "千猪接口") +public class tPigController { + + @Resource + private HighUserService highUserService; + + @Autowired + private UserCenter userCenter; + + @RequestMapping(value = "/getTPigToken", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "【小程序】获取千猪Token") + public ResponseData getH5AccessToken(HttpServletRequest request) { + try { + + // 用户 +// SessionObject sessionObject = userCenter.getSessionObject(request); +// HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); +// +// HighUser highUser = highUserService.findByUserId(userInfoModel.getHighUser().getId()); + + Map params = new HashMap<>(); +// params.put("platformUniqueId", highUser.getUnionId()); +// params.put("nickname", highUser.getName()); +// params.put("mobile", highUser.getPhone()); + + params.put("platformUniqueId", "oArhO6WlHsR2e5LuPUbxTcGo4nsQ"); + params.put("nickname", "Sum1Dream"); + params.put("platformId", "10376"); + params.put("mobile", "18090580471"); +// params.put("timestamp", String.valueOf(new Date().getTime())); + params.put("timestamp", "1624793550754"); + String sign = WxUtils.generateSignaturePig(params, "ktxb49sh2jfhgn8g" , WXPayConstants.SignType.MD5); + params.put("sign", sign); + return ResponseMsgUtil.success(HttpsUtils.doGet("https://live-test.qianzhu8.com/api/v2/platform/getToken", params , "")); + + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-cweb/src/main/resources/dev/config.properties b/hai-cweb/src/main/resources/dev/config.properties index 7de3b0e3..21bbf7d7 100644 --- a/hai-cweb/src/main/resources/dev/config.properties +++ b/hai-cweb/src/main/resources/dev/config.properties @@ -5,10 +5,6 @@ wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df wxH5AppId=wxa075e8509802f826 wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5 -tuanYouUrl=https://test02-motorcade-hcs.czb365.com -tuanYouAppKey=208241666939552 -tuanYouAppSecret=adecc3cff077834cb8632c8ab3bec0e6 - wxApiKey=Skufk5oi85wDFGl888i6wsRSTkdd5df5 wxMchAppId=wx637bd6f7314daa46 wxMchId=1289663601 diff --git a/hai-cweb/src/main/resources/prod/config.properties b/hai-cweb/src/main/resources/prod/config.properties index 383b00ed..71f142a9 100644 --- a/hai-cweb/src/main/resources/prod/config.properties +++ b/hai-cweb/src/main/resources/prod/config.properties @@ -5,10 +5,6 @@ wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df wxH5AppId=wxa075e8509802f826 wxH5AppSecret=0e606fc1378d35e359fcf3f15570b2c5 -tuanYouUrl=https://test02-motorcade-hcs.czb365.com -tuanYouAppKey=208241666939552 -tuanYouAppSecret=adecc3cff077834cb8632c8ab3bec0e6 - wxApiKey=Skufk5oi85wDFGl888i6wsRSTkdd5df5 wxMchAppId=wx637bd6f7314daa46 wxMchId=1289663601 diff --git a/hai-service/pom.xml b/hai-service/pom.xml index 24ce40c8..70a6412b 100644 --- a/hai-service/pom.xml +++ b/hai-service/pom.xml @@ -304,5 +304,12 @@ 0.2.2 - + + + + src/main/resources/${env} + false + + + diff --git a/hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java b/hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java index d2a894c2..5fe774e3 100644 --- a/hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java +++ b/hai-service/src/main/java/com/hai/common/utils/HttpsUtils.java @@ -126,6 +126,44 @@ public class HttpsUtils { return null; } + public static JSONObject doGet(String url, Map params , String o) { + String apiUrl = url; + StringBuffer param = new StringBuffer(); + int i = 0; + for (String key : params.keySet()) { + if (i == 0) + param.append("?"); + else + param.append("&"); + param.append(key).append("=").append(params.get(key)); + i++; + } + apiUrl += param; + String result = null; + HttpClient httpClient = null; + try { + + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + + HttpGet httpGet = new HttpGet(apiUrl); + HttpResponse response = httpClient.execute(httpGet); + HttpEntity entity = response.getEntity(); + if (entity != null) { + InputStream instream = entity.getContent(); + result = IOUtils.toString(instream, "UTF-8"); + } + return JSON.parseObject(result); + } catch (Exception e) { + log.error(e.getMessage(),e); + } + return null; + } + public static JSONObject doGet(String url, Map params , Map headers) { String apiUrl = url; StringBuffer param = new StringBuffer(); 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 266fae06..a9c152b4 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 @@ -237,7 +237,7 @@ public class WxUtils { } sb.append("key=").append(key); if (WXPayConstants.SignType.MD5.equals(signType)) { - return MD5(sb.toString()).toUpperCase(); + return MD5(sb.toString() , true); } else if (WXPayConstants.SignType.HMACSHA256.equals(signType)) { return HMACSHA256(sb.toString(), key); @@ -289,16 +289,22 @@ public class WxUtils { * @param data 待处理数据 * @return MD5结果 */ - public static String MD5(String data) throws Exception { + public static String MD5(String data , Boolean isUpperCase) throws Exception { java.security.MessageDigest md = MessageDigest.getInstance("MD5"); byte[] array = md.digest(data.getBytes("UTF-8")); StringBuilder sb = new StringBuilder(); for (byte item : array) { sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3)); } - return sb.toString().toUpperCase(); + if (isUpperCase) { + return sb.toString().toUpperCase(); + } else { + return sb.toString(); + } } + + /** * 将Map转换为XML格式的字符串 * @@ -338,6 +344,38 @@ public class WxUtils { } + /** + * 千猪生成签名。 + * + * @param data 待签名数据 + * @param secret API密钥 + * @param signType 签名方式 + * @return 签名 + */ + public static String generateSignaturePig(final Map data, String secret, WXPayConstants.SignType signType) throws Exception { + Set keySet = data.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)) { + continue; + } + if (data.get(k).trim().length() > 0) // 参数值为空,则不参与签名 + sb.append(k).append("=").append(data.get(k).trim()).append("&"); + } + String s = sb.substring(0, sb.length() - 1) + secret; + + if (WXPayConstants.SignType.MD5.equals(signType)) { + return MD5(sb.toString() , false); + } + else if (WXPayConstants.SignType.HMACSHA256.equals(signType)) { + return HMACSHA256(s, secret); + } + else { + throw new Exception(String.format("Invalid sign_type: %s", signType)); + } + } } diff --git a/hai-service/src/main/java/com/hai/config/CommonSysConfig.java b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java new file mode 100644 index 00000000..032c1c93 --- /dev/null +++ b/hai-service/src/main/java/com/hai/config/CommonSysConfig.java @@ -0,0 +1,49 @@ +package com.hai.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +@Component("commonSysConfig") +@ConfigurationProperties +@PropertySource("classpath:/commonConfig.properties") +public class CommonSysConfig { + + private String tuanYouUrl; + private String tuanYouAppKey; + private String tuanYouAppSecret; + + private String wx_cert; + + public String getWx_cert() { + return wx_cert; + } + + public void setWx_cert(String wx_cert) { + this.wx_cert = wx_cert; + } + + public String getTuanYouUrl() { + return tuanYouUrl; + } + + public void setTuanYouUrl(String tuanYouUrl) { + this.tuanYouUrl = tuanYouUrl; + } + + public String getTuanYouAppKey() { + return tuanYouAppKey; + } + + public void setTuanYouAppKey(String tuanYouAppKey) { + this.tuanYouAppKey = tuanYouAppKey; + } + + public String getTuanYouAppSecret() { + return tuanYouAppSecret; + } + + public void setTuanYouAppSecret(String tuanYouAppSecret) { + this.tuanYouAppSecret = tuanYouAppSecret; + } +} diff --git a/hai-service/src/main/java/com/hai/config/CommonSysConst.java b/hai-service/src/main/java/com/hai/config/CommonSysConst.java new file mode 100644 index 00000000..cf790283 --- /dev/null +++ b/hai-service/src/main/java/com/hai/config/CommonSysConst.java @@ -0,0 +1,19 @@ +package com.hai.config; + +public class CommonSysConst { + + private static CommonSysConfig sysConfig; + + public static void setSysConfig(CommonSysConfig arg){ + sysConfig = arg; + } + + public static CommonSysConfig getSysConfig(){ + if (null == sysConfig) { + //防止空指针异常 + sysConfig = new CommonSysConfig(); + return sysConfig; + } + return sysConfig; + } +} diff --git a/hai-service/src/main/java/com/hai/config/ConfigListener.java b/hai-service/src/main/java/com/hai/config/ConfigListener.java new file mode 100644 index 00000000..506f428d --- /dev/null +++ b/hai-service/src/main/java/com/hai/config/ConfigListener.java @@ -0,0 +1,23 @@ +package com.hai.config; + +import javax.annotation.Resource; +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; +import javax.servlet.annotation.WebListener; + +@WebListener +public class ConfigListener implements ServletContextListener { + + @Resource + private CommonSysConfig commonSysConfig; + + @Override + public void contextInitialized(ServletContextEvent sce) { + CommonSysConst.setSysConfig(commonSysConfig); + } + + @Override + public void contextDestroyed(ServletContextEvent sce) { + } + +} diff --git a/hai-cweb/src/main/java/com/cweb/config/TuanYouConfig.java b/hai-service/src/main/java/com/hai/config/TuanYouConfig.java similarity index 69% rename from hai-cweb/src/main/java/com/cweb/config/TuanYouConfig.java rename to hai-service/src/main/java/com/hai/config/TuanYouConfig.java index 8a070b90..65b9e4db 100644 --- a/hai-cweb/src/main/java/com/cweb/config/TuanYouConfig.java +++ b/hai-service/src/main/java/com/hai/config/TuanYouConfig.java @@ -1,4 +1,4 @@ -package com.cweb.config; +package com.hai.config; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; @@ -27,12 +27,12 @@ public class TuanYouConfig { */ public static JSONObject queryGasInfoListByPage(Integer pageIndex,Integer pageSize) throws Exception { Map paramMap = new HashMap<>(); - paramMap.put("app_key", SysConst.getSysConfig().getTuanYouAppKey()); + paramMap.put("app_key", CommonSysConst.getSysConfig().getTuanYouAppKey()); paramMap.put("timestamp", new Date().getTime()); paramMap.put("pageIndex", pageIndex); paramMap.put("pageSize", pageSize); - paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,SysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); - return HttpsUtils.doPost(SysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/queryGasInfoListByPage", JSON.toJSONString(paramMap)); + paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,CommonSysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/queryGasInfoListByPage", JSON.toJSONString(paramMap)); } /** @@ -43,11 +43,11 @@ public class TuanYouConfig { */ public static JSONObject queryGasInfoByGasId(String gasId) throws Exception { Map paramMap = new HashMap<>(); - paramMap.put("app_key", SysConst.getSysConfig().getTuanYouAppKey()); + paramMap.put("app_key", CommonSysConst.getSysConfig().getTuanYouAppKey()); paramMap.put("timestamp", new Date().getTime()); paramMap.put("gasId", gasId); - paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,SysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); - return HttpsUtils.doPost(SysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/queryGasInfoByGasId", JSON.toJSONString(paramMap)); + paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,CommonSysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/queryGasInfoByGasId", JSON.toJSONString(paramMap)); } /** @@ -59,12 +59,12 @@ public class TuanYouConfig { */ public static JSONObject queryCompanyPriceDetail(String gasId,String oilNo) throws Exception { Map paramMap = new HashMap<>(); - paramMap.put("app_key", SysConst.getSysConfig().getTuanYouAppKey()); + paramMap.put("app_key", CommonSysConst.getSysConfig().getTuanYouAppKey()); paramMap.put("timestamp", new Date().getTime()); paramMap.put("gasId", gasId); paramMap.put("oilNo", oilNo); - paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,SysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); - return HttpsUtils.doPost(SysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/queryCompanyPriceDetail", JSON.toJSONString(paramMap)); + paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,CommonSysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/queryCompanyPriceDetail", JSON.toJSONString(paramMap)); } /** @@ -75,13 +75,13 @@ public class TuanYouConfig { */ public static JSONObject refuelingOrderPush(Map map) throws Exception { Map paramMap = new HashMap<>(); - paramMap.put("app_key", SysConst.getSysConfig().getTuanYouAppKey()); + paramMap.put("app_key", CommonSysConst.getSysConfig().getTuanYouAppKey()); paramMap.put("timestamp", new Date().getTime()); for (Map.Entry entry : map.entrySet()) { paramMap.put(entry.getKey(), entry.getValue().toString()); } - paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,SysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); - return HttpsUtils.doPost(SysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/refuelingOrderPush", JSON.toJSONString(paramMap)); + paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,CommonSysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/refuelingOrderPush", JSON.toJSONString(paramMap)); } /** @@ -94,13 +94,13 @@ public class TuanYouConfig { */ public static JSONObject refuelingOrderRefund(String driverPhone,String thirdSerialNo,String refundReason) throws Exception { Map paramMap = new HashMap<>(); - paramMap.put("app_key", SysConst.getSysConfig().getTuanYouAppKey()); + paramMap.put("app_key", CommonSysConst.getSysConfig().getTuanYouAppKey()); paramMap.put("timestamp", new Date().getTime()); paramMap.put("driverPhone", driverPhone); paramMap.put("thirdSerialNo", thirdSerialNo); paramMap.put("refundReason", refundReason); - paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,SysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); - return HttpsUtils.doPost(SysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/refuelingOrderRefund", JSON.toJSONString(paramMap)); + paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,CommonSysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/refuelingOrderRefund", JSON.toJSONString(paramMap)); } /** @@ -111,11 +111,11 @@ public class TuanYouConfig { */ public static JSONObject queryThirdOrderDretail(String thirdSerialNo) throws Exception { Map paramMap = new HashMap<>(); - paramMap.put("app_key", SysConst.getSysConfig().getTuanYouAppKey()); + paramMap.put("app_key", CommonSysConst.getSysConfig().getTuanYouAppKey()); paramMap.put("timestamp", new Date().getTime()); paramMap.put("thirdSerialNo", thirdSerialNo); - paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,SysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); - return HttpsUtils.doPost(SysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/queryThirdOrderDretail", JSON.toJSONString(paramMap)); + paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,CommonSysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/queryThirdOrderDetail", JSON.toJSONString(paramMap)); } /** @@ -131,7 +131,7 @@ public class TuanYouConfig { */ public static JSONObject queryOrderInfoList(String companyCode,String startTime,String endTime,Integer page,Integer rows,Integer orderPayFlag) throws Exception { Map paramMap = new HashMap<>(); - paramMap.put("app_key", SysConst.getSysConfig().getTuanYouAppKey()); + paramMap.put("app_key", CommonSysConst.getSysConfig().getTuanYouAppKey()); paramMap.put("timestamp", new Date().getTime()); paramMap.put("companyCode", companyCode); paramMap.put("startTime", startTime); @@ -145,8 +145,8 @@ public class TuanYouConfig { if (orderPayFlag != null) { paramMap.put("orderPayFlag", orderPayFlag); } - paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,SysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); - return HttpsUtils.doPost(SysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/queryOrderInfoList", JSON.toJSONString(paramMap)); + paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,CommonSysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/queryOrderInfoList", JSON.toJSONString(paramMap)); } /** @@ -157,11 +157,11 @@ public class TuanYouConfig { */ public static JSONObject loopShangQiOrder(String thirdSerialNo) throws Exception { Map paramMap = new HashMap<>(); - paramMap.put("app_key", SysConst.getSysConfig().getTuanYouAppKey()); + paramMap.put("app_key", CommonSysConst.getSysConfig().getTuanYouAppKey()); paramMap.put("timestamp", new Date().getTime()); paramMap.put("thirdSerialNo", thirdSerialNo); - paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,SysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); - return HttpsUtils.doPost(SysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/loopShangQiOrder", JSON.toJSONString(paramMap)); + paramMap.put("sign", MD5Util.encode(generateTuanYouSignature(paramMap,CommonSysConst.getSysConfig().getTuanYouAppSecret()).getBytes()).toLowerCase()); + return HttpsUtils.doPost(CommonSysConst.getSysConfig().getTuanYouUrl()+"/services/vp/openapi/loopShangQiOrder", JSON.toJSONString(paramMap)); } /** diff --git a/hai-service/src/main/java/com/hai/config/WxOrderConfig.java b/hai-service/src/main/java/com/hai/config/WxOrderConfig.java new file mode 100644 index 00000000..5d7b62f4 --- /dev/null +++ b/hai-service/src/main/java/com/hai/config/WxOrderConfig.java @@ -0,0 +1,116 @@ +package com.hai.config; + +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.XmlUtil; +import com.hai.common.pay.util.sdk.WXPayConstants; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.common.utils.WxUtils; +import com.hai.entity.OutRechargeOrder; +import com.hai.model.OrderRefundModel; +import com.hai.model.ResponseData; +import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIConversion; +import io.swagger.annotations.ApiOperation; +import org.apache.http.HttpEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.ssl.SSLContexts; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.net.ssl.SSLContext; +import javax.servlet.http.HttpServletRequest; +import java.io.FileInputStream; +import java.math.BigDecimal; +import java.security.KeyStore; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * 微信订单处理 + */ +public class WxOrderConfig { + + private static final Logger log = LoggerFactory.getLogger(WxOrderConfig.class); + + + public static OrderRefundModel orderToRefund(String paySerialNo,BigDecimal totalFee,BigDecimal refundFee) throws Exception { + Map param = new HashMap<>(); + param.put("appid", "wx637bd6f7314daa46"); + param.put("mch_id", "1289663601"); + param.put("sub_mch_id" , "1609882817"); + param.put("nonce_str", WxUtils.makeNonStr()); + param.put("transaction_id", paySerialNo); + param.put("out_refund_no", "HFR"+new Date().getTime()); + param.put("total_fee", String.valueOf(totalFee.multiply(new BigDecimal("100")).intValue())); + param.put("refund_fee", String.valueOf(refundFee.multiply(new BigDecimal("100")).intValue())); + param.put("sign_type", "HMAC-SHA256"); + String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256); + param.put("sign", signStr); + String resultXmL = doSSLRequest(param.get("mch_id"), "https://api.mch.weixin.qq.com/secapi/pay/refund", WxUtils.mapToXml(param)); + return XmlUtil.getObjectFromXML(resultXmL, OrderRefundModel.class); + } + + + private static String doSSLRequest(String mchId, String url, String data) throws Exception { + //双向证书的认证 + CloseableHttpClient httpClient = readCertificate(mchId); + try { + //HttpPost httpost = new HttpPost("https://api.mch.weixin.qq.com/secapi/pay/refund"); // 设置响应头信息 + HttpPost httpost = new HttpPost(url); // 设置响应头信息 + httpost.addHeader("Connection", "keep-alive"); + httpost.addHeader("Accept", "*/*"); + httpost.addHeader("Content-Type", "text/xml"); + httpost.addHeader("Host", "api.mch.weixin.qq.com"); + httpost.addHeader("X-Requested-With", "XMLHttpRequest"); + httpost.addHeader("Cache-Control", "max-age=0"); + httpost.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) "); + httpost.setEntity(new StringEntity(data, "UTF-8")); + CloseableHttpResponse response = httpClient.execute(httpost); + try { + HttpEntity entity = response.getEntity(); + String jsonStr = EntityUtils.toString(response.getEntity(), "UTF-8"); + EntityUtils.consume(entity); + return jsonStr; + } finally { + response.close(); + } + } catch (Exception e){ + throw new RuntimeException(e); + } finally { + httpClient.close(); + } + } + + private static CloseableHttpClient readCertificate(String mchId) throws Exception{ + /** + * 注意PKCS12证书 是从微信商户平台-》账户设置-》 API安全 中下载的 + */ + KeyStore keyStore = KeyStore.getInstance("PKCS12"); + //P12文件目录 证书路径,这里需要你自己修改,linux下还是windows下的根路径 + // FileInputStream instream = new FileInputStream("/home/project/wx_cert/1289663601_apiclient_cert.p12"); + FileInputStream instream = new FileInputStream(CommonSysConst.getSysConfig().getWx_cert()+mchId+"_apiclient_cert.p12"); + try { + keyStore.load(instream, mchId.toCharArray());//这里写密码..默认是你的MCHID + } finally { + instream.close(); + } + SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, mchId.toCharArray()).build();//这里也是写密码的 + SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext, SSLConnectionSocketFactory.getDefaultHostnameVerifier()); + // Allow TLSv1 protocol only + return HttpClients.custom().setSSLSocketFactory(sslsf).build(); + } + +} diff --git a/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java b/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java index a4c0ad75..0d8ed3c8 100644 --- a/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java +++ b/hai-service/src/main/java/com/hai/dao/HighChildOrderMapper.java @@ -43,17 +43,23 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "goods_type, goods_id, ", "goods_name, goods_img, ", "goods_spec_name, goods_price, ", - "sale_count, total_price, ", - "giveaway_type, child_orde_status, ", - "praise_status, ext_1, ", + "goods_actual_price, sale_count, ", + "total_price, giveaway_type, ", + "child_orde_status, praise_status, ", + "gas_oil_no, gas_gun_no, ", + "gas_order_no, gas_price_gun, ", + "gas_price_vip, ext_1, ", "ext_2, ext_3)", "values (#{orderId,jdbcType=BIGINT}, #{memId,jdbcType=BIGINT}, ", "#{goodsType,jdbcType=INTEGER}, #{goodsId,jdbcType=BIGINT}, ", "#{goodsName,jdbcType=VARCHAR}, #{goodsImg,jdbcType=VARCHAR}, ", "#{goodsSpecName,jdbcType=VARCHAR}, #{goodsPrice,jdbcType=DECIMAL}, ", - "#{saleCount,jdbcType=INTEGER}, #{totalPrice,jdbcType=DECIMAL}, ", - "#{giveawayType,jdbcType=BIT}, #{childOrdeStatus,jdbcType=INTEGER}, ", - "#{praiseStatus,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, ", + "#{goodsActualPrice,jdbcType=DECIMAL}, #{saleCount,jdbcType=INTEGER}, ", + "#{totalPrice,jdbcType=DECIMAL}, #{giveawayType,jdbcType=BIT}, ", + "#{childOrdeStatus,jdbcType=INTEGER}, #{praiseStatus,jdbcType=INTEGER}, ", + "#{gasOilNo,jdbcType=VARCHAR}, #{gasGunNo,jdbcType=VARCHAR}, ", + "#{gasOrderNo,jdbcType=VARCHAR}, #{gasPriceGun,jdbcType=DECIMAL}, ", + "#{gasPriceVip,jdbcType=DECIMAL}, #{ext1,jdbcType=VARCHAR}, ", "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" }) @Options(useGeneratedKeys=true,keyProperty="id") @@ -74,11 +80,17 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { @Result(column="goods_img", property="goodsImg", jdbcType=JdbcType.VARCHAR), @Result(column="goods_spec_name", property="goodsSpecName", jdbcType=JdbcType.VARCHAR), @Result(column="goods_price", property="goodsPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="goods_actual_price", property="goodsActualPrice", jdbcType=JdbcType.DECIMAL), @Result(column="sale_count", property="saleCount", jdbcType=JdbcType.INTEGER), @Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL), @Result(column="giveaway_type", property="giveawayType", jdbcType=JdbcType.BIT), @Result(column="child_orde_status", property="childOrdeStatus", jdbcType=JdbcType.INTEGER), @Result(column="praise_status", property="praiseStatus", jdbcType=JdbcType.INTEGER), + @Result(column="gas_oil_no", property="gasOilNo", jdbcType=JdbcType.VARCHAR), + @Result(column="gas_gun_no", property="gasGunNo", jdbcType=JdbcType.VARCHAR), + @Result(column="gas_order_no", property="gasOrderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="gas_price_gun", property="gasPriceGun", jdbcType=JdbcType.DECIMAL), + @Result(column="gas_price_vip", property="gasPriceVip", jdbcType=JdbcType.DECIMAL), @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) @@ -88,7 +100,8 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { @Select({ "select", "id, order_id, mem_id, goods_type, goods_id, goods_name, goods_img, goods_spec_name, ", - "goods_price, sale_count, total_price, giveaway_type, child_orde_status, praise_status, ", + "goods_price, goods_actual_price, sale_count, total_price, giveaway_type, child_orde_status, ", + "praise_status, gas_oil_no, gas_gun_no, gas_order_no, gas_price_gun, gas_price_vip, ", "ext_1, ext_2, ext_3", "from high_child_order", "where id = #{id,jdbcType=BIGINT}" @@ -103,11 +116,17 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { @Result(column="goods_img", property="goodsImg", jdbcType=JdbcType.VARCHAR), @Result(column="goods_spec_name", property="goodsSpecName", jdbcType=JdbcType.VARCHAR), @Result(column="goods_price", property="goodsPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="goods_actual_price", property="goodsActualPrice", jdbcType=JdbcType.DECIMAL), @Result(column="sale_count", property="saleCount", jdbcType=JdbcType.INTEGER), @Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL), @Result(column="giveaway_type", property="giveawayType", jdbcType=JdbcType.BIT), @Result(column="child_orde_status", property="childOrdeStatus", jdbcType=JdbcType.INTEGER), @Result(column="praise_status", property="praiseStatus", jdbcType=JdbcType.INTEGER), + @Result(column="gas_oil_no", property="gasOilNo", jdbcType=JdbcType.VARCHAR), + @Result(column="gas_gun_no", property="gasGunNo", jdbcType=JdbcType.VARCHAR), + @Result(column="gas_order_no", property="gasOrderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="gas_price_gun", property="gasPriceGun", jdbcType=JdbcType.DECIMAL), + @Result(column="gas_price_vip", property="gasPriceVip", jdbcType=JdbcType.DECIMAL), @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) @@ -133,11 +152,17 @@ public interface HighChildOrderMapper extends HighChildOrderMapperExt { "goods_img = #{goodsImg,jdbcType=VARCHAR},", "goods_spec_name = #{goodsSpecName,jdbcType=VARCHAR},", "goods_price = #{goodsPrice,jdbcType=DECIMAL},", + "goods_actual_price = #{goodsActualPrice,jdbcType=DECIMAL},", "sale_count = #{saleCount,jdbcType=INTEGER},", "total_price = #{totalPrice,jdbcType=DECIMAL},", "giveaway_type = #{giveawayType,jdbcType=BIT},", "child_orde_status = #{childOrdeStatus,jdbcType=INTEGER},", "praise_status = #{praiseStatus,jdbcType=INTEGER},", + "gas_oil_no = #{gasOilNo,jdbcType=VARCHAR},", + "gas_gun_no = #{gasGunNo,jdbcType=VARCHAR},", + "gas_order_no = #{gasOrderNo,jdbcType=VARCHAR},", + "gas_price_gun = #{gasPriceGun,jdbcType=DECIMAL},", + "gas_price_vip = #{gasPriceVip,jdbcType=DECIMAL},", "ext_1 = #{ext1,jdbcType=VARCHAR},", "ext_2 = #{ext2,jdbcType=VARCHAR},", "ext_3 = #{ext3,jdbcType=VARCHAR}", diff --git a/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java index 8e488550..2850133f 100644 --- a/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighChildOrderSqlProvider.java @@ -60,6 +60,10 @@ public class HighChildOrderSqlProvider { sql.VALUES("goods_price", "#{goodsPrice,jdbcType=DECIMAL}"); } + if (record.getGoodsActualPrice() != null) { + sql.VALUES("goods_actual_price", "#{goodsActualPrice,jdbcType=DECIMAL}"); + } + if (record.getSaleCount() != null) { sql.VALUES("sale_count", "#{saleCount,jdbcType=INTEGER}"); } @@ -80,6 +84,26 @@ public class HighChildOrderSqlProvider { sql.VALUES("praise_status", "#{praiseStatus,jdbcType=INTEGER}"); } + if (record.getGasOilNo() != null) { + sql.VALUES("gas_oil_no", "#{gasOilNo,jdbcType=VARCHAR}"); + } + + if (record.getGasGunNo() != null) { + sql.VALUES("gas_gun_no", "#{gasGunNo,jdbcType=VARCHAR}"); + } + + if (record.getGasOrderNo() != null) { + sql.VALUES("gas_order_no", "#{gasOrderNo,jdbcType=VARCHAR}"); + } + + if (record.getGasPriceGun() != null) { + sql.VALUES("gas_price_gun", "#{gasPriceGun,jdbcType=DECIMAL}"); + } + + if (record.getGasPriceVip() != null) { + sql.VALUES("gas_price_vip", "#{gasPriceVip,jdbcType=DECIMAL}"); + } + if (record.getExt1() != null) { sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); } @@ -110,11 +134,17 @@ public class HighChildOrderSqlProvider { sql.SELECT("goods_img"); sql.SELECT("goods_spec_name"); sql.SELECT("goods_price"); + sql.SELECT("goods_actual_price"); sql.SELECT("sale_count"); sql.SELECT("total_price"); sql.SELECT("giveaway_type"); sql.SELECT("child_orde_status"); sql.SELECT("praise_status"); + sql.SELECT("gas_oil_no"); + sql.SELECT("gas_gun_no"); + sql.SELECT("gas_order_no"); + sql.SELECT("gas_price_gun"); + sql.SELECT("gas_price_vip"); sql.SELECT("ext_1"); sql.SELECT("ext_2"); sql.SELECT("ext_3"); @@ -171,6 +201,10 @@ public class HighChildOrderSqlProvider { sql.SET("goods_price = #{record.goodsPrice,jdbcType=DECIMAL}"); } + if (record.getGoodsActualPrice() != null) { + sql.SET("goods_actual_price = #{record.goodsActualPrice,jdbcType=DECIMAL}"); + } + if (record.getSaleCount() != null) { sql.SET("sale_count = #{record.saleCount,jdbcType=INTEGER}"); } @@ -191,6 +225,26 @@ public class HighChildOrderSqlProvider { sql.SET("praise_status = #{record.praiseStatus,jdbcType=INTEGER}"); } + if (record.getGasOilNo() != null) { + sql.SET("gas_oil_no = #{record.gasOilNo,jdbcType=VARCHAR}"); + } + + if (record.getGasGunNo() != null) { + sql.SET("gas_gun_no = #{record.gasGunNo,jdbcType=VARCHAR}"); + } + + if (record.getGasOrderNo() != null) { + sql.SET("gas_order_no = #{record.gasOrderNo,jdbcType=VARCHAR}"); + } + + if (record.getGasPriceGun() != null) { + sql.SET("gas_price_gun = #{record.gasPriceGun,jdbcType=DECIMAL}"); + } + + if (record.getGasPriceVip() != null) { + sql.SET("gas_price_vip = #{record.gasPriceVip,jdbcType=DECIMAL}"); + } + if (record.getExt1() != null) { sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); } @@ -220,11 +274,17 @@ public class HighChildOrderSqlProvider { sql.SET("goods_img = #{record.goodsImg,jdbcType=VARCHAR}"); sql.SET("goods_spec_name = #{record.goodsSpecName,jdbcType=VARCHAR}"); sql.SET("goods_price = #{record.goodsPrice,jdbcType=DECIMAL}"); + sql.SET("goods_actual_price = #{record.goodsActualPrice,jdbcType=DECIMAL}"); sql.SET("sale_count = #{record.saleCount,jdbcType=INTEGER}"); sql.SET("total_price = #{record.totalPrice,jdbcType=DECIMAL}"); sql.SET("giveaway_type = #{record.giveawayType,jdbcType=BIT}"); sql.SET("child_orde_status = #{record.childOrdeStatus,jdbcType=INTEGER}"); sql.SET("praise_status = #{record.praiseStatus,jdbcType=INTEGER}"); + sql.SET("gas_oil_no = #{record.gasOilNo,jdbcType=VARCHAR}"); + sql.SET("gas_gun_no = #{record.gasGunNo,jdbcType=VARCHAR}"); + sql.SET("gas_order_no = #{record.gasOrderNo,jdbcType=VARCHAR}"); + sql.SET("gas_price_gun = #{record.gasPriceGun,jdbcType=DECIMAL}"); + sql.SET("gas_price_vip = #{record.gasPriceVip,jdbcType=DECIMAL}"); sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); @@ -270,6 +330,10 @@ public class HighChildOrderSqlProvider { sql.SET("goods_price = #{goodsPrice,jdbcType=DECIMAL}"); } + if (record.getGoodsActualPrice() != null) { + sql.SET("goods_actual_price = #{goodsActualPrice,jdbcType=DECIMAL}"); + } + if (record.getSaleCount() != null) { sql.SET("sale_count = #{saleCount,jdbcType=INTEGER}"); } @@ -290,6 +354,26 @@ public class HighChildOrderSqlProvider { sql.SET("praise_status = #{praiseStatus,jdbcType=INTEGER}"); } + if (record.getGasOilNo() != null) { + sql.SET("gas_oil_no = #{gasOilNo,jdbcType=VARCHAR}"); + } + + if (record.getGasGunNo() != null) { + sql.SET("gas_gun_no = #{gasGunNo,jdbcType=VARCHAR}"); + } + + if (record.getGasOrderNo() != null) { + sql.SET("gas_order_no = #{gasOrderNo,jdbcType=VARCHAR}"); + } + + if (record.getGasPriceGun() != null) { + sql.SET("gas_price_gun = #{gasPriceGun,jdbcType=DECIMAL}"); + } + + if (record.getGasPriceVip() != null) { + sql.SET("gas_price_vip = #{gasPriceVip,jdbcType=DECIMAL}"); + } + if (record.getExt1() != null) { sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); } diff --git a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java index 2c4a4d86..54bda4cb 100644 --- a/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java @@ -1,11 +1,7 @@ package com.hai.dao; -import com.hai.entity.HighCouponRecycle; 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.type.JdbcType; import java.util.List; import java.util.Map; @@ -18,6 +14,8 @@ public interface HighGasOilPriceMapperExt { @Select(""}) List selectGoodsOrderList(@Param("map") Map map); + + @Select({""}) + List selectGasOrderList(@Param("map") Map map); + } diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java b/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java index c7c07c7e..2b393146 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderSqlProvider.java @@ -108,6 +108,18 @@ public class HighOrderSqlProvider { sql.VALUES("remarks", "#{remarks,jdbcType=VARCHAR}"); } + if (record.getRefundTime() != null) { + sql.VALUES("refund_time", "#{refundTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRefundContent() != null) { + sql.VALUES("refund_content", "#{refundContent,jdbcType=VARCHAR}"); + } + + if (record.getRefusalRefundContent() != null) { + sql.VALUES("refusal_refund_content", "#{refusalRefundContent,jdbcType=VARCHAR}"); + } + if (record.getExt1() != null) { sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); } @@ -150,6 +162,9 @@ public class HighOrderSqlProvider { sql.SELECT("cancel_time"); sql.SELECT("finish_time"); sql.SELECT("remarks"); + sql.SELECT("refund_time"); + sql.SELECT("refund_content"); + sql.SELECT("refusal_refund_content"); sql.SELECT("ext_1"); sql.SELECT("ext_2"); sql.SELECT("ext_3"); @@ -254,6 +269,18 @@ public class HighOrderSqlProvider { sql.SET("remarks = #{record.remarks,jdbcType=VARCHAR}"); } + if (record.getRefundTime() != null) { + sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRefundContent() != null) { + sql.SET("refund_content = #{record.refundContent,jdbcType=VARCHAR}"); + } + + if (record.getRefusalRefundContent() != null) { + sql.SET("refusal_refund_content = #{record.refusalRefundContent,jdbcType=VARCHAR}"); + } + if (record.getExt1() != null) { sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); } @@ -295,6 +322,9 @@ public class HighOrderSqlProvider { sql.SET("cancel_time = #{record.cancelTime,jdbcType=TIMESTAMP}"); sql.SET("finish_time = #{record.finishTime,jdbcType=TIMESTAMP}"); sql.SET("remarks = #{record.remarks,jdbcType=VARCHAR}"); + sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); + sql.SET("refund_content = #{record.refundContent,jdbcType=VARCHAR}"); + sql.SET("refusal_refund_content = #{record.refusalRefundContent,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}"); @@ -388,6 +418,18 @@ public class HighOrderSqlProvider { sql.SET("remarks = #{remarks,jdbcType=VARCHAR}"); } + if (record.getRefundTime() != null) { + sql.SET("refund_time = #{refundTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRefundContent() != null) { + sql.SET("refund_content = #{refundContent,jdbcType=VARCHAR}"); + } + + if (record.getRefusalRefundContent() != null) { + sql.SET("refusal_refund_content = #{refusalRefundContent,jdbcType=VARCHAR}"); + } + if (record.getExt1() != null) { sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); } diff --git a/hai-service/src/main/java/com/hai/entity/HighChildOrder.java b/hai-service/src/main/java/com/hai/entity/HighChildOrder.java index e5e1db8a..6e12b19d 100644 --- a/hai-service/src/main/java/com/hai/entity/HighChildOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighChildOrder.java @@ -29,7 +29,7 @@ public class HighChildOrder implements Serializable { private Long memId; /** - * 商品类型 1:卡卷 + * 商品类型 1:卡卷 2:金币充值 3:团油【加油站】 */ private Integer goodsType; @@ -58,6 +58,11 @@ public class HighChildOrder implements Serializable { */ private BigDecimal goodsPrice; + /** + * 商品的实际价格 + */ + private BigDecimal goodsActualPrice; + /** * 商品的数量 */ @@ -74,7 +79,7 @@ public class HighChildOrder implements Serializable { private Boolean giveawayType; /** - * 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 + * 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 */ private Integer childOrdeStatus; @@ -83,6 +88,31 @@ public class HighChildOrder implements Serializable { */ private Integer praiseStatus; + /** + * 【加油站】油号 + */ + private String gasOilNo; + + /** + * 【加油站】油抢号 + */ + private String gasGunNo; + + /** + * 【加油站】订单号 + */ + private String gasOrderNo; + + /** + * 【加油站】油枪价 + */ + private BigDecimal gasPriceGun; + + /** + * 【加油站】优惠价 + */ + private BigDecimal gasPriceVip; + private String ext1; private String ext2; @@ -163,6 +193,14 @@ public class HighChildOrder implements Serializable { this.goodsPrice = goodsPrice; } + public BigDecimal getGoodsActualPrice() { + return goodsActualPrice; + } + + public void setGoodsActualPrice(BigDecimal goodsActualPrice) { + this.goodsActualPrice = goodsActualPrice; + } + public Integer getSaleCount() { return saleCount; } @@ -203,6 +241,46 @@ public class HighChildOrder implements Serializable { this.praiseStatus = praiseStatus; } + public String getGasOilNo() { + return gasOilNo; + } + + public void setGasOilNo(String gasOilNo) { + this.gasOilNo = gasOilNo; + } + + public String getGasGunNo() { + return gasGunNo; + } + + public void setGasGunNo(String gasGunNo) { + this.gasGunNo = gasGunNo; + } + + public String getGasOrderNo() { + return gasOrderNo; + } + + public void setGasOrderNo(String gasOrderNo) { + this.gasOrderNo = gasOrderNo; + } + + public BigDecimal getGasPriceGun() { + return gasPriceGun; + } + + public void setGasPriceGun(BigDecimal gasPriceGun) { + this.gasPriceGun = gasPriceGun; + } + + public BigDecimal getGasPriceVip() { + return gasPriceVip; + } + + public void setGasPriceVip(BigDecimal gasPriceVip) { + this.gasPriceVip = gasPriceVip; + } + public String getExt1() { return ext1; } @@ -248,11 +326,17 @@ public class HighChildOrder implements Serializable { && (this.getGoodsImg() == null ? other.getGoodsImg() == null : this.getGoodsImg().equals(other.getGoodsImg())) && (this.getGoodsSpecName() == null ? other.getGoodsSpecName() == null : this.getGoodsSpecName().equals(other.getGoodsSpecName())) && (this.getGoodsPrice() == null ? other.getGoodsPrice() == null : this.getGoodsPrice().equals(other.getGoodsPrice())) + && (this.getGoodsActualPrice() == null ? other.getGoodsActualPrice() == null : this.getGoodsActualPrice().equals(other.getGoodsActualPrice())) && (this.getSaleCount() == null ? other.getSaleCount() == null : this.getSaleCount().equals(other.getSaleCount())) && (this.getTotalPrice() == null ? other.getTotalPrice() == null : this.getTotalPrice().equals(other.getTotalPrice())) && (this.getGiveawayType() == null ? other.getGiveawayType() == null : this.getGiveawayType().equals(other.getGiveawayType())) && (this.getChildOrdeStatus() == null ? other.getChildOrdeStatus() == null : this.getChildOrdeStatus().equals(other.getChildOrdeStatus())) && (this.getPraiseStatus() == null ? other.getPraiseStatus() == null : this.getPraiseStatus().equals(other.getPraiseStatus())) + && (this.getGasOilNo() == null ? other.getGasOilNo() == null : this.getGasOilNo().equals(other.getGasOilNo())) + && (this.getGasGunNo() == null ? other.getGasGunNo() == null : this.getGasGunNo().equals(other.getGasGunNo())) + && (this.getGasOrderNo() == null ? other.getGasOrderNo() == null : this.getGasOrderNo().equals(other.getGasOrderNo())) + && (this.getGasPriceGun() == null ? other.getGasPriceGun() == null : this.getGasPriceGun().equals(other.getGasPriceGun())) + && (this.getGasPriceVip() == null ? other.getGasPriceVip() == null : this.getGasPriceVip().equals(other.getGasPriceVip())) && (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())); @@ -271,11 +355,17 @@ public class HighChildOrder implements Serializable { result = prime * result + ((getGoodsImg() == null) ? 0 : getGoodsImg().hashCode()); result = prime * result + ((getGoodsSpecName() == null) ? 0 : getGoodsSpecName().hashCode()); result = prime * result + ((getGoodsPrice() == null) ? 0 : getGoodsPrice().hashCode()); + result = prime * result + ((getGoodsActualPrice() == null) ? 0 : getGoodsActualPrice().hashCode()); result = prime * result + ((getSaleCount() == null) ? 0 : getSaleCount().hashCode()); result = prime * result + ((getTotalPrice() == null) ? 0 : getTotalPrice().hashCode()); result = prime * result + ((getGiveawayType() == null) ? 0 : getGiveawayType().hashCode()); result = prime * result + ((getChildOrdeStatus() == null) ? 0 : getChildOrdeStatus().hashCode()); result = prime * result + ((getPraiseStatus() == null) ? 0 : getPraiseStatus().hashCode()); + result = prime * result + ((getGasOilNo() == null) ? 0 : getGasOilNo().hashCode()); + result = prime * result + ((getGasGunNo() == null) ? 0 : getGasGunNo().hashCode()); + result = prime * result + ((getGasOrderNo() == null) ? 0 : getGasOrderNo().hashCode()); + result = prime * result + ((getGasPriceGun() == null) ? 0 : getGasPriceGun().hashCode()); + result = prime * result + ((getGasPriceVip() == null) ? 0 : getGasPriceVip().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()); @@ -297,11 +387,17 @@ public class HighChildOrder implements Serializable { sb.append(", goodsImg=").append(goodsImg); sb.append(", goodsSpecName=").append(goodsSpecName); sb.append(", goodsPrice=").append(goodsPrice); + sb.append(", goodsActualPrice=").append(goodsActualPrice); sb.append(", saleCount=").append(saleCount); sb.append(", totalPrice=").append(totalPrice); sb.append(", giveawayType=").append(giveawayType); sb.append(", childOrdeStatus=").append(childOrdeStatus); sb.append(", praiseStatus=").append(praiseStatus); + sb.append(", gasOilNo=").append(gasOilNo); + sb.append(", gasGunNo=").append(gasGunNo); + sb.append(", gasOrderNo=").append(gasOrderNo); + sb.append(", gasPriceGun=").append(gasPriceGun); + sb.append(", gasPriceVip=").append(gasPriceVip); sb.append(", ext1=").append(ext1); sb.append(", ext2=").append(ext2); sb.append(", ext3=").append(ext3); diff --git a/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java b/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java index 0e314fd7..87bc2a78 100644 --- a/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighChildOrderExample.java @@ -695,6 +695,66 @@ public class HighChildOrderExample { return (Criteria) this; } + public Criteria andGoodsActualPriceIsNull() { + addCriterion("goods_actual_price is null"); + return (Criteria) this; + } + + public Criteria andGoodsActualPriceIsNotNull() { + addCriterion("goods_actual_price is not null"); + return (Criteria) this; + } + + public Criteria andGoodsActualPriceEqualTo(BigDecimal value) { + addCriterion("goods_actual_price =", value, "goodsActualPrice"); + return (Criteria) this; + } + + public Criteria andGoodsActualPriceNotEqualTo(BigDecimal value) { + addCriterion("goods_actual_price <>", value, "goodsActualPrice"); + return (Criteria) this; + } + + public Criteria andGoodsActualPriceGreaterThan(BigDecimal value) { + addCriterion("goods_actual_price >", value, "goodsActualPrice"); + return (Criteria) this; + } + + public Criteria andGoodsActualPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("goods_actual_price >=", value, "goodsActualPrice"); + return (Criteria) this; + } + + public Criteria andGoodsActualPriceLessThan(BigDecimal value) { + addCriterion("goods_actual_price <", value, "goodsActualPrice"); + return (Criteria) this; + } + + public Criteria andGoodsActualPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("goods_actual_price <=", value, "goodsActualPrice"); + return (Criteria) this; + } + + public Criteria andGoodsActualPriceIn(List values) { + addCriterion("goods_actual_price in", values, "goodsActualPrice"); + return (Criteria) this; + } + + public Criteria andGoodsActualPriceNotIn(List values) { + addCriterion("goods_actual_price not in", values, "goodsActualPrice"); + return (Criteria) this; + } + + public Criteria andGoodsActualPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("goods_actual_price between", value1, value2, "goodsActualPrice"); + return (Criteria) this; + } + + public Criteria andGoodsActualPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("goods_actual_price not between", value1, value2, "goodsActualPrice"); + return (Criteria) this; + } + public Criteria andSaleCountIsNull() { addCriterion("sale_count is null"); return (Criteria) this; @@ -995,6 +1055,336 @@ public class HighChildOrderExample { return (Criteria) this; } + public Criteria andGasOilNoIsNull() { + addCriterion("gas_oil_no is null"); + return (Criteria) this; + } + + public Criteria andGasOilNoIsNotNull() { + addCriterion("gas_oil_no is not null"); + return (Criteria) this; + } + + public Criteria andGasOilNoEqualTo(String value) { + addCriterion("gas_oil_no =", value, "gasOilNo"); + return (Criteria) this; + } + + public Criteria andGasOilNoNotEqualTo(String value) { + addCriterion("gas_oil_no <>", value, "gasOilNo"); + return (Criteria) this; + } + + public Criteria andGasOilNoGreaterThan(String value) { + addCriterion("gas_oil_no >", value, "gasOilNo"); + return (Criteria) this; + } + + public Criteria andGasOilNoGreaterThanOrEqualTo(String value) { + addCriterion("gas_oil_no >=", value, "gasOilNo"); + return (Criteria) this; + } + + public Criteria andGasOilNoLessThan(String value) { + addCriterion("gas_oil_no <", value, "gasOilNo"); + return (Criteria) this; + } + + public Criteria andGasOilNoLessThanOrEqualTo(String value) { + addCriterion("gas_oil_no <=", value, "gasOilNo"); + return (Criteria) this; + } + + public Criteria andGasOilNoLike(String value) { + addCriterion("gas_oil_no like", value, "gasOilNo"); + return (Criteria) this; + } + + public Criteria andGasOilNoNotLike(String value) { + addCriterion("gas_oil_no not like", value, "gasOilNo"); + return (Criteria) this; + } + + public Criteria andGasOilNoIn(List values) { + addCriterion("gas_oil_no in", values, "gasOilNo"); + return (Criteria) this; + } + + public Criteria andGasOilNoNotIn(List values) { + addCriterion("gas_oil_no not in", values, "gasOilNo"); + return (Criteria) this; + } + + public Criteria andGasOilNoBetween(String value1, String value2) { + addCriterion("gas_oil_no between", value1, value2, "gasOilNo"); + return (Criteria) this; + } + + public Criteria andGasOilNoNotBetween(String value1, String value2) { + addCriterion("gas_oil_no not between", value1, value2, "gasOilNo"); + return (Criteria) this; + } + + public Criteria andGasGunNoIsNull() { + addCriterion("gas_gun_no is null"); + return (Criteria) this; + } + + public Criteria andGasGunNoIsNotNull() { + addCriterion("gas_gun_no is not null"); + return (Criteria) this; + } + + public Criteria andGasGunNoEqualTo(String value) { + addCriterion("gas_gun_no =", value, "gasGunNo"); + return (Criteria) this; + } + + public Criteria andGasGunNoNotEqualTo(String value) { + addCriterion("gas_gun_no <>", value, "gasGunNo"); + return (Criteria) this; + } + + public Criteria andGasGunNoGreaterThan(String value) { + addCriterion("gas_gun_no >", value, "gasGunNo"); + return (Criteria) this; + } + + public Criteria andGasGunNoGreaterThanOrEqualTo(String value) { + addCriterion("gas_gun_no >=", value, "gasGunNo"); + return (Criteria) this; + } + + public Criteria andGasGunNoLessThan(String value) { + addCriterion("gas_gun_no <", value, "gasGunNo"); + return (Criteria) this; + } + + public Criteria andGasGunNoLessThanOrEqualTo(String value) { + addCriterion("gas_gun_no <=", value, "gasGunNo"); + return (Criteria) this; + } + + public Criteria andGasGunNoLike(String value) { + addCriterion("gas_gun_no like", value, "gasGunNo"); + return (Criteria) this; + } + + public Criteria andGasGunNoNotLike(String value) { + addCriterion("gas_gun_no not like", value, "gasGunNo"); + return (Criteria) this; + } + + public Criteria andGasGunNoIn(List values) { + addCriterion("gas_gun_no in", values, "gasGunNo"); + return (Criteria) this; + } + + public Criteria andGasGunNoNotIn(List values) { + addCriterion("gas_gun_no not in", values, "gasGunNo"); + return (Criteria) this; + } + + public Criteria andGasGunNoBetween(String value1, String value2) { + addCriterion("gas_gun_no between", value1, value2, "gasGunNo"); + return (Criteria) this; + } + + public Criteria andGasGunNoNotBetween(String value1, String value2) { + addCriterion("gas_gun_no not between", value1, value2, "gasGunNo"); + return (Criteria) this; + } + + public Criteria andGasOrderNoIsNull() { + addCriterion("gas_order_no is null"); + return (Criteria) this; + } + + public Criteria andGasOrderNoIsNotNull() { + addCriterion("gas_order_no is not null"); + return (Criteria) this; + } + + public Criteria andGasOrderNoEqualTo(String value) { + addCriterion("gas_order_no =", value, "gasOrderNo"); + return (Criteria) this; + } + + public Criteria andGasOrderNoNotEqualTo(String value) { + addCriterion("gas_order_no <>", value, "gasOrderNo"); + return (Criteria) this; + } + + public Criteria andGasOrderNoGreaterThan(String value) { + addCriterion("gas_order_no >", value, "gasOrderNo"); + return (Criteria) this; + } + + public Criteria andGasOrderNoGreaterThanOrEqualTo(String value) { + addCriterion("gas_order_no >=", value, "gasOrderNo"); + return (Criteria) this; + } + + public Criteria andGasOrderNoLessThan(String value) { + addCriterion("gas_order_no <", value, "gasOrderNo"); + return (Criteria) this; + } + + public Criteria andGasOrderNoLessThanOrEqualTo(String value) { + addCriterion("gas_order_no <=", value, "gasOrderNo"); + return (Criteria) this; + } + + public Criteria andGasOrderNoLike(String value) { + addCriterion("gas_order_no like", value, "gasOrderNo"); + return (Criteria) this; + } + + public Criteria andGasOrderNoNotLike(String value) { + addCriterion("gas_order_no not like", value, "gasOrderNo"); + return (Criteria) this; + } + + public Criteria andGasOrderNoIn(List values) { + addCriterion("gas_order_no in", values, "gasOrderNo"); + return (Criteria) this; + } + + public Criteria andGasOrderNoNotIn(List values) { + addCriterion("gas_order_no not in", values, "gasOrderNo"); + return (Criteria) this; + } + + public Criteria andGasOrderNoBetween(String value1, String value2) { + addCriterion("gas_order_no between", value1, value2, "gasOrderNo"); + return (Criteria) this; + } + + public Criteria andGasOrderNoNotBetween(String value1, String value2) { + addCriterion("gas_order_no not between", value1, value2, "gasOrderNo"); + return (Criteria) this; + } + + public Criteria andGasPriceGunIsNull() { + addCriterion("gas_price_gun is null"); + return (Criteria) this; + } + + public Criteria andGasPriceGunIsNotNull() { + addCriterion("gas_price_gun is not null"); + return (Criteria) this; + } + + public Criteria andGasPriceGunEqualTo(BigDecimal value) { + addCriterion("gas_price_gun =", value, "gasPriceGun"); + return (Criteria) this; + } + + public Criteria andGasPriceGunNotEqualTo(BigDecimal value) { + addCriterion("gas_price_gun <>", value, "gasPriceGun"); + return (Criteria) this; + } + + public Criteria andGasPriceGunGreaterThan(BigDecimal value) { + addCriterion("gas_price_gun >", value, "gasPriceGun"); + return (Criteria) this; + } + + public Criteria andGasPriceGunGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("gas_price_gun >=", value, "gasPriceGun"); + return (Criteria) this; + } + + public Criteria andGasPriceGunLessThan(BigDecimal value) { + addCriterion("gas_price_gun <", value, "gasPriceGun"); + return (Criteria) this; + } + + public Criteria andGasPriceGunLessThanOrEqualTo(BigDecimal value) { + addCriterion("gas_price_gun <=", value, "gasPriceGun"); + return (Criteria) this; + } + + public Criteria andGasPriceGunIn(List values) { + addCriterion("gas_price_gun in", values, "gasPriceGun"); + return (Criteria) this; + } + + public Criteria andGasPriceGunNotIn(List values) { + addCriterion("gas_price_gun not in", values, "gasPriceGun"); + return (Criteria) this; + } + + public Criteria andGasPriceGunBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("gas_price_gun between", value1, value2, "gasPriceGun"); + return (Criteria) this; + } + + public Criteria andGasPriceGunNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("gas_price_gun not between", value1, value2, "gasPriceGun"); + return (Criteria) this; + } + + public Criteria andGasPriceVipIsNull() { + addCriterion("gas_price_vip is null"); + return (Criteria) this; + } + + public Criteria andGasPriceVipIsNotNull() { + addCriterion("gas_price_vip is not null"); + return (Criteria) this; + } + + public Criteria andGasPriceVipEqualTo(BigDecimal value) { + addCriterion("gas_price_vip =", value, "gasPriceVip"); + return (Criteria) this; + } + + public Criteria andGasPriceVipNotEqualTo(BigDecimal value) { + addCriterion("gas_price_vip <>", value, "gasPriceVip"); + return (Criteria) this; + } + + public Criteria andGasPriceVipGreaterThan(BigDecimal value) { + addCriterion("gas_price_vip >", value, "gasPriceVip"); + return (Criteria) this; + } + + public Criteria andGasPriceVipGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("gas_price_vip >=", value, "gasPriceVip"); + return (Criteria) this; + } + + public Criteria andGasPriceVipLessThan(BigDecimal value) { + addCriterion("gas_price_vip <", value, "gasPriceVip"); + return (Criteria) this; + } + + public Criteria andGasPriceVipLessThanOrEqualTo(BigDecimal value) { + addCriterion("gas_price_vip <=", value, "gasPriceVip"); + return (Criteria) this; + } + + public Criteria andGasPriceVipIn(List values) { + addCriterion("gas_price_vip in", values, "gasPriceVip"); + return (Criteria) this; + } + + public Criteria andGasPriceVipNotIn(List values) { + addCriterion("gas_price_vip not in", values, "gasPriceVip"); + return (Criteria) this; + } + + public Criteria andGasPriceVipBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("gas_price_vip between", value1, value2, "gasPriceVip"); + return (Criteria) this; + } + + public Criteria andGasPriceVipNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("gas_price_vip not between", value1, value2, "gasPriceVip"); + return (Criteria) this; + } + public Criteria andExt1IsNull() { addCriterion("ext_1 is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/entity/HighGasOrderPush.java b/hai-service/src/main/java/com/hai/entity/HighGasOrderPush.java new file mode 100644 index 00000000..48f26e7c --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasOrderPush.java @@ -0,0 +1,168 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * high_gas_order_push + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighGasOrderPush implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 推送状态 + */ + private String code; + + /** + * 请求内容 + */ + private String requestContent; + + /** + * 返回结果 + */ + private String returnContent; + + /** + * 创建时间 + */ + private Date createTime; + + private String ext1; + + private String ext2; + + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getRequestContent() { + return requestContent; + } + + public void setRequestContent(String requestContent) { + this.requestContent = requestContent; + } + + public String getReturnContent() { + return returnContent; + } + + public void setReturnContent(String returnContent) { + this.returnContent = returnContent; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + 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; + } + HighGasOrderPush other = (HighGasOrderPush) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode())) + && (this.getRequestContent() == null ? other.getRequestContent() == null : this.getRequestContent().equals(other.getRequestContent())) + && (this.getReturnContent() == null ? other.getReturnContent() == null : this.getReturnContent().equals(other.getReturnContent())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (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 + ((getCode() == null) ? 0 : getCode().hashCode()); + result = prime * result + ((getRequestContent() == null) ? 0 : getRequestContent().hashCode()); + result = prime * result + ((getReturnContent() == null) ? 0 : getReturnContent().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().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(", code=").append(code); + sb.append(", requestContent=").append(requestContent); + sb.append(", returnContent=").append(returnContent); + sb.append(", createTime=").append(createTime); + 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/HighGasOrderPushExample.java b/hai-service/src/main/java/com/hai/entity/HighGasOrderPushExample.java new file mode 100644 index 00000000..58526200 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasOrderPushExample.java @@ -0,0 +1,763 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighGasOrderPushExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighGasOrderPushExample() { + 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 andCodeIsNull() { + addCriterion("code is null"); + return (Criteria) this; + } + + public Criteria andCodeIsNotNull() { + addCriterion("code is not null"); + return (Criteria) this; + } + + public Criteria andCodeEqualTo(String value) { + addCriterion("code =", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotEqualTo(String value) { + addCriterion("code <>", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThan(String value) { + addCriterion("code >", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeGreaterThanOrEqualTo(String value) { + addCriterion("code >=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThan(String value) { + addCriterion("code <", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLessThanOrEqualTo(String value) { + addCriterion("code <=", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeLike(String value) { + addCriterion("code like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotLike(String value) { + addCriterion("code not like", value, "code"); + return (Criteria) this; + } + + public Criteria andCodeIn(List values) { + addCriterion("code in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotIn(List values) { + addCriterion("code not in", values, "code"); + return (Criteria) this; + } + + public Criteria andCodeBetween(String value1, String value2) { + addCriterion("code between", value1, value2, "code"); + return (Criteria) this; + } + + public Criteria andCodeNotBetween(String value1, String value2) { + addCriterion("code not between", value1, value2, "code"); + return (Criteria) this; + } + + public Criteria andRequestContentIsNull() { + addCriterion("request_content is null"); + return (Criteria) this; + } + + public Criteria andRequestContentIsNotNull() { + addCriterion("request_content is not null"); + return (Criteria) this; + } + + public Criteria andRequestContentEqualTo(String value) { + addCriterion("request_content =", value, "requestContent"); + return (Criteria) this; + } + + public Criteria andRequestContentNotEqualTo(String value) { + addCriterion("request_content <>", value, "requestContent"); + return (Criteria) this; + } + + public Criteria andRequestContentGreaterThan(String value) { + addCriterion("request_content >", value, "requestContent"); + return (Criteria) this; + } + + public Criteria andRequestContentGreaterThanOrEqualTo(String value) { + addCriterion("request_content >=", value, "requestContent"); + return (Criteria) this; + } + + public Criteria andRequestContentLessThan(String value) { + addCriterion("request_content <", value, "requestContent"); + return (Criteria) this; + } + + public Criteria andRequestContentLessThanOrEqualTo(String value) { + addCriterion("request_content <=", value, "requestContent"); + return (Criteria) this; + } + + public Criteria andRequestContentLike(String value) { + addCriterion("request_content like", value, "requestContent"); + return (Criteria) this; + } + + public Criteria andRequestContentNotLike(String value) { + addCriterion("request_content not like", value, "requestContent"); + return (Criteria) this; + } + + public Criteria andRequestContentIn(List values) { + addCriterion("request_content in", values, "requestContent"); + return (Criteria) this; + } + + public Criteria andRequestContentNotIn(List values) { + addCriterion("request_content not in", values, "requestContent"); + return (Criteria) this; + } + + public Criteria andRequestContentBetween(String value1, String value2) { + addCriterion("request_content between", value1, value2, "requestContent"); + return (Criteria) this; + } + + public Criteria andRequestContentNotBetween(String value1, String value2) { + addCriterion("request_content not between", value1, value2, "requestContent"); + return (Criteria) this; + } + + public Criteria andReturnContentIsNull() { + addCriterion("return_content is null"); + return (Criteria) this; + } + + public Criteria andReturnContentIsNotNull() { + addCriterion("return_content is not null"); + return (Criteria) this; + } + + public Criteria andReturnContentEqualTo(String value) { + addCriterion("return_content =", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentNotEqualTo(String value) { + addCriterion("return_content <>", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentGreaterThan(String value) { + addCriterion("return_content >", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentGreaterThanOrEqualTo(String value) { + addCriterion("return_content >=", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentLessThan(String value) { + addCriterion("return_content <", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentLessThanOrEqualTo(String value) { + addCriterion("return_content <=", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentLike(String value) { + addCriterion("return_content like", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentNotLike(String value) { + addCriterion("return_content not like", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentIn(List values) { + addCriterion("return_content in", values, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentNotIn(List values) { + addCriterion("return_content not in", values, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentBetween(String value1, String value2) { + addCriterion("return_content between", value1, value2, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentNotBetween(String value1, String value2) { + addCriterion("return_content not between", value1, value2, "returnContent"); + 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 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/entity/HighGasOrderRefund.java b/hai-service/src/main/java/com/hai/entity/HighGasOrderRefund.java new file mode 100644 index 00000000..76195843 --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasOrderRefund.java @@ -0,0 +1,136 @@ +package com.hai.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * high_gas_order_refund + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class HighGasOrderRefund implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 返回结果 + */ + private String returnContent; + + /** + * 创建时间 + */ + private Date createTime; + + private String ext1; + + private String ext2; + + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getReturnContent() { + return returnContent; + } + + public void setReturnContent(String returnContent) { + this.returnContent = returnContent; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + 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; + } + HighGasOrderRefund other = (HighGasOrderRefund) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getReturnContent() == null ? other.getReturnContent() == null : this.getReturnContent().equals(other.getReturnContent())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (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 + ((getReturnContent() == null) ? 0 : getReturnContent().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().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(", returnContent=").append(returnContent); + sb.append(", createTime=").append(createTime); + 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/HighGasOrderRefundExample.java b/hai-service/src/main/java/com/hai/entity/HighGasOrderRefundExample.java new file mode 100644 index 00000000..7c7d461a --- /dev/null +++ b/hai-service/src/main/java/com/hai/entity/HighGasOrderRefundExample.java @@ -0,0 +1,623 @@ +package com.hai.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class HighGasOrderRefundExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public HighGasOrderRefundExample() { + 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 andReturnContentIsNull() { + addCriterion("return_content is null"); + return (Criteria) this; + } + + public Criteria andReturnContentIsNotNull() { + addCriterion("return_content is not null"); + return (Criteria) this; + } + + public Criteria andReturnContentEqualTo(String value) { + addCriterion("return_content =", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentNotEqualTo(String value) { + addCriterion("return_content <>", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentGreaterThan(String value) { + addCriterion("return_content >", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentGreaterThanOrEqualTo(String value) { + addCriterion("return_content >=", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentLessThan(String value) { + addCriterion("return_content <", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentLessThanOrEqualTo(String value) { + addCriterion("return_content <=", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentLike(String value) { + addCriterion("return_content like", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentNotLike(String value) { + addCriterion("return_content not like", value, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentIn(List values) { + addCriterion("return_content in", values, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentNotIn(List values) { + addCriterion("return_content not in", values, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentBetween(String value1, String value2) { + addCriterion("return_content between", value1, value2, "returnContent"); + return (Criteria) this; + } + + public Criteria andReturnContentNotBetween(String value1, String value2) { + addCriterion("return_content not between", value1, value2, "returnContent"); + 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 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/entity/HighOrder.java b/hai-service/src/main/java/com/hai/entity/HighOrder.java index c410ecd8..39455eb7 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighOrder.java @@ -86,7 +86,7 @@ public class HighOrder implements Serializable { private BigDecimal deductionPrice; /** - * 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 + * 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消 6.退款中 7.拒绝退款 */ private Integer orderStatus; @@ -120,6 +120,21 @@ public class HighOrder implements Serializable { */ private String remarks; + /** + * 退款时间【退款成功时间】 + */ + private Date refundTime; + + /** + * 退款原因 + */ + private String refundContent; + + /** + * 拒绝退款原因 + */ + private String refusalRefundContent; + private String ext1; private String ext2; @@ -130,6 +145,8 @@ public class HighOrder implements Serializable { private HighDiscount highDiscount; + private static final long serialVersionUID = 1L; + public List getHighChildOrderList() { return highChildOrderList; } @@ -146,8 +163,6 @@ public class HighOrder implements Serializable { this.highDiscount = highDiscount; } - private static final long serialVersionUID = 1L; - public Long getId() { return id; } @@ -316,6 +331,30 @@ public class HighOrder implements Serializable { this.remarks = remarks; } + public Date getRefundTime() { + return refundTime; + } + + public void setRefundTime(Date refundTime) { + this.refundTime = refundTime; + } + + public String getRefundContent() { + return refundContent; + } + + public void setRefundContent(String refundContent) { + this.refundContent = refundContent; + } + + public String getRefusalRefundContent() { + return refusalRefundContent; + } + + public void setRefusalRefundContent(String refusalRefundContent) { + this.refusalRefundContent = refusalRefundContent; + } + public String getExt1() { return ext1; } @@ -373,6 +412,9 @@ public class HighOrder implements Serializable { && (this.getCancelTime() == null ? other.getCancelTime() == null : this.getCancelTime().equals(other.getCancelTime())) && (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime())) && (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks())) + && (this.getRefundTime() == null ? other.getRefundTime() == null : this.getRefundTime().equals(other.getRefundTime())) + && (this.getRefundContent() == null ? other.getRefundContent() == null : this.getRefundContent().equals(other.getRefundContent())) + && (this.getRefusalRefundContent() == null ? other.getRefusalRefundContent() == null : this.getRefusalRefundContent().equals(other.getRefusalRefundContent())) && (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())); @@ -403,6 +445,9 @@ public class HighOrder implements Serializable { result = prime * result + ((getCancelTime() == null) ? 0 : getCancelTime().hashCode()); result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().hashCode()); result = prime * result + ((getRemarks() == null) ? 0 : getRemarks().hashCode()); + result = prime * result + ((getRefundTime() == null) ? 0 : getRefundTime().hashCode()); + result = prime * result + ((getRefundContent() == null) ? 0 : getRefundContent().hashCode()); + result = prime * result + ((getRefusalRefundContent() == null) ? 0 : getRefusalRefundContent().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()); @@ -436,6 +481,9 @@ public class HighOrder implements Serializable { sb.append(", cancelTime=").append(cancelTime); sb.append(", finishTime=").append(finishTime); sb.append(", remarks=").append(remarks); + sb.append(", refundTime=").append(refundTime); + sb.append(", refundContent=").append(refundContent); + sb.append(", refusalRefundContent=").append(refusalRefundContent); sb.append(", ext1=").append(ext1); sb.append(", ext2=").append(ext2); sb.append(", ext3=").append(ext3); @@ -443,4 +491,4 @@ public class HighOrder implements Serializable { sb.append("]"); return sb.toString(); } -} +} \ No newline at end of file diff --git a/hai-service/src/main/java/com/hai/entity/HighOrderExample.java b/hai-service/src/main/java/com/hai/entity/HighOrderExample.java index acb7cdcf..e95890a8 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOrderExample.java +++ b/hai-service/src/main/java/com/hai/entity/HighOrderExample.java @@ -1446,6 +1446,206 @@ public class HighOrderExample { return (Criteria) this; } + public Criteria andRefundTimeIsNull() { + addCriterion("refund_time is null"); + return (Criteria) this; + } + + public Criteria andRefundTimeIsNotNull() { + addCriterion("refund_time is not null"); + return (Criteria) this; + } + + public Criteria andRefundTimeEqualTo(Date value) { + addCriterion("refund_time =", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeNotEqualTo(Date value) { + addCriterion("refund_time <>", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeGreaterThan(Date value) { + addCriterion("refund_time >", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeGreaterThanOrEqualTo(Date value) { + addCriterion("refund_time >=", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeLessThan(Date value) { + addCriterion("refund_time <", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeLessThanOrEqualTo(Date value) { + addCriterion("refund_time <=", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeIn(List values) { + addCriterion("refund_time in", values, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeNotIn(List values) { + addCriterion("refund_time not in", values, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeBetween(Date value1, Date value2) { + addCriterion("refund_time between", value1, value2, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeNotBetween(Date value1, Date value2) { + addCriterion("refund_time not between", value1, value2, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundContentIsNull() { + addCriterion("refund_content is null"); + return (Criteria) this; + } + + public Criteria andRefundContentIsNotNull() { + addCriterion("refund_content is not null"); + return (Criteria) this; + } + + public Criteria andRefundContentEqualTo(String value) { + addCriterion("refund_content =", value, "refundContent"); + return (Criteria) this; + } + + public Criteria andRefundContentNotEqualTo(String value) { + addCriterion("refund_content <>", value, "refundContent"); + return (Criteria) this; + } + + public Criteria andRefundContentGreaterThan(String value) { + addCriterion("refund_content >", value, "refundContent"); + return (Criteria) this; + } + + public Criteria andRefundContentGreaterThanOrEqualTo(String value) { + addCriterion("refund_content >=", value, "refundContent"); + return (Criteria) this; + } + + public Criteria andRefundContentLessThan(String value) { + addCriterion("refund_content <", value, "refundContent"); + return (Criteria) this; + } + + public Criteria andRefundContentLessThanOrEqualTo(String value) { + addCriterion("refund_content <=", value, "refundContent"); + return (Criteria) this; + } + + public Criteria andRefundContentLike(String value) { + addCriterion("refund_content like", value, "refundContent"); + return (Criteria) this; + } + + public Criteria andRefundContentNotLike(String value) { + addCriterion("refund_content not like", value, "refundContent"); + return (Criteria) this; + } + + public Criteria andRefundContentIn(List values) { + addCriterion("refund_content in", values, "refundContent"); + return (Criteria) this; + } + + public Criteria andRefundContentNotIn(List values) { + addCriterion("refund_content not in", values, "refundContent"); + return (Criteria) this; + } + + public Criteria andRefundContentBetween(String value1, String value2) { + addCriterion("refund_content between", value1, value2, "refundContent"); + return (Criteria) this; + } + + public Criteria andRefundContentNotBetween(String value1, String value2) { + addCriterion("refund_content not between", value1, value2, "refundContent"); + return (Criteria) this; + } + + public Criteria andRefusalRefundContentIsNull() { + addCriterion("refusal_refund_content is null"); + return (Criteria) this; + } + + public Criteria andRefusalRefundContentIsNotNull() { + addCriterion("refusal_refund_content is not null"); + return (Criteria) this; + } + + public Criteria andRefusalRefundContentEqualTo(String value) { + addCriterion("refusal_refund_content =", value, "refusalRefundContent"); + return (Criteria) this; + } + + public Criteria andRefusalRefundContentNotEqualTo(String value) { + addCriterion("refusal_refund_content <>", value, "refusalRefundContent"); + return (Criteria) this; + } + + public Criteria andRefusalRefundContentGreaterThan(String value) { + addCriterion("refusal_refund_content >", value, "refusalRefundContent"); + return (Criteria) this; + } + + public Criteria andRefusalRefundContentGreaterThanOrEqualTo(String value) { + addCriterion("refusal_refund_content >=", value, "refusalRefundContent"); + return (Criteria) this; + } + + public Criteria andRefusalRefundContentLessThan(String value) { + addCriterion("refusal_refund_content <", value, "refusalRefundContent"); + return (Criteria) this; + } + + public Criteria andRefusalRefundContentLessThanOrEqualTo(String value) { + addCriterion("refusal_refund_content <=", value, "refusalRefundContent"); + return (Criteria) this; + } + + public Criteria andRefusalRefundContentLike(String value) { + addCriterion("refusal_refund_content like", value, "refusalRefundContent"); + return (Criteria) this; + } + + public Criteria andRefusalRefundContentNotLike(String value) { + addCriterion("refusal_refund_content not like", value, "refusalRefundContent"); + return (Criteria) this; + } + + public Criteria andRefusalRefundContentIn(List values) { + addCriterion("refusal_refund_content in", values, "refusalRefundContent"); + return (Criteria) this; + } + + public Criteria andRefusalRefundContentNotIn(List values) { + addCriterion("refusal_refund_content not in", values, "refusalRefundContent"); + return (Criteria) this; + } + + public Criteria andRefusalRefundContentBetween(String value1, String value2) { + addCriterion("refusal_refund_content between", value1, value2, "refusalRefundContent"); + return (Criteria) this; + } + + public Criteria andRefusalRefundContentNotBetween(String value1, String value2) { + addCriterion("refusal_refund_content not between", value1, value2, "refusalRefundContent"); + return (Criteria) this; + } + public Criteria andExt1IsNull() { addCriterion("ext_1 is null"); return (Criteria) this; diff --git a/hai-service/src/main/java/com/hai/model/HighOrderModel.java b/hai-service/src/main/java/com/hai/model/HighOrderModel.java index a8b45258..deb7e2bd 100644 --- a/hai-service/src/main/java/com/hai/model/HighOrderModel.java +++ b/hai-service/src/main/java/com/hai/model/HighOrderModel.java @@ -5,6 +5,7 @@ import java.util.Date; public class HighOrderModel { + private Long orderId; private String merchantName; private String goodsType; private String goodsName; @@ -25,6 +26,59 @@ public class HighOrderModel { private Date createTime; private Date payTime; private Date cancelTime; + private Date refundTime; + private String refundContent; + private String refusalRefundContent; + private Integer goodsTypeId; + private Integer orderStatusId; + + public Long getOrderId() { + return orderId; + } + + public void setOrderId(Long orderId) { + this.orderId = orderId; + } + + public Integer getOrderStatusId() { + return orderStatusId; + } + + public void setOrderStatusId(Integer orderStatusId) { + this.orderStatusId = orderStatusId; + } + + public Date getRefundTime() { + return refundTime; + } + + public void setRefundTime(Date refundTime) { + this.refundTime = refundTime; + } + + public String getRefundContent() { + return refundContent; + } + + public void setRefundContent(String refundContent) { + this.refundContent = refundContent; + } + + public String getRefusalRefundContent() { + return refusalRefundContent; + } + + public void setRefusalRefundContent(String refusalRefundContent) { + this.refusalRefundContent = refusalRefundContent; + } + + public Integer getGoodsTypeId() { + return goodsTypeId; + } + + public void setGoodsTypeId(Integer goodsTypeId) { + this.goodsTypeId = goodsTypeId; + } public String getMerchantName() { return merchantName; diff --git a/hai-service/src/main/java/com/hai/service/HighOrderService.java b/hai-service/src/main/java/com/hai/service/HighOrderService.java index 8f40495f..5cb0e4d9 100644 --- a/hai-service/src/main/java/com/hai/service/HighOrderService.java +++ b/hai-service/src/main/java/com/hai/service/HighOrderService.java @@ -22,6 +22,12 @@ public interface HighOrderService { **/ void insertOrder(HighOrder highOrder) throws Exception; + /** + * 修子订单信息 + * @param highChildOrder + */ + void updateChildOrder(HighChildOrder highChildOrder); + /** * @Author 胡锐 * @Description 金币支付订单 @@ -36,6 +42,12 @@ public interface HighOrderService { **/ void updateOrder(HighOrder highOrder); + /** + * 修改订单详情 + * @param highOrder + */ + void updateOrderDetail(HighOrder highOrder); + /** * @Author 胡锐 * @Description 获取未完成的子订单数量 @@ -105,6 +117,8 @@ public interface HighOrderService { * @return */ List getGoodsOrderModelList(Map map) throws Exception; + + List getGasOrderModelList(Map map) throws Exception; /** * @Author 胡锐 * @Description 查询需要关闭的订单列表 diff --git a/hai-service/src/main/java/com/hai/service/impl/BsCompanyServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsCompanyServiceImpl.java index 5e8dc888..83116e60 100644 --- a/hai-service/src/main/java/com/hai/service/impl/BsCompanyServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/BsCompanyServiceImpl.java @@ -12,6 +12,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -45,7 +46,9 @@ public class BsCompanyServiceImpl implements BsCompanyService { List companyList = bsCompanyMapper.selectByExample(example); if (companyList != null && companyList.size() != 0) { for (BsCompany company : companyList) { - company.setRegionName(commonService.getRegionName(Long.valueOf(company.getRegionId()))); + if (StringUtils.isNotBlank(company.getRegionId())) { + company.setRegionName(commonService.getRegionName(Long.valueOf(company.getRegionId()))); + } } } return companyList; @@ -93,7 +96,9 @@ public class BsCompanyServiceImpl implements BsCompanyService { @Override public List getCompany(Map map) { - return null; + BsCompanyExample example = new BsCompanyExample(); + example.createCriteria().andStatusNotEqualTo(0); + return bsCompanyMapper.selectByExample(example); } @Override diff --git a/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java index ba5e8b4d..711cb97e 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighMerchantServiceImpl.java @@ -124,6 +124,11 @@ public class HighMerchantServiceImpl implements HighMerchantService { criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); } + // todo + if (MapUtils.getBoolean(map, "ext1") == true) { + criteria.andExt1IsNull(); + } + example.setOrderByClause("create_time desc"); return highMerchantMapper.selectByExample(example); } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index eb015a55..003dd7f2 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -14,6 +14,8 @@ import com.hai.model.HighOrderData; import com.hai.model.HighOrderModel; import com.hai.service.*; import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.util.StringUtil; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -22,6 +24,7 @@ import javax.annotation.Resource; import java.io.File; import java.math.BigDecimal; import java.util.*; +import java.util.stream.Collectors; /** * @Auther: 胡锐 @@ -135,6 +138,11 @@ public class HighOrderServiceImpl implements HighOrderService { } } + @Override + public void updateChildOrder(HighChildOrder highChildOrder) { + highChildOrderMapper.updateByPrimaryKey(highChildOrder); + } + @Override @Transactional(propagation= Propagation.REQUIRES_NEW) public void goldPayOrder(Long userId, Long orderId) { @@ -205,6 +213,11 @@ public class HighOrderServiceImpl implements HighOrderService { } } + @Override + public void updateOrderDetail(HighOrder highOrder) { + highOrderMapper.updateByPrimaryKey(highOrder); + } + @Override public Integer getUndoneChildOrder(Long orderId) { HighOrder order = getOrderById(orderId); @@ -316,8 +329,13 @@ public class HighOrderServiceImpl implements HighOrderService { criteria.andMemIdEqualTo(MapUtils.getLong(map, "memId")); } - if (MapUtils.getInteger(map, "status") != null) { - criteria.andOrderStatusEqualTo(MapUtils.getInteger(map, "status")); + if (StringUtils.isNotBlank(MapUtils.getString(map, "status"))) { + String[] statuses = MapUtils.getString(map, "status").split(","); + List list = new ArrayList<>(); + for (String status : statuses) { + list.add(Integer.parseInt(status)); + } + criteria.andOrderStatusIn(list); } if (MapUtils.getString(map, "orderNo") != null) { @@ -352,6 +370,19 @@ public class HighOrderServiceImpl implements HighOrderService { return highOrderMapper.selectGoodsOrderList(map); } + @Override + public List getGasOrderModelList(Map map) throws Exception { + if(MapUtils.getLong(map, "payTimeS") != null) { + map.put("payTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "payTimeS")), "yyyy-MM-dd HH:mm:ss")); + } + + if(MapUtils.getLong(map, "payTimeE") != null) { + map.put("payTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "payTimeE")), "yyyy-MM-dd HH:mm:ss")); + } + + return highOrderMapper.selectGasOrderList(map); + } + @Override public List getCloseOrder() { return highOrderMapperExt.getCloseOrder(); diff --git a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java index fefa5504..c923d44a 100644 --- a/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java @@ -7,8 +7,11 @@ import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.WxUtils; +import com.hai.config.TuanYouConfig; +import com.hai.dao.HighGasOrderPushMapper; import com.hai.dao.HighUserCouponMapper; import com.hai.entity.*; +import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResultProfitSharing; import com.hai.service.*; import com.hai.service.pay.PayService; @@ -47,6 +50,9 @@ public class GoodsOrderServiceImpl implements PayService { @Resource private HighOrderService highOrderService; + @Resource + private HighGasOrderPushMapper highGasOrderPushMapper; + @Resource private HighCouponService highCouponService; @@ -59,6 +65,9 @@ public class GoodsOrderServiceImpl implements PayService { @Resource private HighUserCouponMapper highUserCouponMapper; + @Resource + private HighMerchantStoreService highMerchantStoreService; + @Resource private HighProfitSharingRecordService highProfitSharingRecordService; @@ -125,6 +134,37 @@ public class GoodsOrderServiceImpl implements PayService { Integer goldNum = new BigDecimal(highChildOrder.getTotalPrice().toString()).multiply(new BigDecimal("100")).intValue(); highUserService.goldHandle(highChildOrder.getGoodsId(), goldNum, 1, 1, highChildOrder.getId()); } + + if (highChildOrder.getGoodsType() == 3) { + highChildOrder.setChildOrdeStatus(3); + HighMerchantStoreModel store = highMerchantStoreService.getMerchantStoreById(highChildOrder.getGoodsId()); + // 推送团油订单 + Map paramMap = new HashMap<>(); + paramMap.put("gasId", store.getStoreKey()); + paramMap.put("oilNo", highChildOrder.getGasOilNo()); + paramMap.put("gunNo", highChildOrder.getGasGunNo()); + BigDecimal priceGun = highChildOrder.getGasPriceGun(); + BigDecimal priceVip = highChildOrder.getGasPriceVip(); + paramMap.put("priceGun", priceGun); // 枪单价 + paramMap.put("priceVip", priceVip); // 优惠价 + paramMap.put("driverPhone", order.getMemPhone()); + paramMap.put("thirdSerialNo", order.getOrderNo()); + paramMap.put("refuelingAmount", highChildOrder.getGoodsActualPrice()); + + JSONObject orderPushObject = TuanYouConfig.refuelingOrderPush(paramMap); + System.out.println(orderPushObject.toJSONString()); + // 推送团油订单记录 + HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); + highGasOrderPush.setCreateTime(new Date()); + highGasOrderPush.setCode(orderPushObject.getString("code")); + highGasOrderPush.setRequestContent(JSONObject.toJSONString(paramMap)); + highGasOrderPush.setReturnContent(orderPushObject.toJSONString()); + highGasOrderPushMapper.insert(highGasOrderPush); + + if (orderPushObject != null && orderPushObject.getString("code").equals("200")) { + highChildOrder.setGasOrderNo(orderPushObject.getJSONObject("result").getString("orderNo")); + } + } } highOrderService.updateOrder(order); @@ -141,9 +181,6 @@ public class GoodsOrderServiceImpl implements PayService { // 计算分账金额 手续费后的价格 * 0.01 注:如果与两个相邻数字的距离相等,则为上舍入的舍入模式。 BigDecimal profitSharingAmount = price.multiply(rake).setScale(2,BigDecimal.ROUND_DOWN); this.wxProfitsharing(order.getPaySerialNo(),order.getOrderNo(),profitSharingAmount); - - - } catch (InterruptedException e) { e.printStackTrace(); } diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties new file mode 100644 index 00000000..5ef1ac20 --- /dev/null +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -0,0 +1,5 @@ +tuanYouUrl=https://test02-motorcade-hcs.czb365.com +tuanYouAppKey=208241666939552 +tuanYouAppSecret=adecc3cff077834cb8632c8ab3bec0e6 + +wx_cert=/home/project/wx_cert/ \ 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 new file mode 100644 index 00000000..85a33fc2 --- /dev/null +++ b/hai-service/src/main/resources/prod/commonConfig.properties @@ -0,0 +1,5 @@ +tuanYouUrl=https://test04-motorcade-hcs.czb365.com +tuanYouAppKey=208241666939552 +tuanYouAppSecret=adecc3cff077834cb8632c8ab3bec0e6 + +wx_cert=/home/project/wx_cert/ \ No newline at end of file