|
|
|
@ -4,9 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
|
|
|
|
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; |
|
|
|
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
@ -20,11 +17,12 @@ import org.springblade.core.mp.support.Condition; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.*; |
|
|
|
import org.springblade.core.tool.utils.*; |
|
|
|
|
|
|
|
import org.springblade.modules.desk.entity.CustomMadeInfo; |
|
|
|
import org.springblade.modules.desk.entity.Order; |
|
|
|
import org.springblade.modules.desk.entity.Order; |
|
|
|
|
|
|
|
import org.springblade.modules.desk.service.ICustomMadeInfoService; |
|
|
|
import org.springblade.modules.desk.service.IOrderService; |
|
|
|
import org.springblade.modules.desk.service.IOrderService; |
|
|
|
import org.springblade.modules.desk.vo.OrderExcelVO; |
|
|
|
import org.springblade.modules.desk.vo.OrderExcelVO; |
|
|
|
import org.springblade.modules.weixin.entity.WeChatAddress; |
|
|
|
import org.springblade.modules.weixin.entity.WeChatAddress; |
|
|
|
import org.springblade.modules.weixin.entity.WeChatUser; |
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
@ -45,12 +43,16 @@ public class OrderController { |
|
|
|
|
|
|
|
|
|
|
|
private final IOrderService orderService; |
|
|
|
private final IOrderService orderService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final ICustomMadeInfoService madeInfoService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 详情 |
|
|
|
* 详情 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@GetMapping("/detail") |
|
|
|
@GetMapping("/detail") |
|
|
|
public R<Order> detail(@RequestParam String id) { |
|
|
|
public R<Order> detail(@RequestParam String id) { |
|
|
|
Order detail = orderService.getById(id); |
|
|
|
Order detail = orderService.getById(id); |
|
|
|
|
|
|
|
List<CustomMadeInfo> list = madeInfoService.listByOrderNo(detail.getOrderNo()); |
|
|
|
|
|
|
|
detail.setFilledMadeInfoNum(Func.isEmpty(list) ? 0 : list.size()); |
|
|
|
return R.data(detail); |
|
|
|
return R.data(detail); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -59,21 +61,7 @@ public class OrderController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@GetMapping("/page") |
|
|
|
@GetMapping("/page") |
|
|
|
public R<IPage<Order>> page(Query query, String buyerName, String buyerPhone, String orderNo, String status) { |
|
|
|
public R<IPage<Order>> page(Query query, String buyerName, String buyerPhone, String orderNo, String status) { |
|
|
|
LambdaQueryWrapper<Order> wrapper = Wrappers.lambdaQuery(); |
|
|
|
IPage<Order> pages = orderService.pageWithMadeInfoCount(Condition.getPage(query), buyerName, buyerPhone, orderNo, status); |
|
|
|
if (Func.isNotEmpty(buyerName)) { |
|
|
|
|
|
|
|
wrapper.like(Order::getBuyerName, buyerName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Func.isNotEmpty(buyerPhone)) { |
|
|
|
|
|
|
|
wrapper.like(Order::getBuyerPhone, buyerPhone); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Func.isNotEmpty(orderNo)) { |
|
|
|
|
|
|
|
wrapper.like(Order::getOrderNo, orderNo); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Func.isNotEmpty(status)) { |
|
|
|
|
|
|
|
wrapper.eq(Order::getStatus, status); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IPage<Order> pages = orderService.page(Condition.getPage(query), wrapper); |
|
|
|
|
|
|
|
return R.data(pages); |
|
|
|
return R.data(pages); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -81,7 +69,7 @@ public class OrderController { |
|
|
|
* 导出 |
|
|
|
* 导出 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@GetMapping("/export") |
|
|
|
@GetMapping("/export") |
|
|
|
public void export(HttpServletResponse response, String buyerName, String buyerPhone, String orderNo) { |
|
|
|
public void export(HttpServletResponse response, String buyerName, String buyerPhone, String orderNo, String status) { |
|
|
|
LambdaQueryWrapper<Order> wrapper = Wrappers.lambdaQuery(); |
|
|
|
LambdaQueryWrapper<Order> wrapper = Wrappers.lambdaQuery(); |
|
|
|
if (Func.isNotEmpty(buyerName)) { |
|
|
|
if (Func.isNotEmpty(buyerName)) { |
|
|
|
wrapper.like(Order::getBuyerName, buyerName); |
|
|
|
wrapper.like(Order::getBuyerName, buyerName); |
|
|
|
@ -92,7 +80,11 @@ public class OrderController { |
|
|
|
if (Func.isNotEmpty(orderNo)) { |
|
|
|
if (Func.isNotEmpty(orderNo)) { |
|
|
|
wrapper.like(Order::getOrderNo, orderNo); |
|
|
|
wrapper.like(Order::getOrderNo, orderNo); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (Func.isNotEmpty(status)) { |
|
|
|
|
|
|
|
wrapper.eq(Order::getStatus, status); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wrapper.orderByDesc(Order::getCreateTime); |
|
|
|
List<Order> dataList = orderService.list(wrapper); |
|
|
|
List<Order> dataList = orderService.list(wrapper); |
|
|
|
|
|
|
|
|
|
|
|
List<OrderExcelVO> vos = new ArrayList<>(); |
|
|
|
List<OrderExcelVO> vos = new ArrayList<>(); |
|
|
|
|