袁野 1 day ago
commit fb452786ac
  1. BIN
      bweb/lib/open-api-sdk-2.0-jd.jar
  2. 7
      bweb/pom.xml
  3. 139
      bweb/src/main/java/com/bweb/controller/TestController.java
  4. 1
      bweb/src/main/java/com/bweb/controller/cms/CmsContentController.java
  5. 75
      cweb/src/main/java/com/cweb/controller/cms/CmsContentController.java
  6. 5
      cweb/src/main/java/com/cweb/controller/goods/GoodsController.java
  7. 6
      order/src/main/java/com/order/controller/business/BsOrderGoodsController.java
  8. 84
      order/src/main/java/com/order/controller/business/BsOrderMemberController.java
  9. BIN
      schedule/lib/open-api-sdk-2.0-jd.jar
  10. BIN
      schedule/lib/open-platform-sdk-1.0.21.jar
  11. 21
      schedule/pom.xml
  12. 15
      schedule/src/main/java/com/hfkj/schedule/CouponSchedule.java
  13. 19
      schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java
  14. 5
      service/src/main/java/com/hfkj/config/CommonSysConfig.java
  15. 27
      service/src/main/java/com/hfkj/jd/Impl/JdServiceImpl.java
  16. 10
      service/src/main/java/com/hfkj/jd/JdPostService.java
  17. 11
      service/src/main/java/com/hfkj/jd/JdService.java
  18. 13
      service/src/main/java/com/hfkj/model/CmsContentModel.java
  19. 168
      service/src/main/java/com/hfkj/service/coupon/channel/YouTuCouponService.java
  20. 10
      service/src/main/java/com/hfkj/service/goods/GoodsSpecsService.java
  21. 2
      service/src/main/java/com/hfkj/service/goods/impl/BsOrderMeiTuanServiceImpl.java
  22. 40
      service/src/main/java/com/hfkj/service/goods/impl/BsOrderMemberServiceImpl.java
  23. 3
      service/src/main/java/com/hfkj/service/goods/impl/GoodsMsgServiceImpl.java
  24. 7
      service/src/main/java/com/hfkj/service/goods/impl/GoodsSpecsServiceImpl.java
  25. 5
      service/src/main/java/com/hfkj/service/order/OrderCreateService.java
  26. 23
      service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java
  27. 4
      service/src/main/resources/dev/commonConfig.properties
  28. 4
      service/src/main/resources/prod/commonConfig.properties
  29. BIN
      user/lib/open-api-sdk-2.0-jd.jar
  30. BIN
      user/lib/open-platform-sdk-1.0.21.jar
  31. 21
      user/pom.xml
  32. 2
      user/src/main/java/com/user/controller/BsUserController.java
  33. 42
      user/src/main/java/com/user/controller/SecUserController.java

Binary file not shown.

@ -31,6 +31,13 @@
<version>1.0.21</version>
<systemPath>${basedir}/lib/open-platform-sdk-1.0.21.jar</systemPath>
</dependency>
<dependency>
<groupId>jd.skd</groupId>
<artifactId>jd-open-sdk</artifactId>
<scope>system</scope>
<version>2.0</version>
<systemPath>${basedir}/lib/open-api-sdk-2.0-jd.jar</systemPath>
</dependency>
</dependencies>
<build>

@ -6,12 +6,17 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.*;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.BsOrderGoods;
import com.hfkj.entity.GoodsUserAddress;
import com.hfkj.jd.JdPostService;
import com.hfkj.jd.JdService;
import com.hfkj.mer.BsMerPayConfigService;
import com.hfkj.model.ResponseData;
import com.hfkj.service.card.BsUserCardService;
import com.hfkj.service.coupon.channel.YouTuCouponService;
import com.hfkj.service.goods.BsOrderGoodsService;
import com.hfkj.service.goods.GoodsUserAddressService;
import com.hfkj.service.hlt.HuiLianTongUnionCardService;
import com.hfkj.service.order.BsOrderService;
import com.hfkj.service.order.OrderPayService;
@ -38,12 +43,24 @@ import java.util.*;
@Api(value="测试")
public class TestController {
private static Logger log = LoggerFactory.getLogger(TestController.class);
@Resource
private TradeService huiftTradeService;
@Resource
private BsOrderGoodsService orderGoodsService;
@Resource
private JdService jdService;
@Resource
private BsOrderGoodsService getOrderGoodsService;
@Resource
private GoodsUserAddressService goodsUserAddressService;
@RequestMapping(value="/thirdPayResult",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询V家园订单交易状态")
@ -212,6 +229,35 @@ public class TestController {
}
@RequestMapping(value="/confirmReceipt",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "confirmReceipt")
public ResponseData confirmReceipt() {
try {
Map<String , Object> map = new HashMap<>();
map.put("logisticsStatus" , "AGENT_SIGN");
map.put("status" , 2);
List<BsOrderGoods> orderGoodsList = orderGoodsService.getList(map);
for (BsOrderGoods goods : orderGoodsList) {
// 判断时间是否是十天前
if (DateUtil.differentDays(goods.getCreateTime() , new Date()) > 10) {
orderGoodsService.confirmReceipt(goods.getId());
}
}
return ResponseMsgUtil.success("");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/convertFourAreaByDetailStr",method = RequestMethod.GET)
@ResponseBody
@ -229,4 +275,97 @@ public class TestController {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getYouTuCouponList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取卡券")
public ResponseData getYouTuCouponList() {
try {
JSONObject object = new JSONObject();
object.put("time" , new Date().getTime()/1000);
JSONObject jsonObject = YouTuCouponService.getYouTuCouponList(object);
return ResponseMsgUtil.success(jsonObject);
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getMerchantCouponCode",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取电子券码")
public ResponseData getMerchantCouponCode() {
try {
JSONObject object = new JSONObject();
object.put("id" , "759");
object.put("tradeId" , OrderUtil.generateOrderNo());
object.put("time" , new Date().getTime()/1000);
JSONObject jsonObject = YouTuCouponService.getMerchantCouponCode(object);
return ResponseMsgUtil.success(jsonObject);
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/merchantCouponToMember",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取电子券码")
public ResponseData merchantCouponToMember() {
try {
JSONObject object = new JSONObject();
object.put("id" , "759");
object.put("telephone" , "18090580471");
object.put("tradeId" , OrderUtil.generateOrderNo());
object.put("time" , new Date().getTime()/1000);
JSONObject jsonObject = YouTuCouponService.merchantCouponToMember(object);
return ResponseMsgUtil.success(jsonObject);
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getGoodsUpdate",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "更新商品")
public ResponseData getGoodsUpdate() {
try {
Map<String , Object> map = new HashMap<>();
map.put("status" , 2);
List<BsOrderGoods> orderGoodsList = getOrderGoodsService.getList(map);
List<GoodsUserAddress> userAddresses = goodsUserAddressService.getList(new HashMap<>());
for (BsOrderGoods orderGoods : orderGoodsList) {
GoodsUserAddress address = userAddresses.stream().filter(x -> Objects.equals(x.getId(), orderGoods.getGoodsId())).findFirst().orElse(null);
if (address != null) {
orderGoods.setDeliveryAddress(address.getRegionName() + "-" + address.getAddress() + "-" + address.getConsignee() + "-" + address.getPhone());
getOrderGoodsService.update(orderGoods);
}
}
return ResponseMsgUtil.success("");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -70,6 +70,7 @@ public class CmsContentController {
cmsContent.setName(body.getName());
cmsContent.setAppid(body.getAppid());
cmsContent.setJumpType(body.getJumpType());
cmsContent.setShowType(body.getShowType());
cmsContent.setJumpUrl(body.getJumpUrl());
cmsContent.setPlatformCode(body.getPlatformCode());
cmsContent.setImg(body.getImg());

@ -1,12 +1,20 @@
package com.cweb.controller.cms;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.CmsContent;
import com.hfkj.entity.GoodsMsg;
import com.hfkj.entity.GoodsSpecs;
import com.hfkj.model.CmsContentModel;
import com.hfkj.model.ResponseData;
import com.hfkj.model.goods.GoodsModel;
import com.hfkj.service.cms.CmsContentService;
import com.hfkj.service.goods.GoodsMsgService;
import com.hfkj.service.goods.GoodsSpecsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -14,8 +22,12 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Controller
@RequestMapping(value="/cms")
@ -27,6 +39,12 @@ public class CmsContentController {
@Resource
private CmsContentService cmsContentService;
@Resource
private GoodsMsgService goodsMsgService;
@Resource
private GoodsSpecsService goodsSpecsService;
@RequestMapping(value="/getCms",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询列表")
@ -41,7 +59,62 @@ public class CmsContentController {
}
map.put("status", 1);
map.put("platformCode", platformCode);
return ResponseMsgUtil.success(cmsContentService.getList(map));
List<CmsContent> list = cmsContentService.getList(map);
List<GoodsMsg> goodsMsgList = goodsMsgService.getList(new HashMap<>());
List<GoodsSpecs> specsList = goodsSpecsService.getList(new HashMap<>());
List<CmsContentModel> cmsContents = new ArrayList<>();
for (CmsContent cmsContent : list) {
List<GoodsModel> goodsModels = new ArrayList<>();
if (cmsContent.getShowType() != null) {
List<GoodsMsg> goodsMsgs = new ArrayList<>();
if (cmsContent.getShowType() == 1) {
goodsMsgs = goodsMsgList.stream().filter(s -> s.getGoodsType().equals(cmsContent.getShowDataId().longValue())).limit(2).collect(Collectors.toList());
}
if (cmsContent.getShowType() == 2) {
goodsMsgs = goodsMsgList.stream().filter(s -> s.getGoodsType().equals(cmsContent.getShowDataId().longValue())).limit(4).collect(Collectors.toList());
}
if (cmsContent.getShowType() == 3) {
goodsMsgs = goodsMsgList.stream().filter(s -> s.getGoodsType().equals(cmsContent.getShowDataId().longValue())).limit(10).collect(Collectors.toList());
}
for (GoodsMsg goodsMsg : goodsMsgs) {
GoodsModel goodsModel = new GoodsModel();
List<GoodsSpecs> goodsSpecs = specsList.stream().filter(s -> s.getGoodsId().equals(goodsMsg.getId())).collect(Collectors.toList());
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);
}
}
}
CmsContentModel cmsContentModel = new CmsContentModel();
BeanUtils.copyProperties(cmsContent, cmsContentModel);
cmsContentModel.setGoodsMsgList(goodsModels);
cmsContents.add(cmsContentModel);
}
return ResponseMsgUtil.success(cmsContents);
} catch (Exception e) {
log.error("error!",e);

@ -186,6 +186,8 @@ public class GoodsController {
GoodsMsg goodsMsg = goodsMsgService.queryDetail(id);
GoodsModel goodsModel = new GoodsModel();
BeanUtils.copyProperties(goodsMsg, goodsModel);
@ -202,6 +204,9 @@ public class GoodsController {
BeanUtils.copyProperties(goodsSpec, goodsModelSpec);
GoodsVpd goodsVpd = goodsVpdService.queryDetailBySpecsId(goodsSpec.getId());
if (goodsVpd != null) {
BeanUtils.copyProperties(goodsVpd, goodsModelSpec);
}
goodsModelSpec.setSpecsId(goodsSpec.getId());

@ -346,16 +346,12 @@ public class BsOrderGoodsController {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "暂无物流信息!");
}
GoodsUserAddress userAddress = addressService.queryDetail(orderGoods.getDeliveryAddressId());
if (userAddress == null) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "暂无物流信息!");
}
if (orderGoods.getLogisticsNo() == null) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "待揽收!");
}
GoodsLogistics logistics = (GoodsLogistics) bsOrderGoodsService.getLogisticsMsg(orderGoods.getLogisticsNo() , userAddress.getPhone());
GoodsLogistics logistics = (GoodsLogistics) bsOrderGoodsService.getLogisticsMsg(orderGoods.getLogisticsNo() , orderGoods.getUserPhone());
if (logistics.getLogisticsStatus() != null) {
orderGoods.setLogisticsStatus(logistics.getLogisticsStatus());

@ -0,0 +1,84 @@
package com.order.controller.business;
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.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsOrderMeituan;
import com.hfkj.entity.SecConfig;
import com.hfkj.model.ResponseData;
import com.hfkj.service.SecConfigService;
import com.hfkj.service.goods.BsOrderMeiTuanService;
import com.hfkj.service.goods.BsOrderMemberService;
import com.hfkj.service.goods.impl.BsOrderMeiTuanServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.HashMap;
import java.util.Map;
@Controller
@RequestMapping(value="/orderMember")
@Api(value="会员订单管理")
public class BsOrderMemberController {
@Resource
private BsOrderMemberService bsOrderMemberService;
private static final Logger log = LoggerFactory.getLogger(BsOrderGoodsController.class);
@RequestMapping(value="/getListMember",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询列表")
public ResponseData getListMember(
@RequestParam(value = "orderNo" , required = false) String orderNo,
@RequestParam(value = "childOrderNo" , required = false) String childOrderNo,
@RequestParam(value = "userPhone" , required = false) String userPhone,
@RequestParam(value = "goodsName" , required = false) String goodsName,
@RequestParam(value = "payType" , required = false) Integer payType,
@RequestParam(value = "status" , required = false) Integer status,
@RequestParam(value = "createTimeS" , required = false) Long createTimeS,
@RequestParam(value = "createTimeE" , required = false) Long createTimeE,
@RequestParam(value = "finishTimeS" , required = false) Long finishTimeS,
@RequestParam(value = "finishTimeE" , required = false) Long finishTimeE,
@RequestParam(value = "pageNum" , required = true) Integer pageNum,
@RequestParam(value = "pageSize" , required = true) Integer pageSize) {
try {
Map<String , Object> map = new HashMap<>();
map.put("orderNo", orderNo);
map.put("childOrderNo", childOrderNo);
map.put("userPhone", userPhone);
map.put("goodsName", goodsName);
map.put("payType", payType);
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
map.put("finishTimeS", finishTimeS);
map.put("finishTimeE", finishTimeE);
map.put("status", status);
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(bsOrderMemberService.getList(map)));
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -18,6 +18,20 @@
<artifactId>service</artifactId>
<version>PACKT-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>meituan.skd</groupId>
<artifactId>meituan-open-sdk</artifactId>
<scope>system</scope>
<version>1.0.21</version>
<systemPath>${basedir}/lib/open-platform-sdk-1.0.21.jar</systemPath>
</dependency>
<dependency>
<groupId>jd.skd</groupId>
<artifactId>jd-open-sdk</artifactId>
<scope>system</scope>
<version>2.0</version>
<systemPath>${basedir}/lib/open-api-sdk-2.0-jd.jar</systemPath>
</dependency>
</dependencies>
<build>
@ -26,6 +40,13 @@
<directory>src/main/resources/${env}</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>${basedir}/lib</directory>
<targetPath>BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>

@ -7,6 +7,7 @@ import com.hfkj.service.coupon.BsOrderCouponNoService;
import com.hfkj.service.coupon.BsOrderCouponService;
import com.hfkj.service.coupon.channel.HuiLianTongCouponService;
import com.hfkj.service.coupon.channel.PetroConfig;
import com.hfkj.service.coupon.channel.YouTuCouponService;
import com.hfkj.service.hlt.HuiLianTongUnionCardService;
import com.hfkj.service.order.BsOrderChildService;
import com.hfkj.service.order.BsOrderService;
@ -77,13 +78,15 @@ public class CouponSchedule {
// 查询卡券订单
BsOrderCoupon orderCoupon = orderCouponService.getDetail(coupon.getCouponOrderId());
if (orderCoupon != null) {
JSONObject jsonObject = PetroConfig.couponDetail(coupon.getGoodsVpdSourceCouNo(), orderCoupon.getUserPhone());
if (jsonObject.getString("resultCode").equals("0000")) {
String data = PetroConfig.decrypt(jsonObject.getString("jsonResult"));
JSONObject jsonData = JSONObject.parseObject(data);
if (jsonData.getInteger("state") == 40) {
JSONObject objectP = new JSONObject();
objectP.put("couponCode" , coupon.getGoodsVpdSourceCouNo());
objectP.put("time" , new Date().getTime()/1000);
JSONObject jsonObject = YouTuCouponService.getMerchantCouponState(objectP);
if (jsonObject.getString("code").equals("success")) {
if (jsonObject.getInteger("state") == 3) {
coupon.setStatus(OrderCouponNoStatusEnum.status3.getCode());
coupon.setFinishTime(jsonData.getDate("usedTime"));
coupon.setFinishTime(new Date());
orderCouponNoService.editData(coupon);
}
}

@ -70,6 +70,25 @@ public class OrderGoodsSchedule {
}
}
@Scheduled(cron = "5 0 0 * * ?")
public void orderGoodsConfirmReceiptAgent() {
Map<String , Object> map = new HashMap<>();
map.put("logisticsStatus" , "AGENT_SIGN");
map.put("status" , 2);
List<BsOrderGoods> orderGoodsList = orderGoodsService.getList(map);
for (BsOrderGoods goods : orderGoodsList) {
// 判断时间是否是十天前
if (DateUtil.differentDays(goods.getCreateTime() , new Date()) > 10) {
orderGoodsService.confirmReceipt(goods.getId());
}
}
}
@Scheduled(cron = "5 0 0 * * ?")
public void getLogisticsMsg() {
Map<String , Object> objectMap = new HashMap<>();

@ -160,4 +160,9 @@ public class CommonSysConfig {
private String jDAppKey;
private String jDAppSecret;
private String ytAccessKey;
private String ytSecretKey;
private String ytPostUrl;
}

@ -17,6 +17,7 @@ import com.jd.open.api.sdk.domain.vopsp.SkuPoolGoodsProvider.response.getSkuPool
import com.jd.open.api.sdk.response.vopsp.VopGoodsGetSkuDetailInfoResponse;
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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -62,7 +63,6 @@ public class JdServiceImpl implements JdService {
JdPostService.getAccessToken();
getToken();
}
return token.toString();
}
@ -83,7 +83,8 @@ public class JdServiceImpl implements JdService {
List<GoodsType> goodsType = goodsTypeService.getList(new HashMap<>());
List<GoodsBrand> brands = goodsBrandService.getList(new HashMap<>());
Map<String, Object> goodsMap = new HashMap<>();
goodsMap.put("type", 3);
goodsMap.put("type", 1);
goodsMap.put("childType", 1);
List<GoodsMsg> goodsMsgs = goodsMsgService.getList(goodsMap);
List<GoodsSpecs> goodsSpecsList = goodsSpecsService.getList(new HashMap<>());
BsProductConfig productConfig = productConfigService.queryDetail(OrderChildProductTypeEnum.type6.getCode());
@ -289,4 +290,26 @@ public class JdServiceImpl implements JdService {
}
}
}
@Override
public Boolean checkSkuSale(GoodsMsg goodsMsg) throws Exception {
// 查询商品是否下架
VopGoodsGetSkuStateListResponse skuStateListResponse = JdPostService.getSkuState(getToken(), goodsMsg.getThirdId());
if (skuStateListResponse.getOpenRpcResult().getResult().get(0).getSkuState() == 0) {
return true;
}
// 查询规格
GoodsSpecs specs = goodsSpecsService.queryDetailByThirdId(goodsMsg.getThirdId());
// 根据skuId 查询商品详情
VopGoodsGetSkuDetailInfoResponse skuDetail = JdPostService.getSkuDetailInfo(getToken(), Long.valueOf(goodsMsg.getThirdId()));
GetSkuPoolInfoGoodsResp detail = skuDetail.getOpenRpcResult().getResult();
// 根据skuId 查询商品售价
OpenRpcResult priceResponse = JdPostService.getSellPrice(getToken(), String.valueOf(goodsMsg.getThirdId())).getOpenRpcResult();
return null;
}
}

@ -40,6 +40,7 @@ import java.util.List;
* @Date 2024/10/11 下午3:25
**/
public class JdPostService {
private static Logger log = LoggerFactory.getLogger(JdPostService.class);
/**
@ -162,6 +163,15 @@ public class JdPostService {
return client.execute(request);
}
// 查询商品上下架状态
public static VopGoodsGetSkuStateListResponse getSkuState(String token , String skuId) throws Exception {
JdClient client=new DefaultJdClient(SERVER_URL,token,CommonSysConst.getSysConfig().getJDAppKey(),CommonSysConst.getSysConfig().getJDAppSecret());
VopGoodsGetSkuStateListRequest request=new VopGoodsGetSkuStateListRequest();
request.setSkuId(skuId);
VopGoodsGetSkuStateListResponse response=client.execute(request);
return client.execute(request);
}
// 校验商品购买区域是否受限
public static VopGoodsCheckAreaLimitListResponse checkAreaLimitList(String token , String skuId , Long provinceId , Long cityId , Long countyId , Long townId) throws Exception {
JdClient client=new DefaultJdClient(SERVER_URL,token,CommonSysConst.getSysConfig().getJDAppKey(),CommonSysConst.getSysConfig().getJDAppSecret());

@ -1,5 +1,7 @@
package com.hfkj.jd;
import com.hfkj.entity.GoodsMsg;
public interface JdService {
/**
@ -22,4 +24,13 @@ public interface JdService {
* @Date: 2024/10/16 下午3:21
*/
void getGoodsJd() throws Exception;
/**
* @MethodName checkSkuSale
* @Description: 校验商品可售性
* @param goodsMsg
* @Author: Sum1Dream
* @Date: 2024/11/22 下午2:01
*/
Boolean checkSkuSale(GoodsMsg goodsMsg) throws Exception;
}

@ -0,0 +1,13 @@
package com.hfkj.model;
import com.hfkj.entity.CmsContent;
import com.hfkj.model.goods.GoodsModel;
import lombok.Data;
import java.util.List;
@Data
public class CmsContentModel extends CmsContent {
List<GoodsModel> goodsMsgList;
}

@ -0,0 +1,168 @@
package com.hfkj.service.coupon.channel;
import com.alibaba.fastjson.JSON;
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.HttpsUtils;
import com.hfkj.config.CommonSysConst;
import com.meituan.sqt.utils.EncryptUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Map;
/**
* @ClassName MeiTuanService
* @Author Sum1Dream
* @Description 优涂接口
* @Date 2024/8/26 下午4:52
**/
public class YouTuCouponService {
private static Logger log = LoggerFactory.getLogger(YouTuCouponService.class);
/**
* @MethodName getYouTuCouponList
* @Description:电子券模板列表
* @param param
* @return: com.alibaba.fastjson.JSONObject
* @Author: Sum1Dream
* @Date: 2024/11/19 下午3:38
*/
public static JSONObject getYouTuCouponList(JSONObject param) {
try {
JSONObject object = request( "/openapi/couponV3/getMerchantCouponTpl", param);
if (object.getInteger("code").equals(200)) {
return object.getJSONObject("data");
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!");
}
} catch (Exception e) {
log.info("响应错误信息:{}", e);
}
return null;
}
/**
* @MethodName getMerchantCouponCode
* @Description:获取电子券码
* @param param
* @return: com.alibaba.fastjson.JSONObject
* @Author: Sum1Dream
* @Date: 2024/11/19 下午3:38
*/
public static JSONObject getMerchantCouponCode(JSONObject param) {
try {
JSONObject object = request( "/openapi/couponV3/getMerchantCouponCode", param);
if (object.getInteger("code").equals(200)) {
return object.getJSONObject("data");
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!");
}
} catch (Exception e) {
log.info("响应错误信息:{}", e);
}
return null;
}
/**
* @MethodName merchantCouponToMember
* @Description:发送电子券到优途
* @param param
* @return: com.alibaba.fastjson.JSONObject
* @Author: Sum1Dream
* @Date: 2024/11/19 下午4:36
*/
public static JSONObject merchantCouponToMember(JSONObject param) {
try {
JSONObject object = request( "/openapi/couponV3/merchantCouponToMember", param);
if (object.getInteger("code").equals(200)) {
return object.getJSONObject("data");
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!");
}
} catch (Exception e) {
log.info("响应错误信息:{}", e);
}
return null;
}
public static JSONObject getMerchantCouponState(JSONObject param) {
try {
JSONObject object = request( "/openapi/couponV3/getMerchantCouponState", param);
if (object.getInteger("code").equals(200)) {
return object.getJSONObject("data");
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!");
}
} catch (Exception e) {
log.info("响应错误信息:{}", e);
}
return null;
}
public static JSONObject request(String url , JSONObject param) throws Exception {
log.info("获取卡券列表-请求参数: " + JSON.toJSONString(param));
StringBuilder stringBuffer = new StringBuilder();
param.put("app_id", CommonSysConst.getSysConfig().getYtAccessKey());
JSONObject response = HttpsUtils.doPost(CommonSysConst.getSysConfig().getYtPostUrl() + url + "?app_id" + CommonSysConst.getSysConfig().getYtAccessKey()
+ "&sign=" + encryptSha1(String.valueOf(stringBuffer.append(CommonSysConst.getSysConfig().getYtSecretKey()).append(param.toJSONString())))
, param);
log.info("获取卡券列表-回调参数: " + JSON.toJSONString(response));
log.info("========================请求任务End=========================");
// 请求接口
return response;
}
public static String encryptSha1(String input) {
try {
// Create MD5 Hash
MessageDigest md = MessageDigest.getInstance("SHA-1");
md.update(input.getBytes(java.nio.charset.StandardCharsets.UTF_8));
byte[] digest = md.digest();
StringBuffer hexString = new StringBuffer();
for (byte b : digest) {
String hex = Integer.toHexString(0xff & b);
if (hex.length() == 1) hexString.append('0');
hexString.append(hex);
}
return hexString.toString();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return "";
}
}

@ -56,6 +56,16 @@ public interface GoodsSpecsService {
GoodsSpecs queryDetailByGoodsId(Long id);
/**
* @MethodName queryDetailByThirdId
* @Description: 根据第三方id查询
* @param thirdId
* @return: com.hfkj.entity.GoodsSpecs
* @Author: Sum1Dream
* @Date: 2024/11/22 下午2:34
*/
GoodsSpecs queryDetailByThirdId(String thirdId);
/**
* @Author Sum1Dream
* @Name queryDetailByMap

@ -103,7 +103,7 @@ public class BsOrderMeiTuanServiceImpl implements BsOrderMeiTuanService {
criteria.andChildOrderNoEqualTo(MapUtils.getString(map, "childOrderNo"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "tradeNo"))) {
criteria.andChildOrderNoEqualTo(MapUtils.getString(map, "tradeNo"));
criteria.andTradeNoEqualTo(MapUtils.getString(map, "tradeNo"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "userPhone"))) {

@ -68,7 +68,45 @@ public class BsOrderMemberServiceImpl implements BsOrderMemberService {
@Override
public List<BsOrderMember> getList(Map<String, Object> map) {
return Collections.emptyList();
BsOrderMemberExample example = new BsOrderMemberExample();
BsOrderMemberExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(MapUtils.getString(map, "orderNo"))) {
criteria.andOrderNoEqualTo(MapUtils.getString(map, "orderNo"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "childOrderNo"))) {
criteria.andChildOrderNoEqualTo(MapUtils.getString(map, "childOrderNo"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "userPhone"))) {
criteria.andUserPhoneEqualTo(MapUtils.getString(map, "userPhone"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "goodsName"))) {
criteria.andGoodsNameLike("%"+MapUtils.getString(map, "goodsName")+"%");
}
if (MapUtils.getInteger(map, "payType") != null) {
criteria.andPayTypeEqualTo(MapUtils.getInteger(map, "payType"));
}
if (MapUtils.getLong(map, "createTimeS") != null) {
criteria.andCreateTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(map, "createTimeS")));
}
if (MapUtils.getLong(map, "createTimeE") != null) {
criteria.andCreateTimeLessThan(new Date(MapUtils.getLong(map, "createTimeE")));
}
if (MapUtils.getLong(map, "finishTimeS") != null) {
criteria.andFinishTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(map, "finishTimeS")));
}
if (MapUtils.getLong(map, "finishTimeE") != null) {
criteria.andFinishTimeLessThan(new Date(MapUtils.getLong(map, "finishTimeE")));
}
if (MapUtils.getInteger(map, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status"));
}
example.setOrderByClause("create_time desc");
return bsOrderMemberMapper.selectByExample(example);
}
@Override

@ -98,6 +98,9 @@ public class GoodsMsgServiceImpl implements GoodsMsgService {
if (MapUtils.getInteger(map, "type") != null) {
criteria.andTypeEqualTo(MapUtils.getInteger(map, "type"));
}
if (MapUtils.getInteger(map, "childType") != null) {
criteria.andChildTypeEqualTo(MapUtils.getInteger(map, "childType"));
}
if (MapUtils.getLong(map, "goodsBrand") != null) {
criteria.andGoodsBrandEqualTo(MapUtils.getLong(map, "goodsBrand"));
}

@ -77,6 +77,13 @@ public class GoodsSpecsServiceImpl implements GoodsSpecsService {
return null;
}
@Override
public GoodsSpecs queryDetailByThirdId(String thirdId) {
GoodsSpecsExample goodsSpecsExample = new GoodsSpecsExample();
goodsSpecsExample.createCriteria().andThirdIdEqualTo(thirdId);
return null;
}
@Override
public GoodsSpecs queryDetailByMap(Map<String, Object> map) {
return null;

@ -129,7 +129,7 @@ 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())) {
} else if (goodsVpd.getSource().equals(GoodsVpdSourceEnum.type4.getCode()) || goodsVpd.getSource().equals(GoodsVpdSourceEnum.type10.getCode())) {
couponHlt(order , orderChild , goodsVpd , goodsMsg , goodsSpecs , businessObj);
}
@ -282,7 +282,6 @@ public class OrderCreateService {
jsonObject.put("goodsJump", goodsJump);
// 创建实物订单
orderGoods.setOrderNo(orderChild.getOrderNo());
orderGoods.setChildOrderNo(orderChild.getChildOrderNo());
orderGoods.setMerId(orderChild.getMerId());
@ -302,7 +301,7 @@ public class OrderCreateService {
orderGoods.setGoodsSpecsOriginalPrice(goodsSpecs.getOriginalPrice());
orderGoods.setGoodsCount(orderChild.getProductCount());
orderGoods.setStatus(orderChild.getStatus());
orderGoods.setDeliveryAddress(address.getAddress());
orderGoods.setDeliveryAddress(address.getRegionName() + "-" + address.getAddress() + "-" + address.getConsignee() + "-" + address.getPhone());
orderGoods.setDeliveryAddressId(address.getId());
orderGoods.setCreateTime(new Date());
orderGoods.setUpdateTime(new Date());

@ -6,6 +6,7 @@ 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.OrderUtil;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.*;
import com.hfkj.meituan.MeiTuanService;
@ -14,10 +15,7 @@ import com.hfkj.qianzhu.CinemaService;
import com.hfkj.qianzhu.StarbucksService;
import com.hfkj.service.coupon.BsOrderCouponNoService;
import com.hfkj.service.coupon.BsOrderCouponService;
import com.hfkj.service.coupon.channel.ChongQingCNPCCouponService;
import com.hfkj.service.coupon.channel.HuiLianTongCouponService;
import com.hfkj.service.coupon.channel.PcytCNPCCouponConfig;
import com.hfkj.service.coupon.channel.PetroConfig;
import com.hfkj.service.coupon.channel.*;
import com.hfkj.service.goods.*;
import com.hfkj.service.goods.impl.BsOrderStarbucksServiceImpl;
import com.hfkj.service.hlt.HuiLianTongUnionCardService;
@ -204,14 +202,19 @@ public class OrderPaySuccessService {
orderCouponService.editData(orderCoupon);
} else if (vpd.getSource() == GoodsVpdSourceEnum.type10.getCode()) {
// 发放卡券
JSONObject jsonObject = PcytCNPCCouponConfig.getCoupon(couponNo.getOrderNo() , orderCoupon.getUserPhone() , orderCoupon.getGoodsVpdKey());
if (!jsonObject.getString("code").equals("200")) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , jsonObject.getString("errMsg"));
}
JSONObject object = jsonObject.getJSONObject("data");
JSONObject objectP = new JSONObject();
objectP.put("id" , orderCoupon.getGoodsVpdKey());
objectP.put("telephone" , orderCoupon.getUserPhone());
objectP.put("tradeId" , couponNo.getOrderNo());
objectP.put("time" , new Date().getTime()/1000);
JSONObject jsonObject = YouTuCouponService.merchantCouponToMember(objectP);
JSONObject object = jsonObject.getJSONObject("response").getJSONArray("records").getJSONObject(0);
couponNo.setExpireTime(vpd.getSalesEndTime());
couponNo.setDeliverTime(new Date());
couponNo.setChannelOrderNo(object.getString("recordId"));
couponNo.setGoodsVpdSourceCouNo(object.getString("couponCode"));
couponNo.setStatus(OrderCouponNoStatusEnum.status2.getCode());
orderCouponNoService.editData(couponNo);

@ -90,3 +90,7 @@ haiOilAppSecret = 8aef995ff71485dc19b36e35f04c4016
jDPostUrl = https://test-oil.dctpay.com
jDAppKey = C4FF710550C43FE76D4114E1C9C6A0C9
jDAppSecret = 873bcbc1d8d64f36832270c2ff59c194
ytAccessKey=9326673207264334
ytSecretKey=VCLXFV09BNZNMERR9F21KI3LC7L101YY
ytPostUrl=https://youtu.95504.net/v4

@ -85,3 +85,7 @@ yuShangPostUrl=http://mbapiq.mbs.scyshy.com/
haiOilPostUrl = https://oil.dctpay.com
haiOilAppid = hf166f4b2ed75e71
haiOilAppSecret = 5a11778cfdd4962282a359397bf4f86b
ytAccessKey=9326673207264334
ytSecretKey=VCLXFV09BNZNMERR9F21KI3LC7L101YY
ytPostUrl= https://sichuan.95504.net/v4

Binary file not shown.

@ -18,6 +18,20 @@
<artifactId>service</artifactId>
<version>PACKT-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>meituan.skd</groupId>
<artifactId>meituan-open-sdk</artifactId>
<scope>system</scope>
<version>1.0.21</version>
<systemPath>${basedir}/lib/open-platform-sdk-1.0.21.jar</systemPath>
</dependency>
<dependency>
<groupId>jd.skd</groupId>
<artifactId>jd-open-sdk</artifactId>
<scope>system</scope>
<version>2.0</version>
<systemPath>${basedir}/lib/open-api-sdk-2.0-jd.jar</systemPath>
</dependency>
</dependencies>
<build>
@ -26,6 +40,13 @@
<directory>src/main/resources/${env}</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>${basedir}/lib</directory>
<targetPath>BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>

@ -191,7 +191,7 @@ public class BsUserController {
}
Map<String, Object> other = new HashMap<>();
other.put("maOpenId", "maOpenId");
/*other.put("maOpenId", "maOpenId");*/
return ResponseMsgUtil.success(userService.login(platform, loginType, phone, password, other));
} catch (Exception e) {

@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
@ -107,5 +108,46 @@ public class SecUserController {
}
@RequestMapping(value="/sendUserPass",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "修改用户密码")
public ResponseData sendUserPass(@RequestBody String reqBody , HttpServletRequest request) throws Exception{
try {
JSONObject jsonObject = JSONObject.parseObject(reqBody);
SecUserSessionObject session = userCenter.getSessionModel(SecUserSessionObject.class);
Long userId = session.getAccount().getId(); //用户Id
String oldPassword = jsonObject.getString("oldPassword"); //旧密码
String password = jsonObject.getString("newPassword"); //密码
if(userId == null || StringUtils.isBlank(oldPassword) || StringUtils.isBlank(password)) {
log.error("BaseMemberController --> sendUserPass() error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
//查询用户
SecUser secUser = secUserService.getDetail(userId);
if(secUser == null){
log.error("BaseMemberController --> sendUserPass() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "用户不存在");
}
if(!secUser.getPassword().equals(MD5Util.encode(oldPassword.getBytes()))) {
log.error("BaseMemberController --> sendUserPass() error!","旧密码不一致");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "旧密码不一致");
}
secUser.setPassword(MD5Util.encode(password.getBytes()));
//修改
secUserService.editUser(secUser);
userCenter.remove(request);
return ResponseMsgUtil.success("修改密码成功");
} catch (Exception e) {
log.error("getUserByTelephone",e);
return ResponseMsgUtil.exception(e);
}
}
}

Loading…
Cancel
Save