no message
This commit is contained in:
parent
40ba4652be
commit
f66ee72314
|
|
@ -1511,7 +1511,10 @@ public class OrderController extends BaseController {
|
||||||
Collections.sort(orderListResponses, new Comparator<OrderListResponse>() {
|
Collections.sort(orderListResponses, new Comparator<OrderListResponse>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(OrderListResponse o1, OrderListResponse o2) {
|
public int compare(OrderListResponse o1, OrderListResponse o2) {
|
||||||
return o2.getUpdateTime().compareTo(o1.getUpdateTime());
|
// 如果updateTime为null,则使用createTime代替
|
||||||
|
Date o1Time = o1.getUpdateTime() != null ? o1.getUpdateTime() : o1.getCreateTime();
|
||||||
|
Date o2Time = o2.getUpdateTime() != null ? o2.getUpdateTime() : o2.getCreateTime();
|
||||||
|
return o2Time.compareTo(o1Time);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -2297,7 +2300,11 @@ public class OrderController extends BaseController {
|
||||||
afterServiceRecord.setExcludeAfterServiceFinished(true);
|
afterServiceRecord.setExcludeAfterServiceFinished(true);
|
||||||
List<AfterServiceRecord> afterServiceRecordList
|
List<AfterServiceRecord> afterServiceRecordList
|
||||||
=afterServiceRecordService.selectAfterServiceRecordList(afterServiceRecord);
|
=afterServiceRecordService.selectAfterServiceRecordList(afterServiceRecord);
|
||||||
orderListResponse.setShowAfterServiceRecord( 1);
|
if (detail.getAfterServiceStatus()==2||detail.getAfterServiceStatus()==3) {
|
||||||
|
orderListResponse.setShowAfterServiceRecord( 0);
|
||||||
|
} else{
|
||||||
|
orderListResponse.setShowAfterServiceRecord( 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 编辑返回属性
|
// 编辑返回属性
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.ghy.common.constant.UserConstants;
|
||||||
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.core.page.TableDataInfo;
|
import com.ghy.common.core.page.TableDataInfo;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.ghy.common.enums.*;
|
import com.ghy.common.enums.*;
|
||||||
import com.ghy.common.utils.*;
|
import com.ghy.common.utils.*;
|
||||||
import com.ghy.common.utils.poi.ExcelUtil;
|
import com.ghy.common.utils.poi.ExcelUtil;
|
||||||
|
|
@ -188,10 +189,14 @@ public class OrderDetailController extends BaseController {
|
||||||
return getDataTable(new ArrayList<>());
|
return getDataTable(new ArrayList<>());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
startPage();
|
|
||||||
if (this.getSysUser().getDept().getParentId() != 101) {
|
if (this.getSysUser().getDept().getParentId() != 101) {
|
||||||
orderDetail.setDeptId(this.getSysUser().getDept().getParentId());
|
orderDetail.setDeptId(this.getSysUser().getDept().getParentId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 手动分页:先获取总数,再进行分页查询
|
||||||
|
Long total = orderDetailService.selectOrderDetailCount(orderDetail);
|
||||||
|
startPage();
|
||||||
List<OrderDetail> orderDetails = orderDetailService.selectOrderDetailList(orderDetail);
|
List<OrderDetail> orderDetails = orderDetailService.selectOrderDetailList(orderDetail);
|
||||||
|
|
||||||
Set<Long> customerIds = orderDetails.stream().map(OrderDetail::getCustomerId).collect(Collectors.toSet());
|
Set<Long> customerIds = orderDetails.stream().map(OrderDetail::getCustomerId).collect(Collectors.toSet());
|
||||||
|
|
@ -328,7 +333,12 @@ public class OrderDetailController extends BaseController {
|
||||||
detail.setOrderImgs(stringBuilder.toString());
|
detail.setOrderImgs(stringBuilder.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return getDataTable(orderDetails);
|
// 使用手动获取的总数返回正确的分页信息
|
||||||
|
TableDataInfo rspData = new TableDataInfo();
|
||||||
|
rspData.setCode(0);
|
||||||
|
rspData.setRows(orderDetails);
|
||||||
|
rspData.setTotal(total);
|
||||||
|
return rspData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -425,6 +435,7 @@ public class OrderDetailController extends BaseController {
|
||||||
// 财务信息
|
// 财务信息
|
||||||
FinancialDetail financialDetail = financialDetailService.selectByOrderDetailId(detail.getId());
|
FinancialDetail financialDetail = financialDetailService.selectByOrderDetailId(detail.getId());
|
||||||
BigDecimal detailPayMoney = financialDetail.getPayMoney();
|
BigDecimal detailPayMoney = financialDetail.getPayMoney();
|
||||||
|
|
||||||
// 查询子单加价记录
|
// 查询子单加价记录
|
||||||
// FinancialChangeRecord changeRecordQry = new FinancialChangeRecord();
|
// FinancialChangeRecord changeRecordQry = new FinancialChangeRecord();
|
||||||
// changeRecordQry.setOrderDetailId(detail.getId());
|
// changeRecordQry.setOrderDetailId(detail.getId());
|
||||||
|
|
@ -462,7 +473,7 @@ public class OrderDetailController extends BaseController {
|
||||||
orderStandard.setWaitServerNum(orderStandard.getStandardNum() - orderStandard.getServerNum());
|
orderStandard.setWaitServerNum(orderStandard.getStandardNum() - orderStandard.getServerNum());
|
||||||
standardList.add(orderStandard);
|
standardList.add(orderStandard);
|
||||||
}
|
}
|
||||||
if (this.checkIsOnlyServer(orderMaster.getId(), orderMaster.getWorkerId())) {
|
if (this.checkIsOnlyServer(orderMaster.getId(), orderMaster.getWorkerId())) {
|
||||||
BigDecimal workerFee = financialMaster.getPayMoney();
|
BigDecimal workerFee = financialMaster.getPayMoney();
|
||||||
List<FinancialDetail> financialDetailList = financialDetailService.selectByFinancialMasterId(financialMaster.getId());
|
List<FinancialDetail> financialDetailList = financialDetailService.selectByFinancialMasterId(financialMaster.getId());
|
||||||
for (FinancialDetail param : financialDetailList) {
|
for (FinancialDetail param : financialDetailList) {
|
||||||
|
|
@ -483,6 +494,26 @@ public class OrderDetailController extends BaseController {
|
||||||
AfterServiceRecord afterServiceRecord = new AfterServiceRecord();
|
AfterServiceRecord afterServiceRecord = new AfterServiceRecord();
|
||||||
afterServiceRecord.setOrderDetailId(detail.getId());
|
afterServiceRecord.setOrderDetailId(detail.getId());
|
||||||
List<AfterServiceRecord> afterServiceRecordList = afterServiceRecordService.selectAfterServiceRecordList(afterServiceRecord);
|
List<AfterServiceRecord> afterServiceRecordList = afterServiceRecordService.selectAfterServiceRecordList(afterServiceRecord);
|
||||||
|
if (CollectionUtils.isNotEmpty(afterServiceRecordList)) {
|
||||||
|
// 计算平台退款金额总和
|
||||||
|
BigDecimal totalPlatformRefund = BigDecimal.ZERO;
|
||||||
|
for (AfterServiceRecord record : afterServiceRecordList) {
|
||||||
|
if (record.getPlatformRefund() != null) {
|
||||||
|
totalPlatformRefund = totalPlatformRefund.add(record.getPlatformRefund());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 从detailPayMoney中减去平台退款金额
|
||||||
|
if (totalPlatformRefund.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
orderListResponse.setPayAddMoney(detailPayMoney.subtract(totalPlatformRefund));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 查询加价记录
|
// 查询加价记录
|
||||||
FinancialChangeRecord changeRecordQry = new FinancialChangeRecord();
|
FinancialChangeRecord changeRecordQry = new FinancialChangeRecord();
|
||||||
|
|
@ -685,7 +716,12 @@ public class OrderDetailController extends BaseController {
|
||||||
.map(attachMoney -> attachMoney.multiply(rate).setScale(2, RoundingMode.DOWN))
|
.map(attachMoney -> attachMoney.multiply(rate).setScale(2, RoundingMode.DOWN))
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
}
|
}
|
||||||
|
BigDecimal platformRefundMoney = BigDecimal.ZERO;
|
||||||
|
if (afterServiceRecord.getPlatformRefund()!=null) {
|
||||||
|
platformRefundMoney=afterServiceRecord.getPlatformRefund();
|
||||||
|
}
|
||||||
logger.info("是否支付{}加价的金额{}配件费{}总服务金额为{}", changeRecords, workerFee, attachmentMoney, orderListResponse.getPayMoney().add(workerFee).add(attachmentMoney));
|
logger.info("是否支付{}加价的金额{}配件费{}总服务金额为{}", changeRecords, workerFee, attachmentMoney, orderListResponse.getPayMoney().add(workerFee).add(attachmentMoney));
|
||||||
|
|
||||||
orderListResponse.setPayAddMoney(orderListResponse.getPayMoney().add(workerFee).add(attachmentMoney));
|
orderListResponse.setPayAddMoney(orderListResponse.getPayMoney().add(workerFee).add(attachmentMoney));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -992,6 +992,7 @@ public class OrderMasterController extends BaseController {
|
||||||
@PostMapping("/app/list")
|
@PostMapping("/app/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo appList(@RequestBody OrderMaster orderMaster) {
|
public TableDataInfo appList(@RequestBody OrderMaster orderMaster) {
|
||||||
|
logger.info("appList orderMaster:{}", orderMaster);
|
||||||
// TableDataInfo rspData = new TableDataInfo();
|
// TableDataInfo rspData = new TableDataInfo();
|
||||||
List<OrderListResponse> orderListResponses = new ArrayList<>();
|
List<OrderListResponse> orderListResponses = new ArrayList<>();
|
||||||
// 入参中的城市id存在时,查询符合条件的地址id
|
// 入参中的城市id存在时,查询符合条件的地址id
|
||||||
|
|
@ -1015,17 +1016,25 @@ public class OrderMasterController extends BaseController {
|
||||||
// if (orderMaster.getOrderStatus()==OrderStatus.FINISH_CHECK.code()){
|
// if (orderMaster.getOrderStatus()==OrderStatus.FINISH_CHECK.code()){
|
||||||
// orderMaster.setOrderStatuses();
|
// orderMaster.setOrderStatuses();
|
||||||
// }
|
// }
|
||||||
|
if (orderMaster.getOrderType() != null && orderMaster.getOrderType() == 0&&orderMaster.getFrom().equals("customer")) {
|
||||||
|
orderMaster.setExcludeGoodsOrder(true);
|
||||||
|
}
|
||||||
List<OrderMaster> list = orderMasterService.selectOrderMasterList(orderMaster);
|
List<OrderMaster> list = orderMasterService.selectOrderMasterList(orderMaster);
|
||||||
|
Long count=orderMasterService.selectOrderMasterCount(orderMaster);
|
||||||
|
logger.info("初始 list数量:{},总数{}", list.size(),count);
|
||||||
|
|
||||||
// 处理orderType为0的情况,额外查询原师傅ID相关的订单并添加到list中
|
// 处理orderType为0的情况,额外查询原师傅ID相关的订单并添加到list中
|
||||||
OrderMaster origiOrderMaster = new OrderMaster();
|
OrderMaster origiOrderMaster = new OrderMaster();
|
||||||
if (orderMaster.getOrderType() == 0 && orderMaster.getWorkerId() != null
|
if (orderMaster.getOrderType() == 0 && orderMaster.getWorkerId() != null
|
||||||
&& orderMaster.getWorkerId() != -1 && orderMaster.getIsMonitoredOrder() == true) {
|
&& orderMaster.getWorkerId() != -1 && orderMaster.getIsMonitoredOrder() == true) {
|
||||||
origiOrderMaster.setOriginalWorkerId(orderMaster.getWorkerId());
|
origiOrderMaster.setOriginalWorkerId(orderMaster.getWorkerId());
|
||||||
|
// origiOrderMaster.setFrom(orderMaster.getFrom());
|
||||||
// 修复:将原始请求的isMonitoredOrder属性复制到额外查询中,确保过滤条件一致
|
// 修复:将原始请求的isMonitoredOrder属性复制到额外查询中,确保过滤条件一致
|
||||||
// origiOrderMaster.setShowInMonitor(orderMaster.getIsMonitoredOrder());
|
// origiOrderMaster.setShowInMonitor(orderMaster.getIsMonitoredOrder());
|
||||||
origiOrderMaster.setOrderStatuses("0,1,2,3,4");
|
origiOrderMaster.setOrderStatuses("0,1,2,3,4");
|
||||||
List<OrderMaster> originalList = orderMasterService.selectOrderMasterList(origiOrderMaster);
|
List<OrderMaster> originalList = orderMasterService.selectOrderMasterList(origiOrderMaster);
|
||||||
|
// 对额外查询的结果也应用相同的过滤条件
|
||||||
|
|
||||||
list.addAll(originalList);
|
list.addAll(originalList);
|
||||||
list.sort((o1, o2) -> {
|
list.sort((o1, o2) -> {
|
||||||
if (o1.getUpdateTimeAlias() == null && o2.getUpdateTimeAlias() == null) return 0;
|
if (o1.getUpdateTimeAlias() == null && o2.getUpdateTimeAlias() == null) return 0;
|
||||||
|
|
@ -1076,7 +1085,7 @@ public class OrderMasterController extends BaseController {
|
||||||
List<Goods> goodsList = goodsService.selectByIds(goodsIds);
|
List<Goods> goodsList = goodsService.selectByIds(goodsIds);
|
||||||
goodsList.forEach(goods -> goodsMap.put(goods.getGoodsId(), goods));
|
goodsList.forEach(goods -> goodsMap.put(goods.getGoodsId(), goods));
|
||||||
}
|
}
|
||||||
|
logger.info("list:数量{}", list.size());
|
||||||
list.forEach(master -> {
|
list.forEach(master -> {
|
||||||
// 子单
|
// 子单
|
||||||
List<OrderDetail> detailList = orderDetailService.selectByOrderMasterId(master.getId());
|
List<OrderDetail> detailList = orderDetailService.selectByOrderMasterId(master.getId());
|
||||||
|
|
@ -1748,6 +1757,27 @@ public class OrderMasterController extends BaseController {
|
||||||
FinancialMaster financialMaster = financialMasterService.selectByOrderMasterId(orderMaster.getId());
|
FinancialMaster financialMaster = financialMasterService.selectByOrderMasterId(orderMaster.getId());
|
||||||
// 计算总额
|
// 计算总额
|
||||||
BigDecimal totalPayMoney = financialMaster.getPayMoney();
|
BigDecimal totalPayMoney = financialMaster.getPayMoney();
|
||||||
|
|
||||||
|
// 扣减平台退款金额
|
||||||
|
BigDecimal totalPlatformRefundMoney = BigDecimal.ZERO;
|
||||||
|
for (OrderDetail orderDetail : orderDetailList) {
|
||||||
|
AfterServiceRecord afterServiceRecordQuery = new AfterServiceRecord();
|
||||||
|
afterServiceRecordQuery.setOrderDetailId(orderDetail.getId());
|
||||||
|
List<AfterServiceRecord> afterServiceRecords = afterServiceRecordService
|
||||||
|
.selectAfterServiceRecordList(afterServiceRecordQuery);
|
||||||
|
if (CollectionUtils.isNotEmpty(afterServiceRecords)) {
|
||||||
|
for (AfterServiceRecord record : afterServiceRecords) {
|
||||||
|
if (record.getPlatformRefund() != null && record.getPlatformRefund().compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
totalPlatformRefundMoney = totalPlatformRefundMoney.add(record.getPlatformRefund());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (totalPlatformRefundMoney.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
totalPayMoney = totalPayMoney.subtract(totalPlatformRefundMoney);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BigDecimal leaderMoney = BigDecimal.ZERO;
|
BigDecimal leaderMoney = BigDecimal.ZERO;
|
||||||
for (OrderDetail orderDetail : orderDetailList) {
|
for (OrderDetail orderDetail : orderDetailList) {
|
||||||
List<OrderStandard> standardList = new ArrayList<>();
|
List<OrderStandard> standardList = new ArrayList<>();
|
||||||
|
|
@ -1901,6 +1931,7 @@ public class OrderMasterController extends BaseController {
|
||||||
Worker goodsWorker =new Worker();
|
Worker goodsWorker =new Worker();
|
||||||
OrderMaster goodsOrderMaster =null;
|
OrderMaster goodsOrderMaster =null;
|
||||||
WorkerCertification goodsWorkerRealInfo = null;
|
WorkerCertification goodsWorkerRealInfo = null;
|
||||||
|
Integer goodsPayStatus = null;
|
||||||
|
|
||||||
// 消费者信息
|
// 消费者信息
|
||||||
// Customer customer =
|
// Customer customer =
|
||||||
|
|
@ -1915,6 +1946,7 @@ public class OrderMasterController extends BaseController {
|
||||||
goodsWorkerRealInfo = workerCertificationService.selectByWorkerId(goodsOrderMaster.getWorkerId());
|
goodsWorkerRealInfo = workerCertificationService.selectByWorkerId(goodsOrderMaster.getWorkerId());
|
||||||
orderStandardList=orderGoodsService.selectByOrderMasterId(goodsOrderMaster.getId());
|
orderStandardList=orderGoodsService.selectByOrderMasterId(goodsOrderMaster.getId());
|
||||||
orderListResponse.setOriginalOrderMasterCode(goodsOrderMaster.getCode());
|
orderListResponse.setOriginalOrderMasterCode(goodsOrderMaster.getCode());
|
||||||
|
goodsPayStatus=goodsOrderMaster.getPayStatus();
|
||||||
}
|
}
|
||||||
if (masterWorker != null) {
|
if (masterWorker != null) {
|
||||||
// 大师傅实名信息
|
// 大师傅实名信息
|
||||||
|
|
@ -2039,7 +2071,7 @@ public class OrderMasterController extends BaseController {
|
||||||
org.apache.commons.lang3.StringUtils.isNotEmpty(orderMaster.getPhone()) ? orderMaster.getPhone()
|
org.apache.commons.lang3.StringUtils.isNotEmpty(orderMaster.getPhone()) ? orderMaster.getPhone()
|
||||||
: customerAddress.getPhone());
|
: customerAddress.getPhone());
|
||||||
orderListResponse.setOrderStatus(orderMaster.getOrderStatus());
|
orderListResponse.setOrderStatus(orderMaster.getOrderStatus());
|
||||||
orderListResponse.setPayStatus(orderMaster.getPayStatus());
|
orderListResponse.setPayStatus(goodsPayStatus!=null?goodsPayStatus:orderMaster.getPayStatus());
|
||||||
orderListResponse.setPayType(orderMaster.getPayType());
|
orderListResponse.setPayType(orderMaster.getPayType());
|
||||||
orderListResponse.setStandardList(standardList);
|
orderListResponse.setStandardList(standardList);
|
||||||
orderListResponse.setAddress(completeAddress);
|
orderListResponse.setAddress(completeAddress);
|
||||||
|
|
@ -2139,7 +2171,6 @@ public class OrderMasterController extends BaseController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
startPage();
|
|
||||||
// 非管理员
|
// 非管理员
|
||||||
if (this.getSysUser().getRoles().get(0).getRoleId() != 1) {
|
if (this.getSysUser().getRoles().get(0).getRoleId() != 1) {
|
||||||
orderMaster.setDeptId(this.getSysUser().getDeptId());
|
orderMaster.setDeptId(this.getSysUser().getDeptId());
|
||||||
|
|
@ -2148,6 +2179,11 @@ public class OrderMasterController extends BaseController {
|
||||||
if (this.getSysUser().getRoles().get(0).getRoleId() == 101L) {
|
if (this.getSysUser().getRoles().get(0).getRoleId() == 101L) {
|
||||||
orderMaster.setCreateBy(this.getSysUser().getUserId().toString());
|
orderMaster.setCreateBy(this.getSysUser().getUserId().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 先获取总数
|
||||||
|
Long total = orderMasterService.selectOrderMasterCount(orderMaster);
|
||||||
|
|
||||||
|
startPage();
|
||||||
List<OrderMaster> orderMasterList = orderMasterService.selectOrderMasterList(orderMaster);
|
List<OrderMaster> orderMasterList = orderMasterService.selectOrderMasterList(orderMaster);
|
||||||
Set<Long> orderMasterIds = orderMasterList.stream().map(OrderMaster::getId).collect(Collectors.toSet());
|
Set<Long> orderMasterIds = orderMasterList.stream().map(OrderMaster::getId).collect(Collectors.toSet());
|
||||||
|
|
||||||
|
|
@ -2276,7 +2312,9 @@ public class OrderMasterController extends BaseController {
|
||||||
});
|
});
|
||||||
master.setOrderImgs(stringBuilder.toString());
|
master.setOrderImgs(stringBuilder.toString());
|
||||||
}
|
}
|
||||||
return getDataTable(orderMasterList);
|
TableDataInfo dataTable = getDataTable(orderMasterList);
|
||||||
|
dataTable.setTotal(total);
|
||||||
|
return dataTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "主订单管理", businessType = BusinessType.EXPORT)
|
@Log(title = "主订单管理", businessType = BusinessType.EXPORT)
|
||||||
|
|
|
||||||
|
|
@ -1041,7 +1041,7 @@
|
||||||
modalContent += '<tr>';
|
modalContent += '<tr>';
|
||||||
modalContent += '<td>' + (record.orderDetailCode || record.id) + '</td>';
|
modalContent += '<td>' + (record.orderDetailCode || record.id) + '</td>';
|
||||||
modalContent += '<td>¥' + (record.refund || record.agreedRefund || 0) + '</td>';
|
modalContent += '<td>¥' + (record.refund || record.agreedRefund || 0) + '</td>';
|
||||||
modalContent += '<td>' + getWorkerFeedbackText(record.workerFeedbackResult) + '</td>';
|
modalContent += '<td>' + getWorkerFeedbackText(record.workerFeedbackResult) + '<br/><span style="color: #666; font-size: 12px;">反馈金额:¥' + (record.agreedRefund || 0) + '</span></td>';
|
||||||
modalContent += '<td>' + getCustomerCheckText(record.customerFinalCheck) + '</td>';
|
modalContent += '<td>' + getCustomerCheckText(record.customerFinalCheck) + '</td>';
|
||||||
modalContent += '<td>';
|
modalContent += '<td>';
|
||||||
modalContent += '<div style="margin-bottom: 8px;">';
|
modalContent += '<div style="margin-bottom: 8px;">';
|
||||||
|
|
|
||||||
|
|
@ -1275,7 +1275,7 @@
|
||||||
html += '<tr>';
|
html += '<tr>';
|
||||||
html += '<td>' + (record.orderDetailCode || '') + '</td>';
|
html += '<td>' + (record.orderDetailCode || '') + '</td>';
|
||||||
html += '<td>¥' + (record.refund || record.agreedRefund || 0) + '</td>';
|
html += '<td>¥' + (record.refund || record.agreedRefund || 0) + '</td>';
|
||||||
html += '<td>' + getWorkerFeedbackText(record.workerFeedbackResult) + '</td>';
|
html += '<td>' + getWorkerFeedbackText(record.workerFeedbackResult) + '<br><small style="color: #999;">反馈金额:¥' + (record.agreedRefund || 0) + '</small></td>';
|
||||||
html += '<td>' + getCustomerCheckText(record.customerFinalCheck) + '</td>';
|
html += '<td>' + getCustomerCheckText(record.customerFinalCheck) + '</td>';
|
||||||
html += '<td style="width: 280px;">';
|
html += '<td style="width: 280px;">';
|
||||||
html += '<div style="margin-bottom: 8px;">';
|
html += '<div style="margin-bottom: 8px;">';
|
||||||
|
|
|
||||||
|
|
@ -365,4 +365,12 @@ public class OrderMaster extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date updateTimeAlias;
|
private Date updateTimeAlias;
|
||||||
|
|
||||||
|
|
||||||
|
private String from;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否排除商品订单标识(用于Service层过滤逻辑)
|
||||||
|
*/
|
||||||
|
private Boolean excludeGoodsOrder;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,14 @@ public interface OrderDetailMapper {
|
||||||
|
|
||||||
Long countOrderDetailList(OrderDetail orderDetail);
|
Long countOrderDetailList(OrderDetail orderDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的子单总数(用于分页)
|
||||||
|
*
|
||||||
|
* @param orderDetail 查询条件
|
||||||
|
* @return 总数
|
||||||
|
*/
|
||||||
|
Long selectOrderDetailCount(OrderDetail orderDetail);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param orderDetailId 细单表id
|
* @param orderDetailId 细单表id
|
||||||
* @return 细单表
|
* @return 细单表
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,14 @@ public interface OrderMasterMapper {
|
||||||
*/
|
*/
|
||||||
Long countOrderMasterList(OrderMaster orderMaster);
|
Long countOrderMasterList(OrderMaster orderMaster);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的主单总数
|
||||||
|
*
|
||||||
|
* @param orderMaster 主订单入参
|
||||||
|
* @return 满足条件的主单总数
|
||||||
|
*/
|
||||||
|
Long selectOrderMasterCount(OrderMaster orderMaster);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param orderMasterId 主订单id
|
* @param orderMasterId 主订单id
|
||||||
* @return 主订单
|
* @return 主订单
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,14 @@ public interface OrderDetailService {
|
||||||
*/
|
*/
|
||||||
Long countOrderDetailList(OrderDetail orderDetail);
|
Long countOrderDetailList(OrderDetail orderDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的子单总数(用于分页)
|
||||||
|
*
|
||||||
|
* @param orderDetail 查询条件
|
||||||
|
* @return 总数
|
||||||
|
*/
|
||||||
|
Long selectOrderDetailCount(OrderDetail orderDetail);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 子单改价接口
|
* 子单改价接口
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,14 @@ public interface OrderMasterService {
|
||||||
*/
|
*/
|
||||||
Long countOrderMasterList(OrderMaster orderMaster);
|
Long countOrderMasterList(OrderMaster orderMaster);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询符合条件的主单总数
|
||||||
|
*
|
||||||
|
* @param orderMaster 主订单入参
|
||||||
|
* @return 符合条件的主单总数
|
||||||
|
*/
|
||||||
|
Long selectOrderMasterCount(OrderMaster orderMaster);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param orderMasterId 主订单id
|
* @param orderMasterId 主订单id
|
||||||
* @return 主订单
|
* @return 主订单
|
||||||
|
|
|
||||||
|
|
@ -513,15 +513,21 @@ public class AfterServiceRecordServiceImpl implements IAfterServiceRecordService
|
||||||
// 更新对应主单和子单的售后状态为已完成
|
// 更新对应主单和子单的售后状态为已完成
|
||||||
OrderDetail orderDetail1 = orderDetailService.selectById(afterServiceRecord.getOrderDetailId());
|
OrderDetail orderDetail1 = orderDetailService.selectById(afterServiceRecord.getOrderDetailId());
|
||||||
if (orderDetail1 != null) {
|
if (orderDetail1 != null) {
|
||||||
orderDetail1.setAfterServiceStatus(2);
|
// 只有当子单的售后状态为售后纠纷(1)时,才修改为已完成(2)
|
||||||
orderDetailService.updateOrderDetail(orderDetail1);
|
if (orderDetail1.getAfterServiceStatus() != null && orderDetail1.getAfterServiceStatus() == 1) {
|
||||||
log.info("已将子单[{}]售后状态设置为已完成", orderDetail1.getId());
|
orderDetail1.setAfterServiceStatus(2);
|
||||||
|
orderDetailService.updateOrderDetail(orderDetail1);
|
||||||
|
log.info("已将子单[{}]售后状态从售后纠纷设置为已完成", orderDetail1.getId());
|
||||||
|
}
|
||||||
|
|
||||||
OrderMaster orderMaster = orderMasterService.selectById(orderDetail1.getOrderMasterId());
|
OrderMaster orderMaster = orderMasterService.selectById(orderDetail1.getOrderMasterId());
|
||||||
if (orderMaster != null) {
|
if (orderMaster != null) {
|
||||||
orderMaster.setAfterServiceStatus(2);
|
// 只有当主单的售后状态为售后纠纷(1)时,才修改为已完成(2)
|
||||||
orderMasterService.updateOrderMaster(orderMaster);
|
if (orderMaster.getAfterServiceStatus() != null && orderMaster.getAfterServiceStatus() == 1) {
|
||||||
log.info("已将主单[{}]售后状态设置为已完成", orderMaster.getId());
|
orderMaster.setAfterServiceStatus(2);
|
||||||
|
orderMasterService.updateOrderMaster(orderMaster);
|
||||||
|
log.info("已将主单[{}]售后状态从售后纠纷设置为已完成", orderMaster.getId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
|
|
@ -1112,6 +1112,11 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
||||||
return orderDetailMapper.countOrderDetailList(orderDetail);
|
return orderDetailMapper.countOrderDetailList(orderDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long selectOrderDetailCount(OrderDetail orderDetail) {
|
||||||
|
return orderDetailMapper.selectOrderDetailCount(orderDetail);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int changePrice(Long orderDetailId, BigDecimal changeMoney, Integer type, String remark,String urls ,String fileNames,String reason) throws
|
public int changePrice(Long orderDetailId, BigDecimal changeMoney, Integer type, String remark,String urls ,String fileNames,String reason) throws
|
||||||
|
|
|
||||||
|
|
@ -140,10 +140,20 @@ public class OrderMasterServiceImpl implements OrderMasterService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long countOrderMasterList(OrderMaster orderMaster) {
|
public Long countOrderMasterList(OrderMaster orderMaster) {
|
||||||
|
// 如果查询的是服务订单,则设置标识以排除商品主单id有值的数据
|
||||||
|
if (orderMaster.getOrderType() != null && orderMaster.getOrderType() == 0
|
||||||
|
&& "customer".equals(orderMaster.getFrom())) {
|
||||||
|
orderMaster.setExcludeGoodsOrder(true);
|
||||||
|
}
|
||||||
|
|
||||||
return orderMasterMapper.countOrderMasterList(orderMaster);
|
return orderMasterMapper.countOrderMasterList(orderMaster);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long selectOrderMasterCount(OrderMaster orderMaster) {
|
||||||
|
return orderMasterMapper.selectOrderMasterCount(orderMaster);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OrderMaster selectById(Long orderMasterId) {
|
public OrderMaster selectById(Long orderMasterId) {
|
||||||
return orderMasterMapper.selectById(orderMasterId);
|
return orderMasterMapper.selectById(orderMasterId);
|
||||||
|
|
|
||||||
|
|
@ -287,6 +287,129 @@
|
||||||
</trim>
|
</trim>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOrderDetailCount" parameterType="com.ghy.order.domain.OrderDetail" resultType="Long">
|
||||||
|
SELECT COUNT(*) FROM order_detail od
|
||||||
|
LEFT JOIN order_master om ON od.order_master_id = om.id
|
||||||
|
LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id
|
||||||
|
LEFT JOIN goods g ON g.goods_id = om.goods_id
|
||||||
|
LEFT JOIN worker w ON od.worker_id = w.worker_id
|
||||||
|
<where>
|
||||||
|
<if test="keyWords != null and keyWords != ''">
|
||||||
|
AND
|
||||||
|
(
|
||||||
|
om.code LIKE concat('%', #{keyWords}, '%')
|
||||||
|
or ca.name LIKE concat('%', #{keyWords}, '%')
|
||||||
|
or ca.phone LIKE concat('%', #{keyWords}, '%')
|
||||||
|
or ca.address like concat('%', #{keyWords}, '%')
|
||||||
|
or g.goods_name like concat('%', #{keyWords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="deptId != null and deptId != ''">
|
||||||
|
AND w.dept_id = #{deptId}
|
||||||
|
</if>
|
||||||
|
<if test="code != null and code != ''">
|
||||||
|
AND od.code LIKE concat('%', #{code}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="customerId != null and customerId != 0">
|
||||||
|
AND od.customer_id = #{customerId}
|
||||||
|
</if>
|
||||||
|
<if test="orderType != null">
|
||||||
|
AND od.order_type = #{orderType}
|
||||||
|
</if>
|
||||||
|
<if test="orderStatus != null">
|
||||||
|
AND od.order_status = #{orderStatus}
|
||||||
|
</if>
|
||||||
|
<if test="orderStatusList != null and orderStatusList.size() > 0">
|
||||||
|
AND od.order_status in
|
||||||
|
<foreach collection="orderStatusList" item="orderStatus" open="(" separator="," close=")">
|
||||||
|
#{orderStatus}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="orderMasterCode != null and orderMasterCode != ''">
|
||||||
|
AND od.order_master_code = #{orderMasterCode}
|
||||||
|
</if>
|
||||||
|
<if test="workerId != null and workerId != 0">
|
||||||
|
AND od.worker_id = #{workerId}
|
||||||
|
</if>
|
||||||
|
<if test="workerIds != null and workerIds.size() > 0">
|
||||||
|
AND od.worker_id in
|
||||||
|
<foreach collection="workerIds" item="workerId" open="(" separator="," close=")">
|
||||||
|
#{workerId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="masterIds != null and masterIds.size() > 0">
|
||||||
|
AND od.order_master_id in
|
||||||
|
<foreach collection="masterIds" item="masterId" open="(" separator="," close=")">
|
||||||
|
#{masterId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="goodsCategoryId != null">
|
||||||
|
AND g.dept_goods_category_id = #{goodsCategoryId}
|
||||||
|
</if>
|
||||||
|
<if test="goodsName != null and goodsName != ''">
|
||||||
|
AND g.goods_name like concat('%', #{goodsName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="countryId != null">
|
||||||
|
AND ca.country_id = #{countryId}
|
||||||
|
</if>
|
||||||
|
<if test="expectTimeStart != null">
|
||||||
|
AND od.expect_time_start >= #{expectTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="expectTimeEnd != null">
|
||||||
|
AND od.expect_time_end <= #{expectTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="createTimeStart != null">
|
||||||
|
AND od.create_time >= #{createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="createTimeEnd != null">
|
||||||
|
AND od.create_time <= #{createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="workFinishTimeStart != null">
|
||||||
|
AND od.work_finish_time >= #{workFinishTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="workFinishTimeEnd != null">
|
||||||
|
AND od.work_finish_time <= #{workFinishTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="workBeginTimeStart != null">
|
||||||
|
AND od.work_begin_time >= #{workBeginTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="workBeginTimeEnd != null">
|
||||||
|
AND od.work_begin_time <= #{workBeginTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="afterServiceStatus != null">
|
||||||
|
AND od.after_service_status = #{afterServiceStatus}
|
||||||
|
</if>
|
||||||
|
<if test="orderDetailIds != null">
|
||||||
|
AND od.id in ( ${orderDetailIds} )
|
||||||
|
</if>
|
||||||
|
<if test="shelveStatus != null">
|
||||||
|
AND od.shelve_status = ${shelveStatus}
|
||||||
|
</if>
|
||||||
|
<if test="shelveStatus == null">
|
||||||
|
AND od.shelve_status = 0
|
||||||
|
</if>
|
||||||
|
<if test="drawCashStatus != null">
|
||||||
|
AND od.draw_cash_status = ${drawCashStatus}
|
||||||
|
</if>
|
||||||
|
<if test="drawCashStatusList != null and drawCashStatusList.size() > 0">
|
||||||
|
AND od.draw_cash_status in
|
||||||
|
<foreach collection="drawCashStatusList" item="drawCashStatus" open="(" separator="," close=")">
|
||||||
|
#{drawCashStatus}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="timeout != null">
|
||||||
|
<choose>
|
||||||
|
<when test="includeAfterTimeout != null and includeAfterTimeout == true">
|
||||||
|
AND (od.timeout_ = #{timeout} OR od.after_timeout = #{timeout})
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
AND od.timeout_ = #{timeout}
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="countOrderDetailList" parameterType="com.ghy.order.domain.OrderDetail" resultType="Long">
|
<select id="countOrderDetailList" parameterType="com.ghy.order.domain.OrderDetail" resultType="Long">
|
||||||
SELECT COUNT(*) FROM order_detail od
|
SELECT COUNT(*) FROM order_detail od
|
||||||
<where>
|
<where>
|
||||||
|
|
|
||||||
|
|
@ -240,6 +240,9 @@
|
||||||
or g.goods_name like concat('%', #{keywords}, '%')
|
or g.goods_name like concat('%', #{keywords}, '%')
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
<if test="excludeGoodsOrder != null and excludeGoodsOrder == true">
|
||||||
|
AND om.goods_order_master_id IS NULL
|
||||||
|
</if>
|
||||||
<if test="workerName != null and workerName != ''">
|
<if test="workerName != null and workerName != ''">
|
||||||
AND w.name LIKE concat('%', #{workerName}, '%')
|
AND w.name LIKE concat('%', #{workerName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -503,6 +506,9 @@
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
<if test="excludeGoodsOrder != null and excludeGoodsOrder == true">
|
||||||
|
AND om.goods_order_master_id IS NULL
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -836,4 +842,180 @@
|
||||||
WHERE goods_order_master_id = #{goodsOrderMasterId}
|
WHERE goods_order_master_id = #{goodsOrderMasterId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOrderMasterCount" parameterType="com.ghy.order.domain.OrderMaster" resultType="Long">
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM order_master om
|
||||||
|
LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id
|
||||||
|
LEFT JOIN goods g ON g.goods_id = om.goods_id
|
||||||
|
LEFT JOIN financial_master fm ON om.id = fm.order_master_id
|
||||||
|
LEFT JOIN worker w ON om.worker_id = w.worker_id
|
||||||
|
<where>
|
||||||
|
<if test="keywords != null and keywords != ''">
|
||||||
|
AND
|
||||||
|
(
|
||||||
|
om.code LIKE concat('%', #{keywords}, '%')
|
||||||
|
or ca.name LIKE concat('%', #{keywords}, '%')
|
||||||
|
or ca.phone LIKE concat('%', #{keywords}, '%')
|
||||||
|
or ca.address like concat('%', #{keywords}, '%')
|
||||||
|
or g.goods_name like concat('%', #{keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="workerName != null and workerName != ''">
|
||||||
|
AND w.name LIKE concat('%', #{workerName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="workerPhone != null and workerPhone != ''">
|
||||||
|
AND w.phone LIKE concat('%', #{workerPhone}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="province != null and province != ''">
|
||||||
|
AND ca.province_id = #{province}
|
||||||
|
</if>
|
||||||
|
<if test="city != null and city != ''">
|
||||||
|
AND ca.city_id = #{city}
|
||||||
|
</if>
|
||||||
|
<if test="district != null and district != ''">
|
||||||
|
AND ca.country_id = #{district}
|
||||||
|
</if>
|
||||||
|
<if test="isMonitoredOrder">
|
||||||
|
AND om.show_in_monitor = 1 AND om.order_status in (0,1,2,3,4) and om.worker_id is not null and om.order_status != 6
|
||||||
|
</if>
|
||||||
|
<if test="allSelfAssigned != null">
|
||||||
|
AND all_self_assigned = #{allSelfAssigned}
|
||||||
|
</if>
|
||||||
|
<if test="deptId != null and deptId != 0">
|
||||||
|
AND om.dept_id = #{deptId}
|
||||||
|
</if>
|
||||||
|
<if test="code != null and code != ''">
|
||||||
|
AND om.code LIKE concat('%', #{code}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="customerId != null and customerId != 0">
|
||||||
|
AND om.customer_id = #{customerId}
|
||||||
|
</if>
|
||||||
|
<if test="customerIds != null and customerIds.size > 0">
|
||||||
|
AND om.customer_id in
|
||||||
|
<foreach item="customerId" collection="customerIds" open="(" separator="," close=")">
|
||||||
|
#{customerId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="orderType != null">
|
||||||
|
AND om.order_type = #{orderType}
|
||||||
|
</if>
|
||||||
|
<if test="orderStatus != null">
|
||||||
|
AND om.order_status = #{orderStatus}
|
||||||
|
</if>
|
||||||
|
<if test="payType != null">
|
||||||
|
AND om.pay_type = #{payType}
|
||||||
|
</if>
|
||||||
|
<if test="payStatus != null">
|
||||||
|
AND om.pay_status = #{payStatus}
|
||||||
|
</if>
|
||||||
|
<if test="payStatusList != null">
|
||||||
|
AND om.pay_status in ( #{payStatusList} )
|
||||||
|
</if>
|
||||||
|
<if test="workerId != null and workerId > 0">
|
||||||
|
AND om.worker_id = #{workerId}
|
||||||
|
</if>
|
||||||
|
<if test="workerId == -1">
|
||||||
|
AND om.worker_id IS NULL
|
||||||
|
AND (om.pay_mode = '01' OR (om.pay_mode = '02' and om.pay_status = '1'))
|
||||||
|
</if>
|
||||||
|
<if test="workerId == -2">
|
||||||
|
and om.worker_id IS not NULL
|
||||||
|
</if>
|
||||||
|
<if test="originalWorkerId != null and originalWorkerId > 0">
|
||||||
|
AND om.original_worker_id = #{originalWorkerId}
|
||||||
|
</if>
|
||||||
|
<if test="includeOriginalWorker != null and includeOriginalWorker == true and workerId != null and workerId > 0">
|
||||||
|
AND (om.worker_id = #{workerId} OR om.original_worker_id = #{workerId})
|
||||||
|
</if>
|
||||||
|
<if test="payMode != null">
|
||||||
|
AND om.pay_mode = #{payMode}
|
||||||
|
</if>
|
||||||
|
<if test="sysPayStatus != null">
|
||||||
|
AND fm.pay_status = #{sysPayStatus}
|
||||||
|
</if>
|
||||||
|
<if test="goodsCategoryId != null">
|
||||||
|
AND g.dept_goods_category_id = #{goodsCategoryId}
|
||||||
|
</if>
|
||||||
|
<if test="goodsName != null and goodsName != ''">
|
||||||
|
AND g.goods_name like concat('%', #{goodsName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="countryId != null">
|
||||||
|
AND ca.country_id = #{countryId}
|
||||||
|
</if>
|
||||||
|
<if test="exceptOrderStatus != null">
|
||||||
|
AND om.order_status != #{exceptOrderStatus}
|
||||||
|
</if>
|
||||||
|
<if test="createTimeStart != null">
|
||||||
|
AND om.create_time >= #{createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="createTimeEnd != null">
|
||||||
|
AND om.create_time <= #{createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="updateTimeStart != null">
|
||||||
|
AND om.update_time >= #{updateTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="updateTimeEnd != null">
|
||||||
|
AND om.update_time <= #{updateTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="afterServiceStatus != null">
|
||||||
|
AND om.after_service_status = #{afterServiceStatus}
|
||||||
|
</if>
|
||||||
|
<if test="orderMasterIds != null and orderMasterIds != ''">
|
||||||
|
AND om.id in (${orderMasterIds})
|
||||||
|
</if>
|
||||||
|
<if test="orderMasterIdList != null and orderMasterIdList.size > 0">
|
||||||
|
AND om.id in
|
||||||
|
<foreach collection="orderMasterIdList" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="orderStatuses != null and orderStatuses != ''">
|
||||||
|
AND om.order_status in (${orderStatuses})
|
||||||
|
</if>
|
||||||
|
<if test="hasDispatchedAll != null">
|
||||||
|
AND om.has_dispatched_all = #{hasDispatchedAll}
|
||||||
|
</if>
|
||||||
|
<if test="exceptOrderMasterIds != null and exceptOrderMasterIds.size > 0">
|
||||||
|
AND om.id not in
|
||||||
|
<foreach collection="exceptOrderMasterIds" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="timeout != null">
|
||||||
|
AND (
|
||||||
|
om.timeout_ = #{timeout}
|
||||||
|
OR (
|
||||||
|
#{timeout} = 1
|
||||||
|
AND EXISTS (
|
||||||
|
SELECT 1 FROM order_detail od
|
||||||
|
WHERE od.order_master_id = om.id
|
||||||
|
AND od.timeout_ = 1
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="isCall != null">
|
||||||
|
AND om.is_call = #{isCall}
|
||||||
|
</if>
|
||||||
|
<if test="expectTimeStart != null">
|
||||||
|
AND om.expect_time_start >= #{expectTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="expectTimeEnd != null">
|
||||||
|
AND om.expect_time_end <= #{expectTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null and createBy != ''">
|
||||||
|
AND om.create_by = #{createBy}
|
||||||
|
</if>
|
||||||
|
<if test="addressIds != null and addressIds.size > 0">
|
||||||
|
AND om.address_id IN
|
||||||
|
<foreach collection="addressIds" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="goodsOrderMasterId != null and goodsOrderMasterId > 0">
|
||||||
|
AND om.goods_order_master_id = #{goodsOrderMasterId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,9 @@ public class OrderServiceImpl implements OrderService {
|
||||||
log.info("主订单[{}]超时60分钟", order.getId());
|
log.info("主订单[{}]超时60分钟", order.getId());
|
||||||
// 已超时 45min后取消超时状态 清空workerId
|
// 已超时 45min后取消超时状态 清空workerId
|
||||||
orderMasterService.updateTimeout(order.getId(), 0);
|
orderMasterService.updateTimeout(order.getId(), 0);
|
||||||
orderMasterService.removeWorker(order.getId());
|
if (order.getGoodsOrderMasterId()==null) {
|
||||||
|
orderMasterService.removeWorker(order.getId());
|
||||||
|
}
|
||||||
orderMasterService.updateCreateTime(order.getId());
|
orderMasterService.updateCreateTime(order.getId());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue