From 94eb93864474e0d5f1600d67d441841ab5413764 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Thu, 25 Nov 2021 22:40:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8F=8A=E8=B5=A0=E5=88=B8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/bweb/config/AuthConfig.java | 2 + .../HighCouponPackageController.java | 176 ++++++++++++++++++ .../controller/HighDiscountController.java | 2 +- .../controller/HighOpenApiController.java | 77 ++++++++ .../bweb/controller/HighTestController.java | 2 +- .../bweb/controller/TuanYouController.java | 16 -- .../config/HuiLianTongUnionCardConfig.java | 31 +++ .../hai/dao/HighDiscountUserRelMapperExt.java | 35 +++- .../model/HighUserDiscountUnicomModel.java | 137 ++++++++++++++ .../HighCouponPackageDetailsService.java | 58 ++++++ .../hai/service/HighCouponPackageService.java | 59 ++++++ .../com/hai/service/HighOpenApiService.java | 20 ++ .../HighCouponPackageDetailsServiceImpl.java | 56 ++++++ .../impl/HighCouponPackageServiceImpl.java | 74 ++++++++ .../service/impl/HighOpenApiServiceImpl.java | 29 +++ .../resources/dev/commonConfig.properties | 4 +- 16 files changed, 757 insertions(+), 21 deletions(-) create mode 100644 hai-bweb/src/main/java/com/bweb/controller/HighCouponPackageController.java create mode 100644 hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java create mode 100644 hai-service/src/main/java/com/hai/model/HighUserDiscountUnicomModel.java create mode 100644 hai-service/src/main/java/com/hai/service/HighCouponPackageDetailsService.java create mode 100644 hai-service/src/main/java/com/hai/service/HighCouponPackageService.java create mode 100644 hai-service/src/main/java/com/hai/service/HighOpenApiService.java create mode 100644 hai-service/src/main/java/com/hai/service/impl/HighCouponPackageDetailsServiceImpl.java create mode 100644 hai-service/src/main/java/com/hai/service/impl/HighCouponPackageServiceImpl.java create mode 100644 hai-service/src/main/java/com/hai/service/impl/HighOpenApiServiceImpl.java diff --git a/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java b/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java index 97be7a1f..b77c63f9 100644 --- a/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java +++ b/hai-bweb/src/main/java/com/bweb/config/AuthConfig.java @@ -96,6 +96,8 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/coupon/getGuizhouSinopec") .excludePathPatterns("/cmsContent/get*") .excludePathPatterns("/highGoldRec/*") + .excludePathPatterns("/test/*") + .excludePathPatterns("/openApi/*") ; } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighCouponPackageController.java b/hai-bweb/src/main/java/com/bweb/controller/HighCouponPackageController.java new file mode 100644 index 00000000..a8a1e341 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighCouponPackageController.java @@ -0,0 +1,176 @@ +package com.bweb.controller; + +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.ResponseMsgUtil; +import com.hai.entity.HighCouponPackage; +import com.hai.entity.HighOrderPre; +import com.hai.model.ResponseData; +import com.hai.model.UserInfoModel; +import com.hai.service.HighCouponPackageService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.models.auth.In; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +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.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * @Author Sum1Dream + * @ClassName HighCouponPackageController + * @Description // 优惠券包接口 + * @Date 2021/11/25 4:32 下午 + **/ +@Controller +@RequestMapping(value = "/highCouponPackage") +@Api(value = "优惠券包接口") +public class HighCouponPackageController { + + private static Logger log = LoggerFactory.getLogger(HighOrderPreController.class); + + @Autowired + private UserCenter userCenter; + + @Resource + private HighCouponPackageService highCouponPackageService; + + @RequestMapping(value = "/getCouponPackageList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取优惠券包列表") + public ResponseData getCouponPackageList(@RequestParam(name = "usingAttribution", required = false) Integer usingAttribution, + @RequestParam(name = "title", required = false) String title, + @RequestParam(name = "salesType", required = false) Integer salesType, + @RequestParam(name = "status", required = false) Integer status, + @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<>(); + + map.put("companyId", userInfoModel.getBsCompany().getId()); + map.put("usingAttribution", usingAttribution); + map.put("title" , title); + map.put("salesType" , salesType); + map.put("status" , status); + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highCouponPackageService.getCouponPackageList(map))); + + } catch (Exception e) { + log.error("HighOrderController --> getUserOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value = "/highCouponPackageInfo", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "新增优惠券包基本信息") + public ResponseData highCouponPackageInfo(@RequestBody HighCouponPackage highCouponPackage, HttpServletRequest request) { + try { + + //发布人员 + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + + if (StringUtils.isBlank(highCouponPackage.getTitle()) + || highCouponPackage.getUsingAttribution() == null + || highCouponPackage.getSalesType() == null + || highCouponPackage.getEffectiveTiem() == null + || highCouponPackage.getPurchaseNum() == null + || highCouponPackage.getPrice() == null + || StringUtils.isBlank(highCouponPackage.getBannerImg()) + || StringUtils.isBlank(highCouponPackage.getListImg()) + || StringUtils.isBlank(highCouponPackage.getDetailsImg()) + ) { + log.error("HighAgentController -> insertAgent() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + if (userInfoModel.getBsCompany() == null) { + log.error("highCouponPackage -> highCouponPackageInfo() error!","该主角色没有权限"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); + } + + highCouponPackage.setCompanyId(userInfoModel.getBsCompany().getId().intValue()); + highCouponPackage.setStatus(3); + highCouponPackage.setCreatedTime(new Date()); + highCouponPackage.setCreatedUserId(userInfoModel.getSecUser().getId().intValue()); + highCouponPackage.setUpdatedTime(new Date()); + highCouponPackage.setUpdatedUserId(userInfoModel.getSecUser().getId().intValue()); + + highCouponPackageService.insertCouponPackage(highCouponPackage); + + return ResponseMsgUtil.success(highCouponPackage); + + } catch (Exception e) { + log.error("HighAgentController --> insertAgent() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/highCouponPackageRule", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "新增优惠券包基本信息") + public ResponseData highCouponPackageRule(@RequestBody HighCouponPackage highCouponPackage, HttpServletRequest request) { + try { + //发布人员 + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + + + if (StringUtils.isBlank(highCouponPackage.getTitle()) + || highCouponPackage.getUsingAttribution() == null + || highCouponPackage.getSalesType() == null + || highCouponPackage.getEffectiveTiem() == null + || highCouponPackage.getPurchaseNum() == null + || highCouponPackage.getPrice() == null + || StringUtils.isBlank(highCouponPackage.getBannerImg()) + || StringUtils.isBlank(highCouponPackage.getListImg()) + || StringUtils.isBlank(highCouponPackage.getDetailsImg()) + ) { + log.error("HighAgentController -> insertAgent() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + if (userInfoModel.getBsCompany() == null) { + log.error("highCouponPackage -> highCouponPackageInfo() error!","该主角色没有权限"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); + } + + highCouponPackage.setCompanyId(userInfoModel.getBsCompany().getId().intValue()); + highCouponPackage.setStatus(3); + highCouponPackage.setCreatedTime(new Date()); + highCouponPackage.setCreatedUserId(userInfoModel.getSecUser().getId().intValue()); + highCouponPackage.setUpdatedTime(new Date()); + highCouponPackage.setUpdatedUserId(userInfoModel.getSecUser().getId().intValue()); + + highCouponPackageService.insertCouponPackage(highCouponPackage); + + return ResponseMsgUtil.success(highCouponPackage); + + } catch (Exception e) { + log.error("HighAgentController --> insertAgent() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java index bb6f084c..03cc9c83 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighDiscountController.java @@ -47,7 +47,6 @@ public class HighDiscountController { @Resource private HighDiscountService highDiscountService; - @RequestMapping(value="/insertDiscount",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "增加优惠券") @@ -64,6 +63,7 @@ public class HighDiscountController { || highDiscount.getDiscountType() == null || highDiscount.getDiscountPrice() == null || highDiscount.getEffectiveDay() == null + || highDiscount.getUsingRange() == null || highDiscount.getSalesEndTime() == null) { log.error("HighDiscountController -> insertDiscount() error!","参数错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java new file mode 100644 index 00000000..164168ec --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOpenApiController.java @@ -0,0 +1,77 @@ +package com.bweb.controller; + +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.utils.ResponseMsgUtil; +import com.hai.entity.HighUser; +import com.hai.model.ResponseData; +import com.hai.service.HighOpenApiService; +import com.hai.service.HighUserService; +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.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 java.text.SimpleDateFormat; +import java.util.HashMap; +import java.util.Map; + +/** + * @Author Sum1Dream + * @ClassName HighOpenApiController + * @Description // 开放接口 + * @Date 2021/11/24 4:49 下午 + **/ +@Controller +@RequestMapping(value = "/openApi") +@Api(value = "开放接口") +public class HighOpenApiController { + + private static Logger log = LoggerFactory.getLogger(HighOrderPreController.class); + + @Resource + private HighOpenApiService highOpenApiService; + + @Resource + private HighUserService highUserService; + + @RequestMapping(value = "/getUserOrderPreList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取用户预约订单") + public ResponseData getUserOrderPreList(@RequestParam(name = "usingAttribution", required = false) Integer usingAttribution, + @RequestParam(name = "phone", required = true) String phone, + @RequestParam(name = "year", required = false) String year) { + try { + + HighUser highUser = highUserService.findByPhone(phone); + + if (highUser == null || highUser.getStatus() == 0) { + log.error("getUserOrderPreList error!", "未找到用户"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前手机号暂无用户"); + } + + Map map = new HashMap<>(); + map.put("userId", highUser.getId()); + map.put("usingAttribution", usingAttribution); + if (year != null) { + map.put("createTimeS", year + "-01-01 00:00:00"); + map.put("createTimeE", year + "-12-31 23:59:59"); + } + + return ResponseMsgUtil.success(highOpenApiService.getUserCouponsList(map)); + + } catch (Exception e) { + log.error("HighOrderController --> getUserPreOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } +} diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java index 697c01d6..48d826db 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighTestController.java @@ -1 +1 @@ -package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResponseData; import com.hai.model.ResultProfitSharing; import com.hai.service.*; import io.swagger.annotations.Api; 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.beans.BeanUtils; 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.net.ssl.SSLContext; import java.io.FileInputStream; import java.math.BigDecimal; import java.security.KeyStore; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @Resource private HighMerchantService highMerchantService; @Resource private HighMerchantStoreService highMerchantStoreService; @Resource private HighGasOilPriceService highGasOilPriceService; @Resource private HighOrderService highOrderService; @Resource private HighProfitSharingRecordService highProfitSharingRecordService; @Resource private HighGasOrderPushMapper highGasOrderPushMapper; @Resource private HuiLianTongConfig huiLianTongConfig; @Resource private UnionPayConfig unionPayConfig; @RequestMapping(value = "/getBackendToken", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取访问令牌backendToken") public ResponseData getBackendToken() { try { return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file +package com.bweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.XmlUtil; import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.utils.ResponseMsgUtil; import com.hai.common.utils.WxUtils; import com.hai.config.*; import com.hai.dao.HighGasOrderPushMapper; import com.hai.entity.*; import com.hai.model.HighMerchantModel; import com.hai.model.HighMerchantStoreModel; import com.hai.model.ResponseData; import com.hai.model.ResultProfitSharing; import com.hai.service.*; import io.swagger.annotations.Api; 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.beans.BeanUtils; 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.net.ssl.SSLContext; import java.io.FileInputStream; import java.math.BigDecimal; import java.security.KeyStore; import java.util.*; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/26 23:08 */ @Controller @RequestMapping(value = "/test") @Api(value = "订单接口") public class HighTestController { private static Logger log = LoggerFactory.getLogger(HighTestController.class); @RequestMapping(value = "/getBackendToken", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取访问令牌backendToken") public ResponseData getBackendToken() { try { return ResponseMsgUtil.success(null); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/TCheckEMsgUnionCardVipRights", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "请求会员体系") public ResponseData TCheckEMsgUnionCardVipRights(@RequestParam(name = "phone", required = true) String phone) { try { JSONObject consumptionRecord = HuiLianTongUnionCardConfig.TCheckEMsgUnionCardVipRights(phone); return ResponseMsgUtil.success(consumptionRecord); } catch (Exception e) { log.error("HighOrderController --> getBackendToken() error!", e); return ResponseMsgUtil.exception(e); } } @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "解析") public ResponseData resolveResponse( @RequestParam(name = "data", required = false) String data ) { try { JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); return ResponseMsgUtil.success(cardInfoObject); } catch (Exception e) { log.error("getUserByTelephone",e); return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/hai-bweb/src/main/java/com/bweb/controller/TuanYouController.java b/hai-bweb/src/main/java/com/bweb/controller/TuanYouController.java index ed2b8353..763e1449 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/TuanYouController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/TuanYouController.java @@ -61,22 +61,6 @@ public class TuanYouController { } } - @RequestMapping(value="/resolveResponse",method = RequestMethod.GET) - @ResponseBody - @ApiOperation(value = "解析") - public ResponseData resolveResponse( - @RequestParam(name = "data", required = false) String data - ) { - try { - JSONObject cardInfoObject = HuiLianTongUnionCardConfig.resolveResponse(data); - return ResponseMsgUtil.success(cardInfoObject); - - } catch (Exception e) { - log.error("getUserByTelephone",e); - return ResponseMsgUtil.exception(e); - } - } - @RequestMapping(value="/queryCardInfo",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询") diff --git a/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java b/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java index e92b2393..b620ef50 100644 --- a/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java +++ b/hai-service/src/main/java/com/hai/config/HuiLianTongUnionCardConfig.java @@ -6,10 +6,12 @@ import com.hai.common.exception.ErrorCode; import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.pay.util.MD5Util; +import com.hai.common.pay.util.sdk.WXPayConstants; import com.hai.common.security.DesUtil; import com.hai.common.utils.DateUtil; import com.hai.common.utils.HttpsUtils; +import com.hai.common.utils.WxUtils; import org.apache.commons.collections4.MapUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -91,6 +93,34 @@ public class HuiLianTongUnionCardConfig { } + /** + * @Author Sum1Dream + * @name TCheckEMsgUnionCardVipRights.java + * @Description // 会员体系接口 + * @Date 11:29 上午 2021/11/24 + * @Param [java.lang.String] + * @return com.alibaba.fastjson.JSONObject + */ + public static JSONObject TCheckEMsgUnionCardVipRights(String phone) { + try { + Map map = new HashMap<>(); + map.put("phone" , phone); + // 签名码 + String signCode = CommonSysConst.getSysConfig().getHuiLianTongUnionCardSignCode(); + map.put("appId", signCode); + + Map dataMap = new HashMap<>(); + dataMap.put("phone" , phone); + dataMap.put("appId", signCode); + // Md5加密 + dataMap.put("sign", WxUtils.generateSignature(map, "621=@=HSG!Business#Controller!" , WXPayConstants.SignType.MD5)); + return request("tetcextra/TCheckEMsgUnionCardVipRights" , dataMap); + + } catch (Exception e) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_TIMED_OUT, ""); + } + } + /** * 支付 * @param orderNo 订单号 @@ -134,6 +164,7 @@ public class HuiLianTongUnionCardConfig { return request("qtk/refund", dataMap); } + /** * 会员卡业务请求 * @param method 接口名称 diff --git a/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapperExt.java index 4f5251bf..45cd8278 100644 --- a/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighDiscountUserRelMapperExt.java @@ -1,7 +1,40 @@ package com.hai.dao; +import com.hai.model.HighOrderPreModel; +import com.hai.model.HighUserDiscountUnicomModel; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; +import java.util.Map; + /** * mapper扩展类 */ public interface HighDiscountUserRelMapperExt { -} \ No newline at end of file + + + @Select({""}) + List getUserCouponsList(@Param("map") Map map); +} diff --git a/hai-service/src/main/java/com/hai/model/HighUserDiscountUnicomModel.java b/hai-service/src/main/java/com/hai/model/HighUserDiscountUnicomModel.java new file mode 100644 index 00000000..323c9448 --- /dev/null +++ b/hai-service/src/main/java/com/hai/model/HighUserDiscountUnicomModel.java @@ -0,0 +1,137 @@ +package com.hai.model; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Date; + +public class HighUserDiscountUnicomModel { + /** + * id + */ + private Integer id; + + /** + * 使用归属 + */ + private Integer usingAttribution; + + /** + * 状态 0:已过期 1:未使用 2:已使用 100:删除 + */ + private Integer status; + + /** + * 使用时间 + */ + private Date useTime; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 使用截止时间 + */ + private Date useEndTime; + + /** + * 优惠券名称 + */ + private String discountName; + + /** + * 卡卷类型 1:满减 2:抵扣 3:折扣 + */ + private Integer discountType; + + /** + * 优惠券条件(满减价格) + */ + private BigDecimal discountCondition; + + /** + * 优惠券价格 + */ + private BigDecimal discountPrice; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getUsingAttribution() { + return usingAttribution; + } + + public void setUsingAttribution(Integer usingAttribution) { + this.usingAttribution = usingAttribution; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Date getUseTime() { + return useTime; + } + + public void setUseTime(Date useTime) { + this.useTime = useTime; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUseEndTime() { + return useEndTime; + } + + public void setUseEndTime(Date useEndTime) { + this.useEndTime = useEndTime; + } + + public String getDiscountName() { + return discountName; + } + + public void setDiscountName(String discountName) { + this.discountName = discountName; + } + + public Integer getDiscountType() { + return discountType; + } + + public void setDiscountType(Integer discountType) { + this.discountType = discountType; + } + + public BigDecimal getDiscountCondition() { + return discountCondition; + } + + public void setDiscountCondition(BigDecimal discountCondition) { + this.discountCondition = discountCondition; + } + + public BigDecimal getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(BigDecimal discountPrice) { + this.discountPrice = discountPrice; + } +} diff --git a/hai-service/src/main/java/com/hai/service/HighCouponPackageDetailsService.java b/hai-service/src/main/java/com/hai/service/HighCouponPackageDetailsService.java new file mode 100644 index 00000000..64e957ba --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighCouponPackageDetailsService.java @@ -0,0 +1,58 @@ +package com.hai.service; + +import com.hai.entity.HighCouponPackage; +import com.hai.entity.HighCouponPackageDetails; + +import java.util.List; +import java.util.Map; + +/** + * @serviceName HighCouponPackageDetailsService.java + * @author Sum1Dream + * @version 1.0.0 + * @Description // 优惠券包详情服务 + * @createTime 3:11 下午 2021/11/25 + **/ +public interface HighCouponPackageDetailsService { + + /** + * @Author Sum1Dream + * @name getCouponPackageDetailsList.java + * @Description // 获取优惠券包详情卢列表 + * @Date 3:35 下午 2021/11/25 + * @Param [java.util.Map] + * @return java.util.List + */ + List getCouponPackageDetailsList(Map map); + + /** + * @Author Sum1Dream + * @name findDetailsById.java + * @Description // 获取详情 + * @Date 3:36 下午 2021/11/25 + * @Param [java.lang.Integer] + * @return com.hai.entity.HighCouponPackageDetails + */ + HighCouponPackageDetails findDetailsById(Integer id); + + /** + * @Author Sum1Dream + * @name insertCouponPackageDetails.java + * @Description // 新增优惠券包详情信息 + * @Date 12:07 下午 2021/11/25 + * @Param [com.hai.entity.HighCouponPackage] + * @return void + */ + void insertCouponPackageDetails(HighCouponPackageDetails highCouponPackageDetails); + + /** + * @Author Sum1Dream + * @name updateCouponPackageDetails.java + * @Description // 更新优惠券包详情信息 + * @Date 12:07 下午 2021/11/25 + * @Param [com.hai.entity.HighCouponPackage] + * @return void + */ + void updateCouponPackageDetails(HighCouponPackageDetails highCouponPackageDetails); + +} diff --git a/hai-service/src/main/java/com/hai/service/HighCouponPackageService.java b/hai-service/src/main/java/com/hai/service/HighCouponPackageService.java new file mode 100644 index 00000000..347113b3 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighCouponPackageService.java @@ -0,0 +1,59 @@ +package com.hai.service; + +import com.hai.entity.HighCouponPackage; +import com.hai.entity.HighOrderPre; + +import java.util.List; +import java.util.Map; + +/** + * @serviceName HighCouponPackageService.java + * @author Sum1Dream + * @version 1.0.0 + * @Description // 优惠券包接口服务 + * @createTime 11:31 上午 2021/11/25 + **/ +public interface HighCouponPackageService { + + /** + * @Author Sum1Dream + * @name getCouponPackageList.java + * @Description // 获取优惠券包列表 + * @Date 11:34 上午 2021/11/25 + * @Param [java.util.Map] + * @return java.util.List + */ + List getCouponPackageList(Map map); + + /** + * @Author Sum1Dream + * @name findCouponPackageById.java + * @Description // + * @Date 11:35 上午 2021/11/25 + * @Param [java.lang.Integer] + * @return com.hai.entity.HighCouponPackage + */ + HighCouponPackage findCouponPackageById(Integer id); + + /** + * @Author Sum1Dream + * @name insertCouponPackage.java + * @Description // 新增优惠券包信息 + * @Date 12:07 下午 2021/11/25 + * @Param [com.hai.entity.HighCouponPackage] + * @return void + */ + void insertCouponPackage(HighCouponPackage highCouponPackage); + + /** + * @Author Sum1Dream + * @name updateCouponPackage.java + * @Description // 新增优惠券包信息 + * @Date 12:07 下午 2021/11/25 + * @Param [com.hai.entity.HighCouponPackage] + * @return void + */ + void updateCouponPackage(HighCouponPackage highCouponPackage); + + +} diff --git a/hai-service/src/main/java/com/hai/service/HighOpenApiService.java b/hai-service/src/main/java/com/hai/service/HighOpenApiService.java new file mode 100644 index 00000000..3c77f6fc --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/HighOpenApiService.java @@ -0,0 +1,20 @@ +package com.hai.service; + +import com.hai.model.HighUserDiscountUnicomModel; + +import java.util.List; +import java.util.Map; + +public interface HighOpenApiService { + + + /** + * @Author Sum1Dream + * @name getUserCouponsList.java + * @Description // 获取用户优惠券 + * @Date 4:45 下午 2021/11/24 + * @Param [java.util.Map] + * @return java.util.List + */ + List getUserCouponsList(Map map); +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponPackageDetailsServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponPackageDetailsServiceImpl.java new file mode 100644 index 00000000..4aaf2e1d --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponPackageDetailsServiceImpl.java @@ -0,0 +1,56 @@ +package com.hai.service.impl; + +import com.hai.dao.HighCouponPackageDetailsMapper; +import com.hai.entity.HighCouponPackageDetails; +import com.hai.entity.HighCouponPackageDetailsExample; +import com.hai.service.HighCouponPackageDetailsService; +import org.apache.commons.collections4.MapUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @serviceName HighCouponPackageDetailsServiceImpl.java + * @author Sum1Dream + * @version 1.0.0 + * @Description // 优惠券详情服务 + * @createTime 3:38 下午 2021/11/25 + **/ +@Service("highCouponPackageDetailsService") +public class HighCouponPackageDetailsServiceImpl implements HighCouponPackageDetailsService { + + @Resource + private HighCouponPackageDetailsMapper highCouponPackageDetailsMapper; + + @Override + public List getCouponPackageDetailsList(Map map) { + + HighCouponPackageDetailsExample example = new HighCouponPackageDetailsExample(); + HighCouponPackageDetailsExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getInteger(map, "couponPackageId") != null) { + criteria.andCouponPackageIdEqualTo(MapUtils.getInteger(map, "couponPackageId")); + } + + criteria.andStatusEqualTo(1); + + return highCouponPackageDetailsMapper.selectByExample(example); + } + + @Override + public HighCouponPackageDetails findDetailsById(Integer id) { + return highCouponPackageDetailsMapper.selectByPrimaryKey(id); + } + + @Override + public void insertCouponPackageDetails(HighCouponPackageDetails highCouponPackageDetails) { + highCouponPackageDetailsMapper.insert(highCouponPackageDetails); + } + + @Override + public void updateCouponPackageDetails(HighCouponPackageDetails highCouponPackageDetails) { + highCouponPackageDetailsMapper.updateByPrimaryKey(highCouponPackageDetails); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponPackageServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponPackageServiceImpl.java new file mode 100644 index 00000000..1898817e --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponPackageServiceImpl.java @@ -0,0 +1,74 @@ +package com.hai.service.impl; + +import com.hai.dao.HighCouponPackageMapper; +import com.hai.entity.HighCouponPackage; +import com.hai.entity.HighCouponPackageExample; +import com.hai.service.HighCouponPackageService; +import org.apache.commons.collections4.MapUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @serviceName HighCouponPackageServiceImpl.java + * @author Sum1Dream + * @version 1.0.0 + * @Description // 优惠券包 接口 + * @createTime 12:21 下午 2021/11/25 + **/ +@Service("highCouponPackageService") +public class HighCouponPackageServiceImpl implements HighCouponPackageService { + + @Resource + private HighCouponPackageMapper highCouponPackageMapper; + + @Override + public List getCouponPackageList(Map map) { + + HighCouponPackageExample example = new HighCouponPackageExample(); + HighCouponPackageExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getInteger(map, "companyId") != null) { + criteria.andCompanyIdEqualTo(MapUtils.getInteger(map, "companyId")); + } + + if (MapUtils.getInteger(map, "usingAttribution") != null) { + criteria.andUsingAttributionEqualTo(MapUtils.getInteger(map, "usingAttribution")); + } + + if (MapUtils.getString(map, "title") != null) { + criteria.andTitleLike("%" + MapUtils.getString(map, "title") + "%"); + } + + if (MapUtils.getInteger(map, "salesType") != null) { + criteria.andSalesTypeEqualTo(MapUtils.getInteger(map, "salesType")); + } + + if (MapUtils.getInteger(map, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); + } else { + criteria.andStatusNotEqualTo(0); + } + + example.setOrderByClause("created_time desc"); + + return highCouponPackageMapper.selectByExample(example); + } + + @Override + public HighCouponPackage findCouponPackageById(Integer id) { + return highCouponPackageMapper.selectByPrimaryKey(id); + } + + @Override + public void insertCouponPackage(HighCouponPackage highCouponPackage) { + highCouponPackageMapper.insert(highCouponPackage); + } + + @Override + public void updateCouponPackage(HighCouponPackage highCouponPackage) { + highCouponPackageMapper.updateByPrimaryKey(highCouponPackage); + } +} diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOpenApiServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOpenApiServiceImpl.java new file mode 100644 index 00000000..6dc2aa30 --- /dev/null +++ b/hai-service/src/main/java/com/hai/service/impl/HighOpenApiServiceImpl.java @@ -0,0 +1,29 @@ +package com.hai.service.impl; + +import com.hai.dao.HighDiscountUserRelMapper; +import com.hai.model.HighUserDiscountUnicomModel; +import com.hai.service.HighOpenApiService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @serviceName HighOpenApiServiceImpl.java + * @author Sum1Dream + * @version 1.0.0 + * @Description // 开放接口服务 + * @createTime 5:01 下午 2021/11/24 + **/ +@Service("OpenApiService") +public class HighOpenApiServiceImpl implements HighOpenApiService { + + @Resource + private HighDiscountUserRelMapper highDiscountUserRelMapper; + + @Override + public List getUserCouponsList(Map map) { + return highDiscountUserRelMapper.getUserCouponsList(map); + } +} diff --git a/hai-service/src/main/resources/dev/commonConfig.properties b/hai-service/src/main/resources/dev/commonConfig.properties index 4b808b08..68b9f23b 100644 --- a/hai-service/src/main/resources/dev/commonConfig.properties +++ b/hai-service/src/main/resources/dev/commonConfig.properties @@ -20,8 +20,8 @@ huiliantongAppsecret=FA28E95ACABFA4B2B8E25857437B07F1 # ???????? HuiLianTongUnionCardUrl=http://hltgz.com:4010/api/v2/execute.json -HuiLianTongUnionCardAccessCode=6FCAE1470CEF465988351BB65ABAA8AE -HuiLianTongUnionCardSignCode=F8E91A3C +HuiLianTongUnionCardAccessCode=19741F626EE446939CE6D448B0FB0EE8 +HuiLianTongUnionCardSignCode=7854B96C # ?????? unionPayUrl=https://open.eycard.cn:8443/WorthTech_Access_AppPaySystemV2/apppayacc