Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
5c34b2ad56
|
|
@ -2,6 +2,8 @@ package com.ghy.web.controller.order;
|
||||||
|
|
||||||
import com.ghy.common.core.controller.BaseController;
|
import com.ghy.common.core.controller.BaseController;
|
||||||
import com.ghy.common.core.domain.AjaxResult;
|
import com.ghy.common.core.domain.AjaxResult;
|
||||||
|
import com.ghy.common.enums.OrderStatus;
|
||||||
|
import com.ghy.common.enums.PayStatus;
|
||||||
import com.ghy.common.utils.StringUtils;
|
import com.ghy.common.utils.StringUtils;
|
||||||
import com.ghy.customer.domain.Customer;
|
import com.ghy.customer.domain.Customer;
|
||||||
import com.ghy.customer.service.CustomerService;
|
import com.ghy.customer.service.CustomerService;
|
||||||
|
|
@ -179,6 +181,8 @@ public class OrderController extends BaseController {
|
||||||
Set<Long> goodsStandardIds = appGoodsList.stream().map(AppGoodsRequest::getGoodsStandardId).collect(Collectors.toSet());
|
Set<Long> goodsStandardIds = appGoodsList.stream().map(AppGoodsRequest::getGoodsStandardId).collect(Collectors.toSet());
|
||||||
// 所有商品
|
// 所有商品
|
||||||
List<GoodsStandard> goodsList = goodsStandardService.selectByIds(goodsStandardIds);
|
List<GoodsStandard> goodsList = goodsStandardService.selectByIds(goodsStandardIds);
|
||||||
|
// 商品所属师傅
|
||||||
|
Goods goods = goodsService.selectById(goodsList.get(0).getGoodsId());
|
||||||
// 商户ID
|
// 商户ID
|
||||||
Long deptId = appOrderRequest.getDeptId();
|
Long deptId = appOrderRequest.getDeptId();
|
||||||
Assert.notNull(deptId, "deptId is null!");
|
Assert.notNull(deptId, "deptId is null!");
|
||||||
|
|
@ -188,10 +192,12 @@ public class OrderController extends BaseController {
|
||||||
orderMaster.setDeptId(deptId);
|
orderMaster.setDeptId(deptId);
|
||||||
orderMaster.setCode(orderMasterService.createOrderCode());
|
orderMaster.setCode(orderMasterService.createOrderCode());
|
||||||
orderMaster.setOrderType(1);
|
orderMaster.setOrderType(1);
|
||||||
orderMaster.setOrderStatus(0);
|
orderMaster.setPayType(appOrderRequest.getPayType());
|
||||||
|
orderMaster.setOrderStatus(OrderStatus.PLAIN.code());
|
||||||
orderMaster.setCustomerId(appOrderRequest.getCustomerId());
|
orderMaster.setCustomerId(appOrderRequest.getCustomerId());
|
||||||
orderMaster.setPayStatus(0);
|
orderMaster.setPayStatus(PayStatus.WAIT_PAY.getCode());
|
||||||
orderMaster.setCreateTime(new Date());
|
orderMaster.setCreateTime(new Date());
|
||||||
|
orderMaster.setWorkerId(goods.getWorkerId());
|
||||||
orderMasterService.insertOrderMaster(orderMaster);
|
orderMasterService.insertOrderMaster(orderMaster);
|
||||||
Assert.notNull(orderMaster.getId(), "OrderMaster.id is null!");
|
Assert.notNull(orderMaster.getId(), "OrderMaster.id is null!");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,16 +6,21 @@ import com.ghy.common.core.controller.BaseController;
|
||||||
import com.ghy.common.core.domain.AjaxResult;
|
import com.ghy.common.core.domain.AjaxResult;
|
||||||
import com.ghy.common.core.page.TableDataInfo;
|
import com.ghy.common.core.page.TableDataInfo;
|
||||||
import com.ghy.common.enums.BusinessType;
|
import com.ghy.common.enums.BusinessType;
|
||||||
|
import com.ghy.common.utils.ObjectUtils;
|
||||||
import com.ghy.common.utils.poi.ExcelUtil;
|
import com.ghy.common.utils.poi.ExcelUtil;
|
||||||
import com.ghy.order.domain.OrderDetail;
|
import com.ghy.order.domain.OrderDetail;
|
||||||
import com.ghy.order.service.OrderDetailService;
|
import com.ghy.order.service.OrderDetailService;
|
||||||
|
import com.ghy.web.pojo.vo.OrderDetailsResponseVo;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -43,8 +48,8 @@ public class OrderDetailController extends BaseController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(OrderDetail orderDetail) {
|
public TableDataInfo list(OrderDetail orderDetail) {
|
||||||
startPage();
|
startPage();
|
||||||
List<OrderDetail> list = orderDetailService.selectOrderDetailList(orderDetail);
|
List<OrderDetail> orderDetailList = orderDetailService.selectOrderDetailList(orderDetail);
|
||||||
return getDataTable(list);
|
return getDataTable(orderDetailList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "详细订单管理", businessType = BusinessType.EXPORT)
|
@Log(title = "详细订单管理", businessType = BusinessType.EXPORT)
|
||||||
|
|
|
||||||
|
|
@ -6,17 +6,33 @@ import com.ghy.common.core.controller.BaseController;
|
||||||
import com.ghy.common.core.domain.AjaxResult;
|
import com.ghy.common.core.domain.AjaxResult;
|
||||||
import com.ghy.common.core.page.TableDataInfo;
|
import com.ghy.common.core.page.TableDataInfo;
|
||||||
import com.ghy.common.enums.BusinessType;
|
import com.ghy.common.enums.BusinessType;
|
||||||
|
import com.ghy.common.utils.ObjectUtils;
|
||||||
import com.ghy.common.utils.poi.ExcelUtil;
|
import com.ghy.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ghy.customer.domain.Customer;
|
||||||
|
import com.ghy.customer.domain.CustomerAddress;
|
||||||
|
import com.ghy.customer.service.CustomerAddressService;
|
||||||
|
import com.ghy.customer.service.CustomerService;
|
||||||
|
import com.ghy.order.domain.OrderDetail;
|
||||||
|
import com.ghy.order.domain.OrderGoods;
|
||||||
import com.ghy.order.domain.OrderMaster;
|
import com.ghy.order.domain.OrderMaster;
|
||||||
|
import com.ghy.order.service.OrderDetailService;
|
||||||
|
import com.ghy.order.service.OrderGoodsService;
|
||||||
import com.ghy.order.service.OrderMasterService;
|
import com.ghy.order.service.OrderMasterService;
|
||||||
|
import com.ghy.web.pojo.vo.OrderDetailsResponseVo;
|
||||||
|
import com.ghy.worker.domain.Worker;
|
||||||
|
import com.ghy.worker.service.WorkerService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主订单API
|
* 主订单API
|
||||||
|
|
@ -25,12 +41,17 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/order/master")
|
@RequestMapping("/order/master")
|
||||||
|
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
|
||||||
public class OrderMasterController extends BaseController {
|
public class OrderMasterController extends BaseController {
|
||||||
|
|
||||||
private final String prefix = "order/master";
|
private final String prefix = "order/master";
|
||||||
|
|
||||||
@Resource
|
private final OrderMasterService orderMasterService;
|
||||||
private OrderMasterService orderMasterService;
|
private final CustomerService customerService;
|
||||||
|
private final WorkerService workerService;
|
||||||
|
private final OrderDetailService orderDetailService;
|
||||||
|
private final OrderGoodsService orderGoodsService;
|
||||||
|
private final CustomerAddressService customerAddressService;
|
||||||
|
|
||||||
@RequiresPermissions("order:master:view")
|
@RequiresPermissions("order:master:view")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
|
|
@ -43,8 +64,74 @@ public class OrderMasterController extends BaseController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(OrderMaster orderMaster) {
|
public TableDataInfo list(OrderMaster orderMaster) {
|
||||||
startPage();
|
startPage();
|
||||||
List<OrderMaster> list = orderMasterService.selectOrderMasterList(orderMaster);
|
List<OrderMaster> orderMasterList = orderMasterService.selectOrderMasterList(orderMaster);
|
||||||
return getDataTable(list);
|
// 数据处理。待返回的数据信息。
|
||||||
|
List<OrderDetailsResponseVo> orderDetailsResponseVoList = new ArrayList<>();
|
||||||
|
// 存在数据在进行数据查询处理。
|
||||||
|
if(orderMasterList != null && orderMasterList.size() > 0){
|
||||||
|
// 第一次循环 进行拿到对应用户数据集合信息与实体集合数据信息,
|
||||||
|
// 消费者相关集合
|
||||||
|
List<Long> customIdList = new ArrayList<>();
|
||||||
|
// 师傅相关集合
|
||||||
|
List<Long> workerIdList = new ArrayList<>();
|
||||||
|
// 订单编号数据信息。
|
||||||
|
List<Long> orderIdList = new ArrayList<>();
|
||||||
|
for(OrderMaster orderMasterByListData : orderMasterList){
|
||||||
|
// 订单Id
|
||||||
|
if(ObjectUtils.isNotNull(orderMasterByListData.getId())){
|
||||||
|
orderIdList.add(orderMasterByListData.getId());
|
||||||
|
}
|
||||||
|
// 消费者id
|
||||||
|
if(ObjectUtils.isNotNull(orderMasterByListData.getCustomerId())){
|
||||||
|
customIdList.add(orderMasterByListData.getCustomerId());
|
||||||
|
}
|
||||||
|
// 师傅id
|
||||||
|
if(ObjectUtils.isNotNull(orderMasterByListData.getWorkerId())){
|
||||||
|
workerIdList.add(orderMasterByListData.getWorkerId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 消费者
|
||||||
|
Map<Long, Customer> longCustomerMap = customerService.byCustomerUseridInMap(customIdList);
|
||||||
|
// 师傅
|
||||||
|
Map<Long, Worker> longWorkerMap = workerService.byWorkUserIdInMap(workerIdList);
|
||||||
|
// 订单数据
|
||||||
|
Map<Long, List<OrderDetail>> longOrderDetailMap = orderDetailService.byOrderIdInMap(orderIdList);
|
||||||
|
Map<Long, List<OrderGoods>> longOrderGoodsMap = orderGoodsService.byOrderIdInMap(orderIdList);
|
||||||
|
// 循环数据赋值。
|
||||||
|
for(OrderMaster orderMasterByListData : orderMasterList){
|
||||||
|
OrderDetailsResponseVo orderDetailsResponseVo = new OrderDetailsResponseVo();
|
||||||
|
// 订单基本信息。
|
||||||
|
orderDetailsResponseVo.setOrderId(orderMasterByListData.getId());
|
||||||
|
// 基本信息。
|
||||||
|
List<OrderGoods> orderGoodsList = longOrderGoodsMap.get(orderMasterByListData.getId());
|
||||||
|
if(orderGoodsList != null && orderGoodsList.size() > 0){
|
||||||
|
List<OrderDetailsResponseVo.OrderDetails> orderDetailsList = new ArrayList<>();
|
||||||
|
for(OrderGoods orderGoods : orderGoodsList){
|
||||||
|
OrderDetailsResponseVo.OrderDetails orderDetails = OrderDetailsResponseVo.OrderDetails.modelDataSupplement(orderGoods);
|
||||||
|
orderDetailsList.add(orderDetails);
|
||||||
|
}
|
||||||
|
orderDetailsResponseVo.setDetailsList(orderDetailsList);
|
||||||
|
}
|
||||||
|
// 订单接单信息。 现在都取接单人。
|
||||||
|
Worker workerByReceivingUser = longWorkerMap.get(orderMasterByListData.getWorkerId());
|
||||||
|
Worker workerByOperationUser = longWorkerMap.get(orderMasterByListData.getWorkerId());
|
||||||
|
orderDetailsResponseVo.setReceiving(OrderDetailsResponseVo.OrderReceiving.modelDataSupplement(workerByReceivingUser, workerByOperationUser));
|
||||||
|
// 订单状态。
|
||||||
|
orderDetailsResponseVo.setState(OrderDetailsResponseVo.OrderState.modelDataSupplement(orderMasterByListData));
|
||||||
|
// 消费者相关。
|
||||||
|
Customer customer = longCustomerMap.get(orderMasterByListData.getCustomerId());
|
||||||
|
if(ObjectUtils.isNotNull(customer)){
|
||||||
|
// 地址信息 这里默认取第一条数据既可以了
|
||||||
|
List<CustomerAddress> customerAddressList = customerAddressService.selectByCustomerId(customer.getCustomerId());
|
||||||
|
if(customerAddressList != null && customerAddressList.size() > 0){
|
||||||
|
orderDetailsResponseVo.setCustomDetails(OrderDetailsResponseVo.OrderCustomDetails.modelDataSupplement(customerAddressList.get(0)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 数据添加处理。
|
||||||
|
orderDetailsResponseVoList.add(orderDetailsResponseVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return getDataTable(orderDetailsResponseVoList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "主订单管理", businessType = BusinessType.EXPORT)
|
@Log(title = "主订单管理", businessType = BusinessType.EXPORT)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.ghy.web.controller.worker;
|
||||||
|
|
||||||
|
import com.ghy.common.core.controller.BaseController;
|
||||||
|
import com.ghy.common.core.domain.AjaxResult;
|
||||||
|
import com.ghy.common.core.page.TableDataInfo;
|
||||||
|
import com.ghy.common.utils.ExceptionUtil;
|
||||||
|
import com.ghy.worker.domain.WorkerTeam;
|
||||||
|
import com.ghy.worker.service.WorkerTeamService;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/worker/team")
|
||||||
|
public class WorkerTeamController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WorkerTeamService workerTeamService;
|
||||||
|
|
||||||
|
@PostMapping("/addTeam")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addTeam(@RequestBody WorkerTeam workerTeam){
|
||||||
|
try {
|
||||||
|
int result = workerTeamService.insertWorkerTeam(workerTeam);
|
||||||
|
if(result > 0){
|
||||||
|
return AjaxResult.success("新增成功");
|
||||||
|
}else {
|
||||||
|
return AjaxResult.warn("新增失败");
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error(e.getMessage());
|
||||||
|
return AjaxResult.error(ExceptionUtil.getExceptionMessage(e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getTeamList")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo getTeamList(@RequestBody WorkerTeam workerTeam){
|
||||||
|
startPage();
|
||||||
|
List<WorkerTeam> list = workerTeamService.getWorkerTeam(workerTeam);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,356 @@
|
||||||
|
package com.ghy.web.pojo.vo;
|
||||||
|
|
||||||
|
import com.ghy.common.enums.OrderStatus;
|
||||||
|
import com.ghy.common.utils.DateUtils;
|
||||||
|
import com.ghy.common.utils.ObjectUtils;
|
||||||
|
import com.ghy.customer.domain.CustomerAddress;
|
||||||
|
import com.ghy.order.domain.OrderGoods;
|
||||||
|
import com.ghy.order.domain.OrderMaster;
|
||||||
|
import com.ghy.worker.domain.Worker;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : 但星霖
|
||||||
|
* @date : 2022-05-30 20:04
|
||||||
|
* 订单列表返回数据vo
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class OrderDetailsResponseVo implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序号
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户ID
|
||||||
|
*/
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单序号
|
||||||
|
*/
|
||||||
|
private Long orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单消费者信息。
|
||||||
|
*/
|
||||||
|
private OrderCustomDetails customDetails;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单详细信息
|
||||||
|
*/
|
||||||
|
private List<OrderDetails> detailsList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态
|
||||||
|
*/
|
||||||
|
private OrderState state;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 便签数据
|
||||||
|
*/
|
||||||
|
private OrderMemo memo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单流转信息,
|
||||||
|
*/
|
||||||
|
private OrderCirculation circulation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家信息
|
||||||
|
*/
|
||||||
|
private OrderBusiness business;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接单数据信息
|
||||||
|
*/
|
||||||
|
private OrderReceiving receiving;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public static class OrderState {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单状态
|
||||||
|
*/
|
||||||
|
private Integer orderStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单枚举
|
||||||
|
*/
|
||||||
|
private OrderStatus orderStatusEnum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单枚举翻译
|
||||||
|
*/
|
||||||
|
private String orderStatusDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间
|
||||||
|
* 对应不同对状态展现不同对时间数据。
|
||||||
|
* 发布时间/接单时间/完成时间
|
||||||
|
* 格式为转移后对yyyy-mm-dd hh:ss:mm
|
||||||
|
*/
|
||||||
|
private String receivingTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改上门时间次数
|
||||||
|
* 单一字段展现。
|
||||||
|
*/
|
||||||
|
private Integer doorFrequency;
|
||||||
|
|
||||||
|
public static OrderState modelDataSupplement(OrderMaster orderMaster){
|
||||||
|
OrderState orderState = new OrderState();
|
||||||
|
orderState.setOrderStatus(orderMaster.getOrderStatus());
|
||||||
|
if(ObjectUtils.isNotNull(orderMaster.getOrderStatus())){
|
||||||
|
OrderStatus orderStatusByEnum = OrderStatus.parse(orderMaster.getOrderStatus());
|
||||||
|
if(ObjectUtils.isNotNull(orderStatusByEnum)){
|
||||||
|
orderState.setOrderStatusEnum(orderStatusByEnum);
|
||||||
|
orderState.setOrderStatus(orderStatusByEnum.code());
|
||||||
|
orderState.setOrderStatusDesc(orderStatusByEnum.desc());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(ObjectUtils.isNull(orderState.getReceivingTime())){
|
||||||
|
orderState.setReceivingTime("--");
|
||||||
|
}else {
|
||||||
|
orderState.setReceivingTime(orderState.getReceivingTime());
|
||||||
|
}
|
||||||
|
// todo 此处缺少上门次数字段。
|
||||||
|
return orderState;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 便签数据
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public static class OrderMemo {
|
||||||
|
/**
|
||||||
|
* 便签数据
|
||||||
|
*/
|
||||||
|
private String memoStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流转信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public static class OrderCirculation {
|
||||||
|
/**
|
||||||
|
* 流转信息文本数据
|
||||||
|
*/
|
||||||
|
private String circulationStr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流转信息管理员Id
|
||||||
|
*/
|
||||||
|
private String circulationUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public static class OrderBusiness {
|
||||||
|
/**
|
||||||
|
* 商家id
|
||||||
|
*/
|
||||||
|
private String businessId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家姓名
|
||||||
|
*/
|
||||||
|
private String businessUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商家电话
|
||||||
|
*/
|
||||||
|
private String businessUserPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接单信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public static class OrderReceiving {
|
||||||
|
/**
|
||||||
|
* 接单人用户Id
|
||||||
|
*/
|
||||||
|
private Long receivingUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接单人用户姓名
|
||||||
|
*/
|
||||||
|
private String receivingUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接单人用户电话
|
||||||
|
*/
|
||||||
|
private String receivingUserPhone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人用户Id
|
||||||
|
*/
|
||||||
|
private Long operationUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人用户姓名
|
||||||
|
*/
|
||||||
|
private String operationUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作人用户电话
|
||||||
|
*/
|
||||||
|
private String operationUserPhone;
|
||||||
|
|
||||||
|
public static OrderReceiving modelDataSupplement(Worker workerByReceiving, Worker workerByOperation){
|
||||||
|
OrderReceiving orderReceiving = new OrderReceiving();
|
||||||
|
// 接单人
|
||||||
|
if(ObjectUtils.isNotNull(workerByReceiving)){
|
||||||
|
orderReceiving.setReceivingUserId(workerByReceiving.getWorkerId());
|
||||||
|
orderReceiving.setReceivingUserName(workerByReceiving.getName());
|
||||||
|
orderReceiving.setReceivingUserPhone(workerByReceiving.getPhone());
|
||||||
|
}
|
||||||
|
// 操作人
|
||||||
|
if(ObjectUtils.isNotNull(workerByOperation)){
|
||||||
|
orderReceiving.setOperationUserId(workerByReceiving.getWorkerId());
|
||||||
|
orderReceiving.setOperationUserName(workerByReceiving.getName());
|
||||||
|
orderReceiving.setOperationUserPhone(workerByReceiving.getPhone());
|
||||||
|
}
|
||||||
|
return orderReceiving;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单详情
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public static class OrderDetails {
|
||||||
|
/**
|
||||||
|
* 商品规格id
|
||||||
|
*/
|
||||||
|
private Long goodsId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品名称
|
||||||
|
*/
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品数量
|
||||||
|
*/
|
||||||
|
private Integer goodsNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已服务数量
|
||||||
|
*/
|
||||||
|
private Integer serverGoodsNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成时间
|
||||||
|
*/
|
||||||
|
private String finishTime;
|
||||||
|
|
||||||
|
public static OrderDetails modelDataSupplement(OrderGoods orderGoods){
|
||||||
|
OrderDetails orderDetails = new OrderDetails();
|
||||||
|
if(ObjectUtils.isNotNull(orderGoods)){
|
||||||
|
orderDetails.setGoodsId(orderGoods.getGoodsId());
|
||||||
|
orderDetails.setGoodsName(orderGoods.getGoodsName());
|
||||||
|
orderDetails.setGoodsNum(orderGoods.getGoodsNum());
|
||||||
|
orderDetails.setServerGoodsNum(orderGoods.getServerGoodsNum());
|
||||||
|
if(ObjectUtils.isNotNull(orderGoods.getFinishTime())){
|
||||||
|
orderDetails.setFinishTime(DateUtils.getDateTimeFormat(orderGoods.getFinishTime()));
|
||||||
|
}else {
|
||||||
|
orderDetails.setFinishTime("--");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return orderDetails;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单消费者信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public static class OrderCustomDetails {
|
||||||
|
/**
|
||||||
|
* 消费者id
|
||||||
|
*/
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收件人姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收件人手机号
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省
|
||||||
|
*/
|
||||||
|
private String provinceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市
|
||||||
|
*/
|
||||||
|
private String cityName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区
|
||||||
|
*/
|
||||||
|
private String countryName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
public static OrderCustomDetails modelDataSupplement(CustomerAddress customerAddress){
|
||||||
|
OrderCustomDetails orderCustomDetails = new OrderCustomDetails();
|
||||||
|
if(ObjectUtils.isNotNull(customerAddress)){
|
||||||
|
orderCustomDetails.setCustomerId(customerAddress.getCustomerId());
|
||||||
|
orderCustomDetails.setAddress(customerAddress.getAddress());
|
||||||
|
orderCustomDetails.setCityName(customerAddress.getCityName());
|
||||||
|
orderCustomDetails.setPhone(customerAddress.getPhone());
|
||||||
|
orderCustomDetails.setProvinceName(customerAddress.getProvinceName());
|
||||||
|
orderCustomDetails.setName(customerAddress.getName());
|
||||||
|
orderCustomDetails.setCountryName(customerAddress.getCountryName());
|
||||||
|
}
|
||||||
|
return orderCustomDetails;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -90,62 +90,143 @@
|
||||||
visible: false
|
visible: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'code',
|
field: 'id',
|
||||||
title: '订单号'
|
title: '序号'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'customerId',
|
field: 'detailsList',
|
||||||
title: '消费者ID'
|
title: '订单信息',
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'orderType',
|
|
||||||
title: '订单类型',
|
|
||||||
align: 'center',
|
|
||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
return $.table.selectDictLabel(orderTypes, value);
|
console.log(value);
|
||||||
|
console.log(row);
|
||||||
|
console.log(index);
|
||||||
|
var actions = [];
|
||||||
|
value.forEach(item => {
|
||||||
|
actions.push("商品id:" + item.goodsId + "</br>");
|
||||||
|
actions.push("商品名称:" + item.goodsName+ "</br>");
|
||||||
|
actions.push("商品数量:" + item.goodsNum+ "</br>");
|
||||||
|
actions.push("已服务数量:" + item.serverGoodsNum + "</br>");
|
||||||
|
actions.push("完成时间:" + item.finishTime + "</br>");
|
||||||
|
})
|
||||||
|
/** 消费者相关信息 **/
|
||||||
|
if(row.customDetails){
|
||||||
|
actions.push("消费者Id:" + row.customDetails.customerId + "</br>");
|
||||||
|
actions.push("收件人姓名:" + row.customDetails.name+ "</br>");
|
||||||
|
actions.push("收件人手机:" + row.customDetails.phone + "</br>");
|
||||||
|
actions.push("地址信息:" + row.customDetails.provinceName + "-" + row.customDetails.cityName + "-" + row.customDetails.countryName + "</br>");
|
||||||
|
actions.push("详细地址:" + row.customDetails.address + "</br>");
|
||||||
|
}
|
||||||
|
if(actions.length){
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'orderStatus',
|
field: 'state',
|
||||||
title: '订单状态'
|
title: '订单状态',
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'payType',
|
|
||||||
title: '付款类型',
|
|
||||||
align: 'center',
|
|
||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
return $.table.selectDictLabel(payTypes, value);
|
var actions = [];
|
||||||
|
if(value){
|
||||||
|
actions.push("订单状态:" + value.orderStatusDesc + "</br>" );
|
||||||
|
actions.push("订单时间:" + value.receivingTime + "</br>" );
|
||||||
|
}
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// field: 'orderType',
|
||||||
|
// title: '订单类型',
|
||||||
|
// align: 'center',
|
||||||
|
// formatter: function (value, row, index) {
|
||||||
|
// return $.table.selectDictLabel(orderTypes, value);
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
field: 'memo',
|
||||||
|
title: '便签',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
if(value){
|
||||||
|
return value.memoStr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'payStatus',
|
field: 'detailsList',
|
||||||
title: '付款状态'
|
title: '订单流转信息',
|
||||||
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'payTime',
|
field: 'receiving',
|
||||||
title: '付款时间'
|
title: '接单信息',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
if(value){
|
||||||
|
actions.push("接单人id:" + value.receivingUserId + "</br>");
|
||||||
|
actions.push("接单人姓名:" + value.receivingUserName + "</br>");
|
||||||
|
actions.push("接单人电话:" + value.receivingUserPhone + "</br>");
|
||||||
|
actions.push("操作人id:" + value.operationUserId + "</br>");
|
||||||
|
actions.push("操作人姓名:" + value.operationUserName + "</br>");
|
||||||
|
actions.push("操作人电话:" + value.operationUserPhone + "</br>");
|
||||||
|
}
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'operationType',
|
||||||
|
title: '操作',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-info-circle"></i>查看</a> </br>');
|
||||||
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(1)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-info-circle"></i>查看急报</a> </br>');
|
||||||
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(2)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-info-circle"></i>发送急报</a> </br>');
|
||||||
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(3)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-info-circle"></i>追加扣减</a> </br>');
|
||||||
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(4)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-info-circle"></i>师傅退单</a> </br>');
|
||||||
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(5)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-info-circle"></i>商家退款</a> </br>');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'workerId',
|
field: 'workerId',
|
||||||
title: '接单师傅ID'
|
title: '客诉中'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'revTime',
|
field: 'revTime',
|
||||||
title: '接单时间'
|
title: '商家信息',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
if(value){
|
||||||
|
actions.push("商家id:" + value.businessId+ "</br>");
|
||||||
|
actions.push("商家姓名:" + value.businessUserName+ "</br>");
|
||||||
|
actions.push("商家电话:" + value.businessUserPhone+ "</br>");
|
||||||
|
}
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'business',
|
||||||
|
title: '商家发布家'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'createTime',
|
field: 'createTime',
|
||||||
title: '创建时间',
|
title: '商家加追金额'
|
||||||
sortable: true
|
},
|
||||||
}, {
|
{
|
||||||
title: '操作',
|
field: 'createTime',
|
||||||
align: 'left',
|
title: '代收款'
|
||||||
formatter: function (value, row, index) {
|
},
|
||||||
var actions = [];
|
{
|
||||||
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-info-circle"></i>详情</a> ');
|
field: 'createTime',
|
||||||
return actions.join('');
|
title: '奖励金'
|
||||||
}
|
},
|
||||||
}]
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '邀请人'
|
||||||
|
}
|
||||||
|
// {
|
||||||
|
// title: '操作',
|
||||||
|
// align: 'left',
|
||||||
|
// }
|
||||||
|
]
|
||||||
};
|
};
|
||||||
$.table.init(options);
|
$.table.init(options);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,81 +5,78 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格分页数据对象
|
* 表格分页数据对象
|
||||||
*
|
*
|
||||||
* @author clunt
|
* @author clunt
|
||||||
*/
|
*/
|
||||||
public class TableDataInfo implements Serializable
|
public class TableDataInfo implements Serializable {
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 总记录数 */
|
/**
|
||||||
|
* 总记录数
|
||||||
|
*/
|
||||||
private long total;
|
private long total;
|
||||||
|
|
||||||
/** 列表数据 */
|
/**
|
||||||
|
* 列表数据
|
||||||
|
*/
|
||||||
private List<?> rows;
|
private List<?> rows;
|
||||||
|
|
||||||
/** 消息状态码 */
|
/**
|
||||||
|
* 消息状态码
|
||||||
|
*/
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
/** 消息内容 */
|
/**
|
||||||
|
* 消息内容
|
||||||
|
*/
|
||||||
private String msg;
|
private String msg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格数据对象
|
* 表格数据对象
|
||||||
*/
|
*/
|
||||||
public TableDataInfo()
|
public TableDataInfo() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页
|
* 分页
|
||||||
*
|
*
|
||||||
* @param list 列表数据
|
* @param list 列表数据
|
||||||
* @param total 总记录数
|
* @param total 总记录数
|
||||||
*/
|
*/
|
||||||
public TableDataInfo(List<?> list, int total)
|
public TableDataInfo(List<?> list, int total) {
|
||||||
{
|
|
||||||
this.rows = list;
|
this.rows = list;
|
||||||
this.total = total;
|
this.total = total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTotal()
|
public long getTotal() {
|
||||||
{
|
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTotal(long total)
|
public void setTotal(long total) {
|
||||||
{
|
|
||||||
this.total = total;
|
this.total = total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<?> getRows()
|
public List<?> getRows() {
|
||||||
{
|
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRows(List<?> rows)
|
public void setRows(List<?> rows) {
|
||||||
{
|
|
||||||
this.rows = rows;
|
this.rows = rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCode()
|
public int getCode() {
|
||||||
{
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCode(int code)
|
public void setCode(int code) {
|
||||||
{
|
|
||||||
this.code = code;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMsg()
|
public String getMsg() {
|
||||||
{
|
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMsg(String msg)
|
public void setMsg(String msg) {
|
||||||
{
|
|
||||||
this.msg = msg;
|
this.msg = msg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.ghy.common.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为了能统一处理数据库中定义的各种状态,状态枚举都需要实现此接口
|
||||||
|
*
|
||||||
|
* @author chunhao.guo
|
||||||
|
* @date 2020-03-11
|
||||||
|
*/
|
||||||
|
public interface IEnumType {
|
||||||
|
/**
|
||||||
|
* 数据库中定义的 数字 状态码
|
||||||
|
*/
|
||||||
|
int code();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 简单描述
|
||||||
|
*/
|
||||||
|
String desc();
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,17 @@
|
||||||
package com.ghy.common.enums;
|
package com.ghy.common.enums;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单状态
|
* 订单状态
|
||||||
*
|
*
|
||||||
* @author clunt
|
* @author clunt
|
||||||
*/
|
*/
|
||||||
public enum OrderStatus {
|
public enum OrderStatus implements IEnumType {
|
||||||
|
|
||||||
RECEIVE(0, "待接单"),
|
RECEIVE(0, "待接单"),
|
||||||
PLAIN(1, "待排期"),
|
PLAIN(1, "待排期"),
|
||||||
|
|
@ -14,20 +20,62 @@ public enum OrderStatus {
|
||||||
FINISH(4, "已完成"),
|
FINISH(4, "已完成"),
|
||||||
CANCEL(5, "已取消");
|
CANCEL(5, "已取消");
|
||||||
|
|
||||||
private final Integer code;
|
private final int code;
|
||||||
private final String desc;
|
private final String desc;
|
||||||
|
|
||||||
OrderStatus(Integer code, String desc) {
|
private final static Map<Integer, OrderStatus> BY_CODE_MAP
|
||||||
|
= Arrays.stream(OrderStatus.values()).collect(Collectors.toMap(OrderStatus::code, code -> code));
|
||||||
|
|
||||||
|
private final static Map<String, OrderStatus> BY_NAME_MAP
|
||||||
|
= Arrays.stream(OrderStatus.values()).collect(Collectors.toMap(code -> code.name().toLowerCase(), code -> code));
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param code 代码
|
||||||
|
* @param desc 描述
|
||||||
|
*/
|
||||||
|
OrderStatus(final int code, final String desc) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
this.desc = desc;
|
this.desc = desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getCode() {
|
@Override
|
||||||
return code;
|
public int code() {
|
||||||
|
return this.code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDesc() {
|
@Override
|
||||||
return desc;
|
public String desc() {
|
||||||
|
return this.desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param code 代码
|
||||||
|
* @return 转换出来的状态码
|
||||||
|
*/
|
||||||
|
public static OrderStatus parse(Integer code) {
|
||||||
|
return BY_CODE_MAP.get(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static OrderStatus parse(Integer code, OrderStatus defaultState) {
|
||||||
|
return BY_CODE_MAP.getOrDefault(code, defaultState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param name 名字
|
||||||
|
* @return 转换出来的状态码
|
||||||
|
*/
|
||||||
|
public static OrderStatus parse(String name) {
|
||||||
|
if (StringUtils.isBlank(name)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return BY_NAME_MAP.get(name.trim().toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static OrderStatus parse(String name, OrderStatus defaultState) {
|
||||||
|
if (StringUtils.isBlank(name)) {
|
||||||
|
return defaultState;
|
||||||
|
}
|
||||||
|
return BY_NAME_MAP.getOrDefault(name.trim().toLowerCase(), defaultState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -160,4 +160,13 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||||
// long sec = diff % nd % nh % nm / ns;
|
// long sec = diff % nd % nh % nm / ns;
|
||||||
return day + "天" + hour + "小时" + min + "分钟";
|
return day + "天" + hour + "小时" + min + "分钟";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据当前时间进行转换数据
|
||||||
|
* 格式信息:yy-mm-dd HH:mm:ss
|
||||||
|
*/
|
||||||
|
public static String getDateTimeFormat(Date date) {
|
||||||
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DateUtils.YYYY_MM_DD_HH_MM_SS);
|
||||||
|
return simpleDateFormat.format(date);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
package com.ghy.common.utils;
|
||||||
|
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对象工具类
|
||||||
|
* @since 2022-05-31
|
||||||
|
* @author 但星霖
|
||||||
|
*/
|
||||||
|
public class ObjectUtils {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断object是否为空,集合会校验size
|
||||||
|
*/
|
||||||
|
public static boolean isNull(Object... objs) {
|
||||||
|
for (Object obj : objs) {
|
||||||
|
if (isEmpty(obj)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断object是否不为空,集合会校验size
|
||||||
|
*/
|
||||||
|
public static boolean isNotNull(Object... obj) {
|
||||||
|
return !isNull(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对象非空判断
|
||||||
|
*/
|
||||||
|
public static boolean isNotEmpty(Object obj) {
|
||||||
|
return !isEmpty(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对象空判断
|
||||||
|
*/
|
||||||
|
public static boolean isEmpty(Object obj) {
|
||||||
|
if (obj == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (obj.getClass().isArray()) {
|
||||||
|
return Array.getLength(obj) == 0;
|
||||||
|
}
|
||||||
|
if (obj instanceof CharSequence) {
|
||||||
|
return ((CharSequence) obj).length() == 0;
|
||||||
|
}
|
||||||
|
if (obj instanceof Collection) {
|
||||||
|
return ((Collection<?>) obj).isEmpty();
|
||||||
|
}
|
||||||
|
if (obj instanceof Map) {
|
||||||
|
return ((Map<?, ?>) obj).isEmpty();
|
||||||
|
}
|
||||||
|
if (obj instanceof Iterable) {
|
||||||
|
return !((Iterable<?>) obj).iterator().hasNext();
|
||||||
|
}
|
||||||
|
if (obj instanceof Iterator) {
|
||||||
|
return !((Iterator<?>) obj).hasNext();
|
||||||
|
}
|
||||||
|
// else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ghy.customer.mapper;
|
package com.ghy.customer.mapper;
|
||||||
|
|
||||||
import com.ghy.customer.domain.Customer;
|
import com.ghy.customer.domain.Customer;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -26,10 +27,10 @@ public interface CustomerMapper {
|
||||||
* @param customerId 消费者ids
|
* @param customerId 消费者ids
|
||||||
* @return 删除成功条数
|
* @return 删除成功条数
|
||||||
*/
|
*/
|
||||||
int deleteByIds(Long [] customerId);
|
int deleteByIds(Long[] customerId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param customerId 消费者id
|
* @param customerId 消费者id
|
||||||
* @return 删除成功条数
|
* @return 删除成功条数
|
||||||
*/
|
*/
|
||||||
int deleteByCustomerId(Long customerId);
|
int deleteByCustomerId(Long customerId);
|
||||||
|
|
@ -46,4 +47,12 @@ public interface CustomerMapper {
|
||||||
*/
|
*/
|
||||||
int updateCustomer(Customer customer);
|
int updateCustomer(Customer customer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据消费者id集合信息进行批量查询数据
|
||||||
|
*
|
||||||
|
* @param customerIdList 消费者id集合信息。
|
||||||
|
* @return Customer实体集合信息
|
||||||
|
*/
|
||||||
|
List<Customer> getByCustomerIdList(@Param("customerIdList") List<Long> customerIdList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
package com.ghy.customer.service;
|
package com.ghy.customer.service;
|
||||||
|
|
||||||
|
import com.ghy.customer.domain.Customer;
|
||||||
import com.ghy.customer.domain.CustomerAddress;
|
import com.ghy.customer.domain.CustomerAddress;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface CustomerAddressService {
|
public interface CustomerAddressService {
|
||||||
|
|
||||||
|
|
@ -47,5 +49,4 @@ public interface CustomerAddressService {
|
||||||
* @return 修改成功条数
|
* @return 修改成功条数
|
||||||
*/
|
*/
|
||||||
int updateCustomerAddress(CustomerAddress customerAddress);
|
int updateCustomerAddress(CustomerAddress customerAddress);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.ghy.customer.service;
|
||||||
import com.ghy.customer.domain.Customer;
|
import com.ghy.customer.domain.Customer;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author clunt
|
* @author clunt
|
||||||
|
|
@ -35,7 +36,7 @@ public interface CustomerService {
|
||||||
int deleteByIds(String ids);
|
int deleteByIds(String ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param customerId 消费者id
|
* @param customerId 消费者id
|
||||||
* @return 删除成功条数
|
* @return 删除成功条数
|
||||||
*/
|
*/
|
||||||
int deleteByCustomerId(Long customerId);
|
int deleteByCustomerId(Long customerId);
|
||||||
|
|
@ -52,4 +53,12 @@ public interface CustomerService {
|
||||||
*/
|
*/
|
||||||
int updateCustomer(Customer customer);
|
int updateCustomer(Customer customer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据消费者id集合信息进行查询封装成为map数据,
|
||||||
|
*
|
||||||
|
* @param customerUserIdList 消费者Id集合信息数据
|
||||||
|
* @return 键值队列数据, key-> 消费者Id value-> 消费者实体信息
|
||||||
|
*/
|
||||||
|
Map<Long, Customer> byCustomerUseridInMap(List<Long> customerUserIdList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,9 @@ import com.ghy.customer.service.CustomerService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author clunt
|
* @author clunt
|
||||||
|
|
@ -75,6 +77,20 @@ public class CustomerServiceImpl implements CustomerService {
|
||||||
return customerMapper.updateCustomer(customer);
|
return customerMapper.updateCustomer(customer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Long, Customer> byCustomerUseridInMap(List<Long> customerUserIdList) {
|
||||||
|
Map<Long, Customer> longCustomerMap = new HashMap<>();
|
||||||
|
if(customerUserIdList != null && customerUserIdList.size() > 0){
|
||||||
|
List<Customer> customerList = customerMapper.getByCustomerIdList(customerUserIdList);
|
||||||
|
if(customerList != null && customerList.size() > 0){
|
||||||
|
for(Customer customer : customerList){
|
||||||
|
longCustomerMap.put(customer.getCustomerId(), customer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return longCustomerMap;
|
||||||
|
}
|
||||||
|
|
||||||
public int countUserCustomer(Customer customer) {
|
public int countUserCustomer(Customer customer) {
|
||||||
//TODO 需要校验用户是否在被使用。
|
//TODO 需要校验用户是否在被使用。
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -96,4 +96,14 @@
|
||||||
where customer_id = #{customerId}
|
where customer_id = #{customerId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="getByCustomerIdList" resultMap="CustomerResult">
|
||||||
|
<include refid="selectCustomer" />
|
||||||
|
<where>
|
||||||
|
and customer_id in
|
||||||
|
<foreach item="item" index="customerIdList" collection="customerIdList" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@ public class Goods extends BaseEntity {
|
||||||
@Excel(name = "商品排序", cellType = Excel.ColumnType.NUMERIC)
|
@Excel(name = "商品排序", cellType = Excel.ColumnType.NUMERIC)
|
||||||
private Integer goodsSort;
|
private Integer goodsSort;
|
||||||
|
|
||||||
|
@Excel(name = "归属师傅", cellType = Excel.ColumnType.NUMERIC)
|
||||||
|
private Long workerId;
|
||||||
|
|
||||||
@Excel(name = "类别id,必须是关联到系统的第三级目录")
|
@Excel(name = "类别id,必须是关联到系统的第三级目录")
|
||||||
private Long deptGoodsCategoryId;
|
private Long deptGoodsCategoryId;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
<result property="deptId" column="dept_id" />
|
<result property="deptId" column="dept_id" />
|
||||||
<result property="goodsName" column="goods_name" />
|
<result property="goodsName" column="goods_name" />
|
||||||
<result property="goodsSort" column="goods_sort"/>
|
<result property="goodsSort" column="goods_sort"/>
|
||||||
|
<result property="workerId" column="worker_id"/>
|
||||||
<result property="deptGoodsCategoryId" column="dept_goods_category_id"/>
|
<result property="deptGoodsCategoryId" column="dept_goods_category_id"/>
|
||||||
<result property="goodsImgUrl" column="goods_img_url"/>
|
<result property="goodsImgUrl" column="goods_img_url"/>
|
||||||
<result property="goodsVideoUrl" column="goods_video_url"/>
|
<result property="goodsVideoUrl" column="goods_video_url"/>
|
||||||
|
|
@ -21,7 +22,7 @@
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectGoods">
|
<sql id="selectGoods">
|
||||||
SELECT goods_id, goods_code, dept_id, goods_name, goods_sort,
|
SELECT goods_id, goods_code, dept_id, goods_name, goods_sort, worker_id,
|
||||||
dept_goods_category_id, goods_img_url, goods_video_url, status, create_by, create_time, remark
|
dept_goods_category_id, goods_img_url, goods_video_url, status, create_by, create_time, remark
|
||||||
FROM goods
|
FROM goods
|
||||||
</sql>
|
</sql>
|
||||||
|
|
@ -54,6 +55,7 @@
|
||||||
<if test="deptId != null and deptId != ''">dept_id,</if>
|
<if test="deptId != null and deptId != ''">dept_id,</if>
|
||||||
<if test="goodsName != null and goodsName != ''">goods_name,</if>
|
<if test="goodsName != null and goodsName != ''">goods_name,</if>
|
||||||
<if test="goodsSort != null and goodsSort != ''">goods_sort,</if>
|
<if test="goodsSort != null and goodsSort != ''">goods_sort,</if>
|
||||||
|
<if test="workerId != null and workerId != ''">worker_id,</if>
|
||||||
<if test="deptGoodsCategoryId != null and deptGoodsCategoryId != 0">dept_goods_category_id,</if>
|
<if test="deptGoodsCategoryId != null and deptGoodsCategoryId != 0">dept_goods_category_id,</if>
|
||||||
<if test="goodsImgUrl != null and goodsImgUrl != ''">goods_img_url,</if>
|
<if test="goodsImgUrl != null and goodsImgUrl != ''">goods_img_url,</if>
|
||||||
<if test="goodsVideoUrl != null and goodsVideoUrl != ''">goods_video_url,</if>
|
<if test="goodsVideoUrl != null and goodsVideoUrl != ''">goods_video_url,</if>
|
||||||
|
|
@ -66,6 +68,7 @@
|
||||||
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
||||||
<if test="goodsName != null and goodsName != ''">#{goodsName},</if>
|
<if test="goodsName != null and goodsName != ''">#{goodsName},</if>
|
||||||
<if test="goodsSort != null and goodsSort != ''">#{goodsSort},</if>
|
<if test="goodsSort != null and goodsSort != ''">#{goodsSort},</if>
|
||||||
|
<if test="workerId != null and workerId != ''">#{workerId},</if>
|
||||||
<if test="deptGoodsCategoryId != null and deptGoodsCategoryId != 0">#{deptGoodsCategoryId},</if>
|
<if test="deptGoodsCategoryId != null and deptGoodsCategoryId != 0">#{deptGoodsCategoryId},</if>
|
||||||
<if test="goodsImgUrl != null and goodsImgUrl != ''">#{goodsImgUrl},</if>
|
<if test="goodsImgUrl != null and goodsImgUrl != ''">#{goodsImgUrl},</if>
|
||||||
<if test="goodsVideoUrl != null and goodsVideoUrl != ''">#{goodsVideoUrl},</if>
|
<if test="goodsVideoUrl != null and goodsVideoUrl != ''">#{goodsVideoUrl},</if>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ghy.order.mapper;
|
package com.ghy.order.mapper;
|
||||||
|
|
||||||
import com.ghy.order.domain.OrderDetail;
|
import com.ghy.order.domain.OrderDetail;
|
||||||
|
import com.ghy.order.domain.OrderGoods;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -48,4 +50,12 @@ public interface OrderDetailMapper {
|
||||||
* @return 细单表信息
|
* @return 细单表信息
|
||||||
*/
|
*/
|
||||||
OrderDetail checkOrderDetailCodeUnique(String orderDetailCode);
|
OrderDetail checkOrderDetailCodeUnique(String orderDetailCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单id集合信息进行批量数据查询
|
||||||
|
*
|
||||||
|
* @param orderIdList 订单Id集合信息。
|
||||||
|
* @return OrderDetail实体集合信息。
|
||||||
|
*/
|
||||||
|
List<OrderDetail> getByOrderIdList(@Param("orderIdList") List<Long> orderIdList);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ghy.order.mapper;
|
package com.ghy.order.mapper;
|
||||||
|
|
||||||
import com.ghy.order.domain.OrderGoods;
|
import com.ghy.order.domain.OrderGoods;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -39,4 +40,11 @@ public interface OrderGoodsMapper {
|
||||||
*/
|
*/
|
||||||
int deleteOrderGoodsByIds(Long[] orderGoodsIds);
|
int deleteOrderGoodsByIds(Long[] orderGoodsIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单id集合信息进行批量数据查询
|
||||||
|
*
|
||||||
|
* @param orderIdList 订单Id集合信息。
|
||||||
|
* @return OrderGoods实体集合信息。
|
||||||
|
*/
|
||||||
|
List<OrderGoods> getByOrderIdList(@Param("orderIdList") List<Long> orderIdList);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ghy.order.mapper;
|
package com.ghy.order.mapper;
|
||||||
|
|
||||||
|
import com.ghy.order.domain.OrderGoods;
|
||||||
import com.ghy.order.domain.OrderMaster;
|
import com.ghy.order.domain.OrderMaster;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.ghy.order.service;
|
||||||
import com.ghy.order.domain.OrderDetail;
|
import com.ghy.order.domain.OrderDetail;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详细订单接口
|
* 详细订单接口
|
||||||
|
|
@ -55,4 +56,12 @@ public interface OrderDetailService {
|
||||||
*/
|
*/
|
||||||
String createCode();
|
String createCode();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单id集合信息进行查询封装成为map数据,
|
||||||
|
*
|
||||||
|
* @param orderIdList 订单Id集合信息数据
|
||||||
|
* @return 键值队列数据, key-> 订单Id value-> 订单实体集合信息
|
||||||
|
*/
|
||||||
|
Map<Long, List<OrderDetail>> byOrderIdInMap(List<Long> orderIdList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
package com.ghy.order.service;
|
package com.ghy.order.service;
|
||||||
|
|
||||||
|
import com.ghy.order.domain.OrderDetail;
|
||||||
import com.ghy.order.domain.OrderGoods;
|
import com.ghy.order.domain.OrderGoods;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单商品属性
|
* 订单商品属性
|
||||||
|
|
@ -38,4 +40,12 @@ public interface OrderGoodsService {
|
||||||
* @param orderGoodsIds 需要删除的数据ID
|
* @param orderGoodsIds 需要删除的数据ID
|
||||||
*/
|
*/
|
||||||
int deleteOrderGoodsByIds(Long[] orderGoodsIds);
|
int deleteOrderGoodsByIds(Long[] orderGoodsIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单id集合信息进行查询封装成为map数据,
|
||||||
|
*
|
||||||
|
* @param orderIdList 订单Id集合信息数据
|
||||||
|
* @return 键值队列数据, key-> 订单Id value-> 订单实体集合信息
|
||||||
|
*/
|
||||||
|
Map<Long, List<OrderGoods>> byOrderIdInMap(List<Long> orderIdList);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,10 @@ import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.format.DateTimeFormatterBuilder;
|
import java.time.format.DateTimeFormatterBuilder;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
|
||||||
import static java.time.temporal.ChronoField.*;
|
import static java.time.temporal.ChronoField.*;
|
||||||
|
|
@ -72,4 +75,28 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
return "od" + now.format(MINI_FORMATTER) + INDEX.getAndIncrement();
|
return "od" + now.format(MINI_FORMATTER) + INDEX.getAndIncrement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Long, List<OrderDetail>> byOrderIdInMap(List<Long> orderIdList) {
|
||||||
|
Map<Long, List<OrderDetail>> longByOrderDetailListMap = new HashMap<>();
|
||||||
|
if(orderIdList != null && orderIdList.size() > 0){
|
||||||
|
List<OrderDetail> orderDetailList = orderDetailMapper.getByOrderIdList(orderIdList);
|
||||||
|
if(orderDetailList != null && orderDetailList.size() > 0){
|
||||||
|
for(OrderDetail orderDetail : orderDetailList){
|
||||||
|
List<OrderDetail> orderDetailListByMapCrw = longByOrderDetailListMap.get(orderDetail.getOrderMasterId());
|
||||||
|
if(orderDetailListByMapCrw != null && orderDetailListByMapCrw.size() > 0){
|
||||||
|
List<OrderDetail> orderDetailListByMapNew = new ArrayList<>();
|
||||||
|
orderDetailListByMapNew.add(orderDetail);
|
||||||
|
longByOrderDetailListMap.put(orderDetail.getOrderMasterId(), orderDetailListByMapNew);
|
||||||
|
}else {
|
||||||
|
List<OrderDetail> orderDetailListByMapNew = new ArrayList<>();
|
||||||
|
orderDetailListByMapNew.add(orderDetail);
|
||||||
|
longByOrderDetailListMap.put(orderDetail.getOrderMasterId(), orderDetailListByMapNew);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return longByOrderDetailListMap;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ghy.order.service.impl;
|
package com.ghy.order.service.impl;
|
||||||
|
|
||||||
|
import com.ghy.order.domain.OrderDetail;
|
||||||
import com.ghy.order.domain.OrderGoods;
|
import com.ghy.order.domain.OrderGoods;
|
||||||
import com.ghy.order.mapper.OrderGoodsMapper;
|
import com.ghy.order.mapper.OrderGoodsMapper;
|
||||||
import com.ghy.order.service.OrderGoodsService;
|
import com.ghy.order.service.OrderGoodsService;
|
||||||
|
|
@ -8,7 +9,10 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -42,4 +46,27 @@ public class OrderGoodsServiceImpl implements OrderGoodsService {
|
||||||
public int deleteOrderGoodsByIds(Long[] orderGoodsIds) {
|
public int deleteOrderGoodsByIds(Long[] orderGoodsIds) {
|
||||||
return orderGoodsMapper.deleteOrderGoodsByIds(orderGoodsIds);
|
return orderGoodsMapper.deleteOrderGoodsByIds(orderGoodsIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Long, List<OrderGoods>> byOrderIdInMap(List<Long> orderIdList) {
|
||||||
|
Map<Long, List<OrderGoods>> longByOrderGoodsListMap = new HashMap<>();
|
||||||
|
if(orderIdList != null && orderIdList.size() > 0){
|
||||||
|
List<OrderGoods> orderGoodsList = orderGoodsMapper.getByOrderIdList(orderIdList);
|
||||||
|
if(orderGoodsList != null && orderGoodsList.size() > 0){
|
||||||
|
for(OrderGoods orderGoods : orderGoodsList){
|
||||||
|
List<OrderGoods> orderDetailListByMapCrw = longByOrderGoodsListMap.get(orderGoods.getOrderId());
|
||||||
|
if(orderDetailListByMapCrw != null && orderDetailListByMapCrw.size() > 0){
|
||||||
|
List<OrderGoods> orderDetailListByMapNew = new ArrayList<>();
|
||||||
|
orderDetailListByMapNew.add(orderGoods);
|
||||||
|
longByOrderGoodsListMap.put(orderGoods.getOrderId(), orderDetailListByMapNew);
|
||||||
|
}else {
|
||||||
|
List<OrderGoods> orderDetailListByMapNew = new ArrayList<>();
|
||||||
|
orderDetailListByMapNew.add(orderGoods);
|
||||||
|
longByOrderGoodsListMap.put(orderGoods.getOrderId(), orderDetailListByMapNew);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return longByOrderGoodsListMap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,183 +0,0 @@
|
||||||
package com.ghy.order.vo;
|
|
||||||
|
|
||||||
import lombok.*;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author : 但星霖
|
|
||||||
* @date : 2022-05-30 20:04
|
|
||||||
* 订单列表返回数据vo
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ToString
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Accessors(chain = true)
|
|
||||||
public class OrderDetailsResponseVo implements Serializable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 序号
|
|
||||||
*/
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商户ID
|
|
||||||
*/
|
|
||||||
private Long deptId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单编码
|
|
||||||
*/
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单状态
|
|
||||||
*/
|
|
||||||
private OrderState state;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 便签数据
|
|
||||||
*/
|
|
||||||
private OrderMemo memo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单流转信息,
|
|
||||||
*/
|
|
||||||
private OrderCirculation circulation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商家信息
|
|
||||||
*/
|
|
||||||
private OrderBusiness business;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 接单数据信息
|
|
||||||
*/
|
|
||||||
private OrderReceiving receiving;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单状态
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
public static class OrderState {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单状态
|
|
||||||
*/
|
|
||||||
private Integer orderStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 时间
|
|
||||||
* 对应不同对状态展现不同对时间数据。
|
|
||||||
* 发布时间/接单时间/完成时间
|
|
||||||
* 格式为转移后对yyyy-mm-dd hh:ss:mm
|
|
||||||
*/
|
|
||||||
private String receivingTime;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改上门时间次数
|
|
||||||
* 单一字段展现。
|
|
||||||
*/
|
|
||||||
private Integer doorFrequency;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 便签数据
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
public static class OrderMemo {
|
|
||||||
/**
|
|
||||||
* 便签数据
|
|
||||||
*/
|
|
||||||
private String memoStr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流转信息
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
public static class OrderCirculation {
|
|
||||||
/**
|
|
||||||
* 流转信息文本数据
|
|
||||||
*/
|
|
||||||
private String circulationStr;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 流转信息管理员Id
|
|
||||||
*/
|
|
||||||
private String circulationUserId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商家信息
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
public static class OrderBusiness {
|
|
||||||
/**
|
|
||||||
* 商家id
|
|
||||||
*/
|
|
||||||
private String businessId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商家姓名
|
|
||||||
*/
|
|
||||||
private String businessUserName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商家电话
|
|
||||||
*/
|
|
||||||
private String businessUserPhone;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 接单信息
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
public static class OrderReceiving {
|
|
||||||
/**
|
|
||||||
* 接单人用户Id
|
|
||||||
*/
|
|
||||||
private String receivingUserId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 接单人用户姓名
|
|
||||||
*/
|
|
||||||
private String receivingUserName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 接单人用户电话
|
|
||||||
*/
|
|
||||||
private String receivingUserPhone;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 操作人用户Id
|
|
||||||
*/
|
|
||||||
private String operationUserId;
|
|
||||||
|
|
||||||
/**信·
|
|
||||||
* 操作人用户姓名
|
|
||||||
*/
|
|
||||||
private String operationUserName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 操作人用户电话
|
|
||||||
*/
|
|
||||||
private String operationUserPhone;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -130,4 +130,14 @@
|
||||||
WHERE `code` =#{orderDetailCode} LIMIT 1
|
WHERE `code` =#{orderDetailCode} LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getByOrderIdList" resultMap="OrderDetailResult">
|
||||||
|
<include refid="selectOrderDetail" />
|
||||||
|
<where>
|
||||||
|
and order_master_id in
|
||||||
|
<foreach item="item" index="orderIdList" collection="orderIdList" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -94,4 +94,14 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="getByOrderIdList" resultMap="OrderGoodsResult">
|
||||||
|
<include refid="selectOrderGoods" />
|
||||||
|
<where>
|
||||||
|
and order_id in
|
||||||
|
<foreach item="item" index="orderIdList" collection="orderIdList" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ghy.worker.mapper;
|
package com.ghy.worker.mapper;
|
||||||
|
|
||||||
import com.ghy.worker.domain.Worker;
|
import com.ghy.worker.domain.Worker;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -30,4 +31,12 @@ public interface WorkerMapper {
|
||||||
* @param workerId 师傅ID
|
* @param workerId 师傅ID
|
||||||
*/
|
*/
|
||||||
Worker selectById(Long workerId);
|
Worker selectById(Long workerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据师傅id集合信息进行批量数据查询
|
||||||
|
*
|
||||||
|
* @param workIdList 师傅Id集合信息。
|
||||||
|
* @return Worker实体集合信息。
|
||||||
|
*/
|
||||||
|
List<Worker> getByWorkIdList(@Param("workIdList") List<Long> workIdList);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.ghy.worker.service;
|
||||||
import com.ghy.worker.domain.Worker;
|
import com.ghy.worker.domain.Worker;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface WorkerService {
|
public interface WorkerService {
|
||||||
|
|
||||||
|
|
@ -44,4 +45,12 @@ public interface WorkerService {
|
||||||
* @param workerId workerId
|
* @param workerId workerId
|
||||||
*/
|
*/
|
||||||
boolean checkInTeam(Long leaderId, Long workerId);
|
boolean checkInTeam(Long leaderId, Long workerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据师傅id集合信息进行查询封装成为map数据,
|
||||||
|
*
|
||||||
|
* @param workUserIdList 师傅Id集合信息数据
|
||||||
|
* @return 键值队列数据, key-> 师傅Id value-> 师傅实体信息
|
||||||
|
*/
|
||||||
|
Map<Long, Worker> byWorkUserIdInMap(List<Long> workUserIdList);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.ghy.worker.service;
|
||||||
|
|
||||||
|
import com.ghy.worker.domain.WorkerTeam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 师傅团队
|
||||||
|
* @author clunt
|
||||||
|
*/
|
||||||
|
public interface WorkerTeamService {
|
||||||
|
|
||||||
|
public List<WorkerTeam> getWorkerTeam(WorkerTeam workerTeam);
|
||||||
|
|
||||||
|
public int insertWorkerTeam(WorkerTeam workerTeam);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -10,7 +10,9 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class WorkerServiceImpl implements WorkerService {
|
public class WorkerServiceImpl implements WorkerService {
|
||||||
|
|
@ -58,4 +60,18 @@ public class WorkerServiceImpl implements WorkerService {
|
||||||
List<WorkerTeam> teams = workerTeamMapper.getWorkerTeamList(query);
|
List<WorkerTeam> teams = workerTeamMapper.getWorkerTeamList(query);
|
||||||
return !CollectionUtils.isEmpty(teams);
|
return !CollectionUtils.isEmpty(teams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Long, Worker> byWorkUserIdInMap(List<Long> workUserIdList) {
|
||||||
|
Map<Long, Worker> longWorkerMap = new HashMap<>();
|
||||||
|
if(workUserIdList != null && workUserIdList.size() > 0){
|
||||||
|
List<Worker> workerList = workerMapper.getByWorkIdList(workUserIdList);
|
||||||
|
if(workerList != null && workerList.size() > 0){
|
||||||
|
for(Worker worker : workerList){
|
||||||
|
longWorkerMap.put(worker.getWorkerId(), worker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return longWorkerMap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.ghy.worker.service.impl;
|
||||||
|
|
||||||
|
import com.ghy.worker.domain.WorkerTeam;
|
||||||
|
import com.ghy.worker.mapper.WorkerTeamMapper;
|
||||||
|
import com.ghy.worker.service.WorkerTeamService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class WorkerTeamServiceImpl implements WorkerTeamService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WorkerTeamMapper workerTeamMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WorkerTeam> getWorkerTeam(WorkerTeam workerTeam) {
|
||||||
|
return workerTeamMapper.getWorkerTeamList(workerTeam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertWorkerTeam(WorkerTeam workerTeam) {
|
||||||
|
return workerTeamMapper.insertWorkerTeam(workerTeam);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -79,4 +79,14 @@
|
||||||
</set>
|
</set>
|
||||||
where worker_id = #{workerId}
|
where worker_id = #{workerId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="getByWorkIdList" resultMap="WorkerResult">
|
||||||
|
<include refid="selectWorker" />
|
||||||
|
<where>
|
||||||
|
and w.worker_id in
|
||||||
|
<foreach item="item" index="workIdList" collection="workIdList" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue