定时任务修改文件包与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 查询商品售价
OpenRpcResult priceResponse = JdPostService.getSellPrice(getToken(), String.valueOf(goodsMsg.getThirdId())).getOpenRpcResult();
GetSellPriceGoodsResp price = priceResponse.getResult().get(0);
// 设置涨价
BigDecimal profitPrice = price.getSalePrice().multiply(productConfig.getDiscount().divide(new BigDecimal(100) , 2, RoundingMode.HALF_UP));
// 设置销售价格
specs.setSalePrice(profitPrice.add(price.getSalePrice()));
// 设置原价
specs.setOriginalPrice(price.getMarketPrice());
specs.setThirdPrice(price.getJdPrice());
specs.setName(goodsMsg.getTitle());
specs.setExt3(price.getSalePrice().toString());
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));
// 设置销售价格
specs.setSalePrice(profitPrice.add(price.getSalePrice()));
// 设置原价
specs.setOriginalPrice(price.getMarketPrice());
specs.setThirdPrice(price.getJdPrice());
specs.setName(goodsMsg.getTitle());
specs.setExt3(price.getSalePrice().toString());
} else {
specs.setStatus(0);
specs.setUpdateTime(new Date());
}
// 设置展示图片
goodsSpecsService.update(specs);
}
@ -566,33 +572,38 @@ public class JdServiceImpl implements JdService {
// 创建一个GoodsMsg对象
GoodsMsg goodsMsg = goodsMsgService.queryDetail(aLong.toString());
GetSkuImageGoodsResp img = imageListResponse.getResult().get(0);
StringBuilder imgS = new StringBuilder();
// 遍历商品图片列表
for (SkuImageItemGoodsResp skuImage : img.getSkuImageList()) {
// 如果图片是主图
if (skuImage.getIsPrimary() == 1) {
// 设置主图
goodsMsg.setListImg("https://img13.360buyimg.com/n1/" + skuImage.getShortPath());
if ( goodsMsg != null && !goodsMsg.getStatus().equals(0)) {
GetSkuImageGoodsResp img = imageListResponse.getResult().get(0);
StringBuilder imgS = new StringBuilder();
// 遍历商品图片列表
for (SkuImageItemGoodsResp skuImage : img.getSkuImageList()) {
// 如果图片是主图
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) {
imgS.append("https://img13.360buyimg.com/n1/").append(skuImage.getShortPath()).append(",");
if (imgS.length() > 0) {
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);
StateOrderOpenResp stateOrderOpenResp = queryOrderOpenResp.getOrderState();
// 查看订单是否已确认
if (stateOrderOpenResp.getConfirmState() == 1) {
jsonObject.put("logisticsStatus", "SIGN");
jsonObject.put("logisticsStatusDesc", "已签收");
}
// 订单状态为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("logisticsStatusDesc", "待揽收");
}
@ -741,6 +749,10 @@ public class JdServiceImpl implements JdService {
jsonObject.put("logisticsStatus", "DELIVERING");
jsonObject.put("logisticsStatusDesc", "派件中");
}
if (stateOrderOpenResp.getConfirmState() == 19) {
jsonObject.put("logisticsStatus", "SIGN");
jsonObject.put("logisticsStatusDesc", "已签收");
}
}
return jsonObject;
}

Loading…
Cancel
Save