定时任务修改文件包与service 冲突

dev
袁野 2 months ago
parent 1330a6be40
commit eb11df9f7c
  1. 88
      service/src/main/java/com/hfkj/jd/Impl/JdServiceImpl.java

@ -537,16 +537,22 @@ public class JdServiceImpl implements JdService {
// 根据skuId 查询商品详情 // 根据skuId 查询商品详情
// 根据skuId 查询商品售价 // 根据skuId 查询商品售价
OpenRpcResult priceResponse = JdPostService.getSellPrice(getToken(), String.valueOf(goodsMsg.getThirdId())).getOpenRpcResult(); OpenRpcResult priceResponse = JdPostService.getSellPrice(getToken(), String.valueOf(goodsMsg.getThirdId())).getOpenRpcResult();
GetSellPriceGoodsResp price = priceResponse.getResult().get(0); if (priceResponse.getResultCode().equals("0000") && priceResponse.getSuccess() ) {
// 设置涨价 GetSellPriceGoodsResp price = priceResponse.getResult().get(0);
BigDecimal profitPrice = price.getSalePrice().multiply(productConfig.getDiscount().divide(new BigDecimal(100) , 2, RoundingMode.HALF_UP)); // 设置涨价
// 设置销售价格 BigDecimal profitPrice = price.getSalePrice().multiply(productConfig.getDiscount().divide(new BigDecimal(100) , 2, RoundingMode.HALF_UP));
specs.setSalePrice(profitPrice.add(price.getSalePrice())); // 设置销售价格
// 设置原价 specs.setSalePrice(profitPrice.add(price.getSalePrice()));
specs.setOriginalPrice(price.getMarketPrice()); // 设置原价
specs.setThirdPrice(price.getJdPrice()); specs.setOriginalPrice(price.getMarketPrice());
specs.setName(goodsMsg.getTitle()); specs.setThirdPrice(price.getJdPrice());
specs.setExt3(price.getSalePrice().toString()); specs.setName(goodsMsg.getTitle());
specs.setExt3(price.getSalePrice().toString());
} else {
specs.setStatus(0);
specs.setUpdateTime(new Date());
}
// 设置展示图片 // 设置展示图片
goodsSpecsService.update(specs); goodsSpecsService.update(specs);
} }
@ -566,33 +572,38 @@ public class JdServiceImpl implements JdService {
// 创建一个GoodsMsg对象 // 创建一个GoodsMsg对象
GoodsMsg goodsMsg = goodsMsgService.queryDetail(aLong.toString()); GoodsMsg goodsMsg = goodsMsgService.queryDetail(aLong.toString());
GetSkuImageGoodsResp img = imageListResponse.getResult().get(0);
StringBuilder imgS = new StringBuilder(); if ( goodsMsg != null && !goodsMsg.getStatus().equals(0)) {
// 遍历商品图片列表 GetSkuImageGoodsResp img = imageListResponse.getResult().get(0);
for (SkuImageItemGoodsResp skuImage : img.getSkuImageList()) { StringBuilder imgS = new StringBuilder();
// 如果图片是主图 // 遍历商品图片列表
if (skuImage.getIsPrimary() == 1) { for (SkuImageItemGoodsResp skuImage : img.getSkuImageList()) {
// 设置主图 // 如果图片是主图
goodsMsg.setListImg("https://img13.360buyimg.com/n1/" + skuImage.getShortPath()); if (skuImage.getIsPrimary() == 1) {
// 设置主图
goodsMsg.setListImg("https://img13.360buyimg.com/n1/" + skuImage.getShortPath());
}
// 如果图片不是主图
if (skuImage.getIsPrimary() == 0) {
imgS.append("https://img13.360buyimg.com/n1/").append(skuImage.getShortPath()).append(",");
}
} }
// 如果图片不是主图
if (skuImage.getIsPrimary() == 0) { if (imgS.length() > 0) {
imgS.append("https://img13.360buyimg.com/n1/").append(skuImage.getShortPath()).append(","); imgS.deleteCharAt(imgS.length() - 1);
} }
} goodsMsg.setTitle(detail.getSkuName());
// 设置轮播图
goodsMsg.setBannerImg(String.valueOf(imgS));
// 设置详情图
goodsMsg.setDetailImg(String.valueOf(imgS));
if (imgS.length() > 0) { // 更新商品信息
imgS.deleteCharAt(imgS.length() - 1); goodsMsgService.update(goodsMsg);
updatePrice(goodsMsg);
} }
goodsMsg.setTitle(detail.getSkuName());
// 设置轮播图
goodsMsg.setBannerImg(String.valueOf(imgS));
// 设置详情图
goodsMsg.setDetailImg(String.valueOf(imgS));
// 更新商品信息
goodsMsgService.update(goodsMsg);
updatePrice(goodsMsg);
} }
@ -717,12 +728,9 @@ public class JdServiceImpl implements JdService {
QueryOrderOpenResp queryOrderOpenResp = result.getResult().get(0); QueryOrderOpenResp queryOrderOpenResp = result.getResult().get(0);
StateOrderOpenResp stateOrderOpenResp = queryOrderOpenResp.getOrderState(); StateOrderOpenResp stateOrderOpenResp = queryOrderOpenResp.getOrderState();
// 查看订单是否已确认 // 查看订单是否已确认
if (stateOrderOpenResp.getConfirmState() == 1) {
jsonObject.put("logisticsStatus", "SIGN");
jsonObject.put("logisticsStatusDesc", "已签收");
}
// 订单状态为567为待揽收 // 订单状态为567为待揽收
if (stateOrderOpenResp.getConfirmState() == 5 || stateOrderOpenResp.getConfirmState() == 6 || stateOrderOpenResp.getConfirmState() == 7) { if (stateOrderOpenResp.getConfirmState() == 1 || stateOrderOpenResp.getConfirmState() == 5 || stateOrderOpenResp.getConfirmState() == 6 || stateOrderOpenResp.getConfirmState() == 7) {
jsonObject.put("logisticsStatus", "WAIT_ACCEPT"); jsonObject.put("logisticsStatus", "WAIT_ACCEPT");
jsonObject.put("logisticsStatusDesc", "待揽收"); jsonObject.put("logisticsStatusDesc", "待揽收");
} }
@ -741,6 +749,10 @@ public class JdServiceImpl implements JdService {
jsonObject.put("logisticsStatus", "DELIVERING"); jsonObject.put("logisticsStatus", "DELIVERING");
jsonObject.put("logisticsStatusDesc", "派件中"); jsonObject.put("logisticsStatusDesc", "派件中");
} }
if (stateOrderOpenResp.getConfirmState() == 19) {
jsonObject.put("logisticsStatus", "SIGN");
jsonObject.put("logisticsStatusDesc", "已签收");
}
} }
return jsonObject; return jsonObject;
} }

Loading…
Cancel
Save