From b3d720bf76b19e6aa449dfaadc762849d71631bc Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Wed, 29 May 2024 15:46:53 +0800 Subject: [PATCH 1/6] Changes --- .../main/java/com/bweb/controller/goods/GoodsController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java b/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java index b68e637..a13e50f 100644 --- a/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java +++ b/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java @@ -119,7 +119,7 @@ public class GoodsController { goodsMsg.setListImg(body.getListImg()); goodsMsg.setBannerImg(body.getBannerImg()); goodsMsg.setDetailImg(body.getDetailImg()); - goodsMsg.setMerId(userModel.getAccount().getId()); + goodsMsg.setMerId(userModel.getAccount().getObjectId()); goodsMsg.setMerName(userModel.getAccount().getUserName()); if (body.getId() != null) { From 82446abe63d8679aef158ecb0762dcc6126ff06a Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Tue, 11 Jun 2024 09:25:24 +0800 Subject: [PATCH 2/6] Changes --- .../controller/goods/GoodsController.java | 32 +++++++++++++++---- .../business/BsOrderGoodsController.java | 2 +- .../service/order/OrderPaySuccessService.java | 14 ++++++-- 3 files changed, 38 insertions(+), 10 deletions(-) diff --git a/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java b/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java index a13e50f..2a45795 100644 --- a/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java +++ b/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java @@ -57,6 +57,9 @@ public class GoodsController { @Resource private UserCenter userCenter; + @Resource + private GoodsUserAddressService deliveryAddressService; + @RequestMapping(value="/editGoodsMsg",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "编辑商品信息") @@ -277,7 +280,7 @@ public class GoodsController { map.put("goodsBrand", goodsBrand); if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { - map.put("merId", userModel.getAccount().getId()); + map.put("merId", userModel.getAccount().getObjectId()); } map.put("type", type); @@ -399,11 +402,6 @@ public class GoodsController { SessionObject sessionObject = userCenter.getSessionObject(request); SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); - if (userModel.getAccount().getObjectType() != SecUserObjectTypeEnum.type2.getCode()) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); - - } - GoodsMsg goodsMsg = goodsMsgService.queryDetail(id); if (goodsMsg.getStatus() == 1) { @@ -441,6 +439,28 @@ public class GoodsController { } + @RequestMapping(value = "/findDeliveryAddressById", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询收货地址详情") + public ResponseData findDeliveryAddressById( + @RequestParam(value = "id", required = true) Long id + ) { + try { + + GoodsUserAddress deliveryAddress = deliveryAddressService.queryDetail(id); + + if (deliveryAddress == null) { + log.error("GoodsDetailController -> findGoodsDetailById() error!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到相信息"); + } + + return ResponseMsgUtil.success(deliveryAddress); + + } catch (Exception e) { + log.error("GoodsDetailController --> findGoodsDetailById() error!", e); + return ResponseMsgUtil.exception(e); + } + } } diff --git a/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java b/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java index c9565e1..1d1b4c5 100644 --- a/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java +++ b/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java @@ -76,7 +76,7 @@ public class BsOrderGoodsController { Map map = new HashMap<>(); if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { - map.put("merId", userModel.getAccount().getId()); + map.put("merId", userModel.getAccount().getObjectId()); } map.put("logisticsNo", logisticsNo); diff --git a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java index 5c37325..566da3e 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java @@ -60,7 +60,7 @@ public class OrderPaySuccessService { for (BsOrderChild childOrder : order.getOrderChildList()) { try { if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) { - goods(order); + goods(order, childOrder); } else if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) { product(order, childOrder); } @@ -184,7 +184,7 @@ public class OrderPaySuccessService { * 实物产品 * @param order */ - public void goods(OrderModel order) throws Exception { + public void goods(OrderModel order, BsOrderChild childOrder) throws Exception { BsOrderGoods goodsOrder = bsOrderGoodsService.findGoodsOrder(order.getOrderNo()); if (goodsOrder == null) { @@ -193,7 +193,15 @@ public class OrderPaySuccessService { goodsMsgService.editSaleNum(goodsOrder.getGoodsId() , goodsOrder.getGoodsCount() , 1); - + goodsOrder.setTotalPrice(childOrder.getProductTotalPrice()); + goodsOrder.setTotalDeductionPrice(childOrder.getTotalDeductionPrice()); + goodsOrder.setCouponDiscountPrice(childOrder.getCouponDiscountPrice()); + goodsOrder.setIntegralDiscountPrice(childOrder.getIntegralDiscountPrice()); + goodsOrder.setPayRealPrice(childOrder.getSurplusRefundPrice()); + goodsOrder.setPayChannel(order.getPayChannel()); + goodsOrder.setPayType(order.getPayType()); + goodsOrder.setPaySerialNo(order.getPaySerialNo()); + goodsOrder.setPayTime(order.getPayTime()); goodsOrder.setUpdateTime(new Date()); goodsOrder.setStatus(1); bsOrderGoodsService.update(goodsOrder); From f64a20009dcbb6c56c8d3603bf89300f1d72fdc3 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Tue, 11 Jun 2024 09:27:05 +0800 Subject: [PATCH 3/6] Changes --- .../main/java/com/hfkj/mer/impl/BsMerPayConfigServiceImpl.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/service/src/main/java/com/hfkj/mer/impl/BsMerPayConfigServiceImpl.java b/service/src/main/java/com/hfkj/mer/impl/BsMerPayConfigServiceImpl.java index 8819b6c..c553ae0 100644 --- a/service/src/main/java/com/hfkj/mer/impl/BsMerPayConfigServiceImpl.java +++ b/service/src/main/java/com/hfkj/mer/impl/BsMerPayConfigServiceImpl.java @@ -3,15 +3,12 @@ package com.hfkj.mer.impl; import com.hfkj.dao.BsMerPayConfigMapper; import com.hfkj.entity.BsMerPayConfig; import com.hfkj.entity.BsMerPayConfigExample; -import com.hfkj.entity.GoodsMsg; import com.hfkj.mer.BsMerPayConfigService; import com.hfkj.sysenum.mer.PayPlatformEnum; import org.apache.commons.collections4.MapUtils; -import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.Collections; import java.util.Date; import java.util.List; import java.util.Map; From cc12f6a33dc76030ccb3a2e72de3507a55cdfdb6 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Mon, 17 Jun 2024 17:03:02 +0800 Subject: [PATCH 4/6] Changes --- .../controller/goods/GoodsController.java | 3 + .../main/java/com/cweb/config/AuthConfig.java | 1 + .../com/cweb/controller/CommonController.java | 42 ++++ .../controller/qianZhu/CinemaController.java | 185 ++++++++++++++++++ order/src/main/resources/dev/logback.xml | 22 +++ .../java/com/hfkj/config/CommonSysConfig.java | 7 + .../hfkj/qianzhu/channel/CinemaService.java | 141 +++++++++++++ .../hfkj/qianzhu/channel/QianZhuService.java | 109 +++++++++++ .../resources/dev/commonConfig.properties | 6 + 9 files changed, 516 insertions(+) create mode 100644 cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java create mode 100644 service/src/main/java/com/hfkj/qianzhu/channel/CinemaService.java create mode 100644 service/src/main/java/com/hfkj/qianzhu/channel/QianZhuService.java diff --git a/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java b/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java index 2a45795..339bfda 100644 --- a/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java +++ b/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java @@ -256,6 +256,7 @@ public class GoodsController { @RequestParam(value = "goodsType" , required = false) Long goodsType, @RequestParam(value = "goodsBrand" , required = false) Long goodsBrand, @RequestParam(value = "type" , required = false) Integer type, + @RequestParam(value = "merId" , required = false) Long merId, @RequestParam(value = "status" , required = false) Integer status, @RequestParam(value = "pageNum" , required = true) Integer pageNum, @RequestParam(value = "pageSize" , required = true) Integer pageSize, HttpServletRequest request) { @@ -281,6 +282,8 @@ public class GoodsController { if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { map.put("merId", userModel.getAccount().getObjectId()); + } else { + map.put("merId", merId); } map.put("type", type); diff --git a/cweb/src/main/java/com/cweb/config/AuthConfig.java b/cweb/src/main/java/com/cweb/config/AuthConfig.java index 846b070..7cfd592 100644 --- a/cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -91,6 +91,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/common/*") .excludePathPatterns("/fileUpload/*") .excludePathPatterns("/wxMsg/*") + .excludePathPatterns("/cinema/*") ; } diff --git a/cweb/src/main/java/com/cweb/controller/CommonController.java b/cweb/src/main/java/com/cweb/controller/CommonController.java index b6b7a6d..b406d83 100644 --- a/cweb/src/main/java/com/cweb/controller/CommonController.java +++ b/cweb/src/main/java/com/cweb/controller/CommonController.java @@ -10,6 +10,7 @@ import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.BsOrderGoods; import com.hfkj.entity.GoodsLogistics; import com.hfkj.model.ResponseData; +import com.hfkj.qianzhu.channel.QianZhuService; import com.hfkj.service.CommonService; import com.hfkj.service.goods.BsOrderGoodsService; import io.swagger.annotations.Api; @@ -85,5 +86,46 @@ public class CommonController { } } + @RequestMapping(value = "/getAllCities", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询中国大陆所有城市") + public ResponseData getAllCities() { + try { + + Object data = redisUtil.get("qianZhuCity"); + + if (data == null) { + + JSONObject jsonObjects = QianZhuService.getAllCities(); + redisUtil.set("qianZhuCity", jsonObjects); + + return ResponseMsgUtil.success(jsonObjects); + + } else { + return ResponseMsgUtil.success(data); + } + + } catch (Exception e) { + log.error("HighUserCardController --> oilCardRefund() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/listByCityId", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询城市区域") + public ResponseData listByCityId(@RequestParam(value = "cityId", required = false) Integer cityId) { + try { + + Map params = new HashMap<>(); + params.put("cityId", cityId); + return ResponseMsgUtil.success(QianZhuService.listByCityId(params)); + + } catch (Exception e) { + log.error("HighUserCardController --> oilCardRefund() error!", e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java b/cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java new file mode 100644 index 0000000..2b1b01a --- /dev/null +++ b/cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java @@ -0,0 +1,185 @@ +package com.cweb.controller.qianZhu; + +import com.hfkj.common.utils.DateUtil; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.model.ResponseData; +import com.hfkj.qianzhu.channel.CinemaService; +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 java.math.BigDecimal; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value="/cinema") +@Api(value="电影票数据") +public class CinemaController { + + Logger log = LoggerFactory.getLogger(CinemaController.class); + + @RequestMapping(value="/filmsPagedQuery",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据城市分页查询影片") + public ResponseData filmsPagedQuery(@RequestParam(value = "cityId", required = false) Integer cityId, + @RequestParam(value = "cityCode", required = false) String cityCode, + @RequestParam(value = "cinemaId", required = false) String cinemaId, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize + ) { + try { + + Map params = new HashMap<>(); + if (cityId != null) { + params.put("cityId", cityId); + } + if (cityCode != null) { + params.put("cityCode", cityCode); + } + if (cinemaId != null) { + params.put("cinemaId", cinemaId); + } + params.put("pageIndex", pageNum); + params.put("pageSize", pageSize); + + return ResponseMsgUtil.success(CinemaService.filmsPagedQuery(params)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/pagedQueryNotShownFilms",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "分页查询待上映影片") + public ResponseData pagedQueryNotShownFilms( + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize + ) { + try { + + Map params = new HashMap<>(); + params.put("pageIndex", pageNum); + params.put("pageSize", pageSize); + + return ResponseMsgUtil.success(CinemaService.pagedQueryNotShownFilms(params)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/cinemaBrands",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询所有影院品牌") + public ResponseData cinemaBrands( + ) { + try { + + return ResponseMsgUtil.success(CinemaService.cinemaBrands()); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value="/cinemasPagedQuery",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "分页查询城市影院") + public ResponseData cinemasPagedQuery(@RequestParam(value = "cityId", required = false) Integer cityId, + @RequestParam(value = "cityCode", required = false) String cityCode, + @RequestParam(value = "regionId", required = false) Integer regionId, + @RequestParam(value = "cinemaId", required = false) String cinemaId, + @RequestParam(value = "showDate", required = false) String showDate, + @RequestParam(value = "brandKeyword", required = false) String brandKeyword, + @RequestParam(name = "lon", required = true) BigDecimal lon, + @RequestParam(name = "lat", required = true) BigDecimal lat, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize + ) { + try { + + Map params = new HashMap<>(); + + if (cityId != null) { + params.put("cityId", cityId); + } + if (cityCode != null) { + params.put("cityCode", cityCode); + } + if (cinemaId != null) { + params.put("cinemaId", cinemaId); + } + if (regionId != null) { + params.put("regionId", regionId); + } + if (brandKeyword != null) { + params.put("brandKeyword", brandKeyword); + } + + params.put("lon", lon); + params.put("lat", lat); + params.put("showDate", showDate); + params.put("pageIndex", pageNum); + params.put("pageSize", pageSize); + + return ResponseMsgUtil.success(CinemaService.cinemasPagedQuery(params)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/listByCinemaId",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据影院id查询影片") + public ResponseData listByCinemaId( + @RequestParam(name = "cinemaId", required = true) Integer cinemaId + ) { + try { + + Map params = new HashMap<>(); + params.put("cinemaId", cinemaId); + + return ResponseMsgUtil.success(CinemaService.listByCinemaId(params)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/listByCinemaAndFilm",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据影院和影片查询场次") + public ResponseData listByCinemaAndFilm( + @RequestParam(name = "cinemaId", required = true) Integer cinemaId, + @RequestParam(name = "filmId", required = true) Integer filmId + ) { + try { + + Map params = new HashMap<>(); + params.put("cinemaId", cinemaId); + params.put("filmId", filmId); + + return ResponseMsgUtil.success(CinemaService.listByCinemaAndFilm(params)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } +} diff --git a/order/src/main/resources/dev/logback.xml b/order/src/main/resources/dev/logback.xml index b2b05c1..5f29239 100644 --- a/order/src/main/resources/dev/logback.xml +++ b/order/src/main/resources/dev/logback.xml @@ -202,4 +202,26 @@ + + + log/QianZhuLog.log + + log/QianZhuLog/QianZhuLog.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + diff --git a/service/src/main/java/com/hfkj/config/CommonSysConfig.java b/service/src/main/java/com/hfkj/config/CommonSysConfig.java index 80ea550..fc074c0 100644 --- a/service/src/main/java/com/hfkj/config/CommonSysConfig.java +++ b/service/src/main/java/com/hfkj/config/CommonSysConfig.java @@ -98,4 +98,11 @@ public class CommonSysConfig { private String etcChannelCode; private String etcPublicKey; private String etcPrivateKey; + + /** + * 千猪接口请求参数 + */ + private String qianZhuUrl; + private String qianZhuPlatformId; + private String qianZhuSecret; } diff --git a/service/src/main/java/com/hfkj/qianzhu/channel/CinemaService.java b/service/src/main/java/com/hfkj/qianzhu/channel/CinemaService.java new file mode 100644 index 0000000..310abae --- /dev/null +++ b/service/src/main/java/com/hfkj/qianzhu/channel/CinemaService.java @@ -0,0 +1,141 @@ +package com.hfkj.qianzhu.channel; + +import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; + +import java.util.HashMap; +import java.util.Map; + +/** + * @ClassName CinemaService + * @Author Sum1Dream + * @Description 电影票请求 + * @Date 2024/6/11 上午11:31 + **/ +public class CinemaService { + + /** + * @MethodName filmsPagedQuery + * @Description: 根据城市分页查询影片 + * @param map + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/6/11 上午11:45 + */ + public static JSONObject filmsPagedQuery(Map map) throws Exception { + + JSONObject object = QianZhuService.request("/openApi/v1/films/pagedQuery" , map); + + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + + } + + /** + * @MethodName pagedQueryNotShownFilms + * @Description:分页查询待上映影片 + * @param map + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/6/11 下午3:01 + */ + public static JSONObject pagedQueryNotShownFilms(Map map) throws Exception { + + JSONObject object = QianZhuService.request("/openApi/v1/films/pagedQueryNotShownFilms" , map); + + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + + } + + /** + * @MethodName cinemaBrands + * @Description:查询所有影院品牌 + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/6/11 下午3:21 + */ + public static JSONObject cinemaBrands() throws Exception { + + JSONObject object = QianZhuService.request("/openApi/v1/cinema-brands/listAll" , new HashMap<>()); + + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + + } + + /** + * @MethodName cinemasPagedQuery + * @Description:分页查询城市影院 + * @param map + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/6/11 下午3:31 + */ + public static JSONObject cinemasPagedQuery(Map map) throws Exception { + + JSONObject object = QianZhuService.request("/openApi/v2/cinemas/pagedQuery" , map); + + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + + } + + /** + * @MethodName listByCinemaId + * @Description:根据影院id查询影片 + * @param map + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/6/11 下午4:09 + */ + public static JSONObject listByCinemaId(Map map) throws Exception { + + JSONObject object = QianZhuService.request("/openApi/v1/films/listByCinemaId" , map); + + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + + } + + /** + * @MethodName listByCinemaAndFilm + * @Description:根据影院和影片查询场次 + * @param map + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/6/13 下午5:48 + */ + public static JSONObject listByCinemaAndFilm(Map map) throws Exception { + + JSONObject object = QianZhuService.request("/openApi/v1/films/listByCinemaAndFilm" , map); + + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + + } + + + + +} diff --git a/service/src/main/java/com/hfkj/qianzhu/channel/QianZhuService.java b/service/src/main/java/com/hfkj/qianzhu/channel/QianZhuService.java new file mode 100644 index 0000000..8e650f1 --- /dev/null +++ b/service/src/main/java/com/hfkj/qianzhu/channel/QianZhuService.java @@ -0,0 +1,109 @@ +package com.hfkj.qianzhu.channel; + +import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.pay.util.sdk.WXPayConstants; +import com.hfkj.common.utils.HttpsUtils; +import com.hfkj.common.utils.MD5Util; +import com.hfkj.config.CommonSysConst; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; + +public class QianZhuService { + + private static Logger log = LoggerFactory.getLogger(QianZhuService.class); + + /** + * 请求 + * @param postUrl 接口请求地址 + * @param param 参数 + * @return + * @throws Exception + */ + public static JSONObject request(String postUrl, Map param) throws Exception { + + log.info("============ 千猪请求-START ============="); + param.put("platformId", CommonSysConst.getSysConfig().getQianZhuPlatformId()); + param.put("timestamp", new Date().getTime()); + param.put("sign", MD5Util.encode(generateSignature(param,CommonSysConst.getSysConfig().getQianZhuSecret()).getBytes()).toLowerCase()); + + log.info("请求接口:" + postUrl); + log.info("请求参数:" + JSONObject.toJSONString(param)); + + JSONObject response = HttpsUtils.doPost(CommonSysConst.getSysConfig().getQianZhuUrl()+ postUrl, JSONObject.toJSONString(param)); + + log.info("响应参数:" + response.toJSONString()); + log.info("============ 千猪请求-END =============="); + return response; + + } + + + /** + * @Author Sum1Dream + * @name getAllCities.java + * @Description // 查询所有城市 + * @Date 15:45 2022/6/28 + * @Param [] + * @return com.alibaba.fastjson.JSONObject + */ + public static JSONObject getAllCities() throws Exception { + + JSONObject object = QianZhuService.request("/openApi/v2/cities/listAll" , new HashMap<>()); + + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + } + + /** + * @MethodName listByCityId + * @Description:查询城市区域 + * @param + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/6/11 下午3:12 + */ + public static JSONObject listByCityId(Map param) throws Exception { + JSONObject object = QianZhuService.request("/openApi/v1/regions/listByCityId" , param); + + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + } + + + /** + * 生成签名 + * @param data 数据 + * @param key 秘钥app_secret + * @return 加密结果 + */ + public static String generateSignature(final Map data, String key){ + 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 (StringUtils.isBlank(sb.toString())) { + sb.append(k).append("=").append(data.get(k)); + } else { + sb.append("&").append(k).append("=").append(data.get(k)); + } + } + sb.append(key); + return sb.toString(); + } +} diff --git a/service/src/main/resources/dev/commonConfig.properties b/service/src/main/resources/dev/commonConfig.properties index 27c3704..7f8777e 100644 --- a/service/src/main/resources/dev/commonConfig.properties +++ b/service/src/main/resources/dev/commonConfig.properties @@ -50,3 +50,9 @@ etcPostUrl = https://test.djien-qr.com/ etcChannelCode = GZETCFXQD etcPublicKey = MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMyQb5gR1rweB5oHKqRPJtJjLQKsn5PXOVfaNdGt/2kPkHvRdN3L9zOaAvFEXcEl2V0sg3D8a+2Sfy1YANAZvjscTQYOaoFl+LVyQZvgyyX8RQw+26Jmbqh8DwenUbNf7DFYVSDxIMBLOiWPkGsYGFONjsUVmfykSeVTcEgQB3VwIDAQAB etcPrivateKey = MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBAO8+KWh/OmBahFk7TWOEjPl13BT5NdlbGvQ/311Yua6CQqul9w1DIR2TwFUUh/Bko/eVoLROfF2XVjHbw2bImTdJ7y9C3511HI59YPNzqyql0DHjLxbH0VW92eUgk8mG09wtrUMu1ImN0b7aFE3uqAgz6pwh3TUiQWsDWz+l/MG7AgMBAAECgYEA7nYsOd8OpbmzT2m/omEdTwz9993KocKgZDJCBj4InftyTrrXO93cZSm/PE6BjMgTcxUuIGpWpcbRgFLHOmzZ4Qd+k/6Yb1ErMTfdGlgrxv2B+vztWYfjmFzEiXpecFH47ED6iYrrqm14X3InpnBv4rUkGdqqNbyPGgTO2ncs/3kCQQD+xqRAQSb/TROlqJdO91y6z9v0PO2GLmokqYg444rKYZKhDE0tdJeLU/sfK8SMg5+SlwdQm4nlo8EDJ/w2CEn3AkEA8GRqVkKgIuH413/a6+luYDjlf30WY7Mi1sm3QPSZ6+eH35UwsL6mdX6mjRpUN9Hez6FMfE7s3XOldoPVMzR1XQJBAOa2VTkGhtz8HEWQZOySXfuhjSogHmu7Dk2C5CO4Eg/wycpjDGSUR0NZWnfAt60S6GbjszEQmJBGeNt10xPO78MCQQCWXwnRaZ3IFDhXfQfRWFSN5ilQ5UszFGQvnUB/ZkI+ObdZmXY6qRdxGcdPLnAN9r78fDZe7/Pk1qljCDY98IuVAkEAnSeO/221gDhL1wnbUhGuX1yo8f5Eo/wDTW5cBxXFGZeexhB8I4jnEV4E/xmikkb3jDFvmrnFk+XUtDqkrvicRQ== + + +#QIANZHU +qianZhuUrl=https://live-test.qianzhu8.com +qianZhuPlatformId=10376 +qianZhuSecret=ktxb49sh2jfhgn8g From 271dfb35abc55ac6a0662dea055585078f1162fd Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Thu, 20 Jun 2024 14:42:17 +0800 Subject: [PATCH 5/6] Changes --- .../controller/recharge/PriceController.java | 130 +++ order/src/main/resources/dev/logback.xml | 22 + .../java/com/hfkj/config/CommonSysConfig.java | 9 + .../java/com/hfkj/config/GenerateSign.java | 139 +++ .../java/com/hfkj/dao/RechargeCodeMapper.java | 117 +++ .../com/hfkj/dao/RechargeCodeMapperExt.java | 7 + .../com/hfkj/dao/RechargeCodeSqlProvider.java | 304 ++++++ .../com/hfkj/dao/RechargePriceMapper.java | 125 +++ .../com/hfkj/dao/RechargePriceMapperExt.java | 7 + .../hfkj/dao/RechargePriceSqlProvider.java | 332 ++++++ .../java/com/hfkj/entity/RechargeCode.java | 209 ++++ .../com/hfkj/entity/RechargeCodeExample.java | 873 ++++++++++++++++ .../java/com/hfkj/entity/RechargePrice.java | 233 +++++ .../com/hfkj/entity/RechargePriceExample.java | 974 ++++++++++++++++++ .../com/hfkj/phone/CtPhoneBillService.java | 33 + .../java/com/hfkj/phone/PhoneBillService.java | 52 + .../com/hfkj/qianzhu/channel/KfcService.java | 107 ++ .../hfkj/qianzhu/channel/QianZhuService.java | 58 +- .../service/goods/BsOrderGoodsService.java | 2 - .../hfkj/service/recharge/PriceService.java | 57 + .../recharge/impl/PriceServiceImpl.java | 64 ++ .../resources/dev/commonConfig.properties | 7 + .../resources/prod/commonConfig.properties | 13 + 23 files changed, 3847 insertions(+), 27 deletions(-) create mode 100644 bweb/src/main/java/com/bweb/controller/recharge/PriceController.java create mode 100644 service/src/main/java/com/hfkj/config/GenerateSign.java create mode 100644 service/src/main/java/com/hfkj/dao/RechargeCodeMapper.java create mode 100644 service/src/main/java/com/hfkj/dao/RechargeCodeMapperExt.java create mode 100644 service/src/main/java/com/hfkj/dao/RechargeCodeSqlProvider.java create mode 100644 service/src/main/java/com/hfkj/dao/RechargePriceMapper.java create mode 100644 service/src/main/java/com/hfkj/dao/RechargePriceMapperExt.java create mode 100644 service/src/main/java/com/hfkj/dao/RechargePriceSqlProvider.java create mode 100644 service/src/main/java/com/hfkj/entity/RechargeCode.java create mode 100644 service/src/main/java/com/hfkj/entity/RechargeCodeExample.java create mode 100644 service/src/main/java/com/hfkj/entity/RechargePrice.java create mode 100644 service/src/main/java/com/hfkj/entity/RechargePriceExample.java create mode 100644 service/src/main/java/com/hfkj/phone/CtPhoneBillService.java create mode 100644 service/src/main/java/com/hfkj/phone/PhoneBillService.java create mode 100644 service/src/main/java/com/hfkj/qianzhu/channel/KfcService.java create mode 100644 service/src/main/java/com/hfkj/service/recharge/PriceService.java create mode 100644 service/src/main/java/com/hfkj/service/recharge/impl/PriceServiceImpl.java diff --git a/bweb/src/main/java/com/bweb/controller/recharge/PriceController.java b/bweb/src/main/java/com/bweb/controller/recharge/PriceController.java new file mode 100644 index 0000000..2191319 --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/recharge/PriceController.java @@ -0,0 +1,130 @@ +package com.bweb.controller.recharge; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.SessionObject; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.GoodsBrand; +import com.hfkj.entity.GoodsType; +import com.hfkj.entity.RechargePrice; +import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; +import com.hfkj.service.recharge.PriceService; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +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 javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value="/price") +@Api(value="话费金额") +public class PriceController { + + private static final Logger log = LoggerFactory.getLogger(PriceController.class); + + @Resource + private PriceService priceService; + + @RequestMapping(value="/getListGoods",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询列表") + public ResponseData getListGoods( + @RequestParam(value = "type" , required = false) Integer type, + @RequestParam(value = "pageNum" , required = true) Integer pageNum, + @RequestParam(value = "pageSize" , required = true) Integer pageSize) { + try { + + Map map = new HashMap<>(); + map.put("type", type); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(priceService.getList(map))); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/editPrice", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑金额") + public ResponseData editPrice(@RequestBody RechargePrice body) { + try { + + + if (body == null + || body.getPrice() == null + || body.getDiscount() == null + || body.getSort() == null + || body.getType() == null + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + RechargePrice rechargePrice; + + if (body.getId() != null) { + // 查询品牌 + rechargePrice = priceService.queryDetail(body.getId()); + if (rechargePrice == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); + } + } else { + rechargePrice = new RechargePrice(); + rechargePrice.setCreateTime(new Date()); + } + + rechargePrice.setUpdateTime(new Date()); + rechargePrice.setPayPrice(body.getPrice().multiply(body.getDiscount()).divide(new BigDecimal(100)).setScale(2 , BigDecimal.ROUND_HALF_UP)); + rechargePrice.setPrice(body.getPrice()); + rechargePrice.setDiscount(body.getDiscount()); + rechargePrice.setType(body.getType()); + rechargePrice.setSort(body.getSort()); + rechargePrice.setStatus(1); + + if (body.getId() != null) { + priceService.update(rechargePrice); + } else { + priceService.create(rechargePrice); + } + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("OutRechargePriceController --> insertPrice() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/delete",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "删除") + public ResponseData delete(@RequestParam(value = "id" , required = false) Long id) { + try { + + priceService.delete(id , false); + + return ResponseMsgUtil.success("删除成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } +} diff --git a/order/src/main/resources/dev/logback.xml b/order/src/main/resources/dev/logback.xml index 5f29239..b8a7284 100644 --- a/order/src/main/resources/dev/logback.xml +++ b/order/src/main/resources/dev/logback.xml @@ -224,4 +224,26 @@ + + + log/PhoneBillLog.log + + log/PhoneBillLog/PhoneBillLog.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + diff --git a/service/src/main/java/com/hfkj/config/CommonSysConfig.java b/service/src/main/java/com/hfkj/config/CommonSysConfig.java index fc074c0..d603e4d 100644 --- a/service/src/main/java/com/hfkj/config/CommonSysConfig.java +++ b/service/src/main/java/com/hfkj/config/CommonSysConfig.java @@ -103,6 +103,15 @@ public class CommonSysConfig { * 千猪接口请求参数 */ private String qianZhuUrl; + private String qianZhuH5url; private String qianZhuPlatformId; private String qianZhuSecret; + + /** + * 话费接口请求参数 + */ + private String ctNotifyUrl; + private String CtApiKey; + private String ctMemberId; + private String ctPostUrl; } diff --git a/service/src/main/java/com/hfkj/config/GenerateSign.java b/service/src/main/java/com/hfkj/config/GenerateSign.java new file mode 100644 index 0000000..18e31d4 --- /dev/null +++ b/service/src/main/java/com/hfkj/config/GenerateSign.java @@ -0,0 +1,139 @@ +package com.hfkj.config; + +import com.hfkj.common.pay.util.sdk.WXPayConstants; +import org.apache.commons.lang3.StringUtils; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.security.MessageDigest; +import java.util.Arrays; +import java.util.Map; +import java.util.Set; + +public class GenerateSign { + + + + /** + * 生成签名 + * @param data 数据 + * @param key 秘钥app_secret + * @return 加密结果 + */ + public static String paramSort(final Map data, String key){ + 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 (StringUtils.isBlank(sb.toString())) { + sb.append(k).append("=").append(data.get(k)); + } else { + sb.append("&").append(k).append("=").append(data.get(k)); + } + } + sb.append(key); + return sb.toString(); + } + + /** + * @MethodName paramSort + * @Description: 不带key + * @param param + * @return: java.lang.String + * @Author: Sum1Dream + * @Date: 2024/6/19 上午11:48 + */ + public static String paramSort(final Map param) { + Set keySet = param.keySet(); + String[] keyArray = keySet.toArray(new String[keySet.size()]); + StringBuilder sb = new StringBuilder(); + for (String k : keyArray) { + if (StringUtils.isBlank(sb.toString())) { + sb.append(k).append("=").append(param.get(k)); + } else { + sb.append("&").append(k).append("=").append(param.get(k)); + } + } + return sb.toString(); + } + + /** + * 生成畅停签名. 注意,若含有sign_type字段,必须和signType参数保持一致。 + * + * @param data 待签名数据 + * @param key API密钥 + * @param signType 签名方式 + * @return 签名 + */ + public static String generateSignatureCt(final Map data, String key, WXPayConstants.SignType signType) throws Exception { + + + Set keySet = data.keySet(); + String[] keyArray = keySet.toArray(new String[keySet.size()]); + StringBuilder sb = new StringBuilder(); + for (String k : keyArray) { + if (k.equals(WXPayConstants.FIELD_SIGN)) { + continue; + } + if (data.get(k) != null) // 参数值为空,则不参与签名 + sb.append(k).append(data.get(k)); + } + sb.append("secretKey").append(key); + if (WXPayConstants.SignType.MD5.equals(signType)) { + return MD5(sb.toString() , false); + } + else if (WXPayConstants.SignType.HMACSHA256.equals(signType)) { + return HMACSHA256(sb.toString(), key); + } + else { + throw new Exception(String.format("Invalid sign_type: %s", signType)); + } + } + + + + + /** + * 生成 MD5 + * + * @param data 待处理数据 + * @return MD5结果 + */ + 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)); + } + if (isUpperCase) { + return sb.toString().toUpperCase(); + } else { + return sb.toString(); + } + } + + + /** + * 生成 HMACSHA256 + * @param data 待处理数据 + * @param key 密钥 + * @return 加密结果 + * @throws Exception + */ + public static String HMACSHA256(String data, String key) throws Exception { + Mac sha256_HMAC = Mac.getInstance("HmacSHA256"); + SecretKeySpec secret_key = new SecretKeySpec(key.getBytes("UTF-8"), "HmacSHA256"); + sha256_HMAC.init(secret_key); + byte[] array = sha256_HMAC.doFinal(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(); + } +} diff --git a/service/src/main/java/com/hfkj/dao/RechargeCodeMapper.java b/service/src/main/java/com/hfkj/dao/RechargeCodeMapper.java new file mode 100644 index 0000000..e777b74 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/RechargeCodeMapper.java @@ -0,0 +1,117 @@ +package com.hfkj.dao; + +import com.hfkj.entity.RechargeCode; +import com.hfkj.entity.RechargeCodeExample; +import java.util.List; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Options; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Results; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.Update; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface RechargeCodeMapper extends RechargeCodeMapperExt { + @SelectProvider(type=RechargeCodeSqlProvider.class, method="countByExample") + long countByExample(RechargeCodeExample example); + + @DeleteProvider(type=RechargeCodeSqlProvider.class, method="deleteByExample") + int deleteByExample(RechargeCodeExample example); + + @Delete({ + "delete from recharge_code", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into recharge_code (price_id, platform_type, ", + "goods_id, create_time, ", + "update_time, `status`, ", + "ext_1, ext_2, ext_3)", + "values (#{priceId,jdbcType=VARCHAR}, #{platformType,jdbcType=INTEGER}, ", + "#{goodsId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(RechargeCode record); + + @InsertProvider(type=RechargeCodeSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(RechargeCode record); + + @SelectProvider(type=RechargeCodeSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="price_id", property="priceId", jdbcType=JdbcType.VARCHAR), + @Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER), + @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectByExample(RechargeCodeExample example); + + @Select({ + "select", + "id, price_id, platform_type, goods_id, create_time, update_time, `status`, ext_1, ", + "ext_2, ext_3", + "from recharge_code", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="price_id", property="priceId", jdbcType=JdbcType.VARCHAR), + @Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER), + @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="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) + }) + RechargeCode selectByPrimaryKey(Long id); + + @UpdateProvider(type=RechargeCodeSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") RechargeCode record, @Param("example") RechargeCodeExample example); + + @UpdateProvider(type=RechargeCodeSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") RechargeCode record, @Param("example") RechargeCodeExample example); + + @UpdateProvider(type=RechargeCodeSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(RechargeCode record); + + @Update({ + "update recharge_code", + "set price_id = #{priceId,jdbcType=VARCHAR},", + "platform_type = #{platformType,jdbcType=INTEGER},", + "goods_id = #{goodsId,jdbcType=VARCHAR},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "`status` = #{status,jdbcType=INTEGER},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(RechargeCode record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/RechargeCodeMapperExt.java b/service/src/main/java/com/hfkj/dao/RechargeCodeMapperExt.java new file mode 100644 index 0000000..bb92e88 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/RechargeCodeMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface RechargeCodeMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/RechargeCodeSqlProvider.java b/service/src/main/java/com/hfkj/dao/RechargeCodeSqlProvider.java new file mode 100644 index 0000000..7d4ce16 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/RechargeCodeSqlProvider.java @@ -0,0 +1,304 @@ +package com.hfkj.dao; + +import com.hfkj.entity.RechargeCode; +import com.hfkj.entity.RechargeCodeExample.Criteria; +import com.hfkj.entity.RechargeCodeExample.Criterion; +import com.hfkj.entity.RechargeCodeExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class RechargeCodeSqlProvider { + + public String countByExample(RechargeCodeExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("recharge_code"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(RechargeCodeExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("recharge_code"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(RechargeCode record) { + SQL sql = new SQL(); + sql.INSERT_INTO("recharge_code"); + + if (record.getPriceId() != null) { + sql.VALUES("price_id", "#{priceId,jdbcType=VARCHAR}"); + } + + if (record.getPlatformType() != null) { + sql.VALUES("platform_type", "#{platformType,jdbcType=INTEGER}"); + } + + if (record.getGoodsId() != null) { + sql.VALUES("goods_id", "#{goodsId,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getExt1() != null) { + sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(RechargeCodeExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("price_id"); + sql.SELECT("platform_type"); + sql.SELECT("goods_id"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("`status`"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("recharge_code"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + RechargeCode record = (RechargeCode) parameter.get("record"); + RechargeCodeExample example = (RechargeCodeExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("recharge_code"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getPriceId() != null) { + sql.SET("price_id = #{record.priceId,jdbcType=VARCHAR}"); + } + + if (record.getPlatformType() != null) { + sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}"); + } + + if (record.getGoodsId() != null) { + sql.SET("goods_id = #{record.goodsId,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("recharge_code"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("price_id = #{record.priceId,jdbcType=VARCHAR}"); + sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}"); + sql.SET("goods_id = #{record.goodsId,jdbcType=VARCHAR}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + RechargeCodeExample example = (RechargeCodeExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(RechargeCode record) { + SQL sql = new SQL(); + sql.UPDATE("recharge_code"); + + if (record.getPriceId() != null) { + sql.SET("price_id = #{priceId,jdbcType=VARCHAR}"); + } + + if (record.getPlatformType() != null) { + sql.SET("platform_type = #{platformType,jdbcType=INTEGER}"); + } + + if (record.getGoodsId() != null) { + sql.SET("goods_id = #{goodsId,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, RechargeCodeExample example, boolean includeExamplePhrase) { + if (example == null) { + return; + } + + String parmPhrase1; + String parmPhrase1_th; + String parmPhrase2; + String parmPhrase2_th; + String parmPhrase3; + String parmPhrase3_th; + if (includeExamplePhrase) { + parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } else { + parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } + + StringBuilder sb = new StringBuilder(); + List oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/RechargePriceMapper.java b/service/src/main/java/com/hfkj/dao/RechargePriceMapper.java new file mode 100644 index 0000000..61b4768 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/RechargePriceMapper.java @@ -0,0 +1,125 @@ +package com.hfkj.dao; + +import com.hfkj.entity.RechargePrice; +import com.hfkj.entity.RechargePriceExample; +import java.util.List; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Options; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Results; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.Update; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface RechargePriceMapper extends RechargePriceMapperExt { + @SelectProvider(type=RechargePriceSqlProvider.class, method="countByExample") + long countByExample(RechargePriceExample example); + + @DeleteProvider(type=RechargePriceSqlProvider.class, method="deleteByExample") + int deleteByExample(RechargePriceExample example); + + @Delete({ + "delete from recharge_price", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into recharge_price (discount, `type`, ", + "sort, price, pay_price, ", + "create_time, update_time, ", + "`status`, ext_1, ext_2, ", + "ext_3)", + "values (#{discount,jdbcType=DECIMAL}, #{type,jdbcType=INTEGER}, ", + "#{sort,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{payPrice,jdbcType=DECIMAL}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", + "#{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(RechargePrice record); + + @InsertProvider(type=RechargePriceSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(RechargePrice record); + + @SelectProvider(type=RechargePriceSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="discount", property="discount", jdbcType=JdbcType.DECIMAL), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER), + @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectByExample(RechargePriceExample example); + + @Select({ + "select", + "id, discount, `type`, sort, price, pay_price, create_time, update_time, `status`, ", + "ext_1, ext_2, ext_3", + "from recharge_price", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="discount", property="discount", jdbcType=JdbcType.DECIMAL), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER), + @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="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) + }) + RechargePrice selectByPrimaryKey(Long id); + + @UpdateProvider(type=RechargePriceSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") RechargePrice record, @Param("example") RechargePriceExample example); + + @UpdateProvider(type=RechargePriceSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") RechargePrice record, @Param("example") RechargePriceExample example); + + @UpdateProvider(type=RechargePriceSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(RechargePrice record); + + @Update({ + "update recharge_price", + "set discount = #{discount,jdbcType=DECIMAL},", + "`type` = #{type,jdbcType=INTEGER},", + "sort = #{sort,jdbcType=INTEGER},", + "price = #{price,jdbcType=DECIMAL},", + "pay_price = #{payPrice,jdbcType=DECIMAL},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "`status` = #{status,jdbcType=INTEGER},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(RechargePrice record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/RechargePriceMapperExt.java b/service/src/main/java/com/hfkj/dao/RechargePriceMapperExt.java new file mode 100644 index 0000000..7afc96c --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/RechargePriceMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface RechargePriceMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/RechargePriceSqlProvider.java b/service/src/main/java/com/hfkj/dao/RechargePriceSqlProvider.java new file mode 100644 index 0000000..2868b77 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/RechargePriceSqlProvider.java @@ -0,0 +1,332 @@ +package com.hfkj.dao; + +import com.hfkj.entity.RechargePrice; +import com.hfkj.entity.RechargePriceExample.Criteria; +import com.hfkj.entity.RechargePriceExample.Criterion; +import com.hfkj.entity.RechargePriceExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class RechargePriceSqlProvider { + + public String countByExample(RechargePriceExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("recharge_price"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(RechargePriceExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("recharge_price"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(RechargePrice record) { + SQL sql = new SQL(); + sql.INSERT_INTO("recharge_price"); + + if (record.getDiscount() != null) { + sql.VALUES("discount", "#{discount,jdbcType=DECIMAL}"); + } + + if (record.getType() != null) { + sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); + } + + if (record.getSort() != null) { + sql.VALUES("sort", "#{sort,jdbcType=INTEGER}"); + } + + if (record.getPrice() != null) { + sql.VALUES("price", "#{price,jdbcType=DECIMAL}"); + } + + if (record.getPayPrice() != null) { + sql.VALUES("pay_price", "#{payPrice,jdbcType=DECIMAL}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getExt1() != null) { + sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(RechargePriceExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("discount"); + sql.SELECT("`type`"); + sql.SELECT("sort"); + sql.SELECT("price"); + sql.SELECT("pay_price"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("`status`"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("recharge_price"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + RechargePrice record = (RechargePrice) parameter.get("record"); + RechargePriceExample example = (RechargePriceExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("recharge_price"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getDiscount() != null) { + sql.SET("discount = #{record.discount,jdbcType=DECIMAL}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + } + + if (record.getSort() != null) { + sql.SET("sort = #{record.sort,jdbcType=INTEGER}"); + } + + if (record.getPrice() != null) { + sql.SET("price = #{record.price,jdbcType=DECIMAL}"); + } + + if (record.getPayPrice() != null) { + sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("recharge_price"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("discount = #{record.discount,jdbcType=DECIMAL}"); + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + sql.SET("sort = #{record.sort,jdbcType=INTEGER}"); + sql.SET("price = #{record.price,jdbcType=DECIMAL}"); + sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + RechargePriceExample example = (RechargePriceExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(RechargePrice record) { + SQL sql = new SQL(); + sql.UPDATE("recharge_price"); + + if (record.getDiscount() != null) { + sql.SET("discount = #{discount,jdbcType=DECIMAL}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{type,jdbcType=INTEGER}"); + } + + if (record.getSort() != null) { + sql.SET("sort = #{sort,jdbcType=INTEGER}"); + } + + if (record.getPrice() != null) { + sql.SET("price = #{price,jdbcType=DECIMAL}"); + } + + if (record.getPayPrice() != null) { + sql.SET("pay_price = #{payPrice,jdbcType=DECIMAL}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, RechargePriceExample example, boolean includeExamplePhrase) { + if (example == null) { + return; + } + + String parmPhrase1; + String parmPhrase1_th; + String parmPhrase2; + String parmPhrase2_th; + String parmPhrase3; + String parmPhrase3_th; + if (includeExamplePhrase) { + parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } else { + parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } + + StringBuilder sb = new StringBuilder(); + List oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/RechargeCode.java b/service/src/main/java/com/hfkj/entity/RechargeCode.java new file mode 100644 index 0000000..84d9346 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/RechargeCode.java @@ -0,0 +1,209 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * recharge_code + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class RechargeCode implements Serializable { + /** + * 主键id + */ + private Long id; + + /** + * 金额id + */ + private String priceId; + + /** + * 充值平台:充值平台 1:尖椒 2:龙阅 4.畅停 5.简牛 + */ + private Integer platformType; + + /** + * 产品id + */ + private String goodsId; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 状态 1正常 0 禁用 + */ + private Integer status; + + /** + * ext_1 + */ + private String ext1; + + /** + * ext_2 + */ + private String ext2; + + /** + * ext_3 + */ + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPriceId() { + return priceId; + } + + public void setPriceId(String priceId) { + this.priceId = priceId; + } + + public Integer getPlatformType() { + return platformType; + } + + public void setPlatformType(Integer platformType) { + this.platformType = platformType; + } + + public String getGoodsId() { + return goodsId; + } + + public void setGoodsId(String goodsId) { + this.goodsId = goodsId; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public 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; + } + RechargeCode other = (RechargeCode) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getPriceId() == null ? other.getPriceId() == null : this.getPriceId().equals(other.getPriceId())) + && (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType())) + && (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.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 + ((getPriceId() == null) ? 0 : getPriceId().hashCode()); + result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode()); + result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((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(", priceId=").append(priceId); + sb.append(", platformType=").append(platformType); + sb.append(", goodsId=").append(goodsId); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", status=").append(status); + 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/service/src/main/java/com/hfkj/entity/RechargeCodeExample.java b/service/src/main/java/com/hfkj/entity/RechargeCodeExample.java new file mode 100644 index 0000000..a148591 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/RechargeCodeExample.java @@ -0,0 +1,873 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class RechargeCodeExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public RechargeCodeExample() { + 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 andPriceIdIsNull() { + addCriterion("price_id is null"); + return (Criteria) this; + } + + public Criteria andPriceIdIsNotNull() { + addCriterion("price_id is not null"); + return (Criteria) this; + } + + public Criteria andPriceIdEqualTo(String value) { + addCriterion("price_id =", value, "priceId"); + return (Criteria) this; + } + + public Criteria andPriceIdNotEqualTo(String value) { + addCriterion("price_id <>", value, "priceId"); + return (Criteria) this; + } + + public Criteria andPriceIdGreaterThan(String value) { + addCriterion("price_id >", value, "priceId"); + return (Criteria) this; + } + + public Criteria andPriceIdGreaterThanOrEqualTo(String value) { + addCriterion("price_id >=", value, "priceId"); + return (Criteria) this; + } + + public Criteria andPriceIdLessThan(String value) { + addCriterion("price_id <", value, "priceId"); + return (Criteria) this; + } + + public Criteria andPriceIdLessThanOrEqualTo(String value) { + addCriterion("price_id <=", value, "priceId"); + return (Criteria) this; + } + + public Criteria andPriceIdLike(String value) { + addCriterion("price_id like", value, "priceId"); + return (Criteria) this; + } + + public Criteria andPriceIdNotLike(String value) { + addCriterion("price_id not like", value, "priceId"); + return (Criteria) this; + } + + public Criteria andPriceIdIn(List values) { + addCriterion("price_id in", values, "priceId"); + return (Criteria) this; + } + + public Criteria andPriceIdNotIn(List values) { + addCriterion("price_id not in", values, "priceId"); + return (Criteria) this; + } + + public Criteria andPriceIdBetween(String value1, String value2) { + addCriterion("price_id between", value1, value2, "priceId"); + return (Criteria) this; + } + + public Criteria andPriceIdNotBetween(String value1, String value2) { + addCriterion("price_id not between", value1, value2, "priceId"); + return (Criteria) this; + } + + public Criteria andPlatformTypeIsNull() { + addCriterion("platform_type is null"); + return (Criteria) this; + } + + public Criteria andPlatformTypeIsNotNull() { + addCriterion("platform_type is not null"); + return (Criteria) this; + } + + public Criteria andPlatformTypeEqualTo(Integer value) { + addCriterion("platform_type =", value, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeNotEqualTo(Integer value) { + addCriterion("platform_type <>", value, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeGreaterThan(Integer value) { + addCriterion("platform_type >", value, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("platform_type >=", value, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeLessThan(Integer value) { + addCriterion("platform_type <", value, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeLessThanOrEqualTo(Integer value) { + addCriterion("platform_type <=", value, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeIn(List values) { + addCriterion("platform_type in", values, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeNotIn(List values) { + addCriterion("platform_type not in", values, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeBetween(Integer value1, Integer value2) { + addCriterion("platform_type between", value1, value2, "platformType"); + return (Criteria) this; + } + + public Criteria andPlatformTypeNotBetween(Integer value1, Integer value2) { + addCriterion("platform_type not between", value1, value2, "platformType"); + return (Criteria) this; + } + + public Criteria andGoodsIdIsNull() { + addCriterion("goods_id is null"); + return (Criteria) this; + } + + public Criteria andGoodsIdIsNotNull() { + addCriterion("goods_id is not null"); + return (Criteria) this; + } + + public Criteria andGoodsIdEqualTo(String value) { + addCriterion("goods_id =", value, "goodsId"); + return (Criteria) this; + } + + public Criteria andGoodsIdNotEqualTo(String value) { + addCriterion("goods_id <>", value, "goodsId"); + return (Criteria) this; + } + + public Criteria andGoodsIdGreaterThan(String value) { + addCriterion("goods_id >", value, "goodsId"); + return (Criteria) this; + } + + public Criteria andGoodsIdGreaterThanOrEqualTo(String value) { + addCriterion("goods_id >=", value, "goodsId"); + return (Criteria) this; + } + + public Criteria andGoodsIdLessThan(String value) { + addCriterion("goods_id <", value, "goodsId"); + return (Criteria) this; + } + + public Criteria andGoodsIdLessThanOrEqualTo(String value) { + addCriterion("goods_id <=", value, "goodsId"); + return (Criteria) this; + } + + public Criteria andGoodsIdLike(String value) { + addCriterion("goods_id like", value, "goodsId"); + return (Criteria) this; + } + + public Criteria andGoodsIdNotLike(String value) { + addCriterion("goods_id not like", value, "goodsId"); + return (Criteria) this; + } + + public Criteria andGoodsIdIn(List values) { + addCriterion("goods_id in", values, "goodsId"); + return (Criteria) this; + } + + public Criteria andGoodsIdNotIn(List values) { + addCriterion("goods_id not in", values, "goodsId"); + return (Criteria) this; + } + + public Criteria andGoodsIdBetween(String value1, String value2) { + addCriterion("goods_id between", value1, value2, "goodsId"); + return (Criteria) this; + } + + public Criteria andGoodsIdNotBetween(String value1, String value2) { + addCriterion("goods_id not between", value1, value2, "goodsId"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria 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/service/src/main/java/com/hfkj/entity/RechargePrice.java b/service/src/main/java/com/hfkj/entity/RechargePrice.java new file mode 100644 index 0000000..694f67a --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/RechargePrice.java @@ -0,0 +1,233 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * recharge_price + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class RechargePrice implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 折扣比例 + */ + private BigDecimal discount; + + /** + * 1 电信 2.移动 3.联通 + */ + private Integer type; + + /** + * 排序 + */ + private Integer sort; + + /** + * 充值金额 + */ + private BigDecimal price; + + /** + * 支付金额 + */ + private BigDecimal payPrice; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 0:删除 1:上线 2:已售空 + */ + private Integer status; + + 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 BigDecimal getDiscount() { + return discount; + } + + public void setDiscount(BigDecimal discount) { + this.discount = discount; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public BigDecimal getPayPrice() { + return payPrice; + } + + public void setPayPrice(BigDecimal payPrice) { + this.payPrice = payPrice; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public 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; + } + RechargePrice other = (RechargePrice) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getDiscount() == null ? other.getDiscount() == null : this.getDiscount().equals(other.getDiscount())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort())) + && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice())) + && (this.getPayPrice() == null ? other.getPayPrice() == null : this.getPayPrice().equals(other.getPayPrice())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.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 + ((getDiscount() == null) ? 0 : getDiscount().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode()); + result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode()); + result = prime * result + ((getPayPrice() == null) ? 0 : getPayPrice().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((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(", discount=").append(discount); + sb.append(", type=").append(type); + sb.append(", sort=").append(sort); + sb.append(", price=").append(price); + sb.append(", payPrice=").append(payPrice); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", status=").append(status); + 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/service/src/main/java/com/hfkj/entity/RechargePriceExample.java b/service/src/main/java/com/hfkj/entity/RechargePriceExample.java new file mode 100644 index 0000000..ce1f3aa --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/RechargePriceExample.java @@ -0,0 +1,974 @@ +package com.hfkj.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class RechargePriceExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public RechargePriceExample() { + 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 andDiscountIsNull() { + addCriterion("discount is null"); + return (Criteria) this; + } + + public Criteria andDiscountIsNotNull() { + addCriterion("discount is not null"); + return (Criteria) this; + } + + public Criteria andDiscountEqualTo(BigDecimal value) { + addCriterion("discount =", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountNotEqualTo(BigDecimal value) { + addCriterion("discount <>", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountGreaterThan(BigDecimal value) { + addCriterion("discount >", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount >=", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountLessThan(BigDecimal value) { + addCriterion("discount <", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount <=", value, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountIn(List values) { + addCriterion("discount in", values, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountNotIn(List values) { + addCriterion("discount not in", values, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount between", value1, value2, "discount"); + return (Criteria) this; + } + + public Criteria andDiscountNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount not between", value1, value2, "discount"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(Integer value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(Integer value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(Integer value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(Integer value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(Integer value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(Integer value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(Integer value1, Integer value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(Integer value1, Integer value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andPriceIsNull() { + addCriterion("price is null"); + return (Criteria) this; + } + + public Criteria andPriceIsNotNull() { + addCriterion("price is not null"); + return (Criteria) this; + } + + public Criteria andPriceEqualTo(BigDecimal value) { + addCriterion("price =", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotEqualTo(BigDecimal value) { + addCriterion("price <>", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceGreaterThan(BigDecimal value) { + addCriterion("price >", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("price >=", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceLessThan(BigDecimal value) { + addCriterion("price <", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("price <=", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceIn(List values) { + addCriterion("price in", values, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotIn(List values) { + addCriterion("price not in", values, "price"); + return (Criteria) this; + } + + public Criteria andPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price between", value1, value2, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price not between", value1, value2, "price"); + return (Criteria) this; + } + + public Criteria andPayPriceIsNull() { + addCriterion("pay_price is null"); + return (Criteria) this; + } + + public Criteria andPayPriceIsNotNull() { + addCriterion("pay_price is not null"); + return (Criteria) this; + } + + public Criteria andPayPriceEqualTo(BigDecimal value) { + addCriterion("pay_price =", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotEqualTo(BigDecimal value) { + addCriterion("pay_price <>", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceGreaterThan(BigDecimal value) { + addCriterion("pay_price >", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("pay_price >=", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceLessThan(BigDecimal value) { + addCriterion("pay_price <", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("pay_price <=", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceIn(List values) { + addCriterion("pay_price in", values, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotIn(List values) { + addCriterion("pay_price not in", values, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("pay_price between", value1, value2, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("pay_price not between", value1, value2, "payPrice"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria 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/service/src/main/java/com/hfkj/phone/CtPhoneBillService.java b/service/src/main/java/com/hfkj/phone/CtPhoneBillService.java new file mode 100644 index 0000000..d39592c --- /dev/null +++ b/service/src/main/java/com/hfkj/phone/CtPhoneBillService.java @@ -0,0 +1,33 @@ +package com.hfkj.phone; +import java.util.Map; + +/** + * @ClassName CtPhoneBillService + * @Author Sum1Dream + * @Description 畅停话费话费充值 + * @Date 2024/6/19 上午10:55 + **/ +public class CtPhoneBillService { + + /** + * @MethodName recharge + * @Description: 查询畅停订单下单 + * @param map + * @Author: Sum1Dream + * @Date: 2024/6/19 下午2:06 + */ + public static void recharge(Map map)throws Exception { + PhoneBillService.requestCt("/external/api/telPay" , map); + } + + /** + * @MethodName searchOrder + * @Description:畅停话费查询订单详情 + * @param map + * @Author: Sum1Dream + * @Date: 2024/6/19 下午2:06 + */ + public static void searchOrder(Map map)throws Exception { + PhoneBillService.requestCt("/external/api/searchOrder" , map); + } +} diff --git a/service/src/main/java/com/hfkj/phone/PhoneBillService.java b/service/src/main/java/com/hfkj/phone/PhoneBillService.java new file mode 100644 index 0000000..466881c --- /dev/null +++ b/service/src/main/java/com/hfkj/phone/PhoneBillService.java @@ -0,0 +1,52 @@ +package com.hfkj.phone; + +import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.pay.util.sdk.WXPayConstants; +import com.hfkj.common.utils.HttpsUtils; +import com.hfkj.config.CommonSysConst; +import com.hfkj.config.GenerateSign; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.HashMap; +import java.util.Map; + +/** + * @ClassName PhoneBillService + * @Author Sum1Dream + * @Description 话费 + * @Date 2024/6/19 上午11:29 + **/ +public class PhoneBillService { + + + private static Logger log = LoggerFactory.getLogger(PhoneBillService.class); + + /** + * 请求 + * @param postUrl 接口请求地址 + * @param param 参数 + * @return + * @throws Exception + */ + public static JSONObject requestCt(String postUrl, Map param) throws Exception { + + log.info("============ 话费请求-START ============="); + param.put("mchid" , CommonSysConst.getSysConfig().getCtMemberId()); + param.put("sign", GenerateSign.generateSignatureCt(param , CommonSysConst.getSysConfig().getCtApiKey() , WXPayConstants.SignType.MD5)); + log.info("请求接口:" + postUrl); + log.info("请求参数:" + JSONObject.toJSONString(param)); + + JSONObject response = HttpsUtils.doPostForm(CommonSysConst.getSysConfig().getCtPostUrl() + postUrl, GenerateSign.paramSort(param) , new HashMap<>()); + + log.info("响应参数:" + response.toJSONString()); + log.info("============ 话费请求-END =============="); + return response; + + } + + + + + +} diff --git a/service/src/main/java/com/hfkj/qianzhu/channel/KfcService.java b/service/src/main/java/com/hfkj/qianzhu/channel/KfcService.java new file mode 100644 index 0000000..e6c6b04 --- /dev/null +++ b/service/src/main/java/com/hfkj/qianzhu/channel/KfcService.java @@ -0,0 +1,107 @@ +package com.hfkj.qianzhu.channel; + +import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; + +import java.util.Map; + +/** + * @ClassName KfcService + * @Author Sum1Dream + * @Description + * @Date 2024/6/17 下午5:55 + **/ +public class KfcService { + + /** + * @MethodName getByOrderNo + * @Description: 根据订单号查询订单详情 + * @param map + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/6/17 下午6:00 + */ + public static JSONObject getByOrderNo(Map map) throws Exception { + + JSONObject object = QianZhuService.request("/openApi/v1/kfcOrders/getByOrderNo" , map); + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + } + + /** + * @MethodName payKfcOrder + * @Description:支付订单 + * @param map + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/6/17 下午6:07 + */ + public static JSONObject payKfcOrder(Map map) throws Exception { + + JSONObject object = QianZhuService.request("/openApi/v1/orders/payKfcOrder" , map); + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + } + + /** + * @MethodName listAll + * @Description:查询KFC门店 + * @param map + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/6/17 下午6:10 + */ + public static JSONObject listAll(Map map) throws Exception { + + JSONObject object = QianZhuService.request("/openApi/v2/kfcStores/listAll" , map); + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + } + + /** + * @MethodName listByStoreCode + * @Description:查询KFC门店菜单 + * @param map + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/6/17 下午6:11 + */ + public static JSONObject listByStoreCode(Map map) throws Exception { + + JSONObject object = QianZhuService.request("/openApi/v1/kfcMenus/listByStoreCode" , map); + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + } + + /** + * @MethodName createKfcOrder + * @Description:创建kfc订单 + * @param map + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/6/17 下午6:12 + */ + public static JSONObject createKfcOrder(Map map) throws Exception { + + JSONObject object = QianZhuService.request("/openApi/v4/orders/createKfcOrder" , map); + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + } +} diff --git a/service/src/main/java/com/hfkj/qianzhu/channel/QianZhuService.java b/service/src/main/java/com/hfkj/qianzhu/channel/QianZhuService.java index 8e650f1..09a4688 100644 --- a/service/src/main/java/com/hfkj/qianzhu/channel/QianZhuService.java +++ b/service/src/main/java/com/hfkj/qianzhu/channel/QianZhuService.java @@ -1,5 +1,6 @@ package com.hfkj.qianzhu.channel; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; @@ -7,7 +8,9 @@ import com.hfkj.common.exception.SysCode; import com.hfkj.common.pay.util.sdk.WXPayConstants; import com.hfkj.common.utils.HttpsUtils; import com.hfkj.common.utils.MD5Util; +import com.hfkj.common.utils.WxUtils; import com.hfkj.config.CommonSysConst; +import com.hfkj.config.GenerateSign; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,7 +33,7 @@ public class QianZhuService { log.info("============ 千猪请求-START ============="); param.put("platformId", CommonSysConst.getSysConfig().getQianZhuPlatformId()); param.put("timestamp", new Date().getTime()); - param.put("sign", MD5Util.encode(generateSignature(param,CommonSysConst.getSysConfig().getQianZhuSecret()).getBytes()).toLowerCase()); + param.put("sign", MD5Util.encode(GenerateSign.paramSort(param,CommonSysConst.getSysConfig().getQianZhuSecret()).getBytes()).toLowerCase()); log.info("请求接口:" + postUrl); log.info("请求参数:" + JSONObject.toJSONString(param)); @@ -43,6 +46,35 @@ public class QianZhuService { } + /** + * 请求 + * @param postUrl 接口请求地址 + * @param map 参数 + * @return + * @throws Exception + */ + public static JSONObject requestH5(String postUrl, Map map) throws Exception { + + log.info("============ 千猪请求-START ============="); + Map param = new HashMap<>(); + param.put("platformId", CommonSysConst.getSysConfig().getQianZhuPlatformId()); + param.put("timestamp", new Date().getTime()); + map.put("action", postUrl); + param.put("content", JSON.toJSONString(map)); + param.put("version", "1.0"); + param.put("traceId", WxUtils.makeNonStr()); + param.put("sign", MD5Util.encode(GenerateSign.paramSort(param,CommonSysConst.getSysConfig().getQianZhuSecret()).getBytes()).toLowerCase()); + + log.info("请求接口:" + postUrl); + log.info("请求参数:" + JSONObject.toJSONString(param)); + + JSONObject response = HttpsUtils.doPost(CommonSysConst.getSysConfig().getQianZhuH5url(), JSONObject.toJSONString(param)); + + log.info("响应参数:" + response.toJSONString()); + log.info("============ 千猪请求-END =============="); + return response; + + } /** * @Author Sum1Dream @@ -82,28 +114,4 @@ public class QianZhuService { } - /** - * 生成签名 - * @param data 数据 - * @param key 秘钥app_secret - * @return 加密结果 - */ - public static String generateSignature(final Map data, String key){ - 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 (StringUtils.isBlank(sb.toString())) { - sb.append(k).append("=").append(data.get(k)); - } else { - sb.append("&").append(k).append("=").append(data.get(k)); - } - } - sb.append(key); - return sb.toString(); - } } diff --git a/service/src/main/java/com/hfkj/service/goods/BsOrderGoodsService.java b/service/src/main/java/com/hfkj/service/goods/BsOrderGoodsService.java index 26c5cef..fce3b82 100644 --- a/service/src/main/java/com/hfkj/service/goods/BsOrderGoodsService.java +++ b/service/src/main/java/com/hfkj/service/goods/BsOrderGoodsService.java @@ -2,9 +2,7 @@ package com.hfkj.service.goods; import com.alibaba.fastjson.JSONObject; import com.hfkj.entity.BsOrderGoods; -import com.hfkj.entity.GoodsBrand; import com.hfkj.entity.GoodsLogistics; -import com.hfkj.model.order.OrderModel; import java.util.List; import java.util.Map; diff --git a/service/src/main/java/com/hfkj/service/recharge/PriceService.java b/service/src/main/java/com/hfkj/service/recharge/PriceService.java new file mode 100644 index 0000000..bec3fc1 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/recharge/PriceService.java @@ -0,0 +1,57 @@ +package com.hfkj.service.recharge; + +import com.hfkj.entity.RechargePrice; + +import java.util.List; +import java.util.Map; + +public interface PriceService { + + /** + * @MethodName create + * @Description: 创建 + * @param rechargePrice + * @Author: Sum1Dream + * @Date: 2024/6/19 下午3:15 + */ + void create(RechargePrice rechargePrice); + + /** + * @MethodName update + * @Description: 更新 + * @param rechargePrice + * @Author: Sum1Dream + * @Date: 2024/6/19 下午3:15 + */ + void update(RechargePrice rechargePrice); + + /** + * @MethodName delete + * @Description:删除 + * @param id + * @param fullDelete + * @Author: Sum1Dream + * @Date: 2024/6/19 下午3:15 + */ + void delete(Long id , Boolean fullDelete); + + /** + * @MethodName queryDetail + * @Description: 查询 + * @param id + * @return: com.hfkj.entity.RechargePrice + * @Author: Sum1Dream + * @Date: 2024/6/19 下午3:15 + */ + RechargePrice queryDetail(Long id); + + /** + * @MethodName getList + * @Description: 查询列表 + * @param map + * @return: java.util.List + * @Author: Sum1Dream + * @Date: 2024/6/19 下午3:16 + */ + List getList(Map map); +} diff --git a/service/src/main/java/com/hfkj/service/recharge/impl/PriceServiceImpl.java b/service/src/main/java/com/hfkj/service/recharge/impl/PriceServiceImpl.java new file mode 100644 index 0000000..953792f --- /dev/null +++ b/service/src/main/java/com/hfkj/service/recharge/impl/PriceServiceImpl.java @@ -0,0 +1,64 @@ +package com.hfkj.service.recharge.impl; + +import com.hfkj.dao.RechargePriceMapper; +import com.hfkj.entity.BsOrderGoods; +import com.hfkj.entity.RechargePrice; +import com.hfkj.entity.RechargePriceExample; +import com.hfkj.service.recharge.PriceService; +import org.apache.commons.collections4.MapUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("priceService") +public class PriceServiceImpl implements PriceService { + + @Resource + private RechargePriceMapper rechargePriceMapper; + + @Override + public void create(RechargePrice rechargePrice) { + rechargePriceMapper.insert(rechargePrice); + } + + @Override + public void update(RechargePrice rechargePrice) { + rechargePriceMapper.updateByPrimaryKeySelective(rechargePrice); + } + + @Override + public void delete(Long id, Boolean fullDelete) { + if (fullDelete) { + rechargePriceMapper.deleteByPrimaryKey(id); + } else { + RechargePrice rechargePrice = queryDetail(id); + rechargePrice.setStatus(0); + rechargePrice.setUpdateTime(new Date()); + update(rechargePrice); + } + } + + @Override + public RechargePrice queryDetail(Long id) { + return rechargePriceMapper.selectByPrimaryKey(id); + } + + @Override + public List getList(Map map) { + + RechargePriceExample example = new RechargePriceExample(); + RechargePriceExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getInteger(map, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(map, "type")); + } + + + + return rechargePriceMapper.selectByExample(example); + } +} diff --git a/service/src/main/resources/dev/commonConfig.properties b/service/src/main/resources/dev/commonConfig.properties index 7f8777e..c4c164e 100644 --- a/service/src/main/resources/dev/commonConfig.properties +++ b/service/src/main/resources/dev/commonConfig.properties @@ -54,5 +54,12 @@ etcPrivateKey = MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBAO8+KWh/OmBahFk7 #QIANZHU qianZhuUrl=https://live-test.qianzhu8.com +qianzhuH5url=https://nf-test.qianzhu8.com/gateway qianZhuPlatformId=10376 qianZhuSecret=ktxb49sh2jfhgn8g + +#CT +ctNotifyUrl = 1 +ctApiKey=3fd74e7c16b04681a0f481c5bc0a96d3 +ctMemberId=1622808562621276161 +ctPostUrl=http://113.250.49.100:8088/recharge/ diff --git a/service/src/main/resources/prod/commonConfig.properties b/service/src/main/resources/prod/commonConfig.properties index adab6f1..df3163b 100644 --- a/service/src/main/resources/prod/commonConfig.properties +++ b/service/src/main/resources/prod/commonConfig.properties @@ -49,3 +49,16 @@ etcPostUrl = https://test.djien-qr.com/ etcChannelCode = GZETCFXQD etcPublicKey = MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMyQb5gR1rweB5oHKqRPJtJjLQKsn5PXOVfaNdGt/2kPkHvRdN3L9zOaAvFEXcEl2V0sg3D8a+2Sfy1YANAZvjscTQYOaoFl+LVyQZvgyyX8RQw+26Jmbqh8DwenUbNf7DFYVSDxIMBLOiWPkGsYGFONjsUVmfykSeVTcEgQB3VwIDAQAB etcPrivateKey = MIICeQIBADANBgkqhkiG9w0BAQEFAASCAmMwggJfAgEAAoGBAO8+KWh/OmBahFk7TWOEjPl13BT5NdlbGvQ/311Yua6CQqul9w1DIR2TwFUUh/Bko/eVoLROfF2XVjHbw2bImTdJ7y9C3511HI59YPNzqyql0DHjLxbH0VW92eUgk8mG09wtrUMu1ImN0b7aFE3uqAgz6pwh3TUiQWsDWz+l/MG7AgMBAAECgYEA7nYsOd8OpbmzT2m/omEdTwz9993KocKgZDJCBj4InftyTrrXO93cZSm/PE6BjMgTcxUuIGpWpcbRgFLHOmzZ4Qd+k/6Yb1ErMTfdGlgrxv2B+vztWYfjmFzEiXpecFH47ED6iYrrqm14X3InpnBv4rUkGdqqNbyPGgTO2ncs/3kCQQD+xqRAQSb/TROlqJdO91y6z9v0PO2GLmokqYg444rKYZKhDE0tdJeLU/sfK8SMg5+SlwdQm4nlo8EDJ/w2CEn3AkEA8GRqVkKgIuH413/a6+luYDjlf30WY7Mi1sm3QPSZ6+eH35UwsL6mdX6mjRpUN9Hez6FMfE7s3XOldoPVMzR1XQJBAOa2VTkGhtz8HEWQZOySXfuhjSogHmu7Dk2C5CO4Eg/wycpjDGSUR0NZWnfAt60S6GbjszEQmJBGeNt10xPO78MCQQCWXwnRaZ3IFDhXfQfRWFSN5ilQ5UszFGQvnUB/ZkI+ObdZmXY6qRdxGcdPLnAN9r78fDZe7/Pk1qljCDY98IuVAkEAnSeO/221gDhL1wnbUhGuX1yo8f5Eo/wDTW5cBxXFGZeexhB8I4jnEV4E/xmikkb3jDFvmrnFk+XUtDqkrvicRQ== + + +#QIANZHU +qinzhuUrl=https://live.qianzhu8.com +qianzhuH5url=https://nf.qianzhu8.com/gateway +qinzhuPlatformId=10458 +qinzhuSecret=nnl3gg4ss0pka11t + +#CT +HgNotifyUrl = 1 +HgApiKey=3fd74e7c16b04681a0f481c5bc0a96d3 +HgMemberId=1622808562621276161 +HgPostUrl=http://113.250.49.100:8088/recharge/ From d1facad8e6a26a4f9a35f856fbc5558d68bc3506 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Wed, 26 Jun 2024 15:05:14 +0800 Subject: [PATCH 6/6] Changes --- .../controller/recharge/PriceController.java | 21 ++---- .../com/cweb/controller/CommonController.java | 62 ++++++++++++++--- .../controller/qianZhu/CinemaController.java | 67 +++++++++++++++++++ .../com/hfkj/dao/RechargePriceMapper.java | 17 ++--- .../hfkj/dao/RechargePriceSqlProvider.java | 14 ---- .../java/com/hfkj/entity/RechargePrice.java | 16 ----- .../com/hfkj/entity/RechargePriceExample.java | 60 ----------------- .../hfkj/qianzhu/channel/CinemaService.java | 41 +++++++++++- .../hfkj/qianzhu/channel/QianZhuService.java | 3 +- .../service/recharge/RechargeCodeService.java | 63 +++++++++++++++++ .../impl/RechargeCodeServiceImpl.java | 43 ++++++++++++ 11 files changed, 281 insertions(+), 126 deletions(-) create mode 100644 service/src/main/java/com/hfkj/service/recharge/RechargeCodeService.java create mode 100644 service/src/main/java/com/hfkj/service/recharge/impl/RechargeCodeServiceImpl.java diff --git a/bweb/src/main/java/com/bweb/controller/recharge/PriceController.java b/bweb/src/main/java/com/bweb/controller/recharge/PriceController.java index 2191319..64ff28a 100644 --- a/bweb/src/main/java/com/bweb/controller/recharge/PriceController.java +++ b/bweb/src/main/java/com/bweb/controller/recharge/PriceController.java @@ -1,31 +1,23 @@ package com.bweb.controller.recharge; -import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; -import com.hfkj.common.security.SessionObject; import com.hfkj.common.utils.ResponseMsgUtil; -import com.hfkj.entity.GoodsBrand; -import com.hfkj.entity.GoodsType; + import com.hfkj.entity.RechargePrice; import com.hfkj.model.ResponseData; -import com.hfkj.model.SecUserSessionObject; import com.hfkj.service.recharge.PriceService; -import com.hfkj.sysenum.SecUserObjectTypeEnum; 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 javax.servlet.http.HttpServletRequest; -import java.math.BigDecimal; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -40,10 +32,10 @@ public class PriceController { @Resource private PriceService priceService; - @RequestMapping(value="/getListGoods",method = RequestMethod.GET) + @RequestMapping(value="/getListPrice",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询列表") - public ResponseData getListGoods( + public ResponseData getListPrice( @RequestParam(value = "type" , required = false) Integer type, @RequestParam(value = "pageNum" , required = true) Integer pageNum, @RequestParam(value = "pageSize" , required = true) Integer pageSize) { @@ -67,10 +59,9 @@ public class PriceController { public ResponseData editPrice(@RequestBody RechargePrice body) { try { - if (body == null || body.getPrice() == null - || body.getDiscount() == null + || body.getPayPrice() == null || body.getSort() == null || body.getType() == null ) { @@ -91,9 +82,8 @@ public class PriceController { } rechargePrice.setUpdateTime(new Date()); - rechargePrice.setPayPrice(body.getPrice().multiply(body.getDiscount()).divide(new BigDecimal(100)).setScale(2 , BigDecimal.ROUND_HALF_UP)); + rechargePrice.setPayPrice(body.getPayPrice()); rechargePrice.setPrice(body.getPrice()); - rechargePrice.setDiscount(body.getDiscount()); rechargePrice.setType(body.getType()); rechargePrice.setSort(body.getSort()); rechargePrice.setStatus(1); @@ -110,6 +100,7 @@ public class PriceController { log.error("OutRechargePriceController --> insertPrice() error!", e); return ResponseMsgUtil.exception(e); } + } @RequestMapping(value="/delete",method = RequestMethod.GET) diff --git a/cweb/src/main/java/com/cweb/controller/CommonController.java b/cweb/src/main/java/com/cweb/controller/CommonController.java index b406d83..8e0531d 100644 --- a/cweb/src/main/java/com/cweb/controller/CommonController.java +++ b/cweb/src/main/java/com/cweb/controller/CommonController.java @@ -21,9 +21,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; @RestController @RequestMapping(value="/common") @@ -37,6 +36,7 @@ public class CommonController { @Autowired private RedisUtil redisUtil; + @Resource private BsOrderGoodsService bsOrderGoodsService; @@ -86,10 +86,10 @@ public class CommonController { } } - @RequestMapping(value = "/getAllCities", method = RequestMethod.GET) + @RequestMapping(value = "/getAllQzCities", method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "查询中国大陆所有城市") - public ResponseData getAllCities() { + @ApiOperation(value = "查询千猪中国大陆所有城市") + public ResponseData getAllQzCities() { try { Object data = redisUtil.get("qianZhuCity"); @@ -97,9 +97,21 @@ public class CommonController { if (data == null) { JSONObject jsonObjects = QianZhuService.getAllCities(); - redisUtil.set("qianZhuCity", jsonObjects); - return ResponseMsgUtil.success(jsonObjects); + JSONArray array = jsonObjects.getJSONArray("data"); + List list = new ArrayList<>(); + + for (Object obj : array) { + list.add((JSONObject) obj); + } + List objectList = list.stream() + .filter(n -> n.getInteger("cityId") != null) + .collect(Collectors.toList()); + + + redisUtil.set("qianZhuCity", objectList , 60*60*6); + + return ResponseMsgUtil.success(objectList); } else { return ResponseMsgUtil.success(data); @@ -111,6 +123,40 @@ public class CommonController { } } + + @RequestMapping(value = "/locateByLngAndLat", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据经纬度定位城市") + public ResponseData locateByLngAndLat(@RequestParam(name = "lng", required = true) String lng, @RequestParam(name = "lat", required = true) String lat) { + try { + + String cityName = "重庆市"; + + ResponseData data = getAllQzCities(); + + if (Objects.equals(data.getReturn_code(), "000000")) { + List array = (List) data.getReturn_data(); + + for (JSONObject s : array) { + if (Objects.equals(s.getString("cityName"), cityName)) { + return ResponseMsgUtil.success(s); + } + } + + return ResponseMsgUtil.success("未查询到任何内容!"); + + + } else { + return ResponseMsgUtil.success(data.getReturn_msg()); + } + + + } catch (Exception e) { + log.error("HighUserCardController --> oilCardRefund() error!", e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value = "/listByCityId", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询城市区域") diff --git a/cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java b/cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java index 2b1b01a..6318821 100644 --- a/cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java +++ b/cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java @@ -182,4 +182,71 @@ public class CinemaController { return ResponseMsgUtil.exception(e); } } + + @RequestMapping(value="/pagedQuery",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "分页查询场次") + public ResponseData pagedQuery( + @RequestParam(name = "cityId", required = false) Integer cityId, + @RequestParam(name = "cityCode", required = false) String cityCode, + @RequestParam(name = "cinemaId", required = false) Integer cinemaId, + @RequestParam(name = "filmId", required = false) Integer filmId, + @RequestParam(value = "showTimeBeginTime" , required = false) Long showTimeBeginTime, + @RequestParam(value = "showTimeEndTime" , required = false) Long showTimeEndTime, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize + ) { + try { + + Map params = new HashMap<>(); + + if (cityId != null) { + params.put("cityId", cityId); + } + if (cityCode != null) { + params.put("cityCode", cityCode); + } + if (cinemaId != null) { + params.put("cinemaId", cinemaId); + } + if (filmId != null) { + params.put("filmId", filmId); + } + if (showTimeBeginTime != null) { + params.put("showTimeBeginTime", showTimeBeginTime); + } + if (showTimeEndTime != null) { + params.put("showTimeEndTime", showTimeEndTime); + } + + params.put("pageIndex", pageNum); + params.put("pageSize", pageSize); + + return ResponseMsgUtil.success(CinemaService.pagedQuery(params)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value="/getRealTimeSeatByShowId",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询场次实时座位") + public ResponseData getRealTimeSeatByShowId( + @RequestParam(name = "showId", required = true) Long showId + ) { + try { + + Map params = new HashMap<>(); + params.put("showId", showId); + + return ResponseMsgUtil.success(CinemaService.getRealTimeSeatByShowId(params)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } } diff --git a/service/src/main/java/com/hfkj/dao/RechargePriceMapper.java b/service/src/main/java/com/hfkj/dao/RechargePriceMapper.java index 61b4768..e85697e 100644 --- a/service/src/main/java/com/hfkj/dao/RechargePriceMapper.java +++ b/service/src/main/java/com/hfkj/dao/RechargePriceMapper.java @@ -39,13 +39,13 @@ public interface RechargePriceMapper extends RechargePriceMapperExt { int deleteByPrimaryKey(Long id); @Insert({ - "insert into recharge_price (discount, `type`, ", - "sort, price, pay_price, ", + "insert into recharge_price (`type`, sort, ", + "price, pay_price, ", "create_time, update_time, ", "`status`, ext_1, ext_2, ", "ext_3)", - "values (#{discount,jdbcType=DECIMAL}, #{type,jdbcType=INTEGER}, ", - "#{sort,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{payPrice,jdbcType=DECIMAL}, ", + "values (#{type,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER}, ", + "#{price,jdbcType=DECIMAL}, #{payPrice,jdbcType=DECIMAL}, ", "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", "#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", "#{ext3,jdbcType=VARCHAR})" @@ -60,7 +60,6 @@ public interface RechargePriceMapper extends RechargePriceMapperExt { @SelectProvider(type=RechargePriceSqlProvider.class, method="selectByExample") @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), - @Result(column="discount", property="discount", jdbcType=JdbcType.DECIMAL), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER), @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), @@ -76,14 +75,13 @@ public interface RechargePriceMapper extends RechargePriceMapperExt { @Select({ "select", - "id, discount, `type`, sort, price, pay_price, create_time, update_time, `status`, ", - "ext_1, ext_2, ext_3", + "id, `type`, sort, price, pay_price, create_time, update_time, `status`, ext_1, ", + "ext_2, ext_3", "from recharge_price", "where id = #{id,jdbcType=BIGINT}" }) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), - @Result(column="discount", property="discount", jdbcType=JdbcType.DECIMAL), @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER), @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), @@ -108,8 +106,7 @@ public interface RechargePriceMapper extends RechargePriceMapperExt { @Update({ "update recharge_price", - "set discount = #{discount,jdbcType=DECIMAL},", - "`type` = #{type,jdbcType=INTEGER},", + "set `type` = #{type,jdbcType=INTEGER},", "sort = #{sort,jdbcType=INTEGER},", "price = #{price,jdbcType=DECIMAL},", "pay_price = #{payPrice,jdbcType=DECIMAL},", diff --git a/service/src/main/java/com/hfkj/dao/RechargePriceSqlProvider.java b/service/src/main/java/com/hfkj/dao/RechargePriceSqlProvider.java index 2868b77..b42717d 100644 --- a/service/src/main/java/com/hfkj/dao/RechargePriceSqlProvider.java +++ b/service/src/main/java/com/hfkj/dao/RechargePriceSqlProvider.java @@ -28,10 +28,6 @@ public class RechargePriceSqlProvider { SQL sql = new SQL(); sql.INSERT_INTO("recharge_price"); - if (record.getDiscount() != null) { - sql.VALUES("discount", "#{discount,jdbcType=DECIMAL}"); - } - if (record.getType() != null) { sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); } @@ -82,7 +78,6 @@ public class RechargePriceSqlProvider { } else { sql.SELECT("id"); } - sql.SELECT("discount"); sql.SELECT("`type`"); sql.SELECT("sort"); sql.SELECT("price"); @@ -114,10 +109,6 @@ public class RechargePriceSqlProvider { sql.SET("id = #{record.id,jdbcType=BIGINT}"); } - if (record.getDiscount() != null) { - sql.SET("discount = #{record.discount,jdbcType=DECIMAL}"); - } - if (record.getType() != null) { sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); } @@ -167,7 +158,6 @@ public class RechargePriceSqlProvider { sql.UPDATE("recharge_price"); sql.SET("id = #{record.id,jdbcType=BIGINT}"); - sql.SET("discount = #{record.discount,jdbcType=DECIMAL}"); sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); sql.SET("sort = #{record.sort,jdbcType=INTEGER}"); sql.SET("price = #{record.price,jdbcType=DECIMAL}"); @@ -188,10 +178,6 @@ public class RechargePriceSqlProvider { SQL sql = new SQL(); sql.UPDATE("recharge_price"); - if (record.getDiscount() != null) { - sql.SET("discount = #{discount,jdbcType=DECIMAL}"); - } - if (record.getType() != null) { sql.SET("`type` = #{type,jdbcType=INTEGER}"); } diff --git a/service/src/main/java/com/hfkj/entity/RechargePrice.java b/service/src/main/java/com/hfkj/entity/RechargePrice.java index 694f67a..9c7fed7 100644 --- a/service/src/main/java/com/hfkj/entity/RechargePrice.java +++ b/service/src/main/java/com/hfkj/entity/RechargePrice.java @@ -19,11 +19,6 @@ public class RechargePrice implements Serializable { */ private Long id; - /** - * 折扣比例 - */ - private BigDecimal discount; - /** * 1 电信 2.移动 3.联通 */ @@ -75,14 +70,6 @@ public class RechargePrice implements Serializable { this.id = id; } - public BigDecimal getDiscount() { - return discount; - } - - public void setDiscount(BigDecimal discount) { - this.discount = discount; - } - public Integer getType() { return type; } @@ -176,7 +163,6 @@ public class RechargePrice implements Serializable { } RechargePrice other = (RechargePrice) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) - && (this.getDiscount() == null ? other.getDiscount() == null : this.getDiscount().equals(other.getDiscount())) && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) && (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort())) && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice())) @@ -194,7 +180,6 @@ public class RechargePrice implements Serializable { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); - result = prime * result + ((getDiscount() == null) ? 0 : getDiscount().hashCode()); result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode()); result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode()); @@ -215,7 +200,6 @@ public class RechargePrice implements Serializable { sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); - sb.append(", discount=").append(discount); sb.append(", type=").append(type); sb.append(", sort=").append(sort); sb.append(", price=").append(price); diff --git a/service/src/main/java/com/hfkj/entity/RechargePriceExample.java b/service/src/main/java/com/hfkj/entity/RechargePriceExample.java index ce1f3aa..540638e 100644 --- a/service/src/main/java/com/hfkj/entity/RechargePriceExample.java +++ b/service/src/main/java/com/hfkj/entity/RechargePriceExample.java @@ -186,66 +186,6 @@ public class RechargePriceExample { return (Criteria) this; } - public Criteria andDiscountIsNull() { - addCriterion("discount is null"); - return (Criteria) this; - } - - public Criteria andDiscountIsNotNull() { - addCriterion("discount is not null"); - return (Criteria) this; - } - - public Criteria andDiscountEqualTo(BigDecimal value) { - addCriterion("discount =", value, "discount"); - return (Criteria) this; - } - - public Criteria andDiscountNotEqualTo(BigDecimal value) { - addCriterion("discount <>", value, "discount"); - return (Criteria) this; - } - - public Criteria andDiscountGreaterThan(BigDecimal value) { - addCriterion("discount >", value, "discount"); - return (Criteria) this; - } - - public Criteria andDiscountGreaterThanOrEqualTo(BigDecimal value) { - addCriterion("discount >=", value, "discount"); - return (Criteria) this; - } - - public Criteria andDiscountLessThan(BigDecimal value) { - addCriterion("discount <", value, "discount"); - return (Criteria) this; - } - - public Criteria andDiscountLessThanOrEqualTo(BigDecimal value) { - addCriterion("discount <=", value, "discount"); - return (Criteria) this; - } - - public Criteria andDiscountIn(List values) { - addCriterion("discount in", values, "discount"); - return (Criteria) this; - } - - public Criteria andDiscountNotIn(List values) { - addCriterion("discount not in", values, "discount"); - return (Criteria) this; - } - - public Criteria andDiscountBetween(BigDecimal value1, BigDecimal value2) { - addCriterion("discount between", value1, value2, "discount"); - return (Criteria) this; - } - - public Criteria andDiscountNotBetween(BigDecimal value1, BigDecimal value2) { - addCriterion("discount not between", value1, value2, "discount"); - return (Criteria) this; - } - public Criteria andTypeIsNull() { addCriterion("`type` is null"); return (Criteria) this; diff --git a/service/src/main/java/com/hfkj/qianzhu/channel/CinemaService.java b/service/src/main/java/com/hfkj/qianzhu/channel/CinemaService.java index 310abae..1723a70 100644 --- a/service/src/main/java/com/hfkj/qianzhu/channel/CinemaService.java +++ b/service/src/main/java/com/hfkj/qianzhu/channel/CinemaService.java @@ -26,7 +26,7 @@ public class CinemaService { */ public static JSONObject filmsPagedQuery(Map map) throws Exception { - JSONObject object = QianZhuService.request("/openApi/v1/films/pagedQuery" , map); + JSONObject object = QianZhuService.request("/openApi/v1/films/filmsPagedQuery" , map); if (object.getBoolean("success") && object.getInteger("code") == 10000) { return object; @@ -135,6 +135,45 @@ public class CinemaService { } + /** + * @MethodName pagedQuery + * @Description: 分页查询场次 + * @param map + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/6/25 上午9:58 + */ + public static JSONObject pagedQuery(Map map) throws Exception { + + JSONObject object = QianZhuService.request("/openApi/v2/shows/pagedQuery" , map); + + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + + } + + /** + * @MethodName getRealTimeSeatByShowId + * @Description:查询场次实时座位 + * @param map + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/6/25 上午10:23 + */ + public static JSONObject getRealTimeSeatByShowId(Map map) throws Exception { + + JSONObject object = QianZhuService.request("/openApi/v1/shows/getRealTimeSeatByShowId" , map); + + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + + } diff --git a/service/src/main/java/com/hfkj/qianzhu/channel/QianZhuService.java b/service/src/main/java/com/hfkj/qianzhu/channel/QianZhuService.java index 09a4688..f6e2cf1 100644 --- a/service/src/main/java/com/hfkj/qianzhu/channel/QianZhuService.java +++ b/service/src/main/java/com/hfkj/qianzhu/channel/QianZhuService.java @@ -5,13 +5,11 @@ import com.alibaba.fastjson.JSONObject; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; -import com.hfkj.common.pay.util.sdk.WXPayConstants; import com.hfkj.common.utils.HttpsUtils; import com.hfkj.common.utils.MD5Util; import com.hfkj.common.utils.WxUtils; import com.hfkj.config.CommonSysConst; import com.hfkj.config.GenerateSign; -import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -86,6 +84,7 @@ public class QianZhuService { */ public static JSONObject getAllCities() throws Exception { + JSONObject object = QianZhuService.request("/openApi/v2/cities/listAll" , new HashMap<>()); if (object.getBoolean("success") && object.getInteger("code") == 10000) { diff --git a/service/src/main/java/com/hfkj/service/recharge/RechargeCodeService.java b/service/src/main/java/com/hfkj/service/recharge/RechargeCodeService.java new file mode 100644 index 0000000..9bf4025 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/recharge/RechargeCodeService.java @@ -0,0 +1,63 @@ +package com.hfkj.service.recharge; + +import com.hfkj.entity.RechargeCode; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName RechargeCodeService + * @Author Sum1Dream + * @Description + * @Date 2024/6/24 下午3:07 + **/ +public interface RechargeCodeService { + + /** + * @MethodName create + * @Description: 创建 + * @param rechargeCode + * @Author: Sum1Dream + * @Date: 2024/6/24 下午3:10 + */ + void create(RechargeCode rechargeCode); + + /** + * @MethodName update + * @Description: 更新 + * @param rechargeCode + * @Author: Sum1Dream + * @Date: 2024/6/24 下午3:11 + */ + void update(RechargeCode rechargeCode); + + /** + * @MethodName delete + * @Description: 删除 + * @param id + * @param fullDelete + * @Author: Sum1Dream + * @Date: 2024/6/24 下午3:11 + */ + void delete(Long id , Boolean fullDelete); + + /** + * @MethodName queryDetail + * @Description: 查询详情 + * @param id + * @return: com.hfkj.entity.RechargeCode + * @Author: Sum1Dream + * @Date: 2024/6/24 下午3:11 + */ + RechargeCode queryDetail(Long id); + + /** + * @MethodName getList + * @Description: 查询列表 + * @param map + * @return: java.util.List + * @Author: Sum1Dream + * @Date: 2024/6/24 下午3:11 + */ + List getList(Map map); +} diff --git a/service/src/main/java/com/hfkj/service/recharge/impl/RechargeCodeServiceImpl.java b/service/src/main/java/com/hfkj/service/recharge/impl/RechargeCodeServiceImpl.java new file mode 100644 index 0000000..016ed17 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/recharge/impl/RechargeCodeServiceImpl.java @@ -0,0 +1,43 @@ +package com.hfkj.service.recharge.impl; + +import com.hfkj.dao.RechargeCodeMapper; +import com.hfkj.entity.RechargeCode; +import com.hfkj.service.recharge.RechargeCodeService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +@Service("rechargeCodeService") +public class RechargeCodeServiceImpl implements RechargeCodeService { + + @Resource + private RechargeCodeMapper rechargeCodeMapper; + + @Override + public void create(RechargeCode rechargeCode) { + rechargeCodeMapper.insert(rechargeCode); + } + + @Override + public void update(RechargeCode rechargeCode) { + rechargeCodeMapper.updateByPrimaryKeySelective(rechargeCode); + } + + @Override + public void delete(Long id, Boolean fullDelete) { + rechargeCodeMapper.deleteByPrimaryKey(id); + } + + @Override + public RechargeCode queryDetail(Long id) { + return rechargeCodeMapper.selectByPrimaryKey(id); + } + + @Override + public List getList(Map map) { + return Collections.emptyList(); + } +}