|
|
@ -3,13 +3,12 @@ package com.ruoyi.applet.contoller; |
|
|
|
|
|
|
|
import com.cyl.h5.pojo.vo.H5OrderVO; |
|
|
|
import com.cyl.h5.service.H5OrderService; |
|
|
|
import com.cyl.h5.service.H5PetCareService; |
|
|
|
import com.cyl.h5.service.H5PetService; |
|
|
|
import com.cyl.manager.oms.domain.OmsOrderService; |
|
|
|
import com.cyl.manager.oms.service.OrderService; |
|
|
|
import com.cyl.manager.ums.domain.Pet; |
|
|
|
import com.cyl.manager.ums.domain.PetCare; |
|
|
|
import com.cyl.manager.ums.pojo.vo.PetVO; |
|
|
|
import com.google.gson.JsonObject; |
|
|
|
import com.ruoyi.applet.pojo.vo.PetDate; |
|
|
|
import com.ruoyi.applet.service.IMallOrderService; |
|
|
|
import com.ruoyi.common.core.controller.BaseController; |
|
|
|
import com.ruoyi.common.core.domain.AjaxResult; |
|
|
@ -20,18 +19,11 @@ import com.ruoyi.model.service.impl.AppletOrderItemServiceImpl; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.data.domain.Pageable; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import springfox.documentation.spring.web.json.Json; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import static cn.hutool.poi.excel.sax.ElementName.v; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
@Api(description = "订单模块 - 接单大厅流程") |
|
|
|
@RestController |
|
|
@ -59,6 +51,8 @@ public class ApiAppletOrderController extends BaseController { |
|
|
|
private AppletOrderItemServiceImpl appletOrderItemServiceImpl; |
|
|
|
@Autowired |
|
|
|
private H5PetService h5PetService; |
|
|
|
@Autowired |
|
|
|
private H5PetCareService petCareService; |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("接单大厅列表-带分页") |
|
|
@ -76,19 +70,45 @@ public class ApiAppletOrderController extends BaseController { |
|
|
|
List<AppletOrderItem> itemList = null; |
|
|
|
if(appletOrder.getType().equals("0")){ |
|
|
|
list = appletOrderService.selectAppletOrderListLikeUserIdJson(appletOrder); |
|
|
|
for (AppletOrder order:list){ |
|
|
|
// for (AppletOrder order:list){ |
|
|
|
// H5OrderVO h5OrderVO = h5OrderService.orderDetail(order.getOrderId()); |
|
|
|
// //得到服务信息 |
|
|
|
// List<OmsOrderService> service = h5OrderVO.getOrderServiceList(); |
|
|
|
// List<PetVO> petVOList = new ArrayList<>(); |
|
|
|
// for (OmsOrderService service1:service){ |
|
|
|
// //宠物标识不为空的时候查询数据 |
|
|
|
// if(service1.getPetId()!=null){ |
|
|
|
// PetVO petVO = h5PetService.selectPetById(service1.getPetId()); |
|
|
|
// service1.setPetVo(petVO); |
|
|
|
// petVOList.add(petVO); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// h5OrderVO.setPetVOList(petVOList); |
|
|
|
// order.setH5OrderVO(h5OrderVO); |
|
|
|
// } |
|
|
|
for (AppletOrder order : list) { |
|
|
|
H5OrderVO h5OrderVO = h5OrderService.orderDetail(order.getOrderId()); |
|
|
|
//得到服务信息 |
|
|
|
// 得到服务信息 |
|
|
|
List<OmsOrderService> service = h5OrderVO.getOrderServiceList(); |
|
|
|
|
|
|
|
// 使用一个 Set 来跟踪已经添加的 PetVO 的 id |
|
|
|
Set<Integer> addedPetIds = new HashSet<>(); |
|
|
|
List<PetVO> petVOList = new ArrayList<>(); |
|
|
|
for (OmsOrderService service1:service){ |
|
|
|
//宠物标识不为空的时候查询数据 |
|
|
|
if(service1.getPetId()!=null){ |
|
|
|
|
|
|
|
for (OmsOrderService service1 : service) { |
|
|
|
// 宠物标识不为空的时候查询数据 |
|
|
|
if (service1.getPetId() != null) { |
|
|
|
PetVO petVO = h5PetService.selectPetById(service1.getPetId()); |
|
|
|
service1.setPetVo(petVO); |
|
|
|
petVOList.add(petVO); |
|
|
|
|
|
|
|
// 检查 petVO 的 id 是否已经添加过 |
|
|
|
if (petVO != null && !addedPetIds.contains(petVO.getId())) { |
|
|
|
service1.setPetVo(petVO); |
|
|
|
petVOList.add(petVO); |
|
|
|
addedPetIds.add(petVO.getId()); // 标记该 id 已添加 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
h5OrderVO.setPetVOList(petVOList); |
|
|
|
order.setH5OrderVO(h5OrderVO); |
|
|
|
} |
|
|
@ -97,19 +117,45 @@ public class ApiAppletOrderController extends BaseController { |
|
|
|
} |
|
|
|
if (appletOrder.getType().equals("1")){ |
|
|
|
list = appletOrderService.selectAppletOrderList(appletOrder); |
|
|
|
for (AppletOrder order:list){ |
|
|
|
// for (AppletOrder order:list){ |
|
|
|
// H5OrderVO h5OrderVO = h5OrderService.orderDetail(order.getOrderId()); |
|
|
|
// //得到服务信息 |
|
|
|
// List<OmsOrderService> service = h5OrderVO.getOrderServiceList(); |
|
|
|
// List<PetVO> petVOList = new ArrayList<>(); |
|
|
|
// for (OmsOrderService service1:service){ |
|
|
|
// //宠物标识不为空的时候查询数据 |
|
|
|
// if(service1.getPetId()!=null){ |
|
|
|
// PetVO petVO = h5PetService.selectPetById(service1.getPetId()); |
|
|
|
// service1.setPetVo(petVO); |
|
|
|
// petVOList.add(petVO); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// h5OrderVO.setPetVOList(petVOList); |
|
|
|
// order.setH5OrderVO(h5OrderVO); |
|
|
|
// } |
|
|
|
for (AppletOrder order : list) { |
|
|
|
H5OrderVO h5OrderVO = h5OrderService.orderDetail(order.getOrderId()); |
|
|
|
//得到服务信息 |
|
|
|
// 得到服务信息 |
|
|
|
List<OmsOrderService> service = h5OrderVO.getOrderServiceList(); |
|
|
|
|
|
|
|
// 使用一个 Set 来跟踪已经添加的 PetVO 的 id |
|
|
|
Set<Integer> addedPetIds = new HashSet<>(); |
|
|
|
List<PetVO> petVOList = new ArrayList<>(); |
|
|
|
for (OmsOrderService service1:service){ |
|
|
|
//宠物标识不为空的时候查询数据 |
|
|
|
if(service1.getPetId()!=null){ |
|
|
|
|
|
|
|
for (OmsOrderService service1 : service) { |
|
|
|
// 宠物标识不为空的时候查询数据 |
|
|
|
if (service1.getPetId() != null) { |
|
|
|
PetVO petVO = h5PetService.selectPetById(service1.getPetId()); |
|
|
|
service1.setPetVo(petVO); |
|
|
|
petVOList.add(petVO); |
|
|
|
|
|
|
|
// 检查 petVO 的 id 是否已经添加过 |
|
|
|
if (petVO != null && !addedPetIds.contains(petVO.getId())) { |
|
|
|
service1.setPetVo(petVO); |
|
|
|
petVOList.add(petVO); |
|
|
|
addedPetIds.add(petVO.getId()); // 标记该 id 已添加 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
h5OrderVO.setPetVOList(petVOList); |
|
|
|
order.setH5OrderVO(h5OrderVO); |
|
|
|
} |
|
|
@ -121,19 +167,45 @@ public class ApiAppletOrderController extends BaseController { |
|
|
|
appletOrderItem.setStatus(2); |
|
|
|
appletOrderItem.setUserId(appletOrder.getUserId()); |
|
|
|
itemList = appletOrderItemService.selectAppletOrderItemList(appletOrderItem); |
|
|
|
// for (AppletOrderItem orderItem:itemList){ |
|
|
|
// H5OrderVO h5OrderVO = h5OrderService.orderDetail(orderItem.getOrderId()); |
|
|
|
// //得到服务信息 |
|
|
|
// List<OmsOrderService> service = h5OrderVO.getOrderServiceList(); |
|
|
|
// List<PetVO> petVOList = new ArrayList<>(); |
|
|
|
// for (OmsOrderService service1:service){ |
|
|
|
// //宠物标识不为空的时候查询数据 |
|
|
|
// if(service1.getPetId()!=null){ |
|
|
|
// PetVO petVO = h5PetService.selectPetById(service1.getPetId()); |
|
|
|
// service1.setPetVo(petVO); |
|
|
|
// petVOList.add(petVO); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// h5OrderVO.setPetVOList(petVOList); |
|
|
|
// orderItem.setH5OrderVO(h5OrderVO); |
|
|
|
// } |
|
|
|
for (AppletOrderItem orderItem:itemList){ |
|
|
|
H5OrderVO h5OrderVO = h5OrderService.orderDetail(orderItem.getOrderId()); |
|
|
|
//得到服务信息 |
|
|
|
// 得到服务信息 |
|
|
|
List<OmsOrderService> service = h5OrderVO.getOrderServiceList(); |
|
|
|
|
|
|
|
// 使用一个 Set 来跟踪已经添加的 PetVO 的 id |
|
|
|
Set<Integer> addedPetIds = new HashSet<>(); |
|
|
|
List<PetVO> petVOList = new ArrayList<>(); |
|
|
|
for (OmsOrderService service1:service){ |
|
|
|
//宠物标识不为空的时候查询数据 |
|
|
|
if(service1.getPetId()!=null){ |
|
|
|
|
|
|
|
for (OmsOrderService service1 : service) { |
|
|
|
// 宠物标识不为空的时候查询数据 |
|
|
|
if (service1.getPetId() != null) { |
|
|
|
PetVO petVO = h5PetService.selectPetById(service1.getPetId()); |
|
|
|
service1.setPetVo(petVO); |
|
|
|
petVOList.add(petVO); |
|
|
|
|
|
|
|
// 检查 petVO 的 id 是否已经添加过 |
|
|
|
if (petVO != null && !addedPetIds.contains(petVO.getId())) { |
|
|
|
service1.setPetVo(petVO); |
|
|
|
petVOList.add(petVO); |
|
|
|
addedPetIds.add(petVO.getId()); // 标记该 id 已添加 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
h5OrderVO.setPetVOList(petVOList); |
|
|
|
orderItem.setH5OrderVO(h5OrderVO); |
|
|
|
} |
|
|
@ -310,7 +382,7 @@ public class ApiAppletOrderController extends BaseController { |
|
|
|
|
|
|
|
|
|
|
|
//我的订单流程 |
|
|
|
@ApiOperation("小程序-我的订单流程") |
|
|
|
@ApiOperation("小程序-我的订单流程-总订单") |
|
|
|
@GetMapping("/myList") |
|
|
|
public AjaxResult myList(AppletOrderItem orderItem){ |
|
|
|
if(orderItem.getType()==null){ |
|
|
@ -320,19 +392,45 @@ public class ApiAppletOrderController extends BaseController { |
|
|
|
return AjaxResult.error("userId用户信息标识不能为空"); |
|
|
|
} |
|
|
|
List<AppletOrderItem> itemList = appletOrderItemService.selectAppletOrderItemList(orderItem); |
|
|
|
// for (AppletOrderItem item:itemList){ |
|
|
|
// H5OrderVO h5OrderVO = h5OrderService.orderDetail(item.getOrderId()); |
|
|
|
// //得到服务信息 |
|
|
|
// List<OmsOrderService> service = h5OrderVO.getOrderServiceList(); |
|
|
|
// List<PetVO> petVOList = new ArrayList<>(); |
|
|
|
// for (OmsOrderService service1:service){ |
|
|
|
// //宠物标识不为空的时候查询数据 |
|
|
|
// if(service1.getPetId()!=null){ |
|
|
|
// PetVO petVO = h5PetService.selectPetById(service1.getPetId()); |
|
|
|
// service1.setPetVo(petVO); |
|
|
|
// petVOList.add(petVO); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// h5OrderVO.setPetVOList(petVOList); |
|
|
|
// item.setH5OrderVO(h5OrderVO); |
|
|
|
// } |
|
|
|
for (AppletOrderItem item:itemList){ |
|
|
|
H5OrderVO h5OrderVO = h5OrderService.orderDetail(item.getOrderId()); |
|
|
|
//得到服务信息 |
|
|
|
// 得到服务信息 |
|
|
|
List<OmsOrderService> service = h5OrderVO.getOrderServiceList(); |
|
|
|
|
|
|
|
// 使用一个 Set 来跟踪已经添加的 PetVO 的 id |
|
|
|
Set<Integer> addedPetIds = new HashSet<>(); |
|
|
|
List<PetVO> petVOList = new ArrayList<>(); |
|
|
|
for (OmsOrderService service1:service){ |
|
|
|
//宠物标识不为空的时候查询数据 |
|
|
|
if(service1.getPetId()!=null){ |
|
|
|
|
|
|
|
for (OmsOrderService service1 : service) { |
|
|
|
// 宠物标识不为空的时候查询数据 |
|
|
|
if (service1.getPetId() != null) { |
|
|
|
PetVO petVO = h5PetService.selectPetById(service1.getPetId()); |
|
|
|
service1.setPetVo(petVO); |
|
|
|
petVOList.add(petVO); |
|
|
|
|
|
|
|
// 检查 petVO 的 id 是否已经添加过 |
|
|
|
if (petVO != null && !addedPetIds.contains(petVO.getId())) { |
|
|
|
service1.setPetVo(petVO); |
|
|
|
petVOList.add(petVO); |
|
|
|
addedPetIds.add(petVO.getId()); // 标记该 id 已添加 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
h5OrderVO.setPetVOList(petVOList); |
|
|
|
item.setH5OrderVO(h5OrderVO); |
|
|
|
} |
|
|
@ -355,8 +453,23 @@ public class ApiAppletOrderController extends BaseController { |
|
|
|
return AjaxResult.error("用户标识不能为空"); |
|
|
|
} |
|
|
|
AppletOrderItem order = appletOrderItemService.selectAppletOrderItemById(orderItem.getId()); |
|
|
|
order.setH5OrderVO(h5OrderService.orderDetail(order.getOrderId())); |
|
|
|
order.setManagerOrderDetailVO(service.selectById(order.getOrderId())); |
|
|
|
// H5OrderVO h5OrderVO1 = h5OrderService.orderDetail(order.getOrderId()); |
|
|
|
|
|
|
|
H5OrderVO h5OrderVO = h5OrderService.orderDetail(order.getOrderId()); |
|
|
|
//得到服务信息 |
|
|
|
List<OmsOrderService> service = h5OrderVO.getOrderServiceList(); |
|
|
|
List<PetVO> petVOList = new ArrayList<>(); |
|
|
|
for (OmsOrderService service1:service){ |
|
|
|
//宠物标识不为空的时候查询数据 |
|
|
|
if(service1.getPetId()!=null){ |
|
|
|
PetVO petVO = h5PetService.selectPetById(service1.getPetId()); |
|
|
|
service1.setPetVo(petVO); |
|
|
|
petVOList.add(petVO); |
|
|
|
} |
|
|
|
h5OrderVO.setPetVOList(petVOList); |
|
|
|
} |
|
|
|
order.setH5OrderVO(h5OrderVO); |
|
|
|
// order.setManagerOrderDetailVO(service.selectById(order.getOrderId())); |
|
|
|
Map<String, Object> map = new HashMap(); |
|
|
|
map.put("order",order); |
|
|
|
AppletConfig config = new AppletConfig(); |
|
|
@ -369,16 +482,51 @@ public class ApiAppletOrderController extends BaseController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//订单里面的宠物档案里面数据 |
|
|
|
@ApiOperation("订单里面的宠物档案里面数据") |
|
|
|
@GetMapping("/getOrderPetById/{orderId}") |
|
|
|
public AjaxResult getOrderPetById(@PathVariable("orderId") Long orderId){ |
|
|
|
H5OrderVO h5OrderVO = h5OrderService.orderDetail(orderId); |
|
|
|
// 得到服务信息 |
|
|
|
List<OmsOrderService> service = h5OrderVO.getOrderServiceList(); |
|
|
|
List<PetVO> petVOList = new ArrayList<>(); |
|
|
|
Set<Long> addedPetIds = new HashSet<>(); // 用于跟踪已经添加的 PetVO 的 id |
|
|
|
|
|
|
|
for (OmsOrderService service1 : service) { |
|
|
|
// 宠物标识不为空的时候查询数据 |
|
|
|
if (service1.getPetId() != null) { |
|
|
|
PetVO petVO = h5PetService.selectPetById(service1.getPetId()); |
|
|
|
|
|
|
|
// 检查 petVO 的 id 是否已经添加过 |
|
|
|
if (petVO != null && !addedPetIds.contains(petVO.getId())) { |
|
|
|
service1.setPetVo(petVO); |
|
|
|
petVOList.add(petVO); |
|
|
|
addedPetIds.add(Long.valueOf(petVO.getId())); // 标记该 id 已添加 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return AjaxResult.success("订单里面的宠物档案里面数据",petVOList); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//根据宠物标识查询重新宠物信息 |
|
|
|
@ApiOperation("根据宠物标识查询重新宠物信息") |
|
|
|
@GetMapping("/getPetById/{petId}") |
|
|
|
public AjaxResult getPetById(@PathVariable("petId") Integer petId){ |
|
|
|
PetVO petVO = h5PetService.selectPetById(petId); |
|
|
|
return AjaxResult.success("根据宠物标识查询重新宠物信息",petVO); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//测试派单 |
|
|
|
@ApiOperation("派单") |
|
|
|
@GetMapping("/dispatch/{orderId}") |
|
|
|
public AjaxResult dispatch(@PathVariable("orderId")Long orderId){ |
|
|
|
mallOrderService.dispatch(orderId); |
|
|
|
return AjaxResult.success("派单成功"); |
|
|
|
//根据宠物信息标识查询宠物档案信息列表带分页 |
|
|
|
@ApiOperation("根据宠物信息标识查询宠物档案信息列表带分页") |
|
|
|
@GetMapping("/petList") |
|
|
|
public TableDataInfo petList(PetCare petCare) { |
|
|
|
startPage(); |
|
|
|
List<PetCare> list = petCareService.selectPetCareList(petCare); |
|
|
|
return getDataTable(list); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -390,4 +538,21 @@ public class ApiAppletOrderController extends BaseController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //测试派单 |
|
|
|
// @ApiOperation("派单") |
|
|
|
// @GetMapping("/dispatch/{orderId}") |
|
|
|
// public AjaxResult dispatch(@PathVariable("orderId")Long orderId){ |
|
|
|
// mallOrderService.dispatch(orderId); |
|
|
|
// return AjaxResult.success("派单成功"); |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |