|
|
|
@ -7,6 +7,7 @@ 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; |
|
|
|
@ -15,6 +16,7 @@ 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; |
|
|
|
@ -52,6 +54,12 @@ public class TestController { |
|
|
|
|
@Resource |
|
|
|
|
private JdService jdService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private BsOrderGoodsService getOrderGoodsService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private GoodsUserAddressService goodsUserAddressService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/thirdPayResult",method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
@ -329,4 +337,35 @@ public class TestController { |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|