提交代码

This commit is contained in:
kuang.yife 2023-08-19 00:04:41 +08:00
parent 294123359f
commit a0ab257b18
1 changed files with 38 additions and 2 deletions

View File

@ -36,6 +36,7 @@ import com.ghy.worker.domain.WorkerCertification;
import com.ghy.worker.service.IWorkerCertificationService; import com.ghy.worker.service.IWorkerCertificationService;
import com.ghy.worker.service.WorkerService; import com.ghy.worker.service.WorkerService;
import com.huifu.adapay.core.exception.BaseAdaPayException; import com.huifu.adapay.core.exception.BaseAdaPayException;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
@ -43,7 +44,6 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -104,6 +104,8 @@ public class OrderController extends BaseController {
private OrderBehaviorService orderBehaviorService; private OrderBehaviorService orderBehaviorService;
@Resource @Resource
private IWxMsgService wxMsgService; private IWxMsgService wxMsgService;
@Resource
private IOrderCallRecordService orderCallRecordService;
/** /**
* 可派单商品数量 * 可派单商品数量
@ -800,16 +802,40 @@ public class OrderController extends BaseController {
BeanUtils.copyProperties(orderListRequest, orderDetailReq); BeanUtils.copyProperties(orderListRequest, orderDetailReq);
List<OrderListResponse> detailList = this.getDetailList(orderDetailReq); List<OrderListResponse> detailList = this.getDetailList(orderDetailReq);
orderListResponses.addAll(detailList); orderListResponses.addAll(detailList);
List<OrderListResponse> allList = new ArrayList<>();
List<Long> masterIdSet = new ArrayList<Long>();
if(orderListRequest.getTimeout() != null && orderListRequest.getTimeout() == 1){
// 增加主单下子单有超时的
OrderMaster param = new OrderMaster();
param.setWorkerId(orderListRequest.getWorkerId());
List<OrderMaster> allOrderMaster = orderMasterService.selectOrderMasterList(param);
StringBuilder ids = new StringBuilder();
for (OrderMaster model : allOrderMaster) {
List<OrderDetail> orderDetails = orderDetailService.selectByOrderMasterId(model.getId());
List<OrderDetail> result = orderDetails.stream().filter(s -> s.getTimeout().equals(1)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(result)) {
masterIdSet.add(model.getId());
ids.append(model.getId()).append(",");
}
}
if(ids.length() > 0){
OrderMaster timeOutMaster = new OrderMaster();
timeOutMaster.setOrderMasterIds(ids.substring(0, ids.length() - 1));
allList.addAll(this.getMasterList(timeOutMaster));
}
}
// 查询主单 // 查询主单
OrderMaster orderMasterReq = new OrderMaster(); OrderMaster orderMasterReq = new OrderMaster();
BeanUtils.copyProperties(orderListRequest, orderMasterReq); BeanUtils.copyProperties(orderListRequest, orderMasterReq);
orderMasterReq.setExceptOrderMasterIds(masterIdSet);
List<OrderListResponse> masterList = this.getMasterList(orderMasterReq); List<OrderListResponse> masterList = this.getMasterList(orderMasterReq);
allList.addAll(masterList);
// 超时查询需要排除同个师傅的主单子单同时出现 // 超时查询需要排除同个师傅的主单子单同时出现
if (orderListRequest.getTimeout() != null && orderListRequest.getTimeout() == 1) { if (orderListRequest.getTimeout() != null && orderListRequest.getTimeout() == 1) {
// 需要排除同个师傅的主单子单同时出现 // 需要排除同个师傅的主单子单同时出现
List<OrderListResponse> filteredMasterList = new ArrayList<OrderListResponse>(); List<OrderListResponse> filteredMasterList = new ArrayList<OrderListResponse>();
for (OrderListResponse master : masterList) { for (OrderListResponse master : allList) {
boolean isKeep = false; boolean isKeep = false;
// 查询该主单下所有售后中的子单 // 查询该主单下所有售后中的子单
OrderDetail detailAfterListOfMasterQry = new OrderDetail(); OrderDetail detailAfterListOfMasterQry = new OrderDetail();
@ -1300,6 +1326,16 @@ public class OrderController extends BaseController {
standardList.add(orderStandard); standardList.add(orderStandard);
} }
// 查询是否有拨号记录
OrderCallRecord param = new OrderCallRecord();
param.setOrderId(detail.getId());
List<OrderCallRecord> callList = orderCallRecordService.selectOrderCallRecordList(param);
if(CollectionUtils.isNotEmpty(callList)){
orderListResponse.setIsCall("02");
}else {
orderListResponse.setIsCall("1");
}
// 售后记录 // 售后记录
// AfterServiceRecord afterServiceRecord = new AfterServiceRecord(); // AfterServiceRecord afterServiceRecord = new AfterServiceRecord();
// afterServiceRecord.setOrderDetailId(detail.getId()); // afterServiceRecord.setOrderDetailId(detail.getId());