|
|
|
@ -11,10 +11,13 @@ import com.hai.common.exception.SysCode; |
|
|
|
|
import com.hai.common.security.UserCenter; |
|
|
|
|
import com.hai.common.utils.DateUtil; |
|
|
|
|
import com.hai.common.utils.PageUtil; |
|
|
|
|
import com.hai.common.utils.RedisUtil; |
|
|
|
|
import com.hai.common.utils.ResponseMsgUtil; |
|
|
|
|
import com.hai.config.CommonConfig; |
|
|
|
|
import com.hai.entity.*; |
|
|
|
|
import com.hai.enum_type.UserObjectTypeEnum; |
|
|
|
|
import com.hai.goods.model.GoodsModel; |
|
|
|
|
import com.hai.goods.service.DeliveryAddressService; |
|
|
|
|
import com.hai.goods.service.GoodsLogisticsService; |
|
|
|
|
import com.hai.goods.service.GoodsOrderExtService; |
|
|
|
|
import com.hai.goods.service.GoodsSkuService; |
|
|
|
@ -67,6 +70,12 @@ public class GoodsOrderController { |
|
|
|
|
@Resource |
|
|
|
|
private GoodsLogisticsService goodsLogisticsService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private DeliveryAddressService deliveryAddressService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private RedisUtil redisUtil; |
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/getOrderList", method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "查询订单列表") |
|
|
|
@ -236,13 +245,16 @@ public class GoodsOrderController { |
|
|
|
|
for (HighChildOrder order : list) { |
|
|
|
|
model = new GoodsChildOrderExtModel(); |
|
|
|
|
BeanUtils.copyProperties(order, model); |
|
|
|
|
GoodsOrder goodsOrder = goodsOrderExtService.findGoodsOrder(order.getChildOrderNo()); |
|
|
|
|
if (goodsOrder != null) { |
|
|
|
|
model.setLogisticsStatus(goodsOrder.getStatus()); |
|
|
|
|
GoodsLogistics logistics = goodsLogisticsService.findGoodsLogistics(order.getId()); |
|
|
|
|
if (logistics != null) { |
|
|
|
|
model.setLogisticsStatus(logistics.getLogisticsStatusDesc()); |
|
|
|
|
model.setLogisticsNo(logistics.getNumber()); |
|
|
|
|
} |
|
|
|
|
GoodsOrder goodsOrder = goodsOrderExtService.findGoodsOrder(order.getOrderNo()); |
|
|
|
|
GoodsDeliveryAddress deliveryAddress = deliveryAddressService.findDeliveryAddressById(goodsOrder.getDeliveryAddressId()); |
|
|
|
|
model.setDeliveryAddressMsg(goodsOrder.getDeliveryAddress() + "-" + deliveryAddress.getConsignee() + " " + deliveryAddress.getPhone()); |
|
|
|
|
goodsChildOrderExtModels.add(model); |
|
|
|
|
} |
|
|
|
|
goodsChildOrderExtModels = goodsChildOrderExtModels.stream().sorted(Comparator.comparing(GoodsChildOrderExtModel::getLogisticsStatus)).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success(PageUtil.initPageInfoObj(pageNum, goodsChildOrderExtModels.size(), pageSize, new PageInfo<>(goodsChildOrderExtModels))); |
|
|
|
|
|
|
|
|
@ -252,4 +264,35 @@ public class GoodsOrderController { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/editLogisticsNo", method = RequestMethod.GET) |
|
|
|
|
@ResponseBody |
|
|
|
|
@ApiOperation(value = "录入运单号") |
|
|
|
|
public ResponseData editLogisticsNo(@RequestParam(name = "orderId", required = false) Long orderId, |
|
|
|
|
@RequestParam(name = "logisticsNo", required = false) String logisticsNo |
|
|
|
|
) { |
|
|
|
|
try { |
|
|
|
|
|
|
|
|
|
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); |
|
|
|
|
if (userInfoModel == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
JSONObject jsonObjects = CommonConfig.getLogisticsMsg(logisticsNo); |
|
|
|
|
|
|
|
|
|
jsonObjects.getJSONObject("data").put("orderId" , orderId); |
|
|
|
|
|
|
|
|
|
GoodsLogistics logistics = goodsLogisticsService.editLogistics(jsonObjects.getJSONObject("data")); |
|
|
|
|
|
|
|
|
|
redisUtil.set("logisticsMsg" + orderId , logistics ,21600); |
|
|
|
|
|
|
|
|
|
return ResponseMsgUtil.success("录入成功"); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.error("OrderCouponController --> getOrderList() error!", e); |
|
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|