|
@@ -394,7 +394,33 @@ public class PayOrderLogic {
|
|
if(workerOrder == null){
|
|
if(workerOrder == null){
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+
|
|
WorkerOrderDetail workerOrderDetail = BeanUtil.toBean(workerOrder, WorkerOrderDetail.class);
|
|
WorkerOrderDetail workerOrderDetail = BeanUtil.toBean(workerOrder, WorkerOrderDetail.class);
|
|
|
|
+
|
|
|
|
+ workerOrderDetail.setIfCancel(true);
|
|
|
|
+ if (!StringUtil.isEmpty(workerOrder.getWorkerOrderId())) {
|
|
|
|
+ Integer count = workerOrderService.lambdaQuery()
|
|
|
|
+ .eq(WorkerOrder::getTotalAmount, workerOrder.getTotalAmount())
|
|
|
|
+ .isNotNull(WorkerOrder::getGreeOrderId)
|
|
|
|
+ .eq(WorkerOrder::getWorkerOrderId, workerOrder.getWorkerOrderId())
|
|
|
|
+ .count();
|
|
|
|
+ if (count > 0){
|
|
|
|
+ Integer countWait = workerOrderService.lambdaQuery()
|
|
|
|
+ .eq(WorkerOrder::getTotalAmount, workerOrder.getTotalAmount())
|
|
|
|
+ .eq(WorkerOrder::getPayStatus, PayStatusEnum.WAIT.getKey())
|
|
|
|
+ .eq(WorkerOrder::getWorkerOrderId, workerOrder.getWorkerOrderId())
|
|
|
|
+ .count();
|
|
|
|
+
|
|
|
|
+ if (countWait < 2){
|
|
|
|
+ workerOrderDetail.setIfCancel(false);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
workerOrderDetail.setWorkerOrderItems(workerOrderItemService.lambdaQuery()
|
|
workerOrderDetail.setWorkerOrderItems(workerOrderItemService.lambdaQuery()
|
|
.eq(WorkerOrderItem::getOrderId,orderId).list());
|
|
.eq(WorkerOrderItem::getOrderId,orderId).list());
|
|
return workerOrderDetail;
|
|
return workerOrderDetail;
|
|
@@ -865,7 +891,7 @@ public class PayOrderLogic {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- public Page<WorkerOrder> orderPage(String workerOrderId,String yearMonth,String settlementType,String goodsType, String orderId, String startTime, String endTime, String payStatus, Integer pageNum, Integer pageSize) {
|
|
|
|
|
|
+ public Page<WorkerOrderDetail> orderPage(String workerOrderId,String yearMonth,String settlementType,String goodsType, String orderId, String startTime, String endTime, String payStatus, Integer pageNum, Integer pageSize) {
|
|
|
|
|
|
CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
|
|
CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
|
|
String startMonTime = null;
|
|
String startMonTime = null;
|
|
@@ -879,24 +905,62 @@ public class PayOrderLogic {
|
|
if (StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()) && StringUtil.isEmpty(currentCompanyWechat.getUser().getIdCard()))
|
|
if (StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()) && StringUtil.isEmpty(currentCompanyWechat.getUser().getIdCard()))
|
|
return new Page<>();
|
|
return new Page<>();
|
|
|
|
|
|
- return workerOrderService.lambdaQuery()
|
|
|
|
- .eq(!StringUtil.isEmpty(goodsType),WorkerOrder::getGoodsType,goodsType)
|
|
|
|
- .like(!StringUtil.isEmpty(settlementType),WorkerOrder::getSettlementType,settlementType)
|
|
|
|
- .eq(!StringUtil.isEmpty(orderId),WorkerOrder::getOrderId,orderId)
|
|
|
|
- .eq(!StringUtil.isEmpty(workerOrderId),WorkerOrder::getWorkerOrderId,workerOrderId)
|
|
|
|
- .and(!StringUtil.isEmpty(payStatus),item -> item
|
|
|
|
- .eq(!StringUtil.isEmpty(payStatus),WorkerOrder::getPayStatus,payStatus)
|
|
|
|
|
|
+ Page<WorkerOrder> page = workerOrderService.lambdaQuery()
|
|
|
|
+ .eq(!StringUtil.isEmpty(goodsType), WorkerOrder::getGoodsType, goodsType)
|
|
|
|
+ .like(!StringUtil.isEmpty(settlementType), WorkerOrder::getSettlementType, settlementType)
|
|
|
|
+ .eq(!StringUtil.isEmpty(orderId), WorkerOrder::getOrderId, orderId)
|
|
|
|
+ .eq(!StringUtil.isEmpty(workerOrderId), WorkerOrder::getWorkerOrderId, workerOrderId)
|
|
|
|
+ .and(!StringUtil.isEmpty(payStatus), item -> item
|
|
|
|
+ .eq(!StringUtil.isEmpty(payStatus), WorkerOrder::getPayStatus, payStatus)
|
|
|
|
|
|
- .or(!StringUtil.isEmpty(payStatus) && payStatus.equals(PayStatusEnum.CANCEL.getKey()),
|
|
|
|
- iter -> iter.eq(WorkerOrder::getRefundStatus, IsYesNoEnum.YES.getKey()))
|
|
|
|
|
|
+ .or(!StringUtil.isEmpty(payStatus) && payStatus.equals(PayStatusEnum.CANCEL.getKey()),
|
|
|
|
+ iter -> iter.eq(WorkerOrder::getRefundStatus, IsYesNoEnum.YES.getKey()))
|
|
)
|
|
)
|
|
- .eq(!StringUtil.isEmpty(payStatus) && payStatus.equals(MaterialExamineStatusEnum.PAID.getKey()),WorkerOrder::getRefundStatus, IsYesNoEnum.NO.getKey())
|
|
|
|
- .eq(!StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()),WorkerOrder::getWorkerNumber,currentCompanyWechat.getUser().getWorkerNumber())
|
|
|
|
- .eq(StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()),WorkerOrder::getIdentity,currentCompanyWechat.getUser().getIdCard())
|
|
|
|
- .between(!StringUtil.isEmpty(startTime),WorkerOrder::getCreateTime,startTime,endTime)
|
|
|
|
- .in(WorkerOrder::getCompanyWechatId,currentCompanyWechat.getCompanyWechatId())
|
|
|
|
|
|
+ .eq(!StringUtil.isEmpty(payStatus) && payStatus.equals(MaterialExamineStatusEnum.PAID.getKey()), WorkerOrder::getRefundStatus, IsYesNoEnum.NO.getKey())
|
|
|
|
+ .eq(!StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()), WorkerOrder::getWorkerNumber, currentCompanyWechat.getUser().getWorkerNumber())
|
|
|
|
+ .eq(StringUtil.isEmpty(currentCompanyWechat.getUser().getWorkerNumber()), WorkerOrder::getIdentity, currentCompanyWechat.getUser().getIdCard())
|
|
|
|
+ .between(!StringUtil.isEmpty(startTime), WorkerOrder::getCreateTime, startTime, endTime)
|
|
|
|
+ .in(WorkerOrder::getCompanyWechatId, currentCompanyWechat.getCompanyWechatId())
|
|
.orderByDesc(WorkerOrder::getCreateTime)
|
|
.orderByDesc(WorkerOrder::getCreateTime)
|
|
- .page(new Page<>(pageNum,pageSize));
|
|
|
|
|
|
+ .page(new Page<>(pageNum, pageSize));
|
|
|
|
+
|
|
|
|
+ Page<WorkerOrderDetail> workerOrderDetailPage = new Page<>();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ workerOrderDetailPage.setTotal(page.getTotal());
|
|
|
|
+ workerOrderDetailPage.setCurrent(page.getCurrent());
|
|
|
|
+
|
|
|
|
+ List<WorkerOrderDetail> workerOrderDetails = new ArrayList<>();
|
|
|
|
+ for (WorkerOrder record : page.getRecords()) {
|
|
|
|
+ WorkerOrderDetail workerOrderDetail = BeanUtil.toBean(record, WorkerOrderDetail.class);
|
|
|
|
+
|
|
|
|
+ workerOrderDetail.setIfCancel(true);
|
|
|
|
+ if (!StringUtil.isEmpty(workerOrderDetail.getWorkerOrderId())) {
|
|
|
|
+ Integer count = workerOrderService.lambdaQuery()
|
|
|
|
+ .eq(WorkerOrder::getTotalAmount, workerOrderDetail.getTotalAmount())
|
|
|
|
+ .isNotNull(WorkerOrder::getGreeOrderId)
|
|
|
|
+ .eq(WorkerOrder::getWorkerOrderId, workerOrderDetail.getWorkerOrderId())
|
|
|
|
+ .count();
|
|
|
|
+ if (count > 0){
|
|
|
|
+ Integer countWait = workerOrderService.lambdaQuery()
|
|
|
|
+ .eq(WorkerOrder::getTotalAmount, workerOrderDetail.getTotalAmount())
|
|
|
|
+ .eq(WorkerOrder::getPayStatus, PayStatusEnum.WAIT.getKey())
|
|
|
|
+ .eq(WorkerOrder::getWorkerOrderId, workerOrderDetail.getWorkerOrderId())
|
|
|
|
+ .count();
|
|
|
|
+
|
|
|
|
+ if (countWait < 2){
|
|
|
|
+ workerOrderDetail.setIfCancel(false);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ workerOrderDetails.add(workerOrderDetail);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ workerOrderDetailPage.setRecords(workerOrderDetails);
|
|
|
|
+
|
|
|
|
+ return workerOrderDetailPage;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|