Merge branch 'refs/heads/cpupon-dev' into dev

master
袁野 8 months ago
commit 518ebce9ca
  1. 3
      bweb/src/main/java/com/bweb/config/AuthConfig.java
  2. 184
      bweb/src/main/java/com/bweb/controller/TestController.java
  3. 68
      bweb/src/main/java/com/bweb/controller/api/ApiMerController.java
  4. 42
      bweb/src/main/java/com/bweb/controller/discount/DiscountPackageController.java
  5. 2
      bweb/src/main/java/com/bweb/controller/file/FileController.java
  6. 140
      bweb/src/main/java/com/bweb/controller/goods/GoodPresentController.java
  7. 31
      bweb/src/main/java/com/bweb/controller/goods/GoodsController.java
  8. 1
      cweb/src/main/java/com/cweb/config/AuthConfig.java
  9. 42
      cweb/src/main/java/com/cweb/controller/cms/CmsContentController.java
  10. 102
      cweb/src/main/java/com/cweb/controller/discount/DiscountController.java
  11. 54
      cweb/src/main/java/com/cweb/controller/goods/DeliveryAddressController.java
  12. 68
      cweb/src/main/java/com/cweb/controller/goods/GoodsController.java
  13. 101
      cweb/src/main/java/com/cweb/controller/output/OutputController.java
  14. 4
      openapi/src/main/resources/prod/application.yml
  15. 78
      order/src/main/java/com/order/controller/OrderController.java
  16. 4
      order/src/main/java/com/order/controller/business/BsOrderGoodsController.java
  17. 6
      order/src/main/java/com/order/controller/business/BsOrderMeiTuanController.java
  18. 1
      order/src/main/java/com/order/controller/notify/JdNotify.java
  19. 16
      order/src/main/java/com/order/controller/notify/MeiTuanController.java
  20. 22
      schedule/src/main/java/com/hfkj/schedule/JdGoodsSchedule.java
  21. 55
      schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java
  22. 68
      service/src/main/java/com/hfkj/api/ApiMerService.java
  23. 68
      service/src/main/java/com/hfkj/api/impl/ApiMerServiceImpl.java
  24. 125
      service/src/main/java/com/hfkj/dao/ApiMerMapper.java
  25. 7
      service/src/main/java/com/hfkj/dao/ApiMerMapperExt.java
  26. 332
      service/src/main/java/com/hfkj/dao/ApiMerSqlProvider.java
  27. 17
      service/src/main/java/com/hfkj/dao/BsOrderMapper.java
  28. 14
      service/src/main/java/com/hfkj/dao/BsOrderSqlProvider.java
  29. 120
      service/src/main/java/com/hfkj/dao/GoodPresentMapper.java
  30. 7
      service/src/main/java/com/hfkj/dao/GoodPresentMapperExt.java
  31. 318
      service/src/main/java/com/hfkj/dao/GoodPresentSqlProvider.java
  32. 41
      service/src/main/java/com/hfkj/dao/GoodsMsgMapper.java
  33. 68
      service/src/main/java/com/hfkj/dao/GoodsMsgMapperExt.java
  34. 14
      service/src/main/java/com/hfkj/dao/GoodsMsgSqlProvider.java
  35. 12
      service/src/main/java/com/hfkj/dao/GoodsSpecsMapperExt.java
  36. 108
      service/src/main/java/com/hfkj/dao/JdSkuMapper.java
  37. 39
      service/src/main/java/com/hfkj/dao/JdSkuMapperExt.java
  38. 276
      service/src/main/java/com/hfkj/dao/JdSkuSqlProvider.java
  39. 241
      service/src/main/java/com/hfkj/entity/ApiMer.java
  40. 1023
      service/src/main/java/com/hfkj/entity/ApiMerExample.java
  41. 20
      service/src/main/java/com/hfkj/entity/BsOrder.java
  42. 60
      service/src/main/java/com/hfkj/entity/BsOrderExample.java
  43. 225
      service/src/main/java/com/hfkj/entity/GoodPresent.java
  44. 933
      service/src/main/java/com/hfkj/entity/GoodPresentExample.java
  45. 16
      service/src/main/java/com/hfkj/entity/GoodsMsg.java
  46. 60
      service/src/main/java/com/hfkj/entity/GoodsMsgExample.java
  47. 2
      service/src/main/java/com/hfkj/entity/GoodsVpd.java
  48. 177
      service/src/main/java/com/hfkj/entity/JdSku.java
  49. 743
      service/src/main/java/com/hfkj/entity/JdSkuExample.java
  50. 60
      service/src/main/java/com/hfkj/haioil/HaiOilService.java
  51. 31
      service/src/main/java/com/hfkj/jd/Impl/JdServiceImpl.java
  52. 24
      service/src/main/java/com/hfkj/jd/JdPostService.java
  53. 10
      service/src/main/java/com/hfkj/jd/JdService.java
  54. 3
      service/src/main/java/com/hfkj/model/CmsContentModel.java
  55. 19
      service/src/main/java/com/hfkj/model/discount/CouponDiscountUserRelModel.java
  56. 12
      service/src/main/java/com/hfkj/model/goods/JdGoodsModel.java
  57. 2
      service/src/main/java/com/hfkj/model/order/OrderChildModel.java
  58. 12
      service/src/main/java/com/hfkj/service/discount/CouponDiscountPackageService.java
  59. 15
      service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountPackageServiceImpl.java
  60. 1
      service/src/main/java/com/hfkj/service/goods/BsOrderGoodsService.java
  61. 68
      service/src/main/java/com/hfkj/service/goods/GoodPresentService.java
  62. 2
      service/src/main/java/com/hfkj/service/goods/GoodsMsgService.java
  63. 2
      service/src/main/java/com/hfkj/service/goods/GoodsSpecsService.java
  64. 9
      service/src/main/java/com/hfkj/service/goods/impl/BsOrderGoodsServiceImpl.java
  65. 5
      service/src/main/java/com/hfkj/service/goods/impl/BsOrderMeiTuanServiceImpl.java
  66. 86
      service/src/main/java/com/hfkj/service/goods/impl/GoodPresentServiceImpl.java
  67. 2
      service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java
  68. 4
      service/src/main/java/com/hfkj/service/goods/impl/GoodsSpecsServiceImpl.java
  69. 7
      service/src/main/java/com/hfkj/service/goods/impl/GoodsTypeServiceImpl.java
  70. 8
      service/src/main/java/com/hfkj/service/order/OrderCreateService.java
  71. 45
      service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java
  72. 28
      service/src/main/java/com/hfkj/service/order/impl/BsOrderAfterSalesApplyServiceImpl.java
  73. 51
      service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java
  74. 1
      service/src/main/java/com/hfkj/service/user/BsUserService.java
  75. 28
      service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java
  76. 8
      service/src/main/java/com/hfkj/sysenum/GoodsVpdSourceEnum.java
  77. 1
      service/src/main/java/com/hfkj/sysenum/UserLoginPlatform.java
  78. 1
      service/src/main/java/com/hfkj/sysenum/UserLoginType.java
  79. 105
      user/src/main/java/com/user/controller/BsUserController.java

@ -1,4 +1,4 @@
package com.cweb.config;
package com.bweb.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
@ -89,6 +89,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/fileUpload/*")
.excludePathPatterns("/common/*")
.excludePathPatterns("/test/*")
.excludePathPatterns("/apiMer/*")
.excludePathPatterns("/secMenu/queryMenuList")
.excludePathPatterns("/user/phgDataUser")
.excludePathPatterns("/user/phgDataUserDetail")

@ -1,4 +1,5 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
@ -6,19 +7,22 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.*;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.BsOrder;
import com.hfkj.entity.BsOrderGoods;
import com.hfkj.entity.GoodsUserAddress;
import com.hfkj.entity.*;
import com.hfkj.jd.JdPostService;
import com.hfkj.jd.JdService;
import com.hfkj.mer.BsMerPayConfigService;
import com.hfkj.model.ResponseData;
import com.hfkj.qianzhu.StarbucksService;
import com.hfkj.service.card.BsUserCardService;
import com.hfkj.service.coupon.channel.YouTuCouponService;
import com.hfkj.service.goods.BsOrderGoodsService;
import com.hfkj.service.goods.BsOrderStarbucksService;
import com.hfkj.service.goods.GoodsSpecsService;
import com.hfkj.service.goods.GoodsUserAddressService;
import com.hfkj.service.goods.impl.BsOrderStarbucksServiceImpl;
import com.hfkj.service.hlt.HuiLianTongUnionCardService;
import com.hfkj.service.order.BsOrderChildService;
import com.hfkj.service.order.BsOrderRefundService;
import com.hfkj.service.order.BsOrderService;
import com.hfkj.service.order.OrderPayService;
@ -54,7 +58,8 @@ public class TestController {
@Resource
private BsOrderGoodsService orderGoodsService;
@Resource
private GoodsSpecsService goodsSpecsService;
@Resource
private JdService jdService;
@ -70,6 +75,18 @@ public class TestController {
@Resource
private BsOrderService orderService;
@Resource
private BsOrderStarbucksService orderStarbucksService;
@Resource
private BsOrderChildService orderChildService;
@Resource
private BsOrderStarbucksServiceImpl bsOrderStarbucksService;
@Resource
private GoodsUserAddressService deliveryAddressService;
@RequestMapping(value="/thirdPayResult",method = RequestMethod.GET)
@ResponseBody
@ -161,7 +178,7 @@ public class TestController {
public ResponseData getSkuDetailInfo() {
try {
GetSkuPoolInfoGoodsResp detail = JdPostService.getSkuDetailInfo(jdService.getToken() , 1235014L).getOpenRpcResult().getResult();
GetSkuPoolInfoGoodsResp detail = JdPostService.getSkuDetailInfo(jdService.getToken() , 100017491914L).getOpenRpcResult().getResult();
return ResponseMsgUtil.success(detail);
} catch (Exception e) {
@ -176,7 +193,7 @@ public class TestController {
public ResponseData getSkuImageList() {
try {
return ResponseMsgUtil.success(JdPostService.getSkuImageList(jdService.getToken() , "1235014"));
return ResponseMsgUtil.success(JdPostService.getSkuImageList(jdService.getToken() , "100017491914"));
} catch (Exception e) {
log.error("error!",e);
@ -190,7 +207,7 @@ public class TestController {
public ResponseData getSellPrice() {
try {
return ResponseMsgUtil.success(JdPostService.getSellPrice(jdService.getToken() , "1235014"));
return ResponseMsgUtil.success(JdPostService.getSellPrice(jdService.getToken() , "100017491914"));
} catch (Exception e) {
log.error("error!",e);
@ -226,6 +243,43 @@ public class TestController {
}
}
@RequestMapping(value="/querySkuFreight",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "querySkuFreight")
public ResponseData querySkuFreight() {
try {
List<com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq> skuInfoList = new ArrayList<>();
com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq skuInfo = new com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq();
skuInfo.setSkuId(627345);
skuInfo.setSkuNum(1);
skuInfoList.add(skuInfo);
return ResponseMsgUtil.success( JdPostService.querySkuFreight(jdService.getToken() , skuInfoList , 24L ,2144L , 21037L , 58300L));
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/skuList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "skuList")
public ResponseData skuList() {
try {
return ResponseMsgUtil.success(jdService.skuList());
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/queryTransByVopNormal",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "消息消费")
@ -450,6 +504,24 @@ public class TestController {
}
}
@RequestMapping(value="/queryHltBalance",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询工会卡余额")
public ResponseData queryHltBalance(@RequestParam(value = "cardNo", required = false) String cardNo) {
try {
JSONObject cardInfo = HuiLianTongUnionCardService.queryBalance(cardNo);
if (StringUtils.isBlank(cardInfo.getString("data"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求失败");
}
return ResponseMsgUtil.success(HuiLianTongUnionCardService.resolveResponse(cardInfo.getString("data")));
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getGoodsUpdate",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "更新商品")
@ -478,4 +550,102 @@ public class TestController {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/phgSignLogin",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "加密登陆")
public ResponseData phgSignLogin() {
try {
Map<String , Object> objectMap = new HashMap<>();
objectMap.put("status" , 10);
List<BsOrderStarbucks> orderStarbucks = orderStarbucksService.getList(objectMap);
for (BsOrderStarbucks starbucks : orderStarbucks) {
if (starbucks != null) {
// 查询星巴克订单详情
BsOrderChild child = orderChildService.getDetail(starbucks.getChildOrderNo());
// 查询星巴克订单详情
Map<String , Object> orderMap = new HashMap<>();
orderMap.put("orderNo" , child.getChannelOrderNo());
JSONObject objectOrder = StarbucksService.starbucksOrder(orderMap);
if (objectOrder != null) {
// 订单数据
JSONObject order = objectOrder.getJSONObject("data");
// 修改订单数据
bsOrderStarbucksService.updateOrderStatus(child.getOrderNo() , order.getInteger("status"));
}
}
}
return ResponseMsgUtil.success("");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/querySkuFreight",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "查询运费")
public ResponseData querySkuFreight(@RequestBody JSONObject body) {
try {
if (body == null ||
body.getJSONArray("skuInfoList") == null
|| body.getLong("addressId") == null
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
JSONArray array = body.getJSONArray("skuInfoList");
GoodsUserAddress userAddress = goodsUserAddressService.queryDetail(body.getLong("addressId"));
if (userAddress.getProvinceId() == null) {
VopAddressConvertFourAreaByDetailStrResponse response = JdPostService.convertFourAreaByDetailStr(jdService.getToken() , userAddress.getRegionName() + userAddress.getAddress());
if (response != null && response.getOpenRpcResult().getSuccess()) {
userAddress.setProvinceId(response.getOpenRpcResult().getResult().getProvinceId());
userAddress.setProvinceName(response.getOpenRpcResult().getResult().getProvinceName());
userAddress.setCityId(response.getOpenRpcResult().getResult().getCityId());
userAddress.setCityName(response.getOpenRpcResult().getResult().getCityName());
userAddress.setCountyId(response.getOpenRpcResult().getResult().getCountyId());
userAddress.setCountyName(response.getOpenRpcResult().getResult().getCountyName());
userAddress.setTownId(response.getOpenRpcResult().getResult().getTownId());
userAddress.setTownName(response.getOpenRpcResult().getResult().getTownName());
userAddress.setUpdateTime(new Date());
deliveryAddressService.update(userAddress);
}
}
List<com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq> skuInfoList = new ArrayList<>();
com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq skuInfo = new com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq();
for(Object object : array) {
JSONObject json = (JSONObject)object;
GoodsSpecs specs = goodsSpecsService.queryDetail(json.getLong("specsId"));
if (specs.getThirdId() != null) {
skuInfo.setSkuId(Long.parseLong(specs.getThirdId()));
skuInfo.setSkuNum(json.getInteger("num"));
skuInfoList.add(skuInfo);
}
}
if (skuInfoList.isEmpty()) {
JSONObject object = new JSONObject();
object.put("totalFreight" , 0);
return ResponseMsgUtil.success(object);
}
return ResponseMsgUtil.success(JdPostService.querySkuFreight(jdService.getToken() , skuInfoList , userAddress.getProvinceId() ,userAddress.getCityId() , userAddress.getCountyId() , userAddress.getTownId()).getOpenRpcResult().getResult());
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -0,0 +1,68 @@
package com.bweb.controller.api;
import com.hfkj.api.ApiMerService;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.IDGenerator;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.common.utils.WxUtils;
import com.hfkj.entity.ApiMer;
import com.hfkj.model.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
@Controller
@RequestMapping(value = "/apiMer")
@Api(value = "api商户")
public class ApiMerController {
Logger log = LoggerFactory.getLogger(ApiMerController.class);
@Resource
private ApiMerService apiMerService;
@RequestMapping(value="/insertMerchant",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "增加商户")
public ResponseData insertMer(@RequestBody ApiMer apiMer) {
try {
if (StringUtils.isBlank(apiMer.getMerName())
|| StringUtils.isBlank(apiMer.getContact())
|| StringUtils.isBlank(apiMer.getContactPhone())
) {
log.error("ApiMerchantsController -> insertMerchant() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
apiMer.setCreateTime(new Date());
apiMer.setUpdateTime(new Date());
apiMer.setStatus(1);
apiMer.setAppId(DateUtil.date2String(new Date(), "yyyyMM") + IDGenerator.nextId(5));
apiMer.setAppSecret(WxUtils.MD5(apiMer.getAppId() , true));
apiMerService.create(apiMer);
return ResponseMsgUtil.success("新增成功");
} catch (Exception e) {
log.error("ApiMerchantsController -> insertMerchant() error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -1,5 +1,6 @@
package com.bweb.controller.discount;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -11,6 +12,7 @@ import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.OrderUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.*;
import com.hfkj.haioil.HaiOilService;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.discount.CouponDiscountPackageService;
@ -25,9 +27,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
@Controller
@RequestMapping(value="/discountPackage")
@ -73,6 +73,42 @@ public class DiscountPackageController {
}
@RequestMapping(value = "/discountPackageList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取优惠券包列表")
public ResponseData discountPackageList(
@RequestParam(name = "type", required = false) Integer type) {
try {
Map<String,Object> map = new HashMap<>();
if (type == 1) {
return ResponseMsgUtil.success(couponDiscountPackageService.getList(map));
} else {
List<CouponDiscountPackage> list = new ArrayList<>();
JSONObject object = HaiOilService.queryPkList(map).getJSONObject("return_data");
JSONArray array = object.getJSONArray("dataList");
for (Object obj : array) {
JSONObject jsonObject = (JSONObject)obj;
CouponDiscountPackage couponDiscountPackage = new CouponDiscountPackage();
couponDiscountPackage.setKey(jsonObject.getString("discountPkNo"));
couponDiscountPackage.setTitle(jsonObject.getString("discountPkName"));
list.add(couponDiscountPackage);
}
return ResponseMsgUtil.success(list);
}
} catch (Exception e) {
log.error("HighOrderController --> getUserOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getDiscountPackageRecordList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取优惠券包记录列表")

@ -46,7 +46,7 @@ public class FileController {
@RequestMapping(value="/getFileRecordsList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询列表")
public ResponseData getFileRecordsList( HttpServletRequest request) {
public ResponseData getFileRecordsList(HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);

@ -0,0 +1,140 @@
package com.bweb.controller.goods;
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.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.CouponDiscountPackage;
import com.hfkj.entity.GoodPresent;
import com.hfkj.entity.GoodsMsg;
import com.hfkj.entity.GoodsType;
import com.hfkj.haioil.HaiOilService;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.discount.CouponDiscountPackageService;
import com.hfkj.service.goods.GoodPresentService;
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.util.Date;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping(value="/goodPresent")
@Api(value="商品赠送")
public class GoodPresentController {
private static final Logger log = LoggerFactory.getLogger(GoodPresentController.class);
@Resource
private GoodPresentService goodPresentService;
@Resource
private CouponDiscountPackageService discountPackageService;
@Resource
private UserCenter userCenter;
@RequestMapping(value="/createGoodPresent",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "创建商品赠送")
public ResponseData createGoodPresent(@RequestBody GoodPresent body, HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject();
if (!userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
if (body == null
|| body.getKey() == null
|| body.getType() == null
|| body.getSpecsId() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
CouponDiscountPackage discountPackage = new CouponDiscountPackage();
if (body.getType() == 1) {
discountPackage = discountPackageService.findDiscountPackageByKey(body.getKey());
if (discountPackage == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券包不存在");
}
body.setName(discountPackage.getTitle());
} else {
Map<String , Object> map = new HashMap<>();
map.put("discountPkNo" , body.getKey());
JSONObject jsonObject = HaiOilService.queryPkDetail(map);
body.setName(jsonObject.getJSONObject("return_data").getString("discountPkName"));
}
body.setCreateTime(new Date());
body.setUpdateTime(new Date());
body.setStatus(1);
goodPresentService.create(body);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getLisPresent",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询列表")
public ResponseData getLisPresent(@RequestParam(value = "specsId" , required = false) Long specsId) {
try {
Map<String , Object> map = new HashMap<>();
map.put("specsId", specsId);
return ResponseMsgUtil.success(goodPresentService.getList(map));
} catch (Exception e) {
log.error("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, HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject();
if (!userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
goodPresentService.delete(id , false);
return ResponseMsgUtil.success("删除成功");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -133,6 +133,7 @@ public class GoodsController {
goodsMsg.setGoodsTypeParent(goodsType.getParentId());
goodsMsg.setGoodsTypeParentName(goodsTypeService.findGoodsType(goodsType.getParentId()));
goodsMsg.setType(body.getType());
goodsMsg.setShowType(body.getShowType());
goodsMsg.setGoodsBrand(body.getGoodsBrand());
goodsMsg.setStatus(body.getStatus());
goodsMsg.setTitle(body.getTitle());
@ -256,7 +257,6 @@ public class GoodsController {
// 判断必填项
if ( goodsSpecs.getId() == null
|| body.getValidDay() == null
|| body.getType() == null
|| body.getSource() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
@ -271,7 +271,6 @@ public class GoodsController {
goodsVpd.setSpecsId(goodsSpecs.getId());
goodsVpd.setValidDay(body.getValidDay());
goodsVpd.setType(body.getType());
goodsVpd.setJumpType(body.getJumpType());
goodsVpd.setJumpUrl(body.getJumpUrl());
goodsVpd.setAppid(body.getAppid());
@ -350,7 +349,7 @@ public class GoodsController {
@RequestMapping(value="/getGoodsSpecsList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询商品规格列表")
public ResponseData getGoodsSpecsList(@RequestParam(value = "id" , required = false) Long id) {
public ResponseData getGoodsSpecsList(@RequestParam(value = "id" , required = true) Long id) {
try {
Map<String , Object> map = new HashMap<>();
@ -360,6 +359,7 @@ public class GoodsController {
List<GoodsModelSpecs> goodsModelSpecs = new ArrayList<>();
for (GoodsSpecs goodsSpec : goodsSpecs) {
GoodsModelSpecs goodsModelSpec = new GoodsModelSpecs();
BeanUtils.copyProperties(goodsSpec, goodsModelSpec);
@ -386,30 +386,11 @@ public class GoodsController {
@RequestMapping(value="/getGoodsSpecsListAll",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询商品规格列表")
public ResponseData getGoodsSpecsListAll() {
public ResponseData getGoodsSpecsListAll(@RequestParam(value = "name" , required = false) String name) {
try {
Map<String , Object> map = new HashMap<>();
map.put("status" , 1);
List<GoodsMsg> goodsMsgList = goodsMsgService.getList(new HashMap<>());
List<GoodsModelSpecs> goodsModelSpecs = new ArrayList<>();
for (GoodsMsg goodsMsg : goodsMsgList) {
Map<String , Object> mapGoods = new HashMap<>();
mapGoods.put("goodsId" , goodsMsg.getId());
List<GoodsSpecs> goodsSpecs = goodsSpecsService.getList(mapGoods);
for (GoodsSpecs goodsSpec : goodsSpecs) {
GoodsModelSpecs goodsModelSpec = new GoodsModelSpecs();
BeanUtils.copyProperties(goodsSpec, goodsModelSpec);
goodsModelSpec.setGoodsName(goodsMsg.getTitle());
goodsModelSpec.setSpecsId(goodsSpec.getId());
goodsModelSpecs.add(goodsModelSpec);
}
}
return ResponseMsgUtil.success(goodsModelSpecs);
map.put("name" , name);
return ResponseMsgUtil.success(goodsSpecsService.getGoodsSpecsCrest(map));
} catch (Exception e) {
log.error("error!",e);

@ -95,6 +95,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/starbucks/*")
.excludePathPatterns("/meiTuan/*")
.excludePathPatterns("/jd/*")
.excludePathPatterns("/output/*")
;
}

@ -7,6 +7,7 @@ import com.hfkj.entity.GoodsSpecs;
import com.hfkj.model.CmsContentModel;
import com.hfkj.model.ResponseData;
import com.hfkj.model.goods.GoodsModel;
import com.hfkj.model.goods.JdGoodsModel;
import com.hfkj.service.cms.CmsContentService;
import com.hfkj.service.goods.GoodsMsgService;
import com.hfkj.service.goods.GoodsSpecsService;
@ -64,53 +65,32 @@ public class CmsContentController {
List<CmsContentModel> cmsContents = new ArrayList<>();
for (CmsContent cmsContent : list) {
List<GoodsModel> goodsModels = new ArrayList<>();
List<JdGoodsModel> goodsModels = new ArrayList<>();
if (cmsContent.getShowType() != null) {
Map<String , Object> goodsMap = new HashMap<>();
goodsMap.put("status" , 1);
goodsMap.put("showType" , 1);
List<GoodsMsg> goodsMsgs = new ArrayList<>();
List<JdGoodsModel> goodsMsgs = new ArrayList<>();
if (cmsContent.getShowType() == 1) {
goodsMap.put("goodsType", cmsContent.getShowDataId());
goodsMsgs = goodsMsgService.getList(goodsMap).stream().limit(2).collect(Collectors.toList());
goodsMap.put("limit" , 2);
goodsMsgs = goodsMsgService.getListCrest(goodsMap);
}
if (cmsContent.getShowType() == 2) {
goodsMap.put("goodsType", cmsContent.getShowDataId());
goodsMsgs = goodsMsgService.getList(goodsMap).stream().limit(4).collect(Collectors.toList());
goodsMap.put("limit" , 4);
goodsMsgs = goodsMsgService.getListCrest(goodsMap);
}
if (cmsContent.getShowType() == 3) {
goodsMap.put("goodsType", cmsContent.getShowDataId());
goodsMsgs = goodsMsgService.getList(goodsMap).stream().limit(10).collect(Collectors.toList());
goodsMap.put("limit" , 10);
goodsMsgs = goodsMsgService.getListCrest(goodsMap);
}
for (GoodsMsg goodsMsg : goodsMsgs) {
GoodsModel goodsModel = new GoodsModel();
Map<String , Object> specMap = new HashMap<>();
specMap.put("goodsId", goodsMsg.getId());
List<GoodsSpecs> goodsSpecs = goodsSpecsService.getList(specMap);
if (!goodsSpecs.isEmpty()) {
BigDecimal minPrice = goodsSpecs.get(0).getSalePrice();
BigDecimal minOriginalPrice = goodsSpecs.get(0).getOriginalPrice();
for (GoodsSpecs specs : goodsSpecs) {
if (specs.getSalePrice().compareTo(minPrice) < 0) {
minPrice = specs.getSalePrice();
minOriginalPrice = specs.getOriginalPrice();
}
}
BeanUtils.copyProperties(goodsMsg, goodsModel);
goodsModel.setOriginalPrice(minOriginalPrice);
goodsModel.setPrice(minPrice);
goodsModels.add(goodsModel);
}
}
goodsModels.addAll(goodsMsgs);
}
CmsContentModel cmsContentModel = new CmsContentModel();

@ -1,5 +1,6 @@
package com.cweb.controller.discount;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -10,9 +11,11 @@ import com.hfkj.common.security.SessionObject;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.*;
import com.hfkj.haioil.HaiOilService;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.model.UserSessionObject;
import com.hfkj.model.discount.CouponDiscountUserRelModel;
import com.hfkj.model.discount.DiscountGoodsModel;
import com.hfkj.service.CommonService;
import com.hfkj.service.SecDictionaryService;
@ -63,18 +66,109 @@ public class DiscountController {
@RequestMapping(value = "/getListUserDiscount", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取用户优惠券列表")
public ResponseData getListUserDiscount(@RequestParam(value = "status", required = true) Integer status) {
public ResponseData getListUserDiscount(
@RequestParam(value = "status", required = true) Integer status,
@RequestParam(value = "source", required = true) Integer source
) {
try {
// 用户session
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class);
Map<String, Object> map = new HashMap<>();
if (source == 1) {
Map<String, Object> map = new HashMap<>();
map.put("userId", userSession.getUser().getId());
map.put("status", status);
return ResponseMsgUtil.success(discountUserRelService.getList(map));
} else {
List<CouponDiscountUserRelModel> list = new ArrayList<>();
if (userSession.getUser().getPhone() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "用户未绑定手机号!");
}
Map<String , Object> map = new HashMap<>();
if (status == 0) {
status = 3;
}
map.put("status" , status);
map.put("phone" , userSession.getUser().getPhone());
JSONObject object = HaiOilService.queryListByPhone(map);
if (object.getString("return_code").equals("000000")) {
JSONArray array = object.getJSONObject("return_data").getJSONArray("dataList");
for (int i = 0; i < array.size(); i++) {
JSONObject jsonObject = array.getJSONObject(i);
CouponDiscountUserRelModel rel = new CouponDiscountUserRelModel();
rel.setSource(2);
rel.setUserId(userSession.getUser().getId());
rel.setDiscountName(jsonObject.getString("discountName"));
rel.setDiscountType(jsonObject.getInteger("discountType"));
rel.setDiscountNo(jsonObject.getString("discountNo"));
rel.setDiscountCondition(jsonObject.getBigDecimal("discountCondition"));
if (jsonObject.getInteger("discountType") == 3) {
rel.setDiscountPercentage(jsonObject.getBigDecimal("discountPrice"));
} else {
rel.setDiscountPrice(jsonObject.getBigDecimal("discountPrice"));
}
if (jsonObject.getInteger("status") == 3) {
rel.setStatus(0);
}else {
rel.setStatus(jsonObject.getInteger("status"));
}
rel.setCreateTime(jsonObject.getDate("createTime"));
rel.setUseTime(jsonObject.getDate("useTime"));
rel.setUseEndTime(jsonObject.getDate("expirationTime"));
list.add(rel);
}
return ResponseMsgUtil.success(list);
} else {
return ResponseMsgUtil.success(null);
}
}
} catch (Exception e) {
log.error("GoodsDetailController --> getListUser() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/userDiscountNum", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取券数量")
public ResponseData userDiscountNum() {
try {
// 用户session
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class);
Map<String , Object> map = new HashMap<>();
map.put("status" , 1);
map.put("phone" , userSession.getUser().getPhone());
JSONObject object = HaiOilService.queryListByPhone(map);
int num = 0;
if (object.getString("return_code").equals("000000")) {
JSONArray array = object.getJSONObject("return_data").getJSONArray("dataList");
num += array.size();
}
map.put("userId", userSession.getUser().getId());
map.put("status", status);
map.put("status", 1);
List<CouponDiscountUserRel> list = discountUserRelService.getList(map);
num += list.size();
return ResponseMsgUtil.success(num);
return ResponseMsgUtil.success(discountUserRelService.getList(map));
} catch (Exception e) {
log.error("GoodsDetailController --> getListUser() error!", e);

@ -93,19 +93,19 @@ public class DeliveryAddressController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// VopAddressConvertFourAreaByDetailStrResponse response = JdPostService.convertFourAreaByDetailStr(jdService.getToken() , deliveryAddress.getRegionName() + deliveryAddress.getAddress());
//
//
//
// // 判断response是否为空,并且response的OpenRpcResult的success属性是否为true
// if (response != null && response.getOpenRpcResult().getSuccess()) {
// deliveryAddress.setProvinceId(response.getOpenRpcResult().getResult().getProvinceId());
// deliveryAddress.setCityId(response.getOpenRpcResult().getResult().getCityId());
// deliveryAddress.setCountyId(response.getOpenRpcResult().getResult().getCountyId());
// deliveryAddress.setTownId(response.getOpenRpcResult().getResult().getTownId());
// } else {
// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getOpenRpcResult().getResultMessage());
// }
VopAddressConvertFourAreaByDetailStrResponse response = JdPostService.convertFourAreaByDetailStr(jdService.getToken() , deliveryAddress.getRegionName() + deliveryAddress.getAddress());
// 判断response是否为空,并且response的OpenRpcResult的success属性是否为true
if (response != null && response.getOpenRpcResult().getSuccess()) {
deliveryAddress.setProvinceId(response.getOpenRpcResult().getResult().getProvinceId());
deliveryAddress.setCityId(response.getOpenRpcResult().getResult().getCityId());
deliveryAddress.setCountyId(response.getOpenRpcResult().getResult().getCountyId());
deliveryAddress.setTownId(response.getOpenRpcResult().getResult().getTownId());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getOpenRpcResult().getResultMessage());
}
deliveryAddress.setUserId(userSession.getUser().getId());
@ -154,20 +154,20 @@ public class DeliveryAddressController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前收货地址异常!");
}
// VopAddressConvertFourAreaByDetailStrResponse response = JdPostService.convertFourAreaByDetailStr(jdService.getToken() , deliveryAddress.getRegionName() + deliveryAddress.getAddress());
//
// if (response != null && response.getOpenRpcResult().getSuccess()) {
// deliveryAddress.setProvinceId(response.getOpenRpcResult().getResult().getProvinceId());
// deliveryAddress.setProvinceName(response.getOpenRpcResult().getResult().getProvinceName());
// deliveryAddress.setCityId(response.getOpenRpcResult().getResult().getCityId());
// deliveryAddress.setCityName(response.getOpenRpcResult().getResult().getCityName());
// deliveryAddress.setCountyId(response.getOpenRpcResult().getResult().getCountyId());
// deliveryAddress.setCountyName(response.getOpenRpcResult().getResult().getCountyName());
// deliveryAddress.setTownId(response.getOpenRpcResult().getResult().getTownId());
// deliveryAddress.setTownName(response.getOpenRpcResult().getResult().getTownName());
// } else {
// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getOpenRpcResult().getResultMessage());
// }
VopAddressConvertFourAreaByDetailStrResponse response = JdPostService.convertFourAreaByDetailStr(jdService.getToken() , deliveryAddress.getRegionName() + deliveryAddress.getAddress());
if (response != null && response.getOpenRpcResult().getSuccess()) {
deliveryAddress.setProvinceId(response.getOpenRpcResult().getResult().getProvinceId());
deliveryAddress.setProvinceName(response.getOpenRpcResult().getResult().getProvinceName());
deliveryAddress.setCityId(response.getOpenRpcResult().getResult().getCityId());
deliveryAddress.setCityName(response.getOpenRpcResult().getResult().getCityName());
deliveryAddress.setCountyId(response.getOpenRpcResult().getResult().getCountyId());
deliveryAddress.setCountyName(response.getOpenRpcResult().getResult().getCountyName());
deliveryAddress.setTownId(response.getOpenRpcResult().getResult().getTownId());
deliveryAddress.setTownName(response.getOpenRpcResult().getResult().getTownName());
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getOpenRpcResult().getResultMessage());
}
deliveryAddress.setUserId(userSession.getUser().getId());
deliveryAddress.setStatus(1);

@ -10,16 +10,15 @@ import com.hfkj.common.security.SessionObject;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.PageUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.GoodsMsg;
import com.hfkj.entity.GoodsSpecs;
import com.hfkj.entity.GoodsType;
import com.hfkj.entity.GoodsVpd;
import com.hfkj.entity.*;
import com.hfkj.jd.JdService;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.model.goods.GoodsModel;
import com.hfkj.model.goods.GoodsModelSpecs;
import com.hfkj.model.goods.GoodsTypeModel;
import com.hfkj.model.goods.JdGoodsModel;
import com.hfkj.service.discount.CouponDiscountService;
import com.hfkj.service.goods.*;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import io.swagger.annotations.Api;
@ -59,19 +58,21 @@ public class GoodsController {
@Resource
private GoodsVpdService goodsVpdService;
@Resource
private JdService jdService;
@Resource
private CouponDiscountService couponDiscountService;
@RequestMapping(value="/getListGoodsType",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询商品分类列表")
public ResponseData getListGoodsType() {
public ResponseData getListGoodsType(@RequestParam(value = "type" , required = false) Integer type) {
try {
Map<String ,Object> map = new HashMap<>();
map.put("status" , 1);
map.put("type" , type);
List<GoodsType> list = goodsTypeService.getList(map);
List<GoodsTypeModel> goodsTypeModels = goodsTypeService.getGoodsTypeModelList(list);
@ -114,6 +115,8 @@ public class GoodsController {
@RequestParam(value = "title", required = false) String title,
@RequestParam(value = "goodsTypeParent", required = false) Long goodsTypeParent,
@RequestParam(value = "goodsType", required = false) Long goodsType,
@RequestParam(value = "showType", required = false) Integer showType,
@RequestParam(value = "discountId", required = false) Integer discountId,
@RequestParam(value = "goodsBrand", required = false) Long goodsBrand,
@RequestParam(value = "price", required = false) Integer price,
@RequestParam(value = "saleNum", required = false) Integer saleNum,
@ -129,51 +132,36 @@ public class GoodsController {
map.put("title", title);
map.put("goodsType", goodsType);
map.put("showType", showType);
map.put("price", price);
map.put("goodsTypeParent", goodsTypeParent);
map.put("goodsBrand", goodsBrand);
map.put("saleNum", saleNum);
map.put("limit", limit);
if (limit == null && title == null && goodsType == null && goodsTypeParent == null && goodsBrand == null) {
map.put("limit", 500);
} else {
map.put("limit", limit);
}
map.put("time", time);
map.put("status", 1);
List<GoodsMsg> list = goodsMsgService.getListCrest(map);
List<GoodsSpecs> specsList = goodsSpecsService.getGoodsSpecsCrest();
List<GoodsModel> goodsModels = new ArrayList<>();
for (GoodsMsg goodsMsg : list) {
GoodsModel goodsModel = new GoodsModel();
if (discountId != null) {
// 查询优惠券可以用规格
List<GoodsSpecs> goodsSpecs = specsList.stream().filter(s -> s.getGoodsId().equals(goodsMsg.getId())).collect(Collectors.toList());
Map<String, Object> mapSpecs = new HashMap<>();
mapSpecs.put("discountId", discountId);
if (!goodsSpecs.isEmpty()) {
BigDecimal minPrice = goodsSpecs.get(0).getSalePrice();
BigDecimal minOriginalPrice = goodsSpecs.get(0).getOriginalPrice();
for (GoodsSpecs specs : goodsSpecs) {
if (specs.getSalePrice().compareTo(minPrice) < 0) {
minPrice = specs.getSalePrice();
minOriginalPrice = specs.getOriginalPrice();
}
}
BeanUtils.copyProperties(goodsMsg, goodsModel);
goodsModel.setOriginalPrice(minOriginalPrice);
goodsModel.setPrice(minPrice);
goodsModels.add(goodsModel);
}
// 查询规格可用优惠券
List<CouponDiscountGoodsRel> couponDiscountGoodsRel = couponDiscountService.getListGoodsRel(mapSpecs);
List<Long> sp = couponDiscountGoodsRel.stream().map(CouponDiscountGoodsRel::getSpecsId).collect(Collectors.toList());
map.put("specsId", sp);
}
if (price != null) {
if (price == 1) {
goodsModels = goodsModels.stream().sorted(Comparator.comparing(GoodsModel::getPrice)).collect(Collectors.toList());
}
if (price == 2) {
goodsModels = goodsModels.stream().sorted(Comparator.comparing(GoodsModel::getPrice).reversed()).collect(Collectors.toList());
}
}
List<JdGoodsModel> list = goodsMsgService.getListCrest(map);
return ResponseMsgUtil.success(PageUtil.initPageInfoObj(pageNum, goodsModels.size(), pageSize, new PageInfo<>(goodsModels)));
return ResponseMsgUtil.success(PageUtil.initPageInfoObj(pageNum, list.size(), pageSize, new PageInfo<>(list)));
} catch (Exception e) {
log.error("GoodsDetailController --> getListUser() error!", e);

@ -0,0 +1,101 @@
package com.cweb.controller.output;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.api.ApiMerService;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.common.utils.SignatureUtil;
import com.hfkj.entity.*;
import com.hfkj.model.ResponseData;
import com.hfkj.model.UserSessionObject;
import com.hfkj.service.SecDictionaryService;
import com.hfkj.service.discount.CouponDiscountPackageService;
import com.hfkj.service.discount.CouponDiscountService;
import com.hfkj.service.discount.CouponDiscountUserRelService;
import com.hfkj.service.user.BsUserService;
import com.hfkj.sysenum.UserLoginPlatform;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@Controller
@RequestMapping(value="/output")
@Api(value="输出外部接口")
public class OutputController {
private static final Logger log = LoggerFactory.getLogger(OutputController.class);
@Resource
private ApiMerService apiMerService;
@Resource
private CouponDiscountUserRelService discountUserRelService;
@Resource
private BsUserService bsUserService;
@RequestMapping(value = "/getListUserDiscount", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "获取用户优惠券列表")
public ResponseData getListUserDiscount(@RequestBody JSONObject body) {
try {
if (body == null
|| StringUtils.isBlank(body.getString("status"))
|| StringUtils.isBlank(body.getString("phone"))
|| StringUtils.isBlank(body.getString("sign"))
|| StringUtils.isBlank(body.getString("appid"))
) {
log.error("LoginController --> phone() error!", "请求参数校验失败");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询api商户信息
ApiMer apiMer = apiMerService.queryDetail(body.getString("appid"));
Map<String , Object> map = new HashMap<>();
map.put("appid" , body.getString("appid"));
map.put("phone" , body.getString("phone"));
map.put("status" , body.getString("status"));
String sign = SignatureUtil.createSign(map , apiMer.getAppSecret());
if (!body.getString("sign").equals(sign)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "签名校验失败!");
}
// 查询用户信息
BsUser user = bsUserService.getUser(body.getString("phone"));
if (user == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "用户不存在!");
}
Map<String, Object> mapPost = new HashMap<>();
mapPost.put("userId", user.getId());
mapPost.put("status", body.getInteger("status"));
return ResponseMsgUtil.success(discountUserRelService.getList(mapPost));
} catch (Exception e) {
log.error("GoodsDetailController --> getListUser() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -1,7 +1,7 @@
server:
port: 9301
port: 9505
servlet:
context-path: /crest
context-path: /openapi
#配置是否为debug模式,debug模式下,不开启权限校验
debug: false

@ -1,5 +1,6 @@
package com.order.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -11,22 +12,23 @@ import com.hfkj.common.utils.PageUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.common.utils.SignatureUtil;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.BsOrder;
import com.hfkj.entity.BsOrderChild;
import com.hfkj.entity.BsOrderGoods;
import com.hfkj.entity.GoodsSpecs;
import com.hfkj.entity.*;
import com.hfkj.haioil.HaiOilService;
import com.hfkj.jd.JdPostService;
import com.hfkj.jd.JdService;
import com.hfkj.model.ResponseData;
import com.hfkj.model.UserSessionObject;
import com.hfkj.model.order.OrderChildModel;
import com.hfkj.model.order.OrderModel;
import com.hfkj.service.goods.BsOrderGoodsService;
import com.hfkj.service.goods.GoodsSpecsService;
import com.hfkj.service.goods.GoodsUserAddressService;
import com.hfkj.service.order.BsOrderService;
import com.hfkj.service.order.impl.BsOrderChildServiceImpl;
import com.hfkj.service.pay.HuiPayService;
import com.hfkj.sysenum.UserStatusEnum;
import com.hfkj.sysenum.order.*;
import com.jd.open.api.sdk.response.vopdz.VopAddressConvertFourAreaByDetailStrResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
@ -62,7 +64,12 @@ public class OrderController {
private GoodsSpecsService goodsSpecsService;
@Resource
private BsOrderGoodsService orderGoodsService;
@Resource
private JdService jdService;
@Resource
private GoodsUserAddressService goodsUserAddressService;
@Resource
private GoodsUserAddressService deliveryAddressService;
@RequestMapping(value="/create",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "创建订单")
@ -340,4 +347,65 @@ public class OrderController {
}
}
@RequestMapping(value="/querySkuFreight",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "查询运费")
public ResponseData querySkuFreight(@RequestBody JSONObject body) {
try {
if (body == null ||
body.getJSONArray("skuInfoList") == null
|| body.getLong("addressId") == null
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
JSONArray array = body.getJSONArray("skuInfoList");
GoodsUserAddress userAddress = goodsUserAddressService.queryDetail(body.getLong("addressId"));
if (userAddress.getProvinceId() == null) {
// VopAddressConvertFourAreaByDetailStrResponse response = JdPostService.convertFourAreaByDetailStr(jdService.getToken() , userAddress.getRegionName() + userAddress.getAddress());
//
// if (response != null && response.getOpenRpcResult().getSuccess()) {
// userAddress.setProvinceId(response.getOpenRpcResult().getResult().getProvinceId());
// userAddress.setProvinceName(response.getOpenRpcResult().getResult().getProvinceName());
// userAddress.setCityId(response.getOpenRpcResult().getResult().getCityId());
// userAddress.setCityName(response.getOpenRpcResult().getResult().getCityName());
// userAddress.setCountyId(response.getOpenRpcResult().getResult().getCountyId());
// userAddress.setCountyName(response.getOpenRpcResult().getResult().getCountyName());
// userAddress.setTownId(response.getOpenRpcResult().getResult().getTownId());
// userAddress.setTownName(response.getOpenRpcResult().getResult().getTownName());
// userAddress.setUpdateTime(new Date());
// deliveryAddressService.update(userAddress);
// } else {
// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getOpenRpcResult().getResultMessage());
// }
}
List<com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq> skuInfoList = new ArrayList<>();
com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq skuInfo = new com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq();
for(Object object : array) {
JSONObject json = (JSONObject)object;
GoodsSpecs specs = goodsSpecsService.queryDetail(json.getLong("specsId"));
if (specs.getThirdId() != null) {
skuInfo.setSkuId(Long.parseLong(specs.getThirdId()));
skuInfo.setSkuNum(json.getInteger("num"));
skuInfoList.add(skuInfo);
}
}
if (skuInfoList.isEmpty()) {
JSONObject object = new JSONObject();
object.put("totalFreight" , 0);
return ResponseMsgUtil.success(object);
}
return ResponseMsgUtil.success(JdPostService.querySkuFreight(jdService.getToken() , skuInfoList , userAddress.getProvinceId() ,userAddress.getCityId() , userAddress.getCountyId() , userAddress.getTownId()).getOpenRpcResult().getResult());
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -305,10 +305,6 @@ public class BsOrderGoodsController {
BsOrderGoods goodsOrder = bsOrderGoodsService.queryDetail(body.getId());
if (goodsOrder == null) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "信息错误!");
}

@ -48,11 +48,11 @@ public class BsOrderMeiTuanController {
@Resource
private UserCenter userCenter;
@Resource
private BsOrderMeiTuanServiceImpl bsOrderMeiTuanService;
private static final Logger log = LoggerFactory.getLogger(BsOrderGoodsController.class);
@Autowired
private BsOrderMeiTuanServiceImpl bsOrderMeiTuanService;
@RequestMapping(value="/servicePrice",method = RequestMethod.GET)
@ResponseBody

@ -50,4 +50,5 @@ public class JdNotify {
log.error("WechatPayController --> wechatNotify() error!", e);
}
}
}

@ -5,6 +5,7 @@ import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.OrderUtil;
import com.hfkj.common.utils.SignatureUtil;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.BsOrderMeituan;
import com.hfkj.entity.BsOrderRefund;
@ -103,11 +104,22 @@ public class MeiTuanController {
JSONObject staffInfo = jsonObject.getJSONObject("staffInfo");
// 请求加密
Map<String , Object> map = new HashMap<>();
map.put("appid" , "20241266600");
map.put("phone" , staffInfo.getString("staffPhone"));
String sign = SignatureUtil.createSign(map , "BCB83776BDA7F609FBE99BBB8AC33840");
object.put("thirdTradeNo", thirdTradeNo);
object.put("thirdPayUrl", "https://phg.dctpay.com/cweb/#/pages/meiTuanPay/index?tradeNo=" + jsonObject.getString("tradeNo") +
"&tradeAmount=" + jsonObject.getString("tradeAmount") +
"&outSidePhone=" + staffInfo.getString("staffPhone")
"&outSideAppid=" + map.get("appid") +
"&outSideSign=" + sign +
"&outSidePhone=" + staffInfo.getString("staffPhone") +
"&outsidePlatform=" + "WXAPPLETS" +
"&outSideType=" + "SIGN"
);
log.info("美团下单-参数: {}", object);
data.put("status", 0);
data.put("msg", "成功");
@ -243,7 +255,7 @@ public class MeiTuanController {
}
@RequestMapping(value = "/orderPush", method = RequestMethod.POST)
@RequestMapping(value = "/order", method = RequestMethod.POST)
@ApiOperation(value = "订单状态变更回调")
@ResponseBody
public Object orderPush(

@ -38,16 +38,16 @@ public class JdGoodsSchedule {
@Resource
private JdService jdService;
// //每10分钟执行一次
// @Scheduled(cron = "0 0/10 * * * ?")
// public void etcCarMsg() {
// try {
//
// jdService.deleteMsg();
//
// } catch (Exception e) {
// log.error("HighUserController --> findByUserId() error!", e);
// }
// }
//每10分钟执行一次
@Scheduled(cron = "0 0/10 * * * ?")
public void etcCarMsg() {
try {
jdService.deleteMsg();
} catch (Exception e) {
log.error("HighUserController --> findByUserId() error!", e);
}
}
}

@ -1,13 +1,17 @@
package com.hfkj.schedule;
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.utils.DateUtil;
import com.hfkj.entity.*;
import com.hfkj.qianzhu.StarbucksService;
import com.hfkj.service.goods.BsOrderGoodsService;
import com.hfkj.service.goods.BsOrderStarbucksService;
import com.hfkj.service.goods.GoodsUserAddressService;
import com.hfkj.service.goods.impl.BsOrderMeiTuanServiceImpl;
import com.hfkj.service.goods.impl.BsOrderStarbucksServiceImpl;
import com.hfkj.service.order.BsOrderChildService;
import com.hfkj.service.order.BsOrderService;
import com.hfkj.sysenum.order.OrderLogisticsStatusEnum;
@ -39,7 +43,7 @@ public class OrderGoodsSchedule {
@Resource
private GoodsUserAddressService addressService;
private BsOrderStarbucksServiceImpl bsOrderStarbucksService;
@Resource
private BsOrderStarbucksService orderStarbucksService;
@ -49,7 +53,8 @@ public class OrderGoodsSchedule {
@Resource
private BsOrderService orderService;
@Resource
private BsOrderMeiTuanServiceImpl bsOrderMeiTuanService;
//每日凌晨12点5秒执行一次
@Scheduled(cron = "5 0 0 * * ?")
public void orderGoodsConfirmReceipt() {
@ -143,6 +148,52 @@ public class OrderGoodsSchedule {
}
}
}
@Scheduled(cron = "5 0 0 * * ?")
public void getMeiTuan() {
Map<String , Object> objectMap = new HashMap<>();
objectMap.put("status" , 2);
List<BsOrderMeituan> orderMeiTuan = bsOrderMeiTuanService.getOrderList(objectMap);
for (BsOrderMeituan meituan : orderMeiTuan) {
if (meituan != null) {
bsOrderMeiTuanService.orderFinish(meituan.getChildOrderNo());
}
}
}
@Scheduled(cron = "5 0 0 * * ?")
public void getStarbucksByCompleted() {
Map<String , Object> objectMap = new HashMap<>();
objectMap.put("status" , 10);
List<BsOrderStarbucks> orderStarbucks = orderStarbucksService.getList(objectMap);
for (BsOrderStarbucks starbucks : orderStarbucks) {
if (starbucks != null) {
// 查询星巴克订单详情
BsOrderChild child = orderChildService.getDetail(starbucks.getChildOrderNo());
// 查询星巴克订单详情
Map<String , Object> orderMap = new HashMap<>();
orderMap.put("orderNo" , child.getChannelOrderNo());
JSONObject objectOrder = StarbucksService.starbucksOrder(orderMap);
if (objectOrder != null) {
// 订单数据
JSONObject order = objectOrder.getJSONObject("data");
// 修改订单数据
bsOrderStarbucksService.updateOrderStatus(child.getOrderNo() , order.getInteger("status"));
}
}
}
}
}

@ -0,0 +1,68 @@
package com.hfkj.api;
import com.hfkj.entity.ApiMer;
import java.util.List;
public interface ApiMerService {
/**
* @MethodName create
* @Description: 创建api商户
* @param apiMer
* @Author: Sum1Dream
* @Date: 2024/12/5 下午3:19
*/
void create(ApiMer apiMer);
/**
* @MethodName update
* @Description: /**
* @Description: 更新api商户
* @param apiMer
* @Author: Sum1Dream
* @Date: 2024/12/5 下午3:19
*/
void update(ApiMer apiMer);
/**
* @MethodName delete
* @Description: 删除api商户
* @param id
* @param fullDelete
* @Author: Sum1Dream
* @Date: 2024/12/5 下午3:19
*/
void delete(Long id , Boolean fullDelete);
/**
* @MethodName queryDetail
* @Description: 查询api商户详情
* @param id
* @return: com.hfkj.entity.ApiMer
* @Author: Sum1Dream
* @Date: 2024/12/5 下午3:19
*/
ApiMer queryDetail(Long id);
/**
* @MethodName queryDetail
* @Description: 根据appId查询商户
* @param appId
* @return: com.hfkj.entity.ApiMer
* @Author: Sum1Dream
* @Date: 2024/12/5 下午3:20
*/
ApiMer queryDetail(String appId);
/**
* @MethodName queryList
* @Description: 查询api商户列表
* @param apiMer
* @return: java.util.List<com.hfkj.entity.ApiMer>
* @Author: Sum1Dream
* @Date: 2024/12/5 下午3:20
*/
List<ApiMer> queryList(ApiMer apiMer);
}

@ -0,0 +1,68 @@
package com.hfkj.api.impl;
import com.hfkj.api.ApiMerService;
import com.hfkj.dao.ApiMerMapper;
import com.hfkj.entity.ApiMer;
import com.hfkj.entity.ApiMerExample;
import com.hfkj.entity.BsOrderGoods;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@Service("apiMerService")
public class ApiMerServiceImpl implements ApiMerService {
@Resource
private ApiMerMapper apiMerMapper;
@Override
public void create(ApiMer apiMer) {
apiMerMapper.insert(apiMer);
}
@Override
public void update(ApiMer apiMer) {
apiMerMapper.updateByPrimaryKey(apiMer);
}
@Override
public void delete(Long id, Boolean fullDelete) {
if (fullDelete) {
apiMerMapper.deleteByPrimaryKey(id);
} else {
ApiMer apiMer = queryDetail(id);
apiMer.setStatus(0);
apiMer.setUpdateTime(new Date());
update(apiMer);
}
}
@Override
public ApiMer queryDetail(Long id) {
return apiMerMapper.selectByPrimaryKey(id);
}
@Override
public ApiMer queryDetail(String appId) {
ApiMerExample example = new ApiMerExample();
ApiMerExample.Criteria criteria = example.createCriteria();
criteria.andAppIdEqualTo(appId).andStatusEqualTo(1);
List<ApiMer> list = apiMerMapper.selectByExample(example);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
}
@Override
public List<ApiMer> queryList(ApiMer apiMer) {
return Collections.emptyList();
}
}

@ -0,0 +1,125 @@
package com.hfkj.dao;
import com.hfkj.entity.ApiMer;
import com.hfkj.entity.ApiMerExample;
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 ApiMerMapper extends ApiMerMapperExt {
@SelectProvider(type=ApiMerSqlProvider.class, method="countByExample")
long countByExample(ApiMerExample example);
@DeleteProvider(type=ApiMerSqlProvider.class, method="deleteByExample")
int deleteByExample(ApiMerExample example);
@Delete({
"delete from api_mer",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into api_mer (contact, contact_phone, ",
"mer_name, app_id, ",
"app_secret, create_time, ",
"update_time, `status`, ",
"ext_1, ext_2, ext_3)",
"values (#{contact,jdbcType=VARCHAR}, #{contactPhone,jdbcType=VARCHAR}, ",
"#{merName,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, ",
"#{appSecret,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(ApiMer record);
@InsertProvider(type=ApiMerSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(ApiMer record);
@SelectProvider(type=ApiMerSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="contact", property="contact", jdbcType=JdbcType.VARCHAR),
@Result(column="contact_phone", property="contactPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="app_id", property="appId", jdbcType=JdbcType.VARCHAR),
@Result(column="app_secret", property="appSecret", 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<ApiMer> selectByExample(ApiMerExample example);
@Select({
"select",
"id, contact, contact_phone, mer_name, app_id, app_secret, create_time, update_time, ",
"`status`, ext_1, ext_2, ext_3",
"from api_mer",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="contact", property="contact", jdbcType=JdbcType.VARCHAR),
@Result(column="contact_phone", property="contactPhone", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="app_id", property="appId", jdbcType=JdbcType.VARCHAR),
@Result(column="app_secret", property="appSecret", 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)
})
ApiMer selectByPrimaryKey(Long id);
@UpdateProvider(type=ApiMerSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") ApiMer record, @Param("example") ApiMerExample example);
@UpdateProvider(type=ApiMerSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") ApiMer record, @Param("example") ApiMerExample example);
@UpdateProvider(type=ApiMerSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(ApiMer record);
@Update({
"update api_mer",
"set contact = #{contact,jdbcType=VARCHAR},",
"contact_phone = #{contactPhone,jdbcType=VARCHAR},",
"mer_name = #{merName,jdbcType=VARCHAR},",
"app_id = #{appId,jdbcType=VARCHAR},",
"app_secret = #{appSecret,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(ApiMer record);
}

@ -0,0 +1,7 @@
package com.hfkj.dao;
/**
* mapper扩展类
*/
public interface ApiMerMapperExt {
}

@ -0,0 +1,332 @@
package com.hfkj.dao;
import com.hfkj.entity.ApiMer;
import com.hfkj.entity.ApiMerExample.Criteria;
import com.hfkj.entity.ApiMerExample.Criterion;
import com.hfkj.entity.ApiMerExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class ApiMerSqlProvider {
public String countByExample(ApiMerExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("api_mer");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(ApiMerExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("api_mer");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(ApiMer record) {
SQL sql = new SQL();
sql.INSERT_INTO("api_mer");
if (record.getContact() != null) {
sql.VALUES("contact", "#{contact,jdbcType=VARCHAR}");
}
if (record.getContactPhone() != null) {
sql.VALUES("contact_phone", "#{contactPhone,jdbcType=VARCHAR}");
}
if (record.getMerName() != null) {
sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}");
}
if (record.getAppId() != null) {
sql.VALUES("app_id", "#{appId,jdbcType=VARCHAR}");
}
if (record.getAppSecret() != null) {
sql.VALUES("app_secret", "#{appSecret,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(ApiMerExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("contact");
sql.SELECT("contact_phone");
sql.SELECT("mer_name");
sql.SELECT("app_id");
sql.SELECT("app_secret");
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("api_mer");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
ApiMer record = (ApiMer) parameter.get("record");
ApiMerExample example = (ApiMerExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("api_mer");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getContact() != null) {
sql.SET("contact = #{record.contact,jdbcType=VARCHAR}");
}
if (record.getContactPhone() != null) {
sql.SET("contact_phone = #{record.contactPhone,jdbcType=VARCHAR}");
}
if (record.getMerName() != null) {
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}");
}
if (record.getAppId() != null) {
sql.SET("app_id = #{record.appId,jdbcType=VARCHAR}");
}
if (record.getAppSecret() != null) {
sql.SET("app_secret = #{record.appSecret,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<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("api_mer");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("contact = #{record.contact,jdbcType=VARCHAR}");
sql.SET("contact_phone = #{record.contactPhone,jdbcType=VARCHAR}");
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}");
sql.SET("app_id = #{record.appId,jdbcType=VARCHAR}");
sql.SET("app_secret = #{record.appSecret,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}");
ApiMerExample example = (ApiMerExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(ApiMer record) {
SQL sql = new SQL();
sql.UPDATE("api_mer");
if (record.getContact() != null) {
sql.SET("contact = #{contact,jdbcType=VARCHAR}");
}
if (record.getContactPhone() != null) {
sql.SET("contact_phone = #{contactPhone,jdbcType=VARCHAR}");
}
if (record.getMerName() != null) {
sql.SET("mer_name = #{merName,jdbcType=VARCHAR}");
}
if (record.getAppId() != null) {
sql.SET("app_id = #{appId,jdbcType=VARCHAR}");
}
if (record.getAppSecret() != null) {
sql.SET("app_secret = #{appSecret,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, ApiMerExample 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<Criteria> 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<Criterion> 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());
}
}
}

@ -49,7 +49,8 @@ public interface BsOrderMapper extends BsOrderMapperExt {
"pay_time, finish_time, ",
"cancel_time, refund_time, ",
"order_status, remarks, ",
"ext_1, ext_2, ext_3)",
"ext_1, ext_2, ext_3, ",
"freight_price)",
"values (#{userId,jdbcType=BIGINT}, #{userName,jdbcType=VARCHAR}, ",
"#{userPhone,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, ",
"#{payChannel,jdbcType=INTEGER}, #{payChannelOrderNo,jdbcType=VARCHAR}, ",
@ -60,7 +61,8 @@ public interface BsOrderMapper extends BsOrderMapperExt {
"#{payTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, ",
"#{cancelTime,jdbcType=TIMESTAMP}, #{refundTime,jdbcType=TIMESTAMP}, ",
"#{orderStatus,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}, ",
"#{freightPrice,jdbcType=DECIMAL})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsOrder record);
@ -94,7 +96,8 @@ public interface BsOrderMapper extends BsOrderMapperExt {
@Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR),
@Result(column="freight_price", property="freightPrice", jdbcType=JdbcType.DECIMAL)
})
List<BsOrder> selectByExample(BsOrderExample example);
@ -103,7 +106,7 @@ public interface BsOrderMapper extends BsOrderMapperExt {
"id, user_id, user_name, user_phone, order_no, pay_channel, pay_channel_order_no, ",
"pay_serial_no, pay_type, total_price, pay_real_price, payment, product_total_price, ",
"create_time, update_time, pay_time, finish_time, cancel_time, refund_time, order_status, ",
"remarks, ext_1, ext_2, ext_3",
"remarks, ext_1, ext_2, ext_3, freight_price",
"from bs_order",
"where id = #{id,jdbcType=BIGINT}"
})
@ -131,7 +134,8 @@ public interface BsOrderMapper extends BsOrderMapperExt {
@Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR),
@Result(column="freight_price", property="freightPrice", jdbcType=JdbcType.DECIMAL)
})
BsOrder selectByPrimaryKey(Long id);
@ -168,7 +172,8 @@ public interface BsOrderMapper extends BsOrderMapperExt {
"remarks = #{remarks,jdbcType=VARCHAR},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"ext_3 = #{ext3,jdbcType=VARCHAR},",
"freight_price = #{freightPrice,jdbcType=DECIMAL}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsOrder record);

@ -120,6 +120,10 @@ public class BsOrderSqlProvider {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
if (record.getFreightPrice() != null) {
sql.VALUES("freight_price", "#{freightPrice,jdbcType=DECIMAL}");
}
return sql.toString();
}
@ -153,6 +157,7 @@ public class BsOrderSqlProvider {
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.SELECT("freight_price");
sql.FROM("bs_order");
applyWhere(sql, example, false);
@ -266,6 +271,10 @@ public class BsOrderSqlProvider {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
if (record.getFreightPrice() != null) {
sql.SET("freight_price = #{record.freightPrice,jdbcType=DECIMAL}");
}
applyWhere(sql, example, true);
return sql.toString();
}
@ -298,6 +307,7 @@ public class BsOrderSqlProvider {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
sql.SET("freight_price = #{record.freightPrice,jdbcType=DECIMAL}");
BsOrderExample example = (BsOrderExample) parameter.get("example");
applyWhere(sql, example, true);
@ -400,6 +410,10 @@ public class BsOrderSqlProvider {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
if (record.getFreightPrice() != null) {
sql.SET("freight_price = #{freightPrice,jdbcType=DECIMAL}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();

@ -0,0 +1,120 @@
package com.hfkj.dao;
import com.hfkj.entity.GoodPresent;
import com.hfkj.entity.GoodPresentExample;
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 GoodPresentMapper extends GoodPresentMapperExt {
@SelectProvider(type=GoodPresentSqlProvider.class, method="countByExample")
long countByExample(GoodPresentExample example);
@DeleteProvider(type=GoodPresentSqlProvider.class, method="deleteByExample")
int deleteByExample(GoodPresentExample example);
@Delete({
"delete from good_present",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into good_present (`type`, `key`, ",
"`name`, specs_id, create_time, ",
"update_time, `status`, ",
"ext_1, ext_2, ext_3)",
"values (#{type,jdbcType=INTEGER}, #{key,jdbcType=VARCHAR}, ",
"#{name,jdbcType=VARCHAR}, #{specsId,jdbcType=BIGINT}, #{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(GoodPresent record);
@InsertProvider(type=GoodPresentSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(GoodPresent record);
@SelectProvider(type=GoodPresentSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="key", property="key", jdbcType=JdbcType.VARCHAR),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="specs_id", property="specsId", jdbcType=JdbcType.BIGINT),
@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<GoodPresent> selectByExample(GoodPresentExample example);
@Select({
"select",
"id, `type`, `key`, `name`, specs_id, create_time, update_time, `status`, ext_1, ",
"ext_2, ext_3",
"from good_present",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="key", property="key", jdbcType=JdbcType.VARCHAR),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="specs_id", property="specsId", jdbcType=JdbcType.BIGINT),
@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)
})
GoodPresent selectByPrimaryKey(Long id);
@UpdateProvider(type=GoodPresentSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") GoodPresent record, @Param("example") GoodPresentExample example);
@UpdateProvider(type=GoodPresentSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") GoodPresent record, @Param("example") GoodPresentExample example);
@UpdateProvider(type=GoodPresentSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(GoodPresent record);
@Update({
"update good_present",
"set `type` = #{type,jdbcType=INTEGER},",
"`key` = #{key,jdbcType=VARCHAR},",
"`name` = #{name,jdbcType=VARCHAR},",
"specs_id = #{specsId,jdbcType=BIGINT},",
"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(GoodPresent record);
}

@ -0,0 +1,7 @@
package com.hfkj.dao;
/**
* mapper扩展类
*/
public interface GoodPresentMapperExt {
}

@ -0,0 +1,318 @@
package com.hfkj.dao;
import com.hfkj.entity.GoodPresent;
import com.hfkj.entity.GoodPresentExample.Criteria;
import com.hfkj.entity.GoodPresentExample.Criterion;
import com.hfkj.entity.GoodPresentExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class GoodPresentSqlProvider {
public String countByExample(GoodPresentExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("good_present");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(GoodPresentExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("good_present");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(GoodPresent record) {
SQL sql = new SQL();
sql.INSERT_INTO("good_present");
if (record.getType() != null) {
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
}
if (record.getKey() != null) {
sql.VALUES("`key`", "#{key,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}");
}
if (record.getSpecsId() != null) {
sql.VALUES("specs_id", "#{specsId,jdbcType=BIGINT}");
}
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(GoodPresentExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("`type`");
sql.SELECT("`key`");
sql.SELECT("`name`");
sql.SELECT("specs_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("good_present");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
GoodPresent record = (GoodPresent) parameter.get("record");
GoodPresentExample example = (GoodPresentExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("good_present");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getType() != null) {
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
}
if (record.getKey() != null) {
sql.SET("`key` = #{record.key,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
}
if (record.getSpecsId() != null) {
sql.SET("specs_id = #{record.specsId,jdbcType=BIGINT}");
}
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<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("good_present");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("`key` = #{record.key,jdbcType=VARCHAR}");
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
sql.SET("specs_id = #{record.specsId,jdbcType=BIGINT}");
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}");
GoodPresentExample example = (GoodPresentExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(GoodPresent record) {
SQL sql = new SQL();
sql.UPDATE("good_present");
if (record.getType() != null) {
sql.SET("`type` = #{type,jdbcType=INTEGER}");
}
if (record.getKey() != null) {
sql.SET("`key` = #{key,jdbcType=VARCHAR}");
}
if (record.getName() != null) {
sql.SET("`name` = #{name,jdbcType=VARCHAR}");
}
if (record.getSpecsId() != null) {
sql.SET("specs_id = #{specsId,jdbcType=BIGINT}");
}
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, GoodPresentExample 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<Criteria> 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<Criterion> 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());
}
}
}

@ -43,26 +43,26 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt {
"goods_type_name, goods_type_parent, ",
"goods_type_parent_name, sale_num, ",
"`type`, child_type, ",
"goods_brand_name, goods_brand, ",
"goods_label, goods_explain, ",
"title, list_img, ",
"banner_img, detail_img, ",
"`status`, create_time, ",
"update_time, mer_id, ",
"mer_name, ext_1, ext_2, ",
"ext_3)",
"show_type, goods_brand_name, ",
"goods_brand, goods_label, ",
"goods_explain, title, ",
"list_img, banner_img, ",
"detail_img, `status`, ",
"create_time, update_time, ",
"mer_id, mer_name, ext_1, ",
"ext_2, ext_3)",
"values (#{goodsType,jdbcType=BIGINT}, #{thirdId,jdbcType=VARCHAR}, ",
"#{goodsTypeName,jdbcType=VARCHAR}, #{goodsTypeParent,jdbcType=BIGINT}, ",
"#{goodsTypeParentName,jdbcType=VARCHAR}, #{saleNum,jdbcType=INTEGER}, ",
"#{type,jdbcType=INTEGER}, #{childType,jdbcType=INTEGER}, ",
"#{goodsBrandName,jdbcType=VARCHAR}, #{goodsBrand,jdbcType=BIGINT}, ",
"#{goodsLabel,jdbcType=VARCHAR}, #{goodsExplain,jdbcType=VARCHAR}, ",
"#{title,jdbcType=VARCHAR}, #{listImg,jdbcType=VARCHAR}, ",
"#{bannerImg,jdbcType=VARCHAR}, #{detailImg,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{merId,jdbcType=BIGINT}, ",
"#{merName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR})"
"#{showType,jdbcType=INTEGER}, #{goodsBrandName,jdbcType=VARCHAR}, ",
"#{goodsBrand,jdbcType=BIGINT}, #{goodsLabel,jdbcType=VARCHAR}, ",
"#{goodsExplain,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, ",
"#{listImg,jdbcType=VARCHAR}, #{bannerImg,jdbcType=VARCHAR}, ",
"#{detailImg,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(GoodsMsg record);
@ -82,6 +82,7 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt {
@Result(column="sale_num", property="saleNum", jdbcType=JdbcType.INTEGER),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="child_type", property="childType", jdbcType=JdbcType.INTEGER),
@Result(column="show_type", property="showType", jdbcType=JdbcType.INTEGER),
@Result(column="goods_brand_name", property="goodsBrandName", jdbcType=JdbcType.VARCHAR),
@Result(column="goods_brand", property="goodsBrand", jdbcType=JdbcType.BIGINT),
@Result(column="goods_label", property="goodsLabel", jdbcType=JdbcType.VARCHAR),
@ -104,9 +105,9 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt {
@Select({
"select",
"id, goods_type, third_id, goods_type_name, goods_type_parent, goods_type_parent_name, ",
"sale_num, `type`, child_type, goods_brand_name, goods_brand, goods_label, goods_explain, ",
"title, list_img, banner_img, detail_img, `status`, create_time, update_time, ",
"mer_id, mer_name, ext_1, ext_2, ext_3",
"sale_num, `type`, child_type, show_type, goods_brand_name, goods_brand, goods_label, ",
"goods_explain, title, list_img, banner_img, detail_img, `status`, create_time, ",
"update_time, mer_id, mer_name, ext_1, ext_2, ext_3",
"from goods_msg",
"where id = #{id,jdbcType=BIGINT}"
})
@ -120,6 +121,7 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt {
@Result(column="sale_num", property="saleNum", jdbcType=JdbcType.INTEGER),
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="child_type", property="childType", jdbcType=JdbcType.INTEGER),
@Result(column="show_type", property="showType", jdbcType=JdbcType.INTEGER),
@Result(column="goods_brand_name", property="goodsBrandName", jdbcType=JdbcType.VARCHAR),
@Result(column="goods_brand", property="goodsBrand", jdbcType=JdbcType.BIGINT),
@Result(column="goods_label", property="goodsLabel", jdbcType=JdbcType.VARCHAR),
@ -158,6 +160,7 @@ public interface GoodsMsgMapper extends GoodsMsgMapperExt {
"sale_num = #{saleNum,jdbcType=INTEGER},",
"`type` = #{type,jdbcType=INTEGER},",
"child_type = #{childType,jdbcType=INTEGER},",
"show_type = #{showType,jdbcType=INTEGER},",
"goods_brand_name = #{goodsBrandName,jdbcType=VARCHAR},",
"goods_brand = #{goodsBrand,jdbcType=BIGINT},",
"goods_label = #{goodsLabel,jdbcType=VARCHAR},",

@ -29,7 +29,7 @@ public interface GoodsMsgMapperExt {
" FROM" +
" goods_msg a join goods_specs b on a.id = b.goods_id where a.type = 1 and a.child_type=1 and a.status = 1" +
" <if test='param.goodsTypeParent != null'> and a.goods_type_parent = #{param.goodsTypeParent} </if>" +
" <if test='param.title != null'> and b.title like concat('%',#{param.title},'%') </if>" +
" <if test='param.title != null'> and a.title like concat('%',#{param.title},'%') </if>" +
" <if test='param.goodsType != null'> and a.goods_type = #{param.goodsType} </if>" +
" <if test='param.goodsBrand != null'> and a.goods_brand = #{param.goodsBrand} </if>" +
" <if test='param.salePriceS != null'><![CDATA[ and b.sale_price >= #{param.salePriceS} ]]></if>" +
@ -38,25 +38,61 @@ public interface GoodsMsgMapperExt {
"</script>")
List<JdGoodsModel> getJdGoodsList(@Param("param") Map<String,Object> param);
// @Select("<script>" +
// " SELECT" +
// " id ," +
// " title as title," +
// " list_img as listImg," +
// " third_id as thirdId," +
// " sale_num as saleNum" +
// " FROM" +
// " goods_msg where status = 1" +
// " <if test='param.goodsTypeParent != null'> and goods_type_parent = #{param.goodsTypeParent} </if>" +
// " <if test='param.title != null'> and title like concat('%',#{param.title},'%') </if>" +
// " <if test='param.goodsType != null'> and goods_type = #{param.goodsType} </if>" +
// " <if test='param.showType != null'> and show_type = #{param.showType} </if>" +
// " <if test='param.goodsBrand != null'> and goods_brand = #{param.goodsBrand} </if>" +
// " <if test='param.time != 1'>ORDER BY update_time desc</if>" +
// " <if test='param.time == 1'>ORDER BY create_time desc</if>" +
// " <if test='param.saleNum == 2'>, sale_num desc</if>" +
// " <if test='param.limit != null'>limit #{param.limit}</if>" +
// "</script>")
// List<GoodsMsg> getGoodsListCrest(@Param("param") Map<String,Object> param);
@Select("<script>" +
" SELECT * from (" +
" SELECT" +
" id ," +
" title as title," +
" title as title," +
" list_img as listImg," +
" third_id as thirdId," +
" sale_num as saleNum" +
" a.goods_type_parent_name as goodsTypeParentName," +
" a.goods_type_name as goodsTypeName," +
" a.goods_brand_name as goodsBrandName," +
" a.title as title," +
" a.list_img as listImg," +
" b.sale_price as salePrice, " +
" b.sale_price as price, " +
" b.third_price as thirdPrice," +
" b.original_price as originalPrice," +
" a.third_id as thirdId," +
" b.id as specsId ," +
" a.id as id," +
" MIN(b.sale_price) , " +
"a.create_time as createtime ," +
"a.update_time as updateTime" +
" FROM" +
" goods_msg where status = 1 and third_id is null" +
" <if test='param.goodsTypeParent != null'> and goods_type_parent = #{param.goodsTypeParent} </if>" +
" <if test='param.title != null'> and title like concat('%',#{param.title},'%') </if>" +
" <if test='param.goodsType != null'> and goods_type = #{param.goodsType} </if>" +
" <if test='param.goodsBrand != null'> and goods_brand = #{param.goodsBrand} </if>" +
" <if test='param.time != 1'>ORDER BY update_time desc</if>" +
" <if test='param.time == 1'>ORDER BY create_time desc</if>" +
" <if test='param.saleNum == 2'>, sale_num desc</if>" +
" goods_msg a join goods_specs b on a.id = b.goods_id where a.status = 1" +
" <if test='param.goodsTypeParent != null'> and a.goods_type_parent = #{param.goodsTypeParent} </if>" +
" <if test='param.title != null'> and a.title like concat('%',#{param.title},'%') </if>" +
" <if test='param.goodsType != null'> and a.goods_type = #{param.goodsType} </if>" +
" <if test='param.showType != null'> and a.show_type = #{param.showType} </if>" +
" <if test='param.specsId != null'> and b.id in <foreach collection='param.specsId' item='item' index='index' open='(' separator=',' close=')'>#{item}</foreach> </if>" +
" <if test='param.goodsBrand != null'> and a.goods_brand = #{param.goodsBrand} </if>" +
" <if test='param.price == 1'>b.sale_price asc</if>" +
" <if test='param.price == 2'> b.sale_price desc</if>" +
" <if test='param.saleNum == 2'>, a.sale_num desc</if>" +
" group by a.id) c" +
" <if test='param.time != 1'>ORDER BY c.updateTime desc</if>" +
" <if test='param.time == 1'>ORDER BY c.createtime desc</if>" +
" <if test='param.limit != null'>limit #{param.limit}</if>" +
"</script>")
List<GoodsMsg> getGoodsListCrest(@Param("param") Map<String,Object> param);
List<JdGoodsModel> getGoodsListCrest(@Param("param") Map<String,Object> param);
}

@ -60,6 +60,10 @@ public class GoodsMsgSqlProvider {
sql.VALUES("child_type", "#{childType,jdbcType=INTEGER}");
}
if (record.getShowType() != null) {
sql.VALUES("show_type", "#{showType,jdbcType=INTEGER}");
}
if (record.getGoodsBrandName() != null) {
sql.VALUES("goods_brand_name", "#{goodsBrandName,jdbcType=VARCHAR}");
}
@ -142,6 +146,7 @@ public class GoodsMsgSqlProvider {
sql.SELECT("sale_num");
sql.SELECT("`type`");
sql.SELECT("child_type");
sql.SELECT("show_type");
sql.SELECT("goods_brand_name");
sql.SELECT("goods_brand");
sql.SELECT("goods_label");
@ -211,6 +216,10 @@ public class GoodsMsgSqlProvider {
sql.SET("child_type = #{record.childType,jdbcType=INTEGER}");
}
if (record.getShowType() != null) {
sql.SET("show_type = #{record.showType,jdbcType=INTEGER}");
}
if (record.getGoodsBrandName() != null) {
sql.SET("goods_brand_name = #{record.goodsBrandName,jdbcType=VARCHAR}");
}
@ -292,6 +301,7 @@ public class GoodsMsgSqlProvider {
sql.SET("sale_num = #{record.saleNum,jdbcType=INTEGER}");
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("child_type = #{record.childType,jdbcType=INTEGER}");
sql.SET("show_type = #{record.showType,jdbcType=INTEGER}");
sql.SET("goods_brand_name = #{record.goodsBrandName,jdbcType=VARCHAR}");
sql.SET("goods_brand = #{record.goodsBrand,jdbcType=BIGINT}");
sql.SET("goods_label = #{record.goodsLabel,jdbcType=VARCHAR}");
@ -350,6 +360,10 @@ public class GoodsMsgSqlProvider {
sql.SET("child_type = #{childType,jdbcType=INTEGER}");
}
if (record.getShowType() != null) {
sql.SET("show_type = #{showType,jdbcType=INTEGER}");
}
if (record.getGoodsBrandName() != null) {
sql.SET("goods_brand_name = #{goodsBrandName,jdbcType=VARCHAR}");
}

@ -1,10 +1,8 @@
package com.hfkj.dao;
import com.hfkj.entity.GoodsMsg;
import com.hfkj.entity.GoodsSpecs;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
@ -17,11 +15,13 @@ public interface GoodsSpecsMapperExt {
@Select("<script>" +
" SELECT" +
" goods_id as goodsId ," +
" sale_price as salePrice," +
" original_price as originalPrice" +
" id as id ," +
" name as name ," +
" sale_price as salePrice" +
" FROM" +
" goods_specs where status = 1 " +
" <if test='param.name != null'> and name like concat('%',#{param.name},'%') </if>" +
"limit 2000 " +
"</script>")
List<GoodsSpecs> getGoodsSpecsCrest();
List<GoodsSpecs> getGoodsSpecsCrest(@Param("param") Map<String,Object> param);
}

@ -0,0 +1,108 @@
package com.hfkj.dao;
import com.hfkj.entity.JdSku;
import com.hfkj.entity.JdSkuExample;
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 JdSkuMapper extends JdSkuMapperExt {
@SelectProvider(type=JdSkuSqlProvider.class, method="countByExample")
long countByExample(JdSkuExample example);
@DeleteProvider(type=JdSkuSqlProvider.class, method="deleteByExample")
int deleteByExample(JdSkuExample example);
@Delete({
"delete from jd_sku",
"where id = #{id,jdbcType=INTEGER}"
})
int deleteByPrimaryKey(Integer id);
@Insert({
"insert into jd_sku (sku_id, create_time, ",
"update_time, `status`, ",
"ext_1, ext_2, ext_3)",
"values (#{skuId,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(JdSku record);
@InsertProvider(type=JdSkuSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(JdSku record);
@SelectProvider(type=JdSkuSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
@Result(column="sku_id", property="skuId", 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<JdSku> selectByExample(JdSkuExample example);
@Select({
"select",
"id, sku_id, create_time, update_time, `status`, ext_1, ext_2, ext_3",
"from jd_sku",
"where id = #{id,jdbcType=INTEGER}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
@Result(column="sku_id", property="skuId", 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)
})
JdSku selectByPrimaryKey(Integer id);
@UpdateProvider(type=JdSkuSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") JdSku record, @Param("example") JdSkuExample example);
@UpdateProvider(type=JdSkuSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") JdSku record, @Param("example") JdSkuExample example);
@UpdateProvider(type=JdSkuSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(JdSku record);
@Update({
"update jd_sku",
"set sku_id = #{skuId,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=INTEGER}"
})
int updateByPrimaryKey(JdSku record);
}

@ -0,0 +1,39 @@
package com.hfkj.dao;
import com.hfkj.entity.JdSku;
import com.hfkj.model.goods.JdGoodsModel;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* mapper扩展类
*/
public interface JdSkuMapperExt {
@Insert({
"<script>",
"insert into jd_sku (sku_id, create_time, ",
"update_time, `status`, ",
"ext_1, ext_2, ext_3)",
"values ",
"<foreach collection='list' item='item' index='index' separator=','>",
"(#{item.skuId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, ",
"#{item.updateTime,jdbcType=TIMESTAMP}, #{item.status,jdbcType=INTEGER}, ",
"#{item.ext1,jdbcType=VARCHAR}, #{item.ext2,jdbcType=VARCHAR}, #{item.ext3,jdbcType=VARCHAR})" ,
"</foreach>",
"</script>"
})
void insertJdSkuBatch(@Param(value = "list") List<JdSku> list);
@Select("<script>" +
" SELECT third_id from goods_msg where third_id is not null;" +
"</script>")
List<Long> getJdList();
}

@ -0,0 +1,276 @@
package com.hfkj.dao;
import com.hfkj.entity.JdSku;
import com.hfkj.entity.JdSkuExample.Criteria;
import com.hfkj.entity.JdSkuExample.Criterion;
import com.hfkj.entity.JdSkuExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class JdSkuSqlProvider {
public String countByExample(JdSkuExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("jd_sku");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(JdSkuExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("jd_sku");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(JdSku record) {
SQL sql = new SQL();
sql.INSERT_INTO("jd_sku");
if (record.getSkuId() != null) {
sql.VALUES("sku_id", "#{skuId,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(JdSkuExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("sku_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("jd_sku");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
JdSku record = (JdSku) parameter.get("record");
JdSkuExample example = (JdSkuExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("jd_sku");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=INTEGER}");
}
if (record.getSkuId() != null) {
sql.SET("sku_id = #{record.skuId,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<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("jd_sku");
sql.SET("id = #{record.id,jdbcType=INTEGER}");
sql.SET("sku_id = #{record.skuId,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}");
JdSkuExample example = (JdSkuExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(JdSku record) {
SQL sql = new SQL();
sql.UPDATE("jd_sku");
if (record.getSkuId() != null) {
sql.SET("sku_id = #{skuId,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=INTEGER}");
return sql.toString();
}
protected void applyWhere(SQL sql, JdSkuExample 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<Criteria> 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<Criterion> 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());
}
}
}

@ -0,0 +1,241 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* api_mer
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class ApiMer implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 联系人
*/
private String contact;
/**
* 联系人电话
*/
private String contactPhone;
/**
* 商户名称
*/
private String merName;
/**
* app_id
*/
private String appId;
/**
* appSecret
*/
private String appSecret;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 状态
*/
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 getContact() {
return contact;
}
public void setContact(String contact) {
this.contact = contact;
}
public String getContactPhone() {
return contactPhone;
}
public void setContactPhone(String contactPhone) {
this.contactPhone = contactPhone;
}
public String getMerName() {
return merName;
}
public void setMerName(String merName) {
this.merName = merName;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public String getAppSecret() {
return appSecret;
}
public void setAppSecret(String appSecret) {
this.appSecret = appSecret;
}
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;
}
ApiMer other = (ApiMer) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getContact() == null ? other.getContact() == null : this.getContact().equals(other.getContact()))
&& (this.getContactPhone() == null ? other.getContactPhone() == null : this.getContactPhone().equals(other.getContactPhone()))
&& (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName()))
&& (this.getAppId() == null ? other.getAppId() == null : this.getAppId().equals(other.getAppId()))
&& (this.getAppSecret() == null ? other.getAppSecret() == null : this.getAppSecret().equals(other.getAppSecret()))
&& (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 + ((getContact() == null) ? 0 : getContact().hashCode());
result = prime * result + ((getContactPhone() == null) ? 0 : getContactPhone().hashCode());
result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode());
result = prime * result + ((getAppId() == null) ? 0 : getAppId().hashCode());
result = prime * result + ((getAppSecret() == null) ? 0 : getAppSecret().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(", contact=").append(contact);
sb.append(", contactPhone=").append(contactPhone);
sb.append(", merName=").append(merName);
sb.append(", appId=").append(appId);
sb.append(", appSecret=").append(appSecret);
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();
}
}

File diff suppressed because it is too large Load Diff

@ -65,7 +65,7 @@ public class BsOrder implements Serializable {
private BigDecimal totalPrice;
/**
* 付金额
* 付金额
*/
private BigDecimal payRealPrice;
@ -125,6 +125,11 @@ public class BsOrder implements Serializable {
private String ext3;
/**
* 运费
*/
private BigDecimal freightPrice;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -319,6 +324,14 @@ public class BsOrder implements Serializable {
this.ext3 = ext3;
}
public BigDecimal getFreightPrice() {
return freightPrice;
}
public void setFreightPrice(BigDecimal freightPrice) {
this.freightPrice = freightPrice;
}
@Override
public boolean equals(Object that) {
if (this == that) {
@ -354,7 +367,8 @@ public class BsOrder implements Serializable {
&& (this.getRemarks() == null ? other.getRemarks() == null : this.getRemarks().equals(other.getRemarks()))
&& (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()));
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()))
&& (this.getFreightPrice() == null ? other.getFreightPrice() == null : this.getFreightPrice().equals(other.getFreightPrice()));
}
@Override
@ -385,6 +399,7 @@ public class BsOrder implements Serializable {
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
result = prime * result + ((getFreightPrice() == null) ? 0 : getFreightPrice().hashCode());
return result;
}
@ -418,6 +433,7 @@ public class BsOrder implements Serializable {
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", freightPrice=").append(freightPrice);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

@ -1655,6 +1655,66 @@ public class BsOrderExample {
addCriterion("ext_3 not between", value1, value2, "ext3");
return (Criteria) this;
}
public Criteria andFreightPriceIsNull() {
addCriterion("freight_price is null");
return (Criteria) this;
}
public Criteria andFreightPriceIsNotNull() {
addCriterion("freight_price is not null");
return (Criteria) this;
}
public Criteria andFreightPriceEqualTo(BigDecimal value) {
addCriterion("freight_price =", value, "freightPrice");
return (Criteria) this;
}
public Criteria andFreightPriceNotEqualTo(BigDecimal value) {
addCriterion("freight_price <>", value, "freightPrice");
return (Criteria) this;
}
public Criteria andFreightPriceGreaterThan(BigDecimal value) {
addCriterion("freight_price >", value, "freightPrice");
return (Criteria) this;
}
public Criteria andFreightPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("freight_price >=", value, "freightPrice");
return (Criteria) this;
}
public Criteria andFreightPriceLessThan(BigDecimal value) {
addCriterion("freight_price <", value, "freightPrice");
return (Criteria) this;
}
public Criteria andFreightPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("freight_price <=", value, "freightPrice");
return (Criteria) this;
}
public Criteria andFreightPriceIn(List<BigDecimal> values) {
addCriterion("freight_price in", values, "freightPrice");
return (Criteria) this;
}
public Criteria andFreightPriceNotIn(List<BigDecimal> values) {
addCriterion("freight_price not in", values, "freightPrice");
return (Criteria) this;
}
public Criteria andFreightPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("freight_price between", value1, value2, "freightPrice");
return (Criteria) this;
}
public Criteria andFreightPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("freight_price not between", value1, value2, "freightPrice");
return (Criteria) this;
}
}
/**

@ -0,0 +1,225 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* good_present
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class GoodPresent implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 1:内部优惠券包 2:嗨加油优惠券包
*/
private Integer type;
/**
* 赠送内容编码
*/
private String key;
/**
* 名称
*/
private String name;
/**
* 商品规格id
*/
private Long specsId;
/**
* 创建时间
*/
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 Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getSpecsId() {
return specsId;
}
public void setSpecsId(Long specsId) {
this.specsId = specsId;
}
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;
}
GoodPresent other = (GoodPresent) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getKey() == null ? other.getKey() == null : this.getKey().equals(other.getKey()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getSpecsId() == null ? other.getSpecsId() == null : this.getSpecsId().equals(other.getSpecsId()))
&& (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 + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getKey() == null) ? 0 : getKey().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getSpecsId() == null) ? 0 : getSpecsId().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(", type=").append(type);
sb.append(", key=").append(key);
sb.append(", name=").append(name);
sb.append(", specsId=").append(specsId);
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();
}
}

@ -0,0 +1,933 @@
package com.hfkj.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class GoodPresentExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private Integer limit;
private Long offset;
public GoodPresentExample() {
oredCriteria = new ArrayList<Criteria>();
}
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<Criteria> 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<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> 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<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> 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 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<Integer> values) {
addCriterion("`type` in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> 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 andKeyIsNull() {
addCriterion("`key` is null");
return (Criteria) this;
}
public Criteria andKeyIsNotNull() {
addCriterion("`key` is not null");
return (Criteria) this;
}
public Criteria andKeyEqualTo(String value) {
addCriterion("`key` =", value, "key");
return (Criteria) this;
}
public Criteria andKeyNotEqualTo(String value) {
addCriterion("`key` <>", value, "key");
return (Criteria) this;
}
public Criteria andKeyGreaterThan(String value) {
addCriterion("`key` >", value, "key");
return (Criteria) this;
}
public Criteria andKeyGreaterThanOrEqualTo(String value) {
addCriterion("`key` >=", value, "key");
return (Criteria) this;
}
public Criteria andKeyLessThan(String value) {
addCriterion("`key` <", value, "key");
return (Criteria) this;
}
public Criteria andKeyLessThanOrEqualTo(String value) {
addCriterion("`key` <=", value, "key");
return (Criteria) this;
}
public Criteria andKeyLike(String value) {
addCriterion("`key` like", value, "key");
return (Criteria) this;
}
public Criteria andKeyNotLike(String value) {
addCriterion("`key` not like", value, "key");
return (Criteria) this;
}
public Criteria andKeyIn(List<String> values) {
addCriterion("`key` in", values, "key");
return (Criteria) this;
}
public Criteria andKeyNotIn(List<String> values) {
addCriterion("`key` not in", values, "key");
return (Criteria) this;
}
public Criteria andKeyBetween(String value1, String value2) {
addCriterion("`key` between", value1, value2, "key");
return (Criteria) this;
}
public Criteria andKeyNotBetween(String value1, String value2) {
addCriterion("`key` not between", value1, value2, "key");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("`name` is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("`name` is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("`name` =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("`name` <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("`name` >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("`name` >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("`name` <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("`name` <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("`name` not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("`name` in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("`name` not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("`name` between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("`name` not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andSpecsIdIsNull() {
addCriterion("specs_id is null");
return (Criteria) this;
}
public Criteria andSpecsIdIsNotNull() {
addCriterion("specs_id is not null");
return (Criteria) this;
}
public Criteria andSpecsIdEqualTo(Long value) {
addCriterion("specs_id =", value, "specsId");
return (Criteria) this;
}
public Criteria andSpecsIdNotEqualTo(Long value) {
addCriterion("specs_id <>", value, "specsId");
return (Criteria) this;
}
public Criteria andSpecsIdGreaterThan(Long value) {
addCriterion("specs_id >", value, "specsId");
return (Criteria) this;
}
public Criteria andSpecsIdGreaterThanOrEqualTo(Long value) {
addCriterion("specs_id >=", value, "specsId");
return (Criteria) this;
}
public Criteria andSpecsIdLessThan(Long value) {
addCriterion("specs_id <", value, "specsId");
return (Criteria) this;
}
public Criteria andSpecsIdLessThanOrEqualTo(Long value) {
addCriterion("specs_id <=", value, "specsId");
return (Criteria) this;
}
public Criteria andSpecsIdIn(List<Long> values) {
addCriterion("specs_id in", values, "specsId");
return (Criteria) this;
}
public Criteria andSpecsIdNotIn(List<Long> values) {
addCriterion("specs_id not in", values, "specsId");
return (Criteria) this;
}
public Criteria andSpecsIdBetween(Long value1, Long value2) {
addCriterion("specs_id between", value1, value2, "specsId");
return (Criteria) this;
}
public Criteria andSpecsIdNotBetween(Long value1, Long value2) {
addCriterion("specs_id not between", value1, value2, "specsId");
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<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> 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<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> 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<Integer> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> 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<String> values) {
addCriterion("ext_1 in", values, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotIn(List<String> 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<String> values) {
addCriterion("ext_2 in", values, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotIn(List<String> 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<String> values) {
addCriterion("ext_3 in", values, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotIn(List<String> 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);
}
}
}

@ -58,6 +58,11 @@ public class GoodsMsg implements Serializable {
*/
private Integer childType;
/**
* 展示类型1.正常展示 2.不展示在c端
*/
private Integer showType;
/**
* 商品品牌名称
*/
@ -212,6 +217,14 @@ public class GoodsMsg implements Serializable {
this.childType = childType;
}
public Integer getShowType() {
return showType;
}
public void setShowType(Integer showType) {
this.showType = showType;
}
public String getGoodsBrandName() {
return goodsBrandName;
}
@ -361,6 +374,7 @@ public class GoodsMsg implements Serializable {
&& (this.getSaleNum() == null ? other.getSaleNum() == null : this.getSaleNum().equals(other.getSaleNum()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getChildType() == null ? other.getChildType() == null : this.getChildType().equals(other.getChildType()))
&& (this.getShowType() == null ? other.getShowType() == null : this.getShowType().equals(other.getShowType()))
&& (this.getGoodsBrandName() == null ? other.getGoodsBrandName() == null : this.getGoodsBrandName().equals(other.getGoodsBrandName()))
&& (this.getGoodsBrand() == null ? other.getGoodsBrand() == null : this.getGoodsBrand().equals(other.getGoodsBrand()))
&& (this.getGoodsLabel() == null ? other.getGoodsLabel() == null : this.getGoodsLabel().equals(other.getGoodsLabel()))
@ -392,6 +406,7 @@ public class GoodsMsg implements Serializable {
result = prime * result + ((getSaleNum() == null) ? 0 : getSaleNum().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getChildType() == null) ? 0 : getChildType().hashCode());
result = prime * result + ((getShowType() == null) ? 0 : getShowType().hashCode());
result = prime * result + ((getGoodsBrandName() == null) ? 0 : getGoodsBrandName().hashCode());
result = prime * result + ((getGoodsBrand() == null) ? 0 : getGoodsBrand().hashCode());
result = prime * result + ((getGoodsLabel() == null) ? 0 : getGoodsLabel().hashCode());
@ -426,6 +441,7 @@ public class GoodsMsg implements Serializable {
sb.append(", saleNum=").append(saleNum);
sb.append(", type=").append(type);
sb.append(", childType=").append(childType);
sb.append(", showType=").append(showType);
sb.append(", goodsBrandName=").append(goodsBrandName);
sb.append(", goodsBrand=").append(goodsBrand);
sb.append(", goodsLabel=").append(goodsLabel);

@ -695,6 +695,66 @@ public class GoodsMsgExample {
return (Criteria) this;
}
public Criteria andShowTypeIsNull() {
addCriterion("show_type is null");
return (Criteria) this;
}
public Criteria andShowTypeIsNotNull() {
addCriterion("show_type is not null");
return (Criteria) this;
}
public Criteria andShowTypeEqualTo(Integer value) {
addCriterion("show_type =", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeNotEqualTo(Integer value) {
addCriterion("show_type <>", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeGreaterThan(Integer value) {
addCriterion("show_type >", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("show_type >=", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeLessThan(Integer value) {
addCriterion("show_type <", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeLessThanOrEqualTo(Integer value) {
addCriterion("show_type <=", value, "showType");
return (Criteria) this;
}
public Criteria andShowTypeIn(List<Integer> values) {
addCriterion("show_type in", values, "showType");
return (Criteria) this;
}
public Criteria andShowTypeNotIn(List<Integer> values) {
addCriterion("show_type not in", values, "showType");
return (Criteria) this;
}
public Criteria andShowTypeBetween(Integer value1, Integer value2) {
addCriterion("show_type between", value1, value2, "showType");
return (Criteria) this;
}
public Criteria andShowTypeNotBetween(Integer value1, Integer value2) {
addCriterion("show_type not between", value1, value2, "showType");
return (Criteria) this;
}
public Criteria andGoodsBrandNameIsNull() {
addCriterion("goods_brand_name is null");
return (Criteria) this;

@ -39,7 +39,7 @@ public class GoodsVpd implements Serializable {
private Integer type;
/**
* 产品来源1.内部虚拟商品 4.贵州中石化 5.重庆中石油 6.比邻星停车券 7.四川中石油 10.中油优途中石油
* 产品来源1.内部优惠券包 2娱尚虚拟商品 3:嗨加油优惠券包 4.贵州中石化 5.重庆中石油 6.比邻星停车券 7.四川中石油 10.中油优途中石油
*/
private Integer source;

@ -0,0 +1,177 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* jd_sku
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class JdSku implements Serializable {
/**
* 主键
*/
private Integer id;
/**
* sku编码
*/
private String skuId;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 状态
*/
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 Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getSkuId() {
return skuId;
}
public void setSkuId(String skuId) {
this.skuId = skuId;
}
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;
}
JdSku other = (JdSku) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getSkuId() == null ? other.getSkuId() == null : this.getSkuId().equals(other.getSkuId()))
&& (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 + ((getSkuId() == null) ? 0 : getSkuId().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(", skuId=").append(skuId);
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();
}
}

@ -0,0 +1,743 @@
package com.hfkj.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class JdSkuExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
private Integer limit;
private Long offset;
public JdSkuExample() {
oredCriteria = new ArrayList<Criteria>();
}
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<Criteria> 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<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> 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(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andSkuIdIsNull() {
addCriterion("sku_id is null");
return (Criteria) this;
}
public Criteria andSkuIdIsNotNull() {
addCriterion("sku_id is not null");
return (Criteria) this;
}
public Criteria andSkuIdEqualTo(String value) {
addCriterion("sku_id =", value, "skuId");
return (Criteria) this;
}
public Criteria andSkuIdNotEqualTo(String value) {
addCriterion("sku_id <>", value, "skuId");
return (Criteria) this;
}
public Criteria andSkuIdGreaterThan(String value) {
addCriterion("sku_id >", value, "skuId");
return (Criteria) this;
}
public Criteria andSkuIdGreaterThanOrEqualTo(String value) {
addCriterion("sku_id >=", value, "skuId");
return (Criteria) this;
}
public Criteria andSkuIdLessThan(String value) {
addCriterion("sku_id <", value, "skuId");
return (Criteria) this;
}
public Criteria andSkuIdLessThanOrEqualTo(String value) {
addCriterion("sku_id <=", value, "skuId");
return (Criteria) this;
}
public Criteria andSkuIdLike(String value) {
addCriterion("sku_id like", value, "skuId");
return (Criteria) this;
}
public Criteria andSkuIdNotLike(String value) {
addCriterion("sku_id not like", value, "skuId");
return (Criteria) this;
}
public Criteria andSkuIdIn(List<String> values) {
addCriterion("sku_id in", values, "skuId");
return (Criteria) this;
}
public Criteria andSkuIdNotIn(List<String> values) {
addCriterion("sku_id not in", values, "skuId");
return (Criteria) this;
}
public Criteria andSkuIdBetween(String value1, String value2) {
addCriterion("sku_id between", value1, value2, "skuId");
return (Criteria) this;
}
public Criteria andSkuIdNotBetween(String value1, String value2) {
addCriterion("sku_id not between", value1, value2, "skuId");
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<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> 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<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> 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<Integer> values) {
addCriterion("`status` in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> 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<String> values) {
addCriterion("ext_1 in", values, "ext1");
return (Criteria) this;
}
public Criteria andExt1NotIn(List<String> 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<String> values) {
addCriterion("ext_2 in", values, "ext2");
return (Criteria) this;
}
public Criteria andExt2NotIn(List<String> 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<String> values) {
addCriterion("ext_3 in", values, "ext3");
return (Criteria) this;
}
public Criteria andExt3NotIn(List<String> 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);
}
}
}

@ -39,6 +39,66 @@ public class HaiOilService {
}
/**
* @MethodName queryListByPk
* @Description: 查询优惠券包列表
* @param map
* @return: com.alibaba.fastjson.JSONObject
* @Author: Sum1Dream
* @Date: 2024/9/9 下午3:00
*/
public static JSONObject queryPkList(Map<String , Object> map) throws Exception {
JSONObject object = request("/openapi/discount/queryPkList" , map);
if (Objects.equals(object.getString("return_code"), "000000")) {
return object;
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求失败!");
}
}
/**
* @MethodName queryPkDetail
* @Description: 查询优惠券包详情
* @param map
* @return: com.alibaba.fastjson.JSONObject
* @Author: Sum1Dream
* @Date: 2024/9/9 下午3:00
*/
public static JSONObject queryPkDetail(Map<String , Object> map) throws Exception {
JSONObject object = request("/openapi/discount/queryPkDetail" , map);
if (Objects.equals(object.getString("return_code"), "000000")) {
return object;
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求失败!");
}
}
/**
* @MethodName queryListByPhone
* @Description: 根据手机号查询优惠券包
* @param map
* @return: com.alibaba.fastjson.JSONObject
* @Author: Sum1Dream
* @Date: 2024/9/9 下午3:00
*/
public static JSONObject queryListByPhone(Map<String , Object> map) throws Exception {
JSONObject object = request("/openapi/discount/queryListByPhone" , map);
if (Objects.equals(object.getString("return_code"), "000000")) {
return object;
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求失败!");
}
}
/**
* 请求
* @param postUrl 接口请求地址

@ -3,6 +3,8 @@ package com.hfkj.jd.Impl;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.utils.RedisUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.dao.JdSkuMapper;
import com.hfkj.dao.JdSkuMapperExt;
import com.hfkj.entity.*;
import com.hfkj.jd.JdPostService;
import com.hfkj.jd.JdService;
@ -31,6 +33,7 @@ import com.jd.open.api.sdk.response.vopsp.VopGoodsGetSkuImageListResponse;
import com.jd.open.api.sdk.response.vopsp.VopGoodsGetSkuPoolInfoResponse;
import com.jd.open.api.sdk.response.vopsp.VopGoodsGetSkuStateListResponse;
import com.jd.open.api.sdk.response.vopxx.VopMessageQueryTransByVopNormalResponse;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -69,6 +72,9 @@ public class JdServiceImpl implements JdService {
@Resource
private BsOrderGoodsService bsOrderGoodsService;
@Resource
private JdSkuMapper jdSkuMapper;
private final List<Long> skuListIds = new ArrayList<>();
@ -86,11 +92,9 @@ public class JdServiceImpl implements JdService {
@Override
public String getToken() throws Exception {
Object token = redisUtil.get("jd_access_token");
if (token == null) {
// 请求回调 会在回调存入参数
JdPostService.getAccessToken();
// getToken();
}
return token.toString();
}
@ -104,7 +108,6 @@ public class JdServiceImpl implements JdService {
handleList.forEach(item->{
try {
for (Long aLong : handleList) {
// 根据skuId 查询商品详情
@ -131,7 +134,6 @@ public class JdServiceImpl implements JdService {
GoodsType goodsType1 = goodsTypeService.queryDetail(category1);
GoodsType goodsType2 = goodsTypeService.queryDetail(category2);
// 如果goodsType1为null,则创建一个新的GoodsType对象
if (goodsType1 == null) {
goodsType1 = new GoodsType();
@ -329,7 +331,6 @@ public class JdServiceImpl implements JdService {
// 获取京东商品池编码
List<GetSkuPoolInfoItemGoodsResp> skuPoolList = sku.getOpenRpcResult().getResult().getSkuPoolList();
skuListIds.clear();
BsProductConfig productConfig = productConfigService.queryDetail(OrderChildProductTypeEnum.type6.getCode());
@ -340,9 +341,16 @@ public class JdServiceImpl implements JdService {
getSkuList(token , skuPoolInfoItemGoodsResp.getBizPoolId() , 0L);
}
List<Long> sku1 = jdSkuMapper.getJdList();
List<Long> skuList = skuListIds.stream()
.filter(e -> !sku1.contains(e))
.collect(Collectors.toList());
System.out.println("=========================当前cpu核数:{}" + cpuCoreCnt);
//通过对核心数取余来计算每个线程需要处理的数据量大小
int size = skuListIds.size() % cpuCoreCnt > 0 ? skuListIds.size() / cpuCoreCnt +1 : skuListIds.size() / cpuCoreCnt;
int size = skuList.size() % cpuCoreCnt > 0 ? skuList.size() / cpuCoreCnt +1 : skuList.size() / cpuCoreCnt;
// 用于存储所有任务的Future
List<Future> futureList = new ArrayList<>();
@ -351,7 +359,7 @@ public class JdServiceImpl implements JdService {
for (int i = 0; i < cpuCoreCnt; i++) {
//获取每个线程要处理的数据集
List<Long> handleList = skuListIds.subList(i * size, Math.min(skuListIds.size(), i * size + size));
List<Long> handleList = skuList.subList(i * size, Math.min(skuList.size(), i * size + size));
//创建异步任务添加到线程池,这里使用jdk8的CompletableFuture
CompletableFuture<Void> completableFuture = CompletableFuture.runAsync(() -> {
//数据集处理任务
@ -369,11 +377,16 @@ public class JdServiceImpl implements JdService {
//关闭线程池
threadPool.shutdown();
}, threadPool);
System.out.println(skuListIds.size());
System.out.println(skuList.size());
}
@Override
public List<Long> skuList() {
return jdSkuMapper.getJdList();
}
/**
* @MethodName getSkuList
* @Description: 获取全量商品池

@ -8,6 +8,8 @@ import com.hfkj.entity.GoodsUserAddress;
import com.jd.open.api.sdk.DefaultJdClient;
import com.jd.open.api.sdk.JdClient;
import com.jd.open.api.sdk.domain.vopdd.OperaOrderOpenProvider.request.submitOrder.*;
import com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.AreaBaseInfoOpenReq;
import com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.FreightQueryOpenReq;
import com.jd.open.api.sdk.domain.vopkc.SkuInfoGoodsProvider.request.getNewStockById.AreaBaseInfoGoodsReq;
import com.jd.open.api.sdk.domain.vopkc.SkuInfoGoodsProvider.request.getNewStockById.GetStockByIdGoodsReq;
import com.jd.open.api.sdk.domain.vopkc.SkuInfoGoodsProvider.request.getNewStockById.SkuNumBaseGoodsReq;
@ -21,10 +23,7 @@ import com.jd.open.api.sdk.request.vopsh.VopAfsCreateAfsApplyRequest;
import com.jd.open.api.sdk.request.vopsp.*;
import com.jd.open.api.sdk.request.vopxx.VopMessageDeleteClientMsgByIdListRequest;
import com.jd.open.api.sdk.request.vopxx.VopMessageQueryTransByVopNormalRequest;
import com.jd.open.api.sdk.response.vopdd.VopOrderConfirmOrderResponse;
import com.jd.open.api.sdk.response.vopdd.VopOrderQueryDeliveryInfoResponse;
import com.jd.open.api.sdk.response.vopdd.VopOrderQueryOrderDetailResponse;
import com.jd.open.api.sdk.response.vopdd.VopOrderSubmitOrderResponse;
import com.jd.open.api.sdk.response.vopdd.*;
import com.jd.open.api.sdk.response.vopdz.VopAddressConvertFourAreaByDetailStrResponse;
import com.jd.open.api.sdk.response.vopdz.VopAddressQueryJdAreaIdListResponse;
import com.jd.open.api.sdk.response.vopdz.VopAddressVerifyAreaFourIdOpenReqResponse;
@ -192,6 +191,23 @@ public class JdPostService {
return client.execute(request);
}
// 查询商品运费
public static VopOrderQuerySkuFreightResponse querySkuFreight(String token , List<com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq> skuInfoList , Long provinceId , Long cityId , Long countyId , Long townId) throws Exception {
JdClient client=new DefaultJdClient(SERVER_URL,token,CommonSysConst.getSysConfig().getJDAppKey(),CommonSysConst.getSysConfig().getJDAppSecret());
VopOrderQuerySkuFreightRequest request=new VopOrderQuerySkuFreightRequest();
FreightQueryOpenReq freightQueryOpenReq=new FreightQueryOpenReq();
freightQueryOpenReq.setPaymentType(4);
freightQueryOpenReq.setSkuInfoList(skuInfoList);
AreaBaseInfoOpenReq areaBaseInfoOpenReq = new AreaBaseInfoOpenReq();
areaBaseInfoOpenReq.setProvinceId(provinceId);
areaBaseInfoOpenReq.setCityId(cityId);
areaBaseInfoOpenReq.setCountyId(countyId);
areaBaseInfoOpenReq.setTownId(townId);
freightQueryOpenReq.setAreaInfo(areaBaseInfoOpenReq);
request.setFreightQueryOpenReq(freightQueryOpenReq);
return client.execute(request);
}
// 提交预占订单服务
public static VopOrderSubmitOrderResponse submitOrder(String token , GoodsUserAddress address , String orderNo , Integer skuNum , Long skuId) throws Exception {
// 创建京东客户端

@ -1,13 +1,12 @@
package com.hfkj.jd;
import com.hfkj.entity.BsOrder;
import com.hfkj.entity.BsOrderGoods;
import com.hfkj.entity.GoodsLogistics;
import com.hfkj.entity.GoodsMsg;
import com.hfkj.entity.*;
import com.jd.open.api.sdk.response.vopdd.VopOrderQueryDeliveryInfoResponse;
import com.jd.open.api.sdk.response.vopdd.VopOrderQueryOrderDetailResponse;
import com.jd.open.api.sdk.response.vopsh.VopAfsCreateAfsApplyResponse;
import java.util.List;
public interface JdService {
/**
@ -31,6 +30,9 @@ public interface JdService {
*/
void getGoodsJd() throws Exception;
List<Long> skuList();
/**
* @MethodName checkSkuSale
* @Description: 校验商品可售性

@ -2,6 +2,7 @@ package com.hfkj.model;
import com.hfkj.entity.CmsContent;
import com.hfkj.model.goods.GoodsModel;
import com.hfkj.model.goods.JdGoodsModel;
import lombok.Data;
import java.util.List;
@ -9,5 +10,5 @@ import java.util.List;
@Data
public class CmsContentModel extends CmsContent {
List<GoodsModel> goodsMsgList;
List<JdGoodsModel> goodsMsgList;
}

@ -0,0 +1,19 @@
package com.hfkj.model.discount;
import com.hfkj.entity.CouponDiscountUserRel;
import lombok.Data;
@Data
public class CouponDiscountUserRelModel extends CouponDiscountUserRel {
/**
* 优惠券来源
*/
private Integer source;
/**
* 优惠券编号
*/
private String discountNo;
}

@ -15,6 +15,10 @@ import java.math.BigDecimal;
@Data
public class JdGoodsModel {
@ColumnWidth(50)
@ExcelProperty("编码")
public String id;
@ColumnWidth(50)
@ExcelProperty("一级分类")
public String goodsTypeParentName;
@ -39,6 +43,10 @@ public class JdGoodsModel {
@ExcelProperty("售卖价格")
public BigDecimal salePrice;
@ColumnWidth(15)
@ExcelProperty("售卖价格")
public BigDecimal price;
@ColumnWidth(20)
@ExcelProperty("京东价")
public BigDecimal thirdPrice;
@ -51,6 +59,10 @@ public class JdGoodsModel {
@ExcelProperty({"sku编码"})
public String thirdId;
@ColumnWidth(20)
@ExcelProperty({"规格编码"})
public String specsId;
@ColumnWidth(20)
@ExcelProperty({"销量"})
public String saleNum;

@ -18,4 +18,6 @@ public class OrderChildModel extends BsOrderChild {
*/
private Object business;
private Long addressId;
}

@ -1,5 +1,6 @@
package com.hfkj.service.discount;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.entity.CouponDiscount;
import com.hfkj.entity.CouponDiscountPackage;
import com.hfkj.entity.CouponDiscountPackageDetails;
@ -70,6 +71,7 @@ public interface CouponDiscountPackageService {
*/
List<CouponDiscountPackage> getList(Map<String , Object> map);
/**
* @Author Sum1Dream
* @Name getListRecordByMap
@ -111,6 +113,16 @@ public interface CouponDiscountPackageService {
void deleteDetail(Integer id);
/**
* @MethodName findDiscountPackageByKey
* @Description: 根据key查询优惠券包
* @param key
* @return: com.hfkj.entity.CouponDiscountPackage
* @Author: Sum1Dream
* @Date: 2024/12/16 下午5:38
*/
CouponDiscountPackage findDiscountPackageByKey(String key);
/**
* @MethodName giveDiscountPackage
* @Description: 赠送优惠券包

@ -156,6 +156,21 @@ public class CouponDiscountPackageServiceImpl implements CouponDiscountPackageSe
couponDiscountPackageDetailsMapper.deleteByPrimaryKey(id);
}
@Override
public CouponDiscountPackage findDiscountPackageByKey(String key) {
CouponDiscountPackageExample example = new CouponDiscountPackageExample();
CouponDiscountPackageExample.Criteria criteria = example.createCriteria();
criteria.andKeyEqualTo(key);
List<CouponDiscountPackage> list = couponDiscountPackageMapper.selectByExample(example);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
}
@Override
public void giveDiscountPackage(Integer discountPackageId, String phone) {
CouponDiscountPackage discountPackage = queryDetail(Long.valueOf(discountPackageId));

@ -27,6 +27,7 @@ public interface BsOrderGoodsService {
* @return void
*/
void update(BsOrderGoods orderGoods);
void updateIsNull(BsOrderGoods orderGoods);
/**
* @Author Sum1Dream

@ -0,0 +1,68 @@
package com.hfkj.service.goods;
import com.hfkj.entity.GoodPresent;
import java.util.List;
import java.util.Map;
public interface GoodPresentService {
/**
* @Author Sum1Dream
* @Name create
* @Description // 创建
* @Date 15:12 2024/4/19
* @Param GoodsBrand
* @return void
*/
void create(GoodPresent goodPresent);
/**
* @MethodName update
* @Description: 更新
* @param goodPresent
* @Author: Sum1Dream
* @Date: 2024/12/18 下午3:39
*/
void update(GoodPresent goodPresent);
/**
* @MethodName findById
* @Description:
* @param id
* @return: com.hfkj.entity.GoodPresent
* @Author: Sum1Dream
* @Date: 2024/12/18 下午3:38
*/
GoodPresent findById(Long id);
/**
* @MethodName getList
* @Description: 查询列表
* @param map
* @return: java.util.List<com.hfkj.entity.GoodPresent>
* @Author: Sum1Dream
* @Date: 2024/12/18 下午3:39
*/
List<GoodPresent> getList(Map<String , Object> map);
/**
* @MethodName delete
* @Description: 删除
* @param id
* @param fullDelete
* @Author: Sum1Dream
* @Date: 2024/12/18 下午3:42
*/
void delete(Long id , Boolean fullDelete);
/**
* @MethodName PresentDiscountPackage
* @Description:
* @param specsId
* @Author: Sum1Dream
* @Date: 2024/12/30 下午3:47
*/
void presentDiscountPackage(Long specsId, String phone) throws Exception;
}

@ -87,7 +87,7 @@ public interface GoodsMsgService {
* @Author: Sum1Dream
* @Date: 2024/11/26 上午10:49
*/
List<GoodsMsg> getListCrest(Map<String , Object> map);
List<JdGoodsModel> getListCrest(Map<String , Object> map);
List<JdGoodsModel> getJdGoodsList(Map<String,Object> param);

@ -87,7 +87,7 @@ public interface GoodsSpecsService {
List<GoodsSpecs> getList(Map<String , Object> map);
List<GoodsSpecs> getGoodsSpecsCrest();
List<GoodsSpecs> getGoodsSpecsCrest(Map<String , Object> map);
/**
* @Author Sum1Dream

@ -53,6 +53,11 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService {
bsOrderGoodsMapper.updateByPrimaryKeySelective(orderGoods);
}
@Override
public void updateIsNull(BsOrderGoods orderGoods) {
bsOrderGoodsMapper.updateByPrimaryKey(orderGoods);
}
@Override
public void delete(Long id, Boolean fullDelete) {
if (fullDelete) {
@ -312,6 +317,7 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService {
@Override
public void confirmReceipt(Long orderGoodsId) {
BsOrderGoods orderGoods = queryDetail(orderGoodsId);
if (orderGoods == null ||
orderGoods.getStatus() == 1 ||
orderGoods.getStatus() == 5 ||
@ -321,6 +327,9 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前状态,不支持确认收货!");
}
if (orderGoods.getLogisticsNo() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前状态,不支持确认收货!");
}
// 子订单完成
orderService.childOrderComplete(orderGoods.getChildOrderNo());

@ -202,7 +202,10 @@ public class BsOrderMeiTuanServiceImpl implements BsOrderMeiTuanService {
if (finish) {
// 子订单完成
orderService.childOrderComplete(childNo);
orderMeiTuan.setFinishTime(finshDate);
orderMeiTuan.setFinishTime(new Date());
if (finshDate != null) {
orderMeiTuan.setExt1(finshDate.toString());
}
orderMeiTuan.setUpdateTime(new Date());
orderMeiTuan.setStatus(OrderChildStatusEnum.status3.getCode());
update(orderMeiTuan);

@ -0,0 +1,86 @@
package com.hfkj.service.goods.impl;
import com.hfkj.dao.GoodPresentMapper;
import com.hfkj.entity.CouponDiscountPackage;
import com.hfkj.entity.GoodPresent;
import com.hfkj.entity.GoodPresentExample;
import com.hfkj.entity.GoodsBrand;
import com.hfkj.haioil.HaiOilService;
import com.hfkj.service.discount.CouponDiscountPackageService;
import com.hfkj.service.goods.GoodPresentService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
@Service("goodPresentService")
public class GoodPresentServiceImpl implements GoodPresentService {
@Resource
private GoodPresentMapper goodPresentMapper;
@Resource
private CouponDiscountPackageService couponDiscountPackageService;
@Override
public void create(GoodPresent goodPresent) {
goodPresentMapper.insert(goodPresent);
}
@Override
public void update(GoodPresent goodPresent) {
goodPresentMapper.updateByPrimaryKey(goodPresent);
}
@Override
public GoodPresent findById(Long id) {
return goodPresentMapper.selectByPrimaryKey(id);
}
@Override
public List<GoodPresent> getList(Map<String, Object> map) {
GoodPresentExample example = new GoodPresentExample();
GoodPresentExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "specsId") != null) {
criteria.andSpecsIdEqualTo(MapUtils.getLong(map, "specsId"));
}
criteria.andStatusNotEqualTo(0);
return goodPresentMapper.selectByExample(example);
}
@Override
public void delete(Long id, Boolean fullDelete) {
if (fullDelete) {
goodPresentMapper.deleteByPrimaryKey(id);
} else {
GoodPresent goodPresent = findById(id);
goodPresent.setStatus(0);
goodPresent.setUpdateTime(new Date());
update(goodPresent);
}
}
@Override
public void presentDiscountPackage(Long specsId , String phone) throws Exception {
Map<String , Object> map = new HashMap<>();
map.put("specsId",specsId);
List<GoodPresent> list = getList(map);
for (GoodPresent goodPresent : list) {
if (goodPresent.getType() == 1) {
CouponDiscountPackage discountPackage = couponDiscountPackageService.findDiscountPackageByKey(goodPresent.getKey());
couponDiscountPackageService.giveDiscountPackage(discountPackage.getId().intValue() , phone);
} else {
map.put("discountPkNo" , goodPresent.getKey());
map.put("number" , 1);
map.put("phone" , phone);
HaiOilService.pushPk(map);
}
}
}
}

@ -145,7 +145,7 @@ public class GoodsMsgServiceImpl implements GoodsMsgService {
}
@Override
public List<GoodsMsg> getListCrest(Map<String, Object> map) {
public List<JdGoodsModel> getListCrest(Map<String, Object> map) {
return goodsMsgMapper.getGoodsListCrest(map);
}

@ -112,8 +112,8 @@ public class GoodsSpecsServiceImpl implements GoodsSpecsService {
@Override
public List<GoodsSpecs> getGoodsSpecsCrest() {
return goodsSpecsMapper.getGoodsSpecsCrest();
public List<GoodsSpecs> getGoodsSpecsCrest(Map<String , Object> map) {
return goodsSpecsMapper.getGoodsSpecsCrest(map);
}
@Override

@ -92,7 +92,7 @@ public class GoodsTypeServiceImpl implements GoodsTypeService {
public List<GoodsType> getList(Map<String, Object> map) {
GoodsTypeExample example = new GoodsTypeExample();
GoodsTypeExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
GoodsTypeExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "parentId") != null) {
criteria.andParentIdEqualTo(MapUtils.getLong(map, "parentId"));
@ -103,6 +103,11 @@ public class GoodsTypeServiceImpl implements GoodsTypeService {
if (MapUtils.getInteger(map, "businessType") != null) {
criteria.andBusinessTypeEqualTo(MapUtils.getInteger(map, "businessType"));
}
if (MapUtils.getInteger(map, "type") != null) {
if (MapUtils.getInteger(map, "type") == 2) {
criteria.andOpIdIsNull();
}
}
if (MapUtils.getInteger(map, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status"));
} else {

@ -129,7 +129,11 @@ public class OrderCreateService {
orderChild.setBusiness(goodsVpd);
if (goodsVpd.getSource().equals(GoodsVpdSourceEnum.type2.getCode())) {
yuShang(order , orderChild , goodsVpd , goodsMsg , goodsSpecs , businessObj);
} else if (goodsVpd.getSource().equals(GoodsVpdSourceEnum.type4.getCode()) || goodsVpd.getSource().equals(GoodsVpdSourceEnum.type10.getCode())) {
} else if (
goodsVpd.getSource().equals(GoodsVpdSourceEnum.type1.getCode()) ||
goodsVpd.getSource().equals(GoodsVpdSourceEnum.type3.getCode()) ||
goodsVpd.getSource().equals(GoodsVpdSourceEnum.type4.getCode()) ||
goodsVpd.getSource().equals(GoodsVpdSourceEnum.type10.getCode())) {
couponHlt(order , orderChild , goodsVpd , goodsMsg , goodsSpecs , businessObj);
}
@ -219,6 +223,7 @@ public class OrderCreateService {
}
orderCouponNo.setChannelOrderNo(response.getJSONObject("data").getString("rechargeOrderId"));
}
orderCouponNoService.editData(orderCouponNo);
}
}
@ -317,6 +322,7 @@ public class OrderCreateService {
}
orderChild.setBusiness(jsonObject);
orderChild.setAddressId(address.getId());
return orderChild;
}

@ -9,6 +9,7 @@ import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.OrderUtil;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.*;
import com.hfkj.haioil.HaiOilService;
import com.hfkj.jd.JdService;
import com.hfkj.meituan.MeiTuanService;
import com.hfkj.model.order.OrderModel;
@ -17,6 +18,7 @@ import com.hfkj.qianzhu.StarbucksService;
import com.hfkj.service.coupon.BsOrderCouponNoService;
import com.hfkj.service.coupon.BsOrderCouponService;
import com.hfkj.service.coupon.channel.*;
import com.hfkj.service.discount.CouponDiscountPackageService;
import com.hfkj.service.goods.*;
import com.hfkj.service.goods.impl.BsOrderStarbucksServiceImpl;
import com.hfkj.service.hlt.HuiLianTongUnionCardService;
@ -57,18 +59,21 @@ public class OrderPaySuccessService {
@Resource
private GoodsVpdService goodsVpdService;
@Resource
private BsOrderStarbucksService orderStarbucksService;
private CouponDiscountPackageService discountPackageService;
@Resource
private BsOrderCinemaService bsOrderCinemaService;
@Resource
private BsOrderStarbucksServiceImpl bsOrderStarbucksService;
@Resource
private BsOrderMeiTuanService bsOrderMeiTuanService;
@Resource
private CouponDiscountPackageService couponDiscountPackageService;
@Resource
private BsOrderMemberService bsOrderMemberService;
@Resource
private JdService jdService;
@Resource
private GoodPresentService goodPresentService;
/**
* 订单业务处理
* @param order
@ -152,8 +157,37 @@ public class OrderPaySuccessService {
List<BsOrderCouponNo> couponNoList = orderCouponNoService.getListByCouponOrderId(orderCoupon.getId());
for (BsOrderCouponNo couponNo : couponNoList) {
try {
if (vpd.getSource() == GoodsVpdSourceEnum.type1.getCode()) {
// 查询优惠券包
CouponDiscountPackage couponDiscountPackage = discountPackageService.findDiscountPackageByKey(vpd.getKey());
if (couponDiscountPackage != null) {
couponDiscountPackageService.giveDiscountPackage(couponDiscountPackage.getId().intValue() , order.getUserPhone());
couponNo.setExpireTime(couponDiscountPackage.getEffectiveTime());
couponNo.setDeliverTime(new Date());
couponNo.setGoodsVpdSourceCouNo(couponDiscountPackage.getKey());
couponNo.setStatus(OrderCouponNoStatusEnum.status2.getCode());
orderCouponNoService.editData(couponNo);
}
if (vpd.getSource() == GoodsVpdSourceEnum.type4.getCode()) {
} else if (vpd.getSource() == GoodsVpdSourceEnum.type3.getCode()) {
// 推送给嗨加油
Map<String , Object> map = new HashMap<>();
map.put("discountPkNo" , vpd.getKey());
map.put("number" , 1);
map.put("phone" , order.getUserPhone());
JSONObject returnParam = HaiOilService.pushPk(map);
if (returnParam.getString("return_code").equals("000000")) {
JSONArray dataArray = returnParam.getJSONObject("return_data").getJSONArray("codeList");
couponNo.setExpireTime(dataArray.getJSONObject(0).getDate("expirationDate"));
couponNo.setDeliverTime(new Date());
couponNo.setGoodsVpdSourceCouNo(vpd.getKey());
couponNo.setStatus(OrderCouponNoStatusEnum.status2.getCode());
orderCouponNoService.editData(couponNo);
}
}else if (vpd.getSource() == GoodsVpdSourceEnum.type4.getCode()) {
// 推送给汇联通
JSONObject returnParam = HuiLianTongCouponService.costRechargeOrder(couponNo.getChannelOrderNo());
if (returnParam.getString("respCode").equals("0000")) {
@ -265,8 +299,9 @@ public class OrderPaySuccessService {
if (goodsOrder.getThirdOrderNo() != null) {
jdService.confirmOrder(goodsOrder);
}
if (childOrder.getProductSpecId() != null) {
goodPresentService.presentDiscountPackage(childOrder.getProductSpecId() , order.getUserPhone());
}
goodsMsgService.editSaleNum(goodsOrder.getGoodsId() , goodsOrder.getGoodsCount() , 1);
goodsOrder.setTotalPrice(childOrder.getProductTotalPrice());

@ -15,10 +15,7 @@ import com.hfkj.service.goods.BsOrderGoodsService;
import com.hfkj.service.goods.GoodsMsgService;
import com.hfkj.service.goods.GoodsUserAddressService;
import com.hfkj.service.order.*;
import com.hfkj.sysenum.order.OrderAfterSalesApplyStatusEnum;
import com.hfkj.sysenum.order.OrderAfterSalesApplyTypeEnum;
import com.hfkj.sysenum.order.OrderChildStatusEnum;
import com.hfkj.sysenum.order.OrderRefundStatusEnum;
import com.hfkj.sysenum.order.*;
import com.jd.open.api.sdk.response.vopsh.VopAfsCreateAfsApplyResponse;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
@ -62,6 +59,7 @@ public class BsOrderAfterSalesApplyServiceImpl implements BsOrderAfterSalesApply
private GoodsMsgService goodsMsgService;
@Resource
private BsOrderAfterSalesAddressRecordService afterSalesAddressRecordService;
@Override
public void editData(BsOrderAfterSalesApply data) {
data.setUpdateTime(new Date());
@ -85,6 +83,7 @@ public class BsOrderAfterSalesApplyServiceImpl implements BsOrderAfterSalesApply
&& !orderChild.getStatus().equals(OrderChildStatusEnum.status3.getCode()) ) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误,无法提交");
}
// 查询订单
BsOrder order = orderService.getOrder(orderChild.getOrderNo());
if (order == null) {
@ -132,6 +131,16 @@ public class BsOrderAfterSalesApplyServiceImpl implements BsOrderAfterSalesApply
}
editData(apply);
// 实物商品状态修改为售后中
if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) {
BsOrderGoods goods = bsOrderGoodsService.findGoodsOrderByChild(orderChild.getChildOrderNo());
goods.setStatus(6);
goods.setLogisticsStatus("售后中");
goods.setLogisticsStatusDesc("售后中");
goods.setUpdateTime(new Date());
bsOrderGoodsService.update(goods);
}
// 操作记录
BsOrderAfterSalesOpRecord opRecord = new BsOrderAfterSalesOpRecord();
opRecord.setApplyNo(apply.getApplyNo());
@ -184,6 +193,15 @@ public class BsOrderAfterSalesApplyServiceImpl implements BsOrderAfterSalesApply
} else {
apply.setStatus(OrderAfterSalesApplyStatusEnum.type2.getCode());
BsOrderGoods bsOrderGoods = bsOrderGoodsService.findGoodsOrderByChild(apply.getChildOrderNo());
if (bsOrderGoods != null) {
bsOrderGoods.setStatus(2);
bsOrderGoods.setLogisticsStatus(null);
bsOrderGoods.setLogisticsStatusDesc(null);
bsOrderGoods.setUpdateTime(new Date());
bsOrderGoodsService.updateIsNull(bsOrderGoods);
}
}
// 操作记录
@ -308,7 +326,6 @@ public class BsOrderAfterSalesApplyServiceImpl implements BsOrderAfterSalesApply
if (response.getOpenRpcResult().getSuccess()) {
apply.setStatus(OrderAfterSalesApplyStatusEnum.type4.getCode());
editData(apply);
// 操作记录
BsOrderAfterSalesOpRecord opRecord = new BsOrderAfterSalesOpRecord();
opRecord.setApplyNo(apply.getApplyNo());
@ -322,7 +339,6 @@ public class BsOrderAfterSalesApplyServiceImpl implements BsOrderAfterSalesApply
apply.setAuditMsg(response.getOpenRpcResult().getResultMessage());
editData(apply);
}
}
@Override

@ -11,6 +11,7 @@ import com.hfkj.common.utils.RandomUtils;
import com.hfkj.common.utils.RedisUtil;
import com.hfkj.dao.BsOrderMapper;
import com.hfkj.entity.*;
import com.hfkj.jd.JdPostService;
import com.hfkj.jd.JdService;
import com.hfkj.model.order.OrderChildModel;
import com.hfkj.model.order.OrderModel;
@ -20,6 +21,8 @@ import com.hfkj.service.BsProductConfigService;
import com.hfkj.service.discount.CouponDiscountService;
import com.hfkj.service.discount.CouponDiscountUserRelService;
import com.hfkj.service.goods.BsOrderCinemaService;
import com.hfkj.service.goods.GoodsSpecsService;
import com.hfkj.service.goods.GoodsUserAddressService;
import com.hfkj.service.order.*;
import com.hfkj.service.user.UserIntegralService;
import com.hfkj.sysenum.UserIntegralRecordOpUserTypeEnum;
@ -28,6 +31,9 @@ import com.hfkj.sysenum.order.OrderChildProductTypeEnum;
import com.hfkj.sysenum.order.OrderChildStatusEnum;
import com.hfkj.sysenum.order.OrderPayChannelEnum;
import com.hfkj.sysenum.order.OrderStatusEnum;
import com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.request.querySkuFreight.SkuInfoOrderOpenReq;
import com.jd.open.api.sdk.domain.vopdd.QueryOrderOpenProvider.response.querySkuFreight.FreightQueryOpenResp;
import com.jd.open.api.sdk.response.vopdd.VopOrderQuerySkuFreightResponse;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
@ -91,7 +97,10 @@ public class BsOrderServiceImpl implements BsOrderService {
private BsProductConfigService productConfigService;
@Resource
private JdService jdService;
@Resource
private GoodsSpecsService goodsSpecsService;
@Resource
private GoodsUserAddressService goodsUserAddressService;
@Override
public BsOrder editData(BsOrder order) {
@ -129,11 +138,17 @@ public class BsOrderServiceImpl implements BsOrderService {
order.setOrderNo(DateUtil.date2String(new Date(), "yyMMddHHmmss") + RandomUtils.number(6, false));
editData(order);
Long addressId = null;
// 订单总金额
BigDecimal totalPrice = new BigDecimal("0");
// 商品总金额
BigDecimal productTotalPrice = new BigDecimal("0");
// 创建京东产品物流
List<SkuInfoOrderOpenReq> skuInfoList = new ArrayList<>();
SkuInfoOrderOpenReq skuInfo = new SkuInfoOrderOpenReq();
/************** 处理业务 ***************/
for (OrderChildModel child : order.getOrderChildList()) {
child.setOrderNo(order.getOrderNo());
@ -142,6 +157,14 @@ public class BsOrderServiceImpl implements BsOrderService {
// 提交订单前实物商品处理
if (child.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) {
child = orderCreateService.goods(order, child);
addressId = child.getAddressId();
// 查询规格
GoodsSpecs specs = goodsSpecsService.queryDetail(child.getProductSpecId());
if (specs.getThirdId() != null) {
skuInfo.setSkuId(Long.parseLong(specs.getThirdId()));
skuInfo.setSkuNum(child.getProductCount());
skuInfoList.add(skuInfo);
}
// todo 1.0阶段暂时需要返回收货地址使用
order.setBusiness(child.getBusiness());
} else if (child.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) {
@ -223,6 +246,17 @@ public class BsOrderServiceImpl implements BsOrderService {
order.setOrderStatus(order.getPayRealPrice().compareTo(new BigDecimal("0")) == 0?OrderStatusEnum.status2.getCode():OrderStatusEnum.status1.getCode());
BigDecimal totalChildDiscountPrice = new BigDecimal("0");
Long totalIntegralDiscountPrice = 0L;
// 计算运费
if (!skuInfoList.isEmpty()) {
FreightQueryOpenResp resp = queryFreight(skuInfoList , addressId);
if (resp != null ) {
order.setFreightPrice(resp.getTotalFreight());
order.setPayRealPrice(order.getPayRealPrice().add(resp.getTotalFreight()));
}
}
// 订单入库前处理
for (int i = 0; i < order.getOrderChildList().size();i++) {
OrderChildModel childOrder = order.getOrderChildList().get(i);
@ -687,4 +721,19 @@ public class BsOrderServiceImpl implements BsOrderService {
}
}
private FreightQueryOpenResp queryFreight(List<SkuInfoOrderOpenReq> skuInfoList , Long addressId) throws Exception {
GoodsUserAddress userAddress = goodsUserAddressService.queryDetail(addressId);
if (userAddress.getProvinceId() != null) {
VopOrderQuerySkuFreightResponse freightResponse = JdPostService.querySkuFreight(jdService.getToken() , skuInfoList , userAddress.getProvinceId() ,userAddress.getCityId() , userAddress.getCountyId() , userAddress.getTownId());
if (freightResponse != null && !freightResponse.getOpenRpcResult().getSuccess()) {
return null;
}
return freightResponse.getOpenRpcResult().getResult();
}
return null;
}
}

@ -113,6 +113,7 @@ public interface BsUserService {
*/
SessionObject login(UserLoginPlatform platform, UserLoginType loginType, String outsideOpenid, Map<String, Object> other) throws Exception;
SessionObject signLogin(UserLoginPlatform platform, UserLoginType loginType, String phone) throws Exception;
/**
* 退出登录
* @param token

@ -30,6 +30,7 @@ import org.springframework.web.context.request.RequestContextHolder;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -238,6 +239,33 @@ public class BsUserServiceImpl implements BsUserService {
return sessionObject;
}
@Override
public SessionObject signLogin(UserLoginPlatform platform, UserLoginType loginType, String phone) throws Exception {
// 查询用户
BsUser user = getUser(phone);
if (user == null) {
user = register(phone, null , new HashMap<>());
}
// 缓存
UserSessionObject session = new UserSessionObject();
session.setUser(user);
// 查询汇联通工会卡
List<BsUserCard> hltCardList = userCardService.getCardList(user.getId(), UserCardTypeEnum.type1);
if (hltCardList.isEmpty()) {
session.setHltCardBind(false);
} else {
session.setHltCardBind(true);
session.setHltCard(hltCardList.get(0));
}
SessionObject sessionObject = new SessionObject(token(user), session);
userCenter.save(sessionObject);
// 异步记录登录信息
userLoginLogService.asyncCreateLog(platform, loginType, user, (HttpServletRequest) RequestContextHolder.getRequestAttributes().resolveReference(RequestAttributes.REFERENCE_REQUEST));
return sessionObject;
}
@Override
public void loginOut(String token) {
userCenter.remove(token);

@ -9,13 +9,17 @@ package com.hfkj.sysenum;
public enum GoodsVpdSourceEnum {
/**
* 内部虚拟商品
* 内部优惠券包
*/
type1(1, "内部虚拟商品"),
type1(1, "内部优惠券包"),
/**
* 娱尚虚拟商品
*/
type2(2, "娱尚虚拟商品"),
/**
* 娱尚虚拟商品
*/
type3(3, "嗨加油优惠券包"),
/**
* 贵州中石化
*/

@ -13,6 +13,7 @@ public enum UserLoginPlatform {
WXAPPLETS("WXAPPLETS", "普汇GO"),
VFAMILY("VFAMILY", "V家园"),
GZGOV("GZGOV", "省自机关"),
HIGH("HIGH", "嗨加油"),
;
private String code;

@ -16,6 +16,7 @@ public enum UserLoginType {
WECHAT_MP_OPENID("WECHAT_MP_OPENID", "微信公众号openId"),
V_FAMILY_OPENID("V_FAMILY_OPENID", "V家园openId"),
GZ_GOV_OPENID("GZ_GOV_OPENID", "省自机关openId"),
SIGN("SIGN", "加密登陆"),
;
private String code;

@ -3,12 +3,15 @@ package com.user.controller;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.api.ApiMerService;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.*;
import com.hfkj.config.CommonSysConst;
import com.hfkj.config.WxMaConfig;
import com.hfkj.entity.ApiMer;
import com.hfkj.entity.BsUser;
import com.hfkj.entity.BsUserComplaint;
import com.hfkj.model.ResponseData;
@ -54,6 +57,8 @@ public class BsUserController {
private RedisUtil redisUtil;
@Resource
private BsUserComplaintService userComplaintService;
@Resource
private ApiMerService apiMerService;
@RequestMapping(value = "/phone", method = RequestMethod.POST)
@ResponseBody
@ -156,48 +161,64 @@ public class BsUserController {
}
}
// @RequestMapping(value = "/phoneNotVerify", method = RequestMethod.POST)
// @ResponseBody
// @ApiOperation(value = "H5手机号不校验登陆")
// public ResponseData phoneNotVerify(@RequestBody JSONObject body) {
// try {
// if (body == null
// || StringUtils.isBlank(body.getString("platform"))
// || StringUtils.isBlank(body.getString("type"))
// || StringUtils.isBlank(body.getString("phone"))
// ) {
// log.error("LoginController --> phone() error!", "请求参数校验失败");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
// }
// String phone = body.getString("phone");
// String password = body.getString("password");
//
// // 客户端
// UserLoginPlatform platform = UserLoginPlatform.getDataByType(body.getString("platform"));
// if (platform == null) {
// log.error("LoginController --> phone() error!", "未知客户端");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知客户端");
// }
// // 校验手机号格式
// if (!MemberValidateUtil.validatePhone(phone)) {
// log.error("LoginController --> phone() error!", "请输入正确的手机号");
// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号");
// }
// // 登录类型
// UserLoginType loginType = UserLoginType.getDataByType(body.getString("type"));
// if (loginType == null) {
// log.error("LoginController --> phone() error!", "未知登录类型;" + body.getString("type"));
// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知登录类型");
// }
//
// Map<String, Object> other = new HashMap<>();
// return ResponseMsgUtil.success(userService.login(platform, loginType, phone, password, other));
//
// } catch (Exception e) {
// log.error("LoginController --> phone() error!", e);
// return ResponseMsgUtil.exception(e);
// }
// }
@RequestMapping(value = "/phgSignLogin", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "普惠go加密登陆")
public ResponseData phgSignLogin(@RequestBody JSONObject body) {
try {
if (body == null
|| StringUtils.isBlank(body.getString("platform"))
|| StringUtils.isBlank(body.getString("type"))
|| StringUtils.isBlank(body.getString("phone"))
|| StringUtils.isBlank(body.getString("sign"))
|| StringUtils.isBlank(body.getString("appid"))
) {
log.error("LoginController --> phone() error!", "请求参数校验失败");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
String phone = body.getString("phone");
// 客户端
UserLoginPlatform platform = UserLoginPlatform.getDataByType(body.getString( "platform"));
if (platform == null) {
log.error("LoginController --> phone() error!", "未知客户端");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知客户端");
}
// 校验手机号格式
if (!MemberValidateUtil.validatePhone(phone)) {
log.error("LoginController --> phone() error!", "请输入正确的手机号");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号");
}
// 登录类型
UserLoginType loginType = UserLoginType.getDataByType(body.getString("type"));
if (loginType == null) {
log.error("LoginController --> phone() error!", "未知登录类型;" + body.getString("type"));
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知登录类型");
}
// 校验签名
// 查询api商户信息
ApiMer apiMer = apiMerService.queryDetail(body.getString("appid"));
if (apiMer == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户不存在");
}
Map<String , Object> map = new HashMap<>();
map.put("appid" , body.getString("appid"));
map.put("phone" , body.getString("phone"));
String sign = SignatureUtil.createSign(map , apiMer.getAppSecret());
if (!body.getString("sign").equals(sign)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "签名校验失败!");
}
return ResponseMsgUtil.success(userService.signLogin(platform, loginType, phone));
} catch (Exception e) {
log.error("LoginController --> phone() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/phoneTest", method = RequestMethod.POST)
@ResponseBody

Loading…
Cancel
Save