pc发单流程
This commit is contained in:
parent
cea7d3301a
commit
b57a8383d2
|
|
@ -12,8 +12,10 @@ import com.ghy.common.enums.ImgType;
|
||||||
import com.ghy.common.utils.ExceptionUtil;
|
import com.ghy.common.utils.ExceptionUtil;
|
||||||
import com.ghy.common.utils.StringUtils;
|
import com.ghy.common.utils.StringUtils;
|
||||||
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.domain.CustomerAddress;
|
||||||
import com.ghy.customer.service.CustomerAddressService;
|
import com.ghy.customer.service.CustomerAddressService;
|
||||||
|
import com.ghy.customer.service.CustomerService;
|
||||||
import com.ghy.goods.domain.Goods;
|
import com.ghy.goods.domain.Goods;
|
||||||
import com.ghy.goods.domain.GoodsArea;
|
import com.ghy.goods.domain.GoodsArea;
|
||||||
import com.ghy.goods.domain.GoodsImgs;
|
import com.ghy.goods.domain.GoodsImgs;
|
||||||
|
|
@ -50,6 +52,7 @@ import com.ghy.worker.service.WorkerService;
|
||||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
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;
|
||||||
|
|
@ -57,9 +60,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -91,6 +92,10 @@ public class OrderMasterController extends BaseController {
|
||||||
private GoodsService goodsService;
|
private GoodsService goodsService;
|
||||||
@Resource
|
@Resource
|
||||||
private GoodsImgsService goodsImgsService;
|
private GoodsImgsService goodsImgsService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CustomerService customerService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private FinancialMasterService financialMasterService;
|
private FinancialMasterService financialMasterService;
|
||||||
@Resource
|
@Resource
|
||||||
|
|
@ -112,6 +117,20 @@ public class OrderMasterController extends BaseController {
|
||||||
return prefix;
|
return prefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改详细订单
|
||||||
|
*/
|
||||||
|
@GetMapping("/payQrcode/{orderId}")
|
||||||
|
public String payQrcode(@PathVariable("orderId") Long orderId, ModelMap mmap) {
|
||||||
|
mmap.put("orderId", orderId);
|
||||||
|
return "/order/master-qrcode";
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/pc")
|
||||||
|
public String orderPcMaster() {
|
||||||
|
return "order/pc-master";
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/app/list")
|
@PostMapping("/app/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo appList(@RequestBody OrderMaster orderMaster) {
|
public TableDataInfo appList(@RequestBody OrderMaster orderMaster) {
|
||||||
|
|
@ -588,40 +607,54 @@ public class OrderMasterController extends BaseController {
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(OrderMaster orderMaster) {
|
public TableDataInfo list(OrderMaster orderMaster) {
|
||||||
TableDataInfo rspData = new TableDataInfo();
|
|
||||||
startPage();
|
startPage();
|
||||||
List<OrderMasterResponseVo> orderMasterResponseVos = new ArrayList<>();
|
if (this.getSysUser().getDept().getParentId() != 101) {
|
||||||
|
orderMaster.setDeptId(this.getSysUser().getDept().getParentId());
|
||||||
|
}
|
||||||
List<OrderMaster> orderMasterList = orderMasterService.selectOrderMasterList(orderMaster);
|
List<OrderMaster> orderMasterList = orderMasterService.selectOrderMasterList(orderMaster);
|
||||||
for (OrderMaster master : orderMasterList) {
|
Set<Long> orderMasterIds = orderMasterList.stream().map(OrderMaster::getId).collect(Collectors.toSet());
|
||||||
OrderMasterResponseVo orderMasterResponseVo = new OrderMasterResponseVo();
|
|
||||||
// 将公共属性复制过去
|
|
||||||
BeanUtils.copyProperties(master, orderMasterResponseVo);
|
|
||||||
// 师傅信息
|
|
||||||
if (StringUtils.isNotNull(master.getWorkerId())) {
|
|
||||||
Worker worker = workerService.selectById(master.getWorkerId());
|
|
||||||
orderMasterResponseVo.setWorkerName(worker.getName());
|
|
||||||
}
|
|
||||||
// 消费者信息
|
|
||||||
CustomerAddress customerAddress = addressService.selectByCustomerAddressId(master.getAddressId());
|
|
||||||
orderMasterResponseVo.setCustomerName(customerAddress.getName());
|
|
||||||
|
|
||||||
orderMasterResponseVos.add(orderMasterResponseVo);
|
Set<Long> customerIds = orderMasterList.stream().map(OrderMaster::getCustomerId).collect(Collectors.toSet());
|
||||||
|
Map<Long, Customer> customerMap = customerService.selectByIds(customerIds)
|
||||||
|
.stream().collect(Collectors.toMap(Customer::getCustomerId, x -> x, (x, y) -> y));
|
||||||
|
|
||||||
|
List<FinancialMaster> financialMasters = financialMasterService.selectByOrderMasterIds(orderMasterIds);
|
||||||
|
Map<Long, FinancialMaster> financialMasterMap = financialMasters
|
||||||
|
.stream().collect(Collectors.toMap(FinancialMaster::getOrderMasterId, x -> x, (x, y) -> y));
|
||||||
|
|
||||||
|
Set<Long> goodsIds = orderMasterList.stream().map(OrderMaster::getGoodsId).collect(Collectors.toSet());
|
||||||
|
List<Goods> goods = goodsService.selectByIds(goodsIds);
|
||||||
|
Map<Long, Goods> goodsMap = goods.stream().collect(Collectors.toMap(Goods::getGoodsId, x -> x, (x, y) -> y));
|
||||||
|
|
||||||
|
Set<Long> workerIds = orderMasterList.stream().map(OrderMaster::getWorkerId).collect(Collectors.toSet());
|
||||||
|
workerIds.addAll(goods.stream().map(Goods::getWorkerId).collect(Collectors.toSet()));
|
||||||
|
Map<Long, Worker> workerMap = workerService.selectByIds(workerIds)
|
||||||
|
.stream().collect(Collectors.toMap(Worker::getWorkerId, x -> x, (x, y) -> y));
|
||||||
|
|
||||||
|
for (OrderMaster master : orderMasterList) {
|
||||||
|
Customer customer = customerMap.get(master.getCustomerId());
|
||||||
|
master.setWorker(workerMap.get(master.getWorkerId()));
|
||||||
|
if (customer != null) {
|
||||||
|
master.setCustomerName(customer.getName());
|
||||||
|
master.setCustomerPhone(customer.getPhone());
|
||||||
|
}
|
||||||
|
FinancialMaster fm = financialMasterMap.get(master.getId());
|
||||||
|
if (fm != null) {
|
||||||
|
master.setFinancialMasterMoney(fm.getPayMoney());
|
||||||
|
}
|
||||||
|
Goods good = goodsMap.get(master.getGoodsId());
|
||||||
|
if (good != null) {
|
||||||
|
master.setGoods(good);
|
||||||
|
}
|
||||||
|
// 地址信息
|
||||||
|
CustomerAddress customerAddress = addressService.selectByCustomerAddressId(master.getAddressId());
|
||||||
|
if (customerAddress != null) {
|
||||||
|
master.setAddressName(customerAddress.getName());
|
||||||
|
master.setAddressPhone(customerAddress.getPhone());
|
||||||
|
master.setAddress(customerAddress.getAddress());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 存在数据在进行数据查询处理。
|
return getDataTable(orderMasterList);
|
||||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
||||||
if (null == pageDomain.getPageNum() || null == pageDomain.getPageSize()) {
|
|
||||||
rspData.setRows(orderMasterResponseVos);
|
|
||||||
rspData.setTotal(orderMasterResponseVos.size());
|
|
||||||
return rspData;
|
|
||||||
}
|
|
||||||
int pageNum = (pageDomain.getPageNum() - 1) * 10;
|
|
||||||
int pageSize = pageDomain.getPageNum() * 10;
|
|
||||||
if (pageSize > orderMasterResponseVos.size()) {
|
|
||||||
pageSize = orderMasterResponseVos.size();
|
|
||||||
}
|
|
||||||
rspData.setRows(orderMasterResponseVos.subList(pageNum, pageSize));
|
|
||||||
rspData.setTotal(orderMasterResponseVos.size());
|
|
||||||
return rspData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "主订单管理", businessType = BusinessType.EXPORT)
|
@Log(title = "主订单管理", businessType = BusinessType.EXPORT)
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,77 @@ public class AlipayController extends BaseController {
|
||||||
return AjaxResult.success(map);
|
return AjaxResult.success(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/addMasterQr")
|
||||||
|
public AjaxResult addMasterQrPay(@RequestBody Long orderId) {
|
||||||
|
BigDecimal payMoney = BigDecimal.ZERO;
|
||||||
|
OrderMaster orderMaster = orderMasterService.selectById(orderId);
|
||||||
|
if (orderMaster == null) {
|
||||||
|
return AjaxResult.error("主订单不存在!");
|
||||||
|
}
|
||||||
|
// 查询主单是否有未支付的付款单
|
||||||
|
FinancialMaster fm = financialMasterService.selectByOrderMasterId(orderMaster.getId());
|
||||||
|
if (fm == null) {
|
||||||
|
return AjaxResult.error("财务单不存在!");
|
||||||
|
}
|
||||||
|
// 主单是否付款 没付款的话一起付
|
||||||
|
boolean fmPaid = Objects.equals(PayStatus.WAIT_PAY.getCode(), fm.getPayStatus());
|
||||||
|
if (fmPaid) {
|
||||||
|
payMoney = payMoney.add(fm.getPayMoney());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询关联的加价单
|
||||||
|
FinancialChangeRecord financialChangeRecord = null;
|
||||||
|
// FinancialChangeRecord financialChangeRecord = financialChangeRecordService.selectNotPayRecordByDetailId(orderDetailId);
|
||||||
|
// if (financialChangeRecord != null) {
|
||||||
|
// payMoney = payMoney.add(financialChangeRecord.getChangeMoney());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (BigDecimal.ZERO.compareTo(payMoney) > -1) {
|
||||||
|
// return AjaxResult.error("不需要支付");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 付款
|
||||||
|
PayParam payParam;
|
||||||
|
if (financialChangeRecord == null) {
|
||||||
|
payParam = PayParam.delayPayParam(orderMaster.getCode() + "_" + System.currentTimeMillis(),
|
||||||
|
payMoney.setScale(2, BigDecimal.ROUND_UNNECESSARY).toString(),
|
||||||
|
"订单支付", "叮咚到家服务");
|
||||||
|
} else {
|
||||||
|
payParam = PayParam.delayPayParam(orderMaster.getCode() + "_" + financialChangeRecord.getId() + "_" + System.currentTimeMillis(),
|
||||||
|
payMoney.setScale(2, BigDecimal.ROUND_UNNECESSARY).toString(),
|
||||||
|
"加价付款", "叮咚到家服务");
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject response;
|
||||||
|
try {
|
||||||
|
response = adapayService.alipayQrPay(orderMaster.getDeptId(), payParam, null, null, null);
|
||||||
|
} catch (BaseAdaPayException e) {
|
||||||
|
logger.error("创建支付失败: " + e.getMessage(), e);
|
||||||
|
return AjaxResult.error("网络不佳 请稍后再试");
|
||||||
|
}
|
||||||
|
boolean status = AdapayStatusEnum.succeeded.code.equals(response.getString("status"));
|
||||||
|
if (!status) {
|
||||||
|
logger.error("创建支付失败: {}", response.toJSONString());
|
||||||
|
return AjaxResult.error("网络不佳 请稍后再试");
|
||||||
|
}
|
||||||
|
// 支付二维码创建成功 保存一下paymentId
|
||||||
|
String paymentId = response.getString("id");
|
||||||
|
if (fmPaid) {
|
||||||
|
FinancialMaster fm2update = new FinancialMaster();
|
||||||
|
fm2update.setId(fm.getId());
|
||||||
|
fm2update.setPaymentId(paymentId);
|
||||||
|
fm2update.setPayType(PayTypeEnum.ALIPAY_QR.getCode());
|
||||||
|
financialMasterService.updateFinancialMaster(fm2update);
|
||||||
|
}
|
||||||
|
if (financialChangeRecord != null) {
|
||||||
|
FinancialChangeRecord fcr2update = new FinancialChangeRecord();
|
||||||
|
fcr2update.setId(financialChangeRecord.getId());
|
||||||
|
fcr2update.setPaymentId(paymentId);
|
||||||
|
financialChangeRecordService.update(fcr2update);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(response);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/addQr")
|
@PostMapping("/addQr")
|
||||||
public AjaxResult addQrPay(@RequestBody Long orderDetailId) {
|
public AjaxResult addQrPay(@RequestBody Long orderDetailId) {
|
||||||
BigDecimal payMoney = BigDecimal.ZERO;
|
BigDecimal payMoney = BigDecimal.ZERO;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('支付二维码')"/>
|
||||||
|
<th:block th:include="include :: layout-latest-css"/>
|
||||||
|
<style>
|
||||||
|
#payQrcode {
|
||||||
|
margin-left: 17px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div id="payQrcode"></div>
|
||||||
|
|
||||||
|
<th:block th:include="include :: footer"/>
|
||||||
|
<th:block th:include="include :: layout-latest-js"/>
|
||||||
|
<script th:src="@{/js/jquery.qrcode.min.js}"></script>
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var orderId = '[[${orderId}]]';
|
||||||
|
var prefix = ctx + "pay/ali";
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
dataType:"json",
|
||||||
|
url: prefix + "/addMasterQr",
|
||||||
|
data: orderId,
|
||||||
|
contentType: "application/json",
|
||||||
|
success: function (result) {
|
||||||
|
if (result.code == web_status.SUCCESS) {
|
||||||
|
$('#payQrcode').qrcode(result.data.expend.qrcode_url);
|
||||||
|
} else {
|
||||||
|
$.modal.msgError("数据加载错误,请重试!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -0,0 +1,567 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('发单列表')"/>
|
||||||
|
<th:block th:include="include :: layout-latest-css"/>
|
||||||
|
<th:block th:include="include :: ztree-css"/>
|
||||||
|
<th:block th:include="include :: datetimepicker-css" />
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#orderSearchBtnGroup {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#allOrServing {
|
||||||
|
width: 70px;
|
||||||
|
padding: 6px 9px;
|
||||||
|
height: 33px;
|
||||||
|
font-size: 14px;
|
||||||
|
border: 1px solid #e5e6e7;
|
||||||
|
background: #fff none;
|
||||||
|
border-radius: 4px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-board {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-board-no-wrap {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cx-select-input {
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.normal-select-input {
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.normal-input {
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.long-input {
|
||||||
|
width: 400px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
|
||||||
|
<div class="ui-layout-center">
|
||||||
|
<div class="container-div">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 search-collapse">
|
||||||
|
<form id="order-form" class="m">
|
||||||
|
<input type="hidden" id="deptId" name="deptId">
|
||||||
|
<input type="hidden" id="parentId" name="parentId">
|
||||||
|
<input type="hidden" id="orderStatus" name="orderStatus"/>
|
||||||
|
<div>
|
||||||
|
<select id="allOrServing">
|
||||||
|
<option value="">全部</option>
|
||||||
|
<option value="">在途</option>
|
||||||
|
</select>
|
||||||
|
<a class="btn btn-default btn-outline">
|
||||||
|
待付款
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline">
|
||||||
|
已发布
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline">
|
||||||
|
未约时
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline">
|
||||||
|
未排班
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="searchByOrderStatus(2)">
|
||||||
|
待上门
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="searchByOrderStatus(3)">
|
||||||
|
进行中
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="searchByOrderStatus(4)">
|
||||||
|
确认审核
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="searchByOrderStatus(5)">
|
||||||
|
完成
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="searchByOrderStatus(6)">
|
||||||
|
关闭
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
今日待上门
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
明日待上门
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
售后
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
急报中
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
退单
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
售后纠纷
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="flex-board">
|
||||||
|
<div class="flex-board m-t">
|
||||||
|
区域筛选:
|
||||||
|
<div id="areaCxSelect" class="flex-board-no-wrap">
|
||||||
|
<select class="province form-control cx-select-input m-r" name="province" id="province" data-first-title="选择省" onchange="selectRegion('province', 'city')"></select>
|
||||||
|
<select class="city form-control cx-select-input m-r" name="city" id="city" data-first-title="选择市" onchange="selectRegion('city', 'district')"></select>
|
||||||
|
<select class="district form-control cx-select-input m-r" name="district" id="district" data-first-title="选择区" onchange="selectRegion('district', 'street')"></select>
|
||||||
|
<select class="street form-control cx-select-input m-r" name="streetId" id="streetId" data-first-title="选择街道" ></select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex-board m-t">
|
||||||
|
创建时间:
|
||||||
|
<div class="input-group date">
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
<input type="text" class="form-control date-input" placeholder="开始日期">
|
||||||
|
</div>
|
||||||
|
至
|
||||||
|
<div class="input-group date m-r">
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
<input type="text" class="form-control date-input" placeholder="结束日期">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex-board m-t">
|
||||||
|
服务时间:
|
||||||
|
<div class="input-group date">
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
<input type="text" class="form-control date-input" placeholder="开始日期">
|
||||||
|
</div>
|
||||||
|
至
|
||||||
|
<div class="input-group date m-r">
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
<input type="text" class="form-control date-input" placeholder="结束日期">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex-board m-t">
|
||||||
|
完成时间:
|
||||||
|
<div class="input-group date">
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
<input type="text" class="form-control date-input" placeholder="开始日期">
|
||||||
|
</div>
|
||||||
|
至
|
||||||
|
<div class="input-group date m-r">
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
<input type="text" class="form-control date-input" placeholder="结束日期">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex-board m-t">
|
||||||
|
类别筛选:
|
||||||
|
<div id="categoryCxSelect" class="flex-board-no-wrap">
|
||||||
|
<select class="category1 form-control cx-select-input m-r" name="category1" id="category1" data-first-title="选择一类"></select>
|
||||||
|
<select class="category2 form-control cx-select-input m-r" name="category2" id="category2" data-first-title="选择二类"></select>
|
||||||
|
<select class="category3 form-control cx-select-input m-r" name="category3" id="category3" data-first-title="选择三类"></select>
|
||||||
|
<select class="category4 form-control cx-select-input m-r" name="category4" id="category4" data-first-title="选择四类" ></select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex-board-no-wrap m-t">
|
||||||
|
<label class="form-control-label">后台人员:</label>
|
||||||
|
<input type="text" class="form-control normal-input m-r">
|
||||||
|
</div>
|
||||||
|
<div class="flex-board-no-wrap m-t">
|
||||||
|
<label class="form-control-label">商家名称:</label>
|
||||||
|
<input type="text" class="form-control normal-input m-r">
|
||||||
|
</div>
|
||||||
|
<div class="flex-board-no-wrap m-t">
|
||||||
|
<label class="form-control-label">商家电话:</label>
|
||||||
|
<input type="text" class="form-control normal-input m-r">
|
||||||
|
</div>
|
||||||
|
<div class="flex-board-no-wrap m-t">
|
||||||
|
<label class="form-control-label">接单师傅名称:</label>
|
||||||
|
<input type="text" class="form-control normal-input m-r">
|
||||||
|
</div>
|
||||||
|
<div class="flex-board-no-wrap m-t">
|
||||||
|
<label class="form-control-label">接单师傅电话:</label>
|
||||||
|
<input type="text" class="form-control normal-input m-r">
|
||||||
|
</div>
|
||||||
|
<div class="flex-board-no-wrap m-t">
|
||||||
|
<label class="form-control-label">师傅类型:</label>
|
||||||
|
<select class="form-control normal-select-input m-r">
|
||||||
|
<option value="">全部</option>
|
||||||
|
<option value="">大师傅</option>
|
||||||
|
<option value="">小师傅</option>
|
||||||
|
</select>
|
||||||
|
<input type="text" class="form-control normal-input m-r" placeholder="师傅姓名电话">
|
||||||
|
</div>
|
||||||
|
<div class="flex-board-no-wrap m-t">
|
||||||
|
<label class="form-control-label">订单模式:</label>
|
||||||
|
<select id="orderMode" class="form-control normal-select-input m-r" onchange="changeOrderMode(this.options[this.options.selectedIndex].value)">
|
||||||
|
<option value="0">全部</option>
|
||||||
|
<option value="B2B">B2B</option>
|
||||||
|
<option value="B2C">B2C</option>
|
||||||
|
</select>
|
||||||
|
<select id="B2BOptions" class="form-control normal-select-input m-r">
|
||||||
|
<option value="">全部</option>
|
||||||
|
<option value="">常规单</option>
|
||||||
|
<option value="">赠送单</option>
|
||||||
|
<option value="">合规单</option>
|
||||||
|
</select>
|
||||||
|
<select id="B2COptions" class="form-control normal-select-input m-r">
|
||||||
|
<option value="">全部</option>
|
||||||
|
<option value="">商品配件类目</option>
|
||||||
|
<option value="">服务类目</option>
|
||||||
|
<option value="">社区类目</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="flex-board-no-wrap m-t">
|
||||||
|
<label class="form-control-label">订单标签:</label>
|
||||||
|
<select class="form-control normal-select-input m-r">
|
||||||
|
<option value="">全部</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="flex-board-no-wrap m-t">
|
||||||
|
<label class="form-control-label">订单查询:</label>
|
||||||
|
<input type="text" class="form-control long-input m-r" placeholder="请输入订单号、姓名、电话或地址、品牌、规格">
|
||||||
|
</div>
|
||||||
|
<div class="m-t">
|
||||||
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
|
||||||
|
class="fa fa-search"></i> 搜索</a>
|
||||||
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
|
||||||
|
class="fa fa-refresh"></i> 重置</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="m-t">
|
||||||
|
<a class="btn btn-default btn-outline" onclick="searchByOrderStatus(0)">
|
||||||
|
新订单
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
接单超时
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
约单超时
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
排单超时
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
无法排单
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
待上门超时
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
进行超时
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
售后超时
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
客诉中
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
审核中
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-default btn-outline" onclick="">
|
||||||
|
一票价未改价
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
|
<div class="btn-group-sm" role="group">
|
||||||
|
<a class="btn btn-warning" onclick="$.table.exportExcel()"
|
||||||
|
shiro:hasPermission="order:order:export">
|
||||||
|
<i class="fa fa-download"></i> 导出
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-12 select-table table-striped">
|
||||||
|
<table id="bootstrap-table"></table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<th:block th:include="include :: footer"/>
|
||||||
|
<th:block th:include="include :: layout-latest-js"/>
|
||||||
|
<th:block th:include="include :: ztree-js"/>
|
||||||
|
<th:block th:include="include :: jquery-cxselect-js" />
|
||||||
|
<th:block th:include="include :: datetimepicker-js" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var payTypes = [[${@dict.getType('pay_type')}]];
|
||||||
|
var orderTypes = [[${@dict.getType('goods_category_type')}]];
|
||||||
|
var payStatus = [[${@dict.getType('pay_status')}]];
|
||||||
|
var orderStatus = [[${@dict.getType('order_status')}]];
|
||||||
|
|
||||||
|
var editFlag = [[${@permission.hasPermi('order:order:edit')}]];
|
||||||
|
var prefix = ctx + "order/master";
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
var panehHidden = false;
|
||||||
|
if ($(this).width() < 769) {
|
||||||
|
panehHidden = true;
|
||||||
|
}
|
||||||
|
$('body').layout({initClosed: panehHidden, west__size: 185});
|
||||||
|
// 回到顶部绑定
|
||||||
|
if ($.fn.toTop !== undefined) {
|
||||||
|
var opt = {
|
||||||
|
win: $('.ui-layout-center'),
|
||||||
|
doc: $('.ui-layout-center')
|
||||||
|
};
|
||||||
|
$('#scroll-up').toTop(opt);
|
||||||
|
}
|
||||||
|
queryOrderList();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
dataType:"json",
|
||||||
|
url: ctx + "system/area/list",
|
||||||
|
success: function (result) {
|
||||||
|
if (result.code == web_status.SUCCESS) {
|
||||||
|
$('#areaCxSelect').cxSelect({
|
||||||
|
selects: ['province', 'city', 'district', 'street'],
|
||||||
|
jsonValue: 'areaId',
|
||||||
|
jsonName: 'areaName',
|
||||||
|
data: result.data
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$.modal.msgError("数据加载错误,请重试!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
$(".date-input").datetimepicker({
|
||||||
|
format: "yyyy-mm-dd",
|
||||||
|
minView: "month",
|
||||||
|
autoclose: true
|
||||||
|
});
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
dataType:"json",
|
||||||
|
url: ctx + "goods/deptcategory/app/list",
|
||||||
|
data: JSON.stringify({deptId: 101, goodsCategoryId: 1}),
|
||||||
|
contentType: 'application/json',
|
||||||
|
success: function (result) {
|
||||||
|
if (result.code == web_status.SUCCESS) {
|
||||||
|
$('#categoryCxSelect').cxSelect({
|
||||||
|
selects: ['category1', 'category2', 'category3', 'category4'],
|
||||||
|
jsonValue: 'deptGoodsCategoryId',
|
||||||
|
jsonName: 'goodsCategoryName',
|
||||||
|
jsonSub: 'child',
|
||||||
|
data: result.data
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$.modal.msgError("数据加载错误,请重试!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
changeOrderMode();
|
||||||
|
});
|
||||||
|
|
||||||
|
function changeOrderMode(orderMode) {
|
||||||
|
if (orderMode === 'B2B') {
|
||||||
|
$("#B2BOptions").show();
|
||||||
|
$("#B2COptions").hide();
|
||||||
|
} else if (orderMode === 'B2C') {
|
||||||
|
$("#B2BOptions").hide();
|
||||||
|
$("#B2COptions").show();
|
||||||
|
} else {
|
||||||
|
$("#B2BOptions").hide();
|
||||||
|
$("#B2COptions").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function selectRegion(regionLevelName, nextRegionLevelName) {
|
||||||
|
var regionId = $("#" + regionLevelName).val();
|
||||||
|
if ($.common.isEmpty(regionId)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Ajax调用处理
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
dataType:"json",
|
||||||
|
url: ctx + "system/area/list",
|
||||||
|
data: {parentCode: regionId},
|
||||||
|
success: function (result) {
|
||||||
|
if (result.code == web_status.SUCCESS) {
|
||||||
|
$('#areaCxSelect').cxSelect({
|
||||||
|
selects: [nextRegionLevelName],
|
||||||
|
jsonValue: 'areaId',
|
||||||
|
jsonName: 'areaName',
|
||||||
|
data: result.data
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$.modal.msgError("数据加载错误,请重试!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function queryOrderList() {
|
||||||
|
var options = {
|
||||||
|
url: prefix + "/list",
|
||||||
|
exportUrl: prefix + "/export",
|
||||||
|
sortName: "createTime",
|
||||||
|
sortOrder: "desc",
|
||||||
|
modalName: "订单",
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: '订单ID',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'goods',
|
||||||
|
title: '订单信息',
|
||||||
|
formatter: function (value, row) {
|
||||||
|
return '<div style="display:flex;justify-content: center;align-items: center;">'
|
||||||
|
// + '<img decoding="async" src="' + value.goodsImgUrl + '" width="100" height="100" />'
|
||||||
|
+ '<div>'
|
||||||
|
+ '<small> 订单编号:' + row.code + '<small/> <br>'
|
||||||
|
// + '<h4> ' + value.goodsName + '<h4/>'
|
||||||
|
// + '<small> ' + value.goodsDesc + '</small> <br>'
|
||||||
|
+ '<small> 联系人:' + row.addressName + '</small> <br>'
|
||||||
|
+ '<small> 联系电话:' + row.addressPhone + '</small> <br>'
|
||||||
|
+ '<small> 联系地址:' + row.address + '</small> <br>'
|
||||||
|
+ '<small> 下单时间:' + row.createTime + '</small> <br>'
|
||||||
|
+ '<small> 预约时间:' + row.expectTimeStart + ' - ' + row.expectTimeEnd + '</small> <br>'
|
||||||
|
+ '<small> 总金额:' + row.financialMasterMoney + '元</small> <br>'
|
||||||
|
+ '</div>'
|
||||||
|
+ '</div>';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'orderStatus',
|
||||||
|
title: '订单状态',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return $.table.selectDictLabel(orderStatus, value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'worker',
|
||||||
|
title: '接单信息',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
<!-- return '<small>' + value.name + value.phone + '</small><br>'-->
|
||||||
|
<!-- + '<small>接单时间:' + row.revTime + '</small>';-->
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
align: 'left',
|
||||||
|
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"></i>查看</a> ');
|
||||||
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="orderDetailReject(\'' + row.id + '\')"></i>师傅退单</a> ');
|
||||||
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="orderMasterReject(\'' + row.orderMasterId + '\')"></i>商家退单</a> ');
|
||||||
|
if (row.payStatus == 0) {
|
||||||
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="showPayQrcode(\'' + row.id + '\')"></i>付款</a> ');
|
||||||
|
}
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'goodsWorker',
|
||||||
|
title: '商家信息',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
<!-- return '<small>' + value.name + '</small><br>'-->
|
||||||
|
<!-- + '<small>' + value.phone + '</small>';-->
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'changeMoney',
|
||||||
|
title: '商家追加金额',
|
||||||
|
align: 'center'
|
||||||
|
},{
|
||||||
|
field: 'orderType',
|
||||||
|
title: '订单类型',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return $.table.selectDictLabel(orderTypes, value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'payType',
|
||||||
|
title: '付款类型',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return $.table.selectDictLabel(payTypes, value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'payStatus',
|
||||||
|
title: '付款状态',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return $.table.selectDictLabel(payStatus, value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'payTime',
|
||||||
|
title: '付款时间'
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
$.table.init(options);
|
||||||
|
}
|
||||||
|
|
||||||
|
function detail(id) {
|
||||||
|
var url = "order/goods?orderId=" + id;
|
||||||
|
$.modal.open("商品信息", url);
|
||||||
|
}
|
||||||
|
function orderDetailReject(id) {
|
||||||
|
$.modal.confirm("确定要退单吗?", function() {
|
||||||
|
const url = "detail/reject";
|
||||||
|
const data = { "id": id };
|
||||||
|
$.operate.post(url, data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function orderMasterReject(id) {
|
||||||
|
$.modal.confirm("确定要退单吗?", function() {
|
||||||
|
const url = "master/reject";
|
||||||
|
const data = { "id": id };
|
||||||
|
$.operate.post(url, data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function searchByOrderStatus(orderStatus) {
|
||||||
|
$('#orderStatus').val(orderStatus);
|
||||||
|
$.table.search();
|
||||||
|
}
|
||||||
|
|
||||||
|
function showPayQrcode(id) {
|
||||||
|
var url = "payQrcode/" + id;
|
||||||
|
<!-- $.modal.open("支付二维码", url, 290, 360);-->
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
area: ['290px', '360px'],
|
||||||
|
fix: false,
|
||||||
|
//不固定
|
||||||
|
maxmin: true,
|
||||||
|
shade: 0.3,
|
||||||
|
title: '支付二维码',
|
||||||
|
content: url,
|
||||||
|
btn: ['关闭'],
|
||||||
|
// 弹层外区域关闭
|
||||||
|
shadeClose: true,
|
||||||
|
cancel: function(index) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
@ -6,11 +6,13 @@ import com.ghy.common.core.domain.BaseEntity;
|
||||||
import com.ghy.common.enums.OrderStatus;
|
import com.ghy.common.enums.OrderStatus;
|
||||||
import com.ghy.common.enums.PayStatus;
|
import com.ghy.common.enums.PayStatus;
|
||||||
import com.ghy.common.enums.PayTypeEnum;
|
import com.ghy.common.enums.PayTypeEnum;
|
||||||
|
import com.ghy.goods.domain.Goods;
|
||||||
import com.ghy.payment.domain.FinancialMaster;
|
import com.ghy.payment.domain.FinancialMaster;
|
||||||
import com.ghy.worker.domain.Worker;
|
import com.ghy.worker.domain.Worker;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -78,6 +80,10 @@ public class OrderMaster extends BaseEntity {
|
||||||
|
|
||||||
private Worker worker;
|
private Worker worker;
|
||||||
|
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
private String customerPhone;
|
||||||
|
|
||||||
private FinancialMaster financialMaster;
|
private FinancialMaster financialMaster;
|
||||||
|
|
||||||
private OrderGoods orderGoods;
|
private OrderGoods orderGoods;
|
||||||
|
|
@ -114,6 +120,16 @@ public class OrderMaster extends BaseEntity {
|
||||||
|
|
||||||
private List<Long> exceptOrderMasterIds;
|
private List<Long> exceptOrderMasterIds;
|
||||||
|
|
||||||
|
private BigDecimal financialMasterMoney;
|
||||||
|
|
||||||
|
private Goods goods;
|
||||||
|
|
||||||
|
private String addressPhone;
|
||||||
|
|
||||||
|
private String addressName;
|
||||||
|
|
||||||
|
private String address;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否超时 1=是 0=否
|
* 是否超时 1=是 0=否
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue