袁野 3 weeks ago
commit e135508572
  1. 4
      bweb/src/main/resources/prod/config.properties
  2. 51
      cweb/src/main/java/com/hfkj/controller/GoodsController.java
  3. 101
      cweb/src/main/java/com/hfkj/controller/TestController.java
  4. 37
      cweb/src/main/java/com/hfkj/controller/notify/TaoBaoNotify.java
  5. 2
      cweb/src/main/java/com/hfkj/controller/order/BsOrderController.java
  6. 4
      cweb/src/main/resources/prod/config.properties
  7. 2
      service/src/main/java/com/hfkj/entity/BsOrder.java
  8. 10
      service/src/main/java/com/hfkj/service/order/BsOrderService.java
  9. 126
      service/src/main/java/com/hfkj/service/order/Impl/BsOrderServiceImpl.java
  10. 31
      service/src/main/java/com/hfkj/service/pdd/PddService.java
  11. 2
      service/src/main/java/com/hfkj/service/promotion/PromotionBusinessService.java
  12. 11
      service/src/main/resources/prod/commonConfig.properties

@ -1,2 +1,2 @@
fileUrl=/home/project/hsg/filesystem fileUrl=/home/project/youtao/filesystem
cmsPath=/home/project/hsg/filesystem/cmsPath cmsPath=/home/project/youtao/filesystem/cmsPath

@ -7,11 +7,13 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter; import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.BsOrder; import com.hfkj.entity.BsOrder;
import com.hfkj.entity.BsUser;
import com.hfkj.model.*; import com.hfkj.model.*;
import com.hfkj.service.goods.GoodsDataService; import com.hfkj.service.goods.GoodsDataService;
import com.hfkj.service.order.BsOrderService; import com.hfkj.service.order.BsOrderService;
import com.hfkj.service.pdd.PddService; import com.hfkj.service.pdd.PddService;
import com.hfkj.service.taobao.TaoBaoService; import com.hfkj.service.taobao.TaoBaoService;
import com.hfkj.service.user.BsUserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -37,6 +39,8 @@ public class GoodsController {
private GoodsDataService goodsDataService; private GoodsDataService goodsDataService;
@Autowired @Autowired
private UserCenter userCenter; private UserCenter userCenter;
@Resource
private BsUserService bsUserService;
@ -64,7 +68,7 @@ public class GoodsController {
} else if (type == 2) { } else if (type == 2) {
// 用户session // 用户session
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class);
Map<String , Object> mapUser = new HashMap<>(); Map<String , Object> mapUser = new JSONObject();
mapUser.put("uid", userSession.getUser().getId()); mapUser.put("uid", userSession.getUser().getId());
JSONObject object = PddService.authority(mapUser.toString()); JSONObject object = PddService.authority(mapUser.toString());
boolean generateAuthorityUrl = object.getJSONObject("authorityQueryResponse").getInteger("bind") == 0; boolean generateAuthorityUrl = object.getJSONObject("authorityQueryResponse").getInteger("bind") == 0;
@ -120,39 +124,30 @@ public class GoodsController {
} }
} }
@RequestMapping(value="/promotion",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "多多进宝推广链接生成")
public ResponseData promotion(@RequestParam(value = "searchId" , required = false) String searchId,
@RequestParam(value = "goodsSign" , required = false) String goodsSign
) {
try {
Map<String , Object> map = new HashMap<>();
map.put("searchId" , searchId);
map.put("goodsSign" , goodsSign);
JSONObject object = PddService.authority("139");
boolean generateAuthorityUrl = object.getJSONObject("authorityQueryResponse").getInteger("bind") == 0;
JSONObject jsonObject = PddService.promotion(searchId , goodsSign , generateAuthorityUrl , map.toString());
return ResponseMsgUtil.success(jsonObject.getJSONObject("goodsPromotionUrlGenerateResponse").getJSONArray("goodsPromotionUrlList").getJSONObject(0));
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/publisher",method = RequestMethod.GET) @RequestMapping(value="/publisher",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "淘宝客-公用-私域用户备案") @ApiOperation(value = "淘宝客-公用-私域用户备案")
public ResponseData publisher(@RequestParam(value = "token" , required = false) String token public ResponseData publisher(@RequestParam(value = "code" , required = false) String code
) { ) {
try { try {
// 用户session
UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class);
JSONObject tokenJson = TaoBaoService.getToken(code);
String token = tokenJson.getString("token_result");
JSONObject tokenResult = JSONObject.parseObject(token);
JSONObject jsonObject = TaoBaoService.publisher(tokenResult.getString("access_token"));
String body = jsonObject.getString("body");
JSONObject result = JSONObject.parseObject(body);
BsUser user = bsUserService.getUser(userSession.getUser().getId());
user.setSpecialId(result.getJSONObject("data").getString("relation_id"));
bsUserService.updateInfo(user);
JSONObject jsonObject = TaoBaoService.publisher(token); return ResponseMsgUtil.success("绑定成功");
return ResponseMsgUtil.success(jsonObject);
} catch (Exception e) { } catch (Exception e) {
log.error("error!",e); log.error("error!",e);
@ -168,7 +163,9 @@ public class GoodsController {
try { try {
JSONObject jsonObject = TaoBaoService.getToken(code); JSONObject jsonObject = TaoBaoService.getToken(code);
return ResponseMsgUtil.success(jsonObject); String token = jsonObject.getString("token_result");
JSONObject tokenResult = JSONObject.parseObject(token);
return ResponseMsgUtil.success(tokenResult);
} catch (Exception e) { } catch (Exception e) {
log.error("error!",e); log.error("error!",e);

@ -5,6 +5,7 @@ import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode; import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.model.ResponseData; import com.hfkj.model.ResponseData;
@ -40,12 +41,6 @@ import java.util.Map;
public class TestController { public class TestController {
private static Logger log = LoggerFactory.getLogger(TestController.class); private static Logger log = LoggerFactory.getLogger(TestController.class);
@Resource
private BsUserParentRelService userParentRelService;
@Resource
private BsUserContributeService userContributeService;
@RequestMapping(value="/material",method = RequestMethod.GET) @RequestMapping(value="/material",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "淘宝客-推广者-物料id列表查询 ") @ApiOperation(value = "淘宝客-推广者-物料id列表查询 ")
@ -69,101 +64,7 @@ public class TestController {
} }
} }
@RequestMapping(value="/createCommand",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "淘口令生成 ")
public ResponseData createCommand(@RequestParam(value = "url" , required = false) String url
) {
try {
JSONObject jsonObject = TaoBaoService.createCommand("https:" + url);
if (jsonObject.getBoolean("success")) {
return ResponseMsgUtil.success(jsonObject.getJSONObject("data"));
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求失败!");
}
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/generateLink",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "自助取链接口 ")
public ResponseData generateLink(@RequestParam(value = "actId" , required = false) Long actId,
@RequestParam(value = "linkType" , required = false) Integer linkType
) {
try {
JSONObject jsonObject = new JSONObject();
jsonObject.put("actId" , actId);
jsonObject.put("sid" , "001");
jsonObject.put("linkType" , linkType);
JSONObject object = MeiTuanService.generateLink(jsonObject);
return ResponseMsgUtil.success(object);
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getParent",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "getParent ")
public ResponseData getParent() {
try {
return ResponseMsgUtil.success(userParentRelService.getParent(Arrays.asList(UserGradeEnum.grade3,UserGradeEnum.grade4), 4L));
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@Resource
private BsUserGradeService userGradeService;
@RequestMapping(value="/promote",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "promote")
public ResponseData promote() {
try {
userGradeService.promote(1L);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/purchase",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "会员贡献测试")
public ResponseData purchase(@RequestParam(value = "rebate" , required = true) BigDecimal rebate,
@RequestParam(value = "userId" , required = true) Long userId) {
try {
Map<String,Object> otherParam = new HashMap<>();
otherParam.put("sourceId", System.currentTimeMillis());
otherParam.put("sourceOrderNo", System.currentTimeMillis());
userContributeService.purchase(rebate, userId, otherParam);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}

@ -1,48 +1,41 @@
package com.hfkj.controller.notify; package com.hfkj.controller.notify;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hfkj.service.taobao.TaoBaoService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
@Controller @Controller
@RequestMapping(value = "/taoBaoNotify") @RequestMapping(value = "/taoBaoNotify")
@Api(value = "淘宝业务通知") @Api(value = "淘宝业务通知")
public class TaoBaoNotify { public class TaoBaoNotify {
private static Logger log = LoggerFactory.getLogger(TaoBaoService.class); private static Logger log = LoggerFactory.getLogger(TaoBaoNotify.class);
@RequestMapping(value = "/notify", method = RequestMethod.POST) @RequestMapping(value = "/notify", method = RequestMethod.GET)
@ApiOperation(value = "回调") @ApiOperation(value = "回调")
@ResponseBody @ResponseBody
public void notify(@RequestBody String reqBodyStr, HttpServletResponse response) { public void notify(@RequestParam("code") String code) {
try { try {
JSONObject dataObject = JSONObject.parseObject(reqBodyStr, JSONObject.class); System.out.println("============token回调任务Start=============");
System.out.println("============token回调任务code=============" + code);
log.info("============淘宝回调任务Start============="); JSONObject object = new JSONObject();
log.info("淘宝-回调参数: " + dataObject); object.put("code", code);
log.info("============淘宝回调任务End============="); // JSONObject jsonObject = TaoBaoService.getToken(code);
// if (jsonObject.getBoolean("success")) {
// String token = jsonObject.getString("token_result");
// JSONObject tokenResult = JSONObject.parseObject(token);
// System.out.println("============token回调任务jsonObject=============" + tokenResult);
// }
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=utf-8");
PrintWriter writer= response.getWriter();
writer.write("SUCCESS");
} catch (Exception e) { } catch (Exception e) {
log.error("WechatPayController --> wechatNotify() error!", e); log.error("TaoBaoNotify --> notify() error!", e);
} }
} }
} }

@ -99,7 +99,7 @@ public class BsOrderController {
public ResponseData getPddOrderList() { public ResponseData getPddOrderList() {
try { try {
return ResponseMsgUtil.success(orderService.getOrderList()); return ResponseMsgUtil.success(orderService.getOrderList("2024-10-01 00:00:00"));
} catch (Exception e) { } catch (Exception e) {
log.error("error!",e); log.error("error!",e);

@ -1,2 +1,2 @@
fileUrl=/home/project/hsg/filesystem fileUrl=/home/project/youtao/filesystem
cmsPath=/home/project/hsg/filesystem/cmsPath cmsPath=/home/project/youtao/filesystem/cmsPath

@ -75,7 +75,7 @@ public class BsOrder implements Serializable {
private BigDecimal gold; private BigDecimal gold;
/** /**
* 1-已支付 2-确认收货3-审核成功4-审核失败不可提现5-已经结算 ;10-已处罚 * 状态 0-已支付1-已成团2-确认收货3-审核成功4-审核失败不可提现5-已经结算 6-已失效 ;10-已处罚
*/ */
private Integer status; private Integer status;

@ -1,6 +1,7 @@
package com.hfkj.service.order; package com.hfkj.service.order;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hfkj.entity.BsCornucopiaConfig;
import com.hfkj.entity.BsOrder; import com.hfkj.entity.BsOrder;
import com.hfkj.model.BsOrderModel; import com.hfkj.model.BsOrderModel;
@ -16,6 +17,8 @@ import java.util.Map;
**/ **/
public interface BsOrderService { public interface BsOrderService {
void create(BsOrder order);
/** /**
* 编辑数据 * 编辑数据
* @param order * @param order
@ -64,7 +67,7 @@ public interface BsOrderService {
* @Author: Sum1Dream * @Author: Sum1Dream
* @Date: 2024/10/23 上午10:27 * @Date: 2024/10/23 上午10:27
*/ */
JSONObject getOrderList() throws Exception; JSONObject getOrderList(String startTime) throws Exception;
/** /**
* @MethodName getOrderListParent * @MethodName getOrderListParent
@ -79,13 +82,12 @@ public interface BsOrderService {
/** /**
* @MethodName orderRebate * @MethodName orderRebate
* @Description: 订单返利 * @Description: 订单返利
* @param orderNo 订单号 * @param bsOrder 订单
* @param gold 返利金额
* @return: void * @return: void
* @Author: Sum1Dream * @Author: Sum1Dream
* @Date: 2024/10/24 下午3:03 * @Date: 2024/10/24 下午3:03
*/ */
void orderRebate(String orderNo , BigDecimal gold) throws Exception; void orderRebate(BsOrder bsOrder) throws Exception;
} }

@ -1,14 +1,18 @@
package com.hfkj.service.order.Impl; package com.hfkj.service.order.Impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode; import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.OrderUtil; import com.hfkj.common.utils.OrderUtil;
import com.hfkj.common.utils.RedisUtil; import com.hfkj.common.utils.RedisUtil;
import com.hfkj.dao.BsOrderMapper; import com.hfkj.dao.BsOrderMapper;
import com.hfkj.entity.BsCornucopiaConfig;
import com.hfkj.entity.BsOrder; import com.hfkj.entity.BsOrder;
import com.hfkj.entity.BsOrderExample; import com.hfkj.entity.BsOrderExample;
import com.hfkj.entity.BsUser;
import com.hfkj.model.BsOrderModel; import com.hfkj.model.BsOrderModel;
import com.hfkj.model.UserTeamModel; import com.hfkj.model.UserTeamModel;
import com.hfkj.service.order.BsOrderService; import com.hfkj.service.order.BsOrderService;
@ -18,6 +22,10 @@ import com.hfkj.service.promotion.PromotionBusinessService;
import com.hfkj.service.sec.SecDictionaryService; import com.hfkj.service.sec.SecDictionaryService;
import com.hfkj.service.user.BsUserContributeService; import com.hfkj.service.user.BsUserContributeService;
import com.hfkj.service.user.BsUserParentRelService; import com.hfkj.service.user.BsUserParentRelService;
import com.hfkj.service.user.BsUserService;
import com.hfkj.sysenum.partner.PartnerEnum;
import com.hfkj.sysenum.user.UserAccountRecordSourceTypeEnum;
import com.pdd.pop.sdk.http.api.pop.response.PddDdkOrderListRangeGetResponse;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@ -52,6 +60,14 @@ public class BsOrderServiceImpl implements BsOrderService {
@Resource @Resource
private SecDictionaryService secDictionaryService; private SecDictionaryService secDictionaryService;
@Resource
private BsUserService userService;
@Override
public void create(BsOrder order) {
bsOrderMapper.insert(order);
}
@Override @Override
public BsOrder editData(BsOrder order) { public BsOrder editData(BsOrder order) {
bsOrderMapper.updateByPrimaryKey(order); bsOrderMapper.updateByPrimaryKey(order);
@ -129,10 +145,13 @@ public class BsOrderServiceImpl implements BsOrderService {
} }
@Override @Override
public JSONObject getOrderList() throws Exception{ public JSONObject getOrderList(String startTime) throws Exception{
return PddService.getOrderList();
pddOrder(startTime);
return null;
} }
@Override @Override
public List<BsOrderModel> getOrderListParent(Map<String, Object> map) { public List<BsOrderModel> getOrderListParent(Map<String, Object> map) {
@ -190,9 +209,7 @@ public class BsOrderServiceImpl implements BsOrderService {
} }
@Override @Override
public void orderRebate(String orderNo, BigDecimal gold) throws Exception { public void orderRebate(BsOrder bsOrder) throws Exception {
BsOrder bsOrder = findByOrderNo(orderNo);
// 判断订单状态是否为4或5 // 判断订单状态是否为4或5
if (bsOrder.getStatus().equals(4) || bsOrder.getStatus().equals(5)) { if (bsOrder.getStatus().equals(4) || bsOrder.getStatus().equals(5)) {
// 如果是,则抛出异常,提示订单状态不可返利 // 如果是,则抛出异常,提示订单状态不可返利
@ -202,5 +219,104 @@ public class BsOrderServiceImpl implements BsOrderService {
otherParam.put("sourceId", bsOrder.getId()); otherParam.put("sourceId", bsOrder.getId());
otherParam.put("sourceOrderNo", bsOrder.getOrderNo()); otherParam.put("sourceOrderNo", bsOrder.getOrderNo());
userContributeService.purchase(bsOrder.getPromotionAmount(), bsOrder.getUserId(), otherParam); userContributeService.purchase(bsOrder.getPromotionAmount(), bsOrder.getUserId(), otherParam);
bsOrder.setStatus(8);
bsOrder.setUpdateTime(new Date());
bsOrder.setFinishTime(new Date());
editData(bsOrder);
}
// 根据开始时间获取拼多多订单列表
private void pddOrder(String startTime) throws Exception{
// 调用PddService的getOrderList方法获取订单列表
PddDdkOrderListRangeGetResponse rangeGetResponse = PddService.getOrderList(startTime);
// 调用getOrderList方法获取本地订单列表
List<BsOrder> list = getOrderList(new HashMap<>());
// 判断rangeGetResponse是否为空
if (rangeGetResponse != null) {
// 获取订单列表
List<PddDdkOrderListRangeGetResponse.OrderListGetResponseOrderListItem> orderListItems = rangeGetResponse.getOrderListGetResponse().getOrderList();
// 判断订单列表是否为空
if (!orderListItems.isEmpty()) {
for (PddDdkOrderListRangeGetResponse.OrderListGetResponseOrderListItem orderListItem : orderListItems) {
// 用户uid
boolean containsEqual = orderListItem.getCustomParameters().contains("=");
String uid;
if (containsEqual) {
// 去掉字符串中的'{'
char charToRemove = '{';
String strippedString = StringUtils.strip(orderListItem.getCustomParameters(), String.valueOf(charToRemove));
// 以'='为分隔符,将字符串分割成数组
String[] split = strippedString.substring(0, strippedString.length()-1).split("=");
// 获取数组中的第二个元素,即uid
uid = split[1];
} else {
// 将字符串转换为JSONObject对象
JSONObject custom = JSON.parseObject(orderListItem.getCustomParameters());
// 获取JSONObject对象中的uid
uid = custom.getString("uid");
}
// 根据订单号获取BsOrder对象
BsOrder bsOrder = list.stream().filter(s->s.getOrderNo().equals(orderListItem.getOrderSn())).findFirst().orElse(null);
// 根据uid获取BsUser对象
BsUser user = userService.getUser(uid);
if (bsOrder == null) {
// 如果BsOrder对象为空,则创建新的BsOrder对象
bsOrder = new BsOrder();
bsOrder.setOrderNo(orderListItem.getOrderSn());
bsOrder.setUserId(Long.valueOf(uid));
bsOrder.setUserPhone(user.getPhone());
bsOrder.setCreateTime(new Date());
bsOrder.setUpdateTime(new Date());
bsOrder.setStatus(orderListItem.getOrderStatus());
bsOrder.setImg(orderListItem.getGoodsThumbnailUrl());
bsOrder.setType(2);
bsOrder.setGoodsName(orderListItem.getGoodsName());
bsOrder.setGoodsCount(Math.toIntExact(orderListItem.getGoodsQuantity()));
bsOrder.setCustomparameters(orderListItem.getCustomParameters());
bsOrder.setTotalPrice(BigDecimal.valueOf(orderListItem.getOrderAmount()));
bsOrder.setPromotionAmount(BigDecimal.valueOf(orderListItem.getPromotionAmount()));
bsOrder.setPayTime(DateUtil.long2Date(orderListItem.getOrderPayTime()));
bsOrder.setCreateTime(DateUtil.long2Date(orderListItem.getOrderCreateTime()));
bsOrder.setFinishTime(DateUtil.long2Date(orderListItem.getOrderSettleTime()));
bsOrder.setRefundTime(DateUtil.long2Date(orderListItem.getOrderModifyAt()));
bsOrder.setCancelTime(DateUtil.long2Date(orderListItem.getOrderModifyAt()));
create(bsOrder);
}else {
// 如果BsOrder对象不为空,则更新BsOrder对象
bsOrder.setUpdateTime(new Date());
bsOrder.setStatus(orderListItem.getOrderStatus());
bsOrder.setImg(orderListItem.getGoodsThumbnailUrl());
bsOrder.setType(2);
bsOrder.setGoodsName(orderListItem.getGoodsName());
bsOrder.setGoodsCount(Math.toIntExact(orderListItem.getGoodsQuantity()));
bsOrder.setCustomparameters(orderListItem.getCustomParameters());
bsOrder.setTotalPrice(BigDecimal.valueOf(orderListItem.getOrderAmount()));
bsOrder.setPromotionAmount(BigDecimal.valueOf(orderListItem.getPromotionAmount()));
bsOrder.setPayTime(DateUtil.long2Date(orderListItem.getOrderPayTime()));
bsOrder.setCreateTime(DateUtil.long2Date(orderListItem.getOrderCreateTime()));
bsOrder.setFinishTime(DateUtil.long2Date(orderListItem.getOrderSettleTime()));
bsOrder.setRefundTime(DateUtil.long2Date(orderListItem.getOrderModifyAt()));
bsOrder.setCancelTime(DateUtil.long2Date(orderListItem.getOrderModifyAt()));
// 如果订单状态为5,则调用orderRebate方法
if (bsOrder.getStatus() == 5){
orderRebate(bsOrder);
} else {
editData(bsOrder);
}
}
}
}
}
} }
} }

@ -168,7 +168,7 @@ public class PddService {
* @Author: Sum1Dream * @Author: Sum1Dream
* @Date: 2024/10/23 上午10:27 * @Date: 2024/10/23 上午10:27
*/ */
public static JSONObject getOrderList() throws Exception { public static PddDdkOrderListRangeGetResponse getOrderList(String startTime) throws Exception {
log.info("============ 拼多多请求-START ============="); log.info("============ 拼多多请求-START =============");
String clientId = "71a050c5d93d4169a237539af44c7c33"; String clientId = "71a050c5d93d4169a237539af44c7c33";
@ -176,12 +176,37 @@ public class PddService {
PopClient client = new PopHttpClient(clientId, clientSecret); PopClient client = new PopHttpClient(clientId, clientSecret);
PddDdkOrderListRangeGetRequest request = new PddDdkOrderListRangeGetRequest(); PddDdkOrderListRangeGetRequest request = new PddDdkOrderListRangeGetRequest();
request.setCashGiftOrder(true); request.setStartTime(startTime);
request.setStartTime("2024-05-07 00:00:00");
request.setPageSize(300); request.setPageSize(300);
request.setQueryOrderType(1);
request.setEndTime(DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")); request.setEndTime(DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
PddDdkOrderListRangeGetResponse response = client.syncInvoke(request); PddDdkOrderListRangeGetResponse response = client.syncInvoke(request);
log.info("请求接口:" + "authority");
log.info("请求参数:" + JSONObject.toJSONString(request));
log.info("响应参数:" + JsonUtil.transferToJson(response));
log.info("============ 拼多多请求-END ==============");
return response;
}
public static JSONObject increment() throws Exception {
log.info("============ 拼多多请求-START =============");
String clientId = "71a050c5d93d4169a237539af44c7c33";
String clientSecret = "b96def667dd28660d09f19ba2e9e9f23d810d563";
PopClient client = new PopHttpClient(clientId, clientSecret);
PddDdkOrderListIncrementGetRequest request = new PddDdkOrderListIncrementGetRequest();
request.setCashGiftOrder(true);
request.setEndUpdateTime(24L);
request.setPage(1);
request.setPageSize(50);
request.setQueryOrderType(1);
request.setReturnCount(true);
request.setStartUpdateTime(new Date().getTime());
PddDdkOrderListIncrementGetResponse response = client.syncInvoke(request);
log.info("请求接口:" + "authority"); log.info("请求接口:" + "authority");
log.info("请求参数:" + JSONObject.toJSONString(request)); log.info("请求参数:" + JSONObject.toJSONString(request));
log.info("响应参数:" + JsonUtil.transferToJson(response)); log.info("响应参数:" + JsonUtil.transferToJson(response));

@ -48,7 +48,7 @@ public class PromotionBusinessService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "缺少goodsSign!"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "缺少goodsSign!");
} }
Map<String , Object> mapUser = new HashMap<>(); Map<String , Object> mapUser = new JSONObject();
mapUser.put("uid", jsonObject.getLong("userId")); mapUser.put("uid", jsonObject.getLong("userId"));
// 判断是否需要授权 // 判断是否需要授权

@ -0,0 +1,11 @@
filesystem=/home/project/youtao/filesystem
domain=https://yuanqiyoutao.com
taoBaoPostUrl = https://eco.taobao.com/router/rest
taoBaoAppKey = 34807616
taoBaoAppSecret = f04baedca9cd794665dfa04a2fcbfd86
meiTuanPostUrl = https://openapi.meituan.com/api/
meiTuanAppKey = d876dc3766053f3cde609e5f11a26aba
meiTuanAppSecret = 7cdb8439a4c3fae7a092705bde95d4ef
Loading…
Cancel
Save