Procházet zdrojové kódy

Merge branch 'mp-server-test' into 'master'

Mp server test

See merge request quanshu/mp-server!321
zhong chunping před 3 roky
rodič
revize
26bccc51cf

+ 28 - 0
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/ChannelOrderMgrController.java

@@ -2,6 +2,7 @@ package com.qs.mp.web.controller.api.admin;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.qs.mp.admin.domain.TicketPackage;
 import com.qs.mp.admin.domain.param.ChannelOrderPkgParam;
 import com.qs.mp.admin.domain.param.ChannelOrderQueryParam;
@@ -175,6 +176,33 @@ public class ChannelOrderMgrController extends BaseApiController {
 		return AjaxResult.error("发货失败");
   }
 
+	/**
+	 * 订单发货单号修改
+	 */
+	@Log(title = "经销商订单发货单号修改", businessType = BusinessType.UPDATE)
+	@PostMapping("/ship/update")
+	@ApiOperation(value = "订单发货单号修改" , notes = "在订单发货页面提交")
+	@PreAuthorize("@ss.hasPermi('order:channel:ship')")
+	public AjaxResult updateShipInfo(@RequestBody ChannelOrderShipParam shipParam) {
+		if(null == shipParam || StringUtils.isBlank(shipParam.getOrderId())
+			|| null == shipParam.getDeliveryId() || StringUtils.isBlank(shipParam.getDeliveryFlowId())) {
+			return error(ErrorCodeEnum.ERROR_CODE_1001);
+		}
+
+		ChannelOrder order  = channelOrderService.getById(shipParam.getOrderId());
+		if(null == order || StringUtils.isBlank(order.getOrderId())
+				|| null == order.getChannelId()) {
+			return error(ErrorCodeEnum.ERROR_CODE_1001);
+		}
+
+		boolean rtn = channelOrderService.update(new LambdaUpdateWrapper<ChannelOrder>()
+				.set(ChannelOrder::getDeliveryId, shipParam.getDeliveryId())
+				.set(ChannelOrder::getDeliveryFlowId, shipParam.getDeliveryFlowId())
+				.eq(ChannelOrder::getOrderId, shipParam.getOrderId()));
+		return rtn ? AjaxResult.success() : AjaxResult.error("修改失败");
+
+	}
+
 	@PostMapping("/item/list")
 	@ApiOperation(value = "获取经销商订单盲票组列表", notes = "")
 	public AjaxResult list(@RequestBody ChannelOrder order) {

+ 25 - 0
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/UserDeliverOrderMgrController.java

@@ -1,6 +1,7 @@
 package com.qs.mp.web.controller.api.admin;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.qs.mp.admin.domain.param.UserDeliverOrderQueryParam;
 import com.qs.mp.admin.domain.param.UserDeliverOrderShipParam;
 import com.qs.mp.common.annotation.Log;
@@ -30,6 +31,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -142,6 +144,29 @@ public class UserDeliverOrderMgrController extends BaseApiController {
 		return AjaxResult.error("发货失败");
 	}
 
+	/**
+	 * 订单发货修改
+	 */
+	@Log(title = "用户提货订单发货单号修改", businessType = BusinessType.UPDATE)
+	@PostMapping("/ship/update")
+	@ApiOperation(value = "订单发货修改", notes = "在订单发货页面提交")
+	@PreAuthorize("@ss.hasPermi('order:deliver:ship')")
+	public AjaxResult updateShipInfo(@RequestBody UserDeliverOrderShipParam shipParam) {
+		if (null == shipParam || StringUtils.isBlank(shipParam.getOrderId())
+				|| null == shipParam.getDeliveryId() || StringUtils.isBlank(shipParam.getDeliveryFlowId())
+				|| CollectionUtils.isEmpty(shipParam.getItemIds())) {
+			return error(ErrorCodeEnum.ERROR_CODE_1001);
+		}
+
+		for (String itemId : shipParam.getItemIds()) {
+			userDeliverOrderItemService.update(new LambdaUpdateWrapper<UserDeliverOrderItem>()
+					.set(UserDeliverOrderItem::getDeliveryId, shipParam.getDeliveryId())
+					.set(UserDeliverOrderItem::getDeliveryFlowId, shipParam.getDeliveryFlowId())
+					.eq(UserDeliverOrderItem::getItemId, itemId));
+		}
+		return AjaxResult.success();
+	}
+
 	@Log(title = "提货订单导出", businessType = BusinessType.EXPORT)
 	@PostMapping("/export")
 	@PreAuthorize("@ss.hasPermi('order:deliver:export')")

+ 30 - 5
mp-admin/src/main/java/com/qs/mp/web/controller/api/channel/mall/ChannelOrderController.java

@@ -5,6 +5,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.qs.mp.admin.domain.TicketBox;
 import com.qs.mp.admin.service.ITicketBoxService;
 import com.qs.mp.channel.domain.Channel;
+import com.qs.mp.channel.domain.ChannelOrderDetail;
+import com.qs.mp.channel.domain.vo.ChannelOrderInfoVO;
+import com.qs.mp.channel.domain.vo.ChannelOrderItemVO;
+import com.qs.mp.channel.service.IChannelOrderDetailService;
+import com.qs.mp.common.domain.DeliveryCompany;
 import com.qs.mp.common.service.IDeliveryCompanyService;
 import com.qs.mp.common.utils.StringUtils;
 import com.qs.mp.system.domain.SysUser;
@@ -84,6 +89,9 @@ public class ChannelOrderController extends BaseApiController {
   @Autowired
   private IDeliveryCompanyService deliveryCompanyService;
 
+  @Autowired
+  private IChannelOrderDetailService channelOrderDetailService;
+
   @Autowired
   private ISysUserService sysUserService;
 
@@ -124,12 +132,29 @@ public class ChannelOrderController extends BaseApiController {
     Long channelId = SecurityUtils.getLoginUser().getChannelId();
     ChannelOrder channelOrder = channelOrderService.getOne(new LambdaQueryWrapper<ChannelOrder>()
         .eq(ChannelOrder::getOrderId, order.getOrderId()).eq(ChannelOrder::getChannelId, channelId));
-    ChannelOrderVO channelOrderVO = mapperFacade.map(channelOrder, ChannelOrderVO.class);
-    channelOrderVO.setItems(channelOrderItemService.list(new LambdaQueryWrapper<ChannelOrderItem>()
-        .eq(ChannelOrderItem::getOrderId, channelOrderVO.getOrderId())));
-    if (null != channelOrder.getDeliveryId() && 0 != channelOrder.getDeliveryId()) {
-      channelOrderVO.setCompanyName(deliveryCompanyService.getById(channelOrder.getDeliveryId()).getCompanyName());
+    ChannelOrderInfoVO channelOrderVO = mapperFacade.map(channelOrder, ChannelOrderInfoVO.class);
+
+    if(null != channelOrderVO && null != channelOrderVO.getDeliveryId()) {
+      DeliveryCompany deliveryCompany = deliveryCompanyService.getById(channelOrderVO.getDeliveryId());
+      channelOrderVO.setDeliveryCompany(deliveryCompany);
+    }
+    List<ChannelOrderItem> itemList = channelOrderItemService.list(new LambdaQueryWrapper<ChannelOrderItem>()
+        .eq(ChannelOrderItem::getOrderId, channelOrderVO.getOrderId()));
+
+    List<ChannelOrderItemVO> itemVOList = mapperFacade.mapAsList(itemList, ChannelOrderItemVO.class);
+    if(null != itemVOList && itemVOList.size() > 0) {
+      for(ChannelOrderItemVO itemVO : itemVOList) {
+        if(null != itemVO && org.apache.commons.lang3.StringUtils.isNotBlank(itemVO.getBoxId())
+            && org.apache.commons.lang3.StringUtils.isNotBlank(itemVO.getOrderId())) {
+          LambdaQueryWrapper<ChannelOrderDetail> detailQueryWrapper = new LambdaQueryWrapper<ChannelOrderDetail>();
+          detailQueryWrapper.eq(ChannelOrderDetail::getOrderId, itemVO.getOrderId());
+          detailQueryWrapper.eq(ChannelOrderDetail::getBoxId, itemVO.getBoxId());
+          List<ChannelOrderDetail> detailList = channelOrderDetailService.list(detailQueryWrapper);
+          itemVO.setDetailList(detailList);
+        }
+      }
     }
+    channelOrderVO.setItems(itemVOList);
     return AjaxResult.success(channelOrderVO);
   }
 

+ 1 - 0
mp-admin/src/main/java/com/qs/mp/web/controller/api/user/UserTicketController.java

@@ -200,6 +200,7 @@ public class UserTicketController extends BaseApiController {
     JSONObject jsonObject = new JSONObject();
     jsonObject.put("prizeList", ticketAwardsPrizes);
     jsonObject.put("ticketId", ticket.getTicketId());
+    jsonObject.put("boxId", ticket.getBoxId());
     return AjaxResult.success(jsonObject);
   }
 

+ 1 - 1
mp-common/src/main/java/com/qs/mp/common/utils/DateUtils.java

@@ -288,7 +288,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
             int startWeekOfYear = startCalendar.get(Calendar.WEEK_OF_YEAR);  
             System.out.println("startWeekOfYear == " +startWeekOfYear);
             
-            //截止日期所在的周
+            // 截止日期所在的周
             int endWeekOfYear = endCalendar.get(Calendar.WEEK_OF_YEAR);  
             System.out.println("currentWeekOfYear_e == " +endWeekOfYear);