订单信息页
This commit is contained in:
parent
f8b88dddf1
commit
ab034f6ab9
|
|
@ -12,6 +12,7 @@ import com.ghy.common.enums.PayStatus;
|
||||||
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.customer.service.CustomerService;
|
||||||
|
|
@ -119,8 +120,57 @@ public class OrderDetailController extends BaseController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(OrderDetail orderDetail) {
|
public TableDataInfo list(OrderDetail orderDetail) {
|
||||||
startPage();
|
startPage();
|
||||||
List<OrderDetail> orderDetailList = orderDetailService.selectOrderDetailList(orderDetail);
|
List<OrderDetail> orderDetails = orderDetailService.selectOrderDetailList(orderDetail);
|
||||||
return getDataTable(orderDetailList);
|
|
||||||
|
Set<Long> customerIds = orderDetails.stream().map(OrderDetail::getCustomerId).collect(Collectors.toSet());
|
||||||
|
Map<Long, Customer> customerMap = customerService.selectByIds(customerIds)
|
||||||
|
.stream().collect(Collectors.toMap(Customer::getCustomerId, x -> x, (x, y) -> y));
|
||||||
|
|
||||||
|
Set<Long> orderMasterIds = orderDetails.stream().map(OrderDetail::getOrderMasterId).collect(Collectors.toSet());
|
||||||
|
List<OrderMaster> orderMasters = orderMasterService.selectByIds(orderMasterIds);
|
||||||
|
Map<Long, OrderMaster> orderMasterMap = orderMasters.stream().collect(Collectors.toMap(OrderMaster::getId, 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> orderDetailIds = orderDetails.stream().map(OrderDetail::getId).collect(Collectors.toSet());
|
||||||
|
Map<Long, FinancialDetail> financialDetailMap = financialDetailService.selectByOrderDetailIds(orderDetailIds)
|
||||||
|
.stream().collect(Collectors.toMap(FinancialDetail::getOrderDetailId, x -> x, (x, y) -> y));
|
||||||
|
|
||||||
|
Set<Long> goodsIds = orderMasters.stream().map(OrderMaster::getGoodsId).collect(Collectors.toSet());
|
||||||
|
Map<Long, Goods> goodsMap = goodsService.selectByIds(goodsIds)
|
||||||
|
.stream().collect(Collectors.toMap(Goods::getGoodsId, x -> x, (x, y) -> y));
|
||||||
|
|
||||||
|
Set<Long> workerIds = orderDetails.stream().map(OrderDetail::getWorkerId).collect(Collectors.toSet());
|
||||||
|
Map<Long, Worker> workerMap = workerService.selectByIds(workerIds)
|
||||||
|
.stream().collect(Collectors.toMap(Worker::getWorkerId, x -> x, (x, y) -> y));
|
||||||
|
|
||||||
|
for (OrderDetail detail : orderDetails) {
|
||||||
|
Customer customer = customerMap.get(detail.getCustomerId());
|
||||||
|
if (customer != null) {
|
||||||
|
detail.setCustomerName(customer.getName());
|
||||||
|
detail.setCustomerPhone(customer.getPhone());
|
||||||
|
}
|
||||||
|
OrderMaster orderMaster = orderMasterMap.get(detail.getOrderMasterId());
|
||||||
|
if (orderMaster != null) {
|
||||||
|
detail.setPayStatus(orderMaster.getPayStatus());
|
||||||
|
detail.setPayType(orderMaster.getPayType());
|
||||||
|
detail.setPayTime(orderMaster.getPayTime());
|
||||||
|
detail.setGoods(goodsMap.get(orderMaster.getGoodsId()));
|
||||||
|
FinancialMaster fm = financialMasterMap.get(detail.getOrderMasterId());
|
||||||
|
if (fm != null) {
|
||||||
|
detail.setFinancialMasterMoney(fm.getPayMoney());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FinancialDetail fd = financialDetailMap.get(detail.getId());
|
||||||
|
if (fd != null) {
|
||||||
|
detail.setFinancialDetailMoney(fd.getPayMoney());
|
||||||
|
}
|
||||||
|
detail.setWorker(workerMap.get(detail.getWorkerId()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return getDataTable(orderDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/app/detail")
|
@PostMapping("/app/detail")
|
||||||
|
|
@ -203,7 +253,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(), detail.getWorkerId())){
|
if (this.checkIsOnlyServer(orderMaster.getId(), detail.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) {
|
||||||
|
|
@ -213,7 +263,7 @@ public class OrderDetailController extends BaseController {
|
||||||
}
|
}
|
||||||
orderListResponse.setPayMoney(workerFee);
|
orderListResponse.setPayMoney(workerFee);
|
||||||
orderListResponse.setIsOnlyServ(Boolean.TRUE);
|
orderListResponse.setIsOnlyServ(Boolean.TRUE);
|
||||||
}else {
|
} else {
|
||||||
orderListResponse.setPayMoney(detailPayMoney);
|
orderListResponse.setPayMoney(detailPayMoney);
|
||||||
orderListResponse.setIsOnlyServ(Boolean.FALSE);
|
orderListResponse.setIsOnlyServ(Boolean.FALSE);
|
||||||
}
|
}
|
||||||
|
|
@ -221,7 +271,7 @@ 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);
|
||||||
|
|
||||||
// 超时记录
|
// 超时记录
|
||||||
OrderTimeoutRecord timeoutRecordQry = new OrderTimeoutRecord();
|
OrderTimeoutRecord timeoutRecordQry = new OrderTimeoutRecord();
|
||||||
|
|
@ -230,11 +280,18 @@ public class OrderDetailController extends BaseController {
|
||||||
SysDeptConfig sysDeptConfig = sysDeptConfigService.selectByDeptId(request.getDeptId());
|
SysDeptConfig sysDeptConfig = sysDeptConfigService.selectByDeptId(request.getDeptId());
|
||||||
orderTimeoutRecords.stream().forEach(timeoutRecord -> {
|
orderTimeoutRecords.stream().forEach(timeoutRecord -> {
|
||||||
switch (timeoutRecord.getOrderStatus()) {
|
switch (timeoutRecord.getOrderStatus()) {
|
||||||
case 0: timeoutRecord.setPayMoney(sysDeptConfig.getPlainOutTime()); break;
|
case 0:
|
||||||
case 1: timeoutRecord.setPayMoney(sysDeptConfig.getGoOutTime()); break;
|
timeoutRecord.setPayMoney(sysDeptConfig.getPlainOutTime());
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
timeoutRecord.setPayMoney(sysDeptConfig.getGoOutTime());
|
||||||
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
case 3: timeoutRecord.setPayMoney(sysDeptConfig.getGoingOutTime()); break;
|
case 3:
|
||||||
default: break;
|
timeoutRecord.setPayMoney(sysDeptConfig.getGoingOutTime());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -352,7 +409,7 @@ public class OrderDetailController extends BaseController {
|
||||||
OrderTimeoutRecord orderTimeoutRecord = orderFineRecordService.selectByDetailIdAndStatus(detail.getId(), detail.getOrderStatus());
|
OrderTimeoutRecord orderTimeoutRecord = orderFineRecordService.selectByDetailIdAndStatus(detail.getId(), detail.getOrderStatus());
|
||||||
Boolean isOverTime = orderTimeoutRecord == null ? false : true;
|
Boolean isOverTime = orderTimeoutRecord == null ? false : true;
|
||||||
|
|
||||||
if(this.checkIsOnlyServer(orderMaster.getId(), detail.getWorkerId())){
|
if (this.checkIsOnlyServer(orderMaster.getId(), detail.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) {
|
||||||
|
|
@ -362,7 +419,7 @@ public class OrderDetailController extends BaseController {
|
||||||
}
|
}
|
||||||
orderListResponse.setPayMoney(workerFee);
|
orderListResponse.setPayMoney(workerFee);
|
||||||
orderListResponse.setIsOnlyServ(Boolean.TRUE);
|
orderListResponse.setIsOnlyServ(Boolean.TRUE);
|
||||||
}else {
|
} else {
|
||||||
orderListResponse.setPayMoney(detailPayMoney);
|
orderListResponse.setPayMoney(detailPayMoney);
|
||||||
orderListResponse.setIsOnlyServ(Boolean.FALSE);
|
orderListResponse.setIsOnlyServ(Boolean.FALSE);
|
||||||
}
|
}
|
||||||
|
|
@ -418,17 +475,17 @@ public class OrderDetailController extends BaseController {
|
||||||
AfterServiceRecord afterServiceRecord = new AfterServiceRecord();
|
AfterServiceRecord afterServiceRecord = new AfterServiceRecord();
|
||||||
afterServiceRecord.setExcludeAfterServiceFinished(Boolean.TRUE);
|
afterServiceRecord.setExcludeAfterServiceFinished(Boolean.TRUE);
|
||||||
List<AfterServiceRecord> afterServiceRecordList = afterServiceRecordService.selectAfterServiceRecordList(afterServiceRecord);
|
List<AfterServiceRecord> afterServiceRecordList = afterServiceRecordService.selectAfterServiceRecordList(afterServiceRecord);
|
||||||
Map<Long, List<AfterServiceRecord>> detailRecordMap = afterServiceRecordList.stream().collect(Collectors.groupingBy(record->record.getOrderDetailId()));
|
Map<Long, List<AfterServiceRecord>> detailRecordMap = afterServiceRecordList.stream().collect(Collectors.groupingBy(record -> record.getOrderDetailId()));
|
||||||
// 踢重后的子单ids
|
// 踢重后的子单ids
|
||||||
List<Long> detailIds = afterServiceRecordList.stream().map(AfterServiceRecord::getOrderDetailId).distinct().collect(Collectors.toList());
|
List<Long> detailIds = afterServiceRecordList.stream().map(AfterServiceRecord::getOrderDetailId).distinct().collect(Collectors.toList());
|
||||||
StringBuilder orderDetailIds = new StringBuilder();
|
StringBuilder orderDetailIds = new StringBuilder();
|
||||||
detailIds.forEach(id->{
|
detailIds.forEach(id -> {
|
||||||
orderDetailIds.append(id).append(",");
|
orderDetailIds.append(id).append(",");
|
||||||
});
|
});
|
||||||
String ids = orderDetailIds.toString();
|
String ids = orderDetailIds.toString();
|
||||||
if(StringUtils.isNotEmpty(ids)){
|
if (StringUtils.isNotEmpty(ids)) {
|
||||||
orderDetail.setOrderDetailIds(ids.substring(0, ids.length()-1));
|
orderDetail.setOrderDetailIds(ids.substring(0, ids.length() - 1));
|
||||||
}else {
|
} else {
|
||||||
orderDetail.setOrderDetailIds("0");
|
orderDetail.setOrderDetailIds("0");
|
||||||
}
|
}
|
||||||
startPage();
|
startPage();
|
||||||
|
|
@ -497,7 +554,7 @@ public class OrderDetailController extends BaseController {
|
||||||
OrderTimeoutRecord orderTimeoutRecord = orderFineRecordService.selectByDetailIdAndStatus(detail.getId(), detail.getOrderStatus());
|
OrderTimeoutRecord orderTimeoutRecord = orderFineRecordService.selectByDetailIdAndStatus(detail.getId(), detail.getOrderStatus());
|
||||||
Boolean isOverTime = orderTimeoutRecord == null ? false : true;
|
Boolean isOverTime = orderTimeoutRecord == null ? false : true;
|
||||||
|
|
||||||
if(this.checkIsOnlyServer(orderMaster.getId(), detail.getWorkerId())){
|
if (this.checkIsOnlyServer(orderMaster.getId(), detail.getWorkerId())) {
|
||||||
FinancialMaster financialMaster = financialMasterService.selectByOrderMasterId(detail.getOrderMasterId());
|
FinancialMaster financialMaster = financialMasterService.selectByOrderMasterId(detail.getOrderMasterId());
|
||||||
BigDecimal workerFee = financialMaster.getPayMoney();
|
BigDecimal workerFee = financialMaster.getPayMoney();
|
||||||
List<FinancialDetail> financialDetailList = financialDetailService.selectByFinancialMasterId(financialMaster.getId());
|
List<FinancialDetail> financialDetailList = financialDetailService.selectByFinancialMasterId(financialMaster.getId());
|
||||||
|
|
@ -508,7 +565,7 @@ public class OrderDetailController extends BaseController {
|
||||||
}
|
}
|
||||||
orderListResponse.setPayMoney(workerFee);
|
orderListResponse.setPayMoney(workerFee);
|
||||||
orderListResponse.setIsOnlyServ(Boolean.TRUE);
|
orderListResponse.setIsOnlyServ(Boolean.TRUE);
|
||||||
}else {
|
} else {
|
||||||
orderListResponse.setPayMoney(detailPayMoney);
|
orderListResponse.setPayMoney(detailPayMoney);
|
||||||
orderListResponse.setIsOnlyServ(Boolean.FALSE);
|
orderListResponse.setIsOnlyServ(Boolean.FALSE);
|
||||||
}
|
}
|
||||||
|
|
@ -672,17 +729,17 @@ public class OrderDetailController extends BaseController {
|
||||||
// 判断工单状态是否为服务中以及是否已支付
|
// 判断工单状态是否为服务中以及是否已支付
|
||||||
OrderDetail orderDetail = orderDetailService.selectById(request.getOrderDetailId());
|
OrderDetail orderDetail = orderDetailService.selectById(request.getOrderDetailId());
|
||||||
OrderMaster orderMaster = orderMasterService.selectById(orderDetail.getOrderMasterId());
|
OrderMaster orderMaster = orderMasterService.selectById(orderDetail.getOrderMasterId());
|
||||||
if(orderDetail.getOrderStatus().equals(OrderStatus.FINISH_CHECK.code())){
|
if (orderDetail.getOrderStatus().equals(OrderStatus.FINISH_CHECK.code())) {
|
||||||
return AjaxResult.success("发起成功");
|
return AjaxResult.success("发起成功");
|
||||||
}
|
}
|
||||||
if (orderDetail.getOrderStatus() != OrderStatus.SERVER.code()
|
if (orderDetail.getOrderStatus() != OrderStatus.SERVER.code()
|
||||||
|| !orderMaster.getPayStatus().equals(PayStatus.PAID.getCode())) {
|
|| !orderMaster.getPayStatus().equals(PayStatus.PAID.getCode())) {
|
||||||
return AjaxResult.error("未支付订单或非服务中订单,发起完单失败");
|
return AjaxResult.error("未支付订单或非服务中订单,发起完单失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 存储完单图
|
// 存储完单图
|
||||||
List<GoodsImgs> finishImgObjList = new ArrayList<GoodsImgs>();
|
List<GoodsImgs> finishImgObjList = new ArrayList<GoodsImgs>();
|
||||||
for (String imgUrl: request.getFinishImgList()) {
|
for (String imgUrl : request.getFinishImgList()) {
|
||||||
GoodsImgs finishImgObj = new GoodsImgs();
|
GoodsImgs finishImgObj = new GoodsImgs();
|
||||||
finishImgObj.setGoodsId(0L);
|
finishImgObj.setGoodsId(0L);
|
||||||
finishImgObj.setImgType(ImgType.FINISH_IMG.getId());
|
finishImgObj.setImgType(ImgType.FINISH_IMG.getId());
|
||||||
|
|
@ -745,11 +802,11 @@ public class OrderDetailController extends BaseController {
|
||||||
|
|
||||||
@PostMapping("/app/change/price")
|
@PostMapping("/app/change/price")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult changePrice(@Valid @RequestBody OrderChangePriceRequest request){
|
public AjaxResult changePrice(@Valid @RequestBody OrderChangePriceRequest request) {
|
||||||
try {
|
try {
|
||||||
Assert.notNull(request.getChangeMoney(), "报价不能为空");
|
Assert.notNull(request.getChangeMoney(), "报价不能为空");
|
||||||
return toAjax(orderDetailService.changePrice(request.getOrderDetailId(), request.getChangeMoney(), request.getType(), request.getRemark()));
|
return toAjax(orderDetailService.changePrice(request.getOrderDetailId(), request.getChangeMoney(), request.getType(), request.getRemark()));
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error(ExceptionUtil.getExceptionMessage(e));
|
logger.error(ExceptionUtil.getExceptionMessage(e));
|
||||||
return AjaxResult.error("改价失败!");
|
return AjaxResult.error("改价失败!");
|
||||||
|
|
@ -758,32 +815,32 @@ public class OrderDetailController extends BaseController {
|
||||||
|
|
||||||
@PostMapping("/app/getChangePrice")
|
@PostMapping("/app/getChangePrice")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult getChangePrice(@Valid @RequestBody OrderChangePriceRequest request){
|
public AjaxResult getChangePrice(@Valid @RequestBody OrderChangePriceRequest request) {
|
||||||
try {
|
try {
|
||||||
return AjaxResult.success(orderDetailService.getChangedPriceRecord(request.getOrderDetailId()));
|
return AjaxResult.success(orderDetailService.getChangedPriceRecord(request.getOrderDetailId()));
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error(ExceptionUtil.getExceptionMessage(e));
|
logger.error(ExceptionUtil.getExceptionMessage(e));
|
||||||
return AjaxResult.error("查询改价失败!");
|
return AjaxResult.error("查询改价失败!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkIsOnlyServer(Long orderMasterId, Long workId){
|
private boolean checkIsOnlyServer(Long orderMasterId, Long workId) {
|
||||||
// 找出原单的数量
|
// 找出原单的数量
|
||||||
List<OrderGoods> orderGoodsList = orderGoodsService.selectByOrderMasterId(orderMasterId);
|
List<OrderGoods> orderGoodsList = orderGoodsService.selectByOrderMasterId(orderMasterId);
|
||||||
// 找出原单关联的细单的商品数量
|
// 找出原单关联的细单的商品数量
|
||||||
List<OrderDetail> orderDetailList = orderDetailService.selectByOrderMasterId(orderMasterId);
|
List<OrderDetail> orderDetailList = orderDetailService.selectByOrderMasterId(orderMasterId);
|
||||||
for (OrderDetail detail : orderDetailList){
|
for (OrderDetail detail : orderDetailList) {
|
||||||
// 非一个师傅接单
|
// 非一个师傅接单
|
||||||
if(!workId.equals(detail.getWorkerId())){
|
if (!workId.equals(detail.getWorkerId())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 子单数量
|
// 子单数量
|
||||||
List<OrderGoods> orderDetailGoodsList = orderGoodsService.selectByOrderDetailId(detail.getId());
|
List<OrderGoods> orderDetailGoodsList = orderGoodsService.selectByOrderDetailId(detail.getId());
|
||||||
// 计算剩余未分配的商品数量
|
// 计算剩余未分配的商品数量
|
||||||
for (OrderGoods detailGoods : orderDetailGoodsList) {
|
for (OrderGoods detailGoods : orderDetailGoodsList) {
|
||||||
for(OrderGoods masterGoods : orderGoodsList){
|
for (OrderGoods masterGoods : orderGoodsList) {
|
||||||
if(Objects.equals(masterGoods.getGoodsStandardId(), detailGoods.getGoodsStandardId())){
|
if (Objects.equals(masterGoods.getGoodsStandardId(), detailGoods.getGoodsStandardId())) {
|
||||||
masterGoods.setGoodsNum(masterGoods.getGoodsNum() - detailGoods.getGoodsNum());
|
masterGoods.setGoodsNum(masterGoods.getGoodsNum() - detailGoods.getGoodsNum());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@
|
||||||
<li>
|
<li>
|
||||||
订单状态:<select name="status" th:with="type=${@dict.getType('order_status')}">
|
订单状态:<select name="status" th:with="type=${@dict.getType('order_status')}">
|
||||||
<option value="">所有</option>
|
<option value="">所有</option>
|
||||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
|
||||||
|
th:value="${dict.dictValue}"></option>
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|
@ -60,7 +61,7 @@
|
||||||
var orderStatus = [[${@dict.getType('order_status')}]];
|
var orderStatus = [[${@dict.getType('order_status')}]];
|
||||||
|
|
||||||
var editFlag = [[${@permission.hasPermi('order:order:edit')}]];
|
var editFlag = [[${@permission.hasPermi('order:order:edit')}]];
|
||||||
var prefix = ctx + "order/master";
|
var prefix = ctx + "order/detail";
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
var panehHidden = false;
|
var panehHidden = false;
|
||||||
|
|
@ -95,35 +96,51 @@
|
||||||
title: '订单ID',
|
title: '订单ID',
|
||||||
visible: false
|
visible: false
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// field: 'code',
|
||||||
|
// title: '订单编号'
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
field: 'code',
|
field: 'goods',
|
||||||
title: '订单号'
|
title: '订单信息',
|
||||||
},
|
formatter: function (value, row) {
|
||||||
{
|
return '<div style="display:flex">'
|
||||||
field: 'customerName',
|
+ '<img decoding="async" src="' + value.goodsImgUrl + '" width="120" height="120" />'
|
||||||
title: '消费者'
|
+ '<div>'
|
||||||
},
|
+ '<h3>' + row.code + '<h3/>'
|
||||||
{
|
+ '<h3>' + value.goodsName + '<h3/>'
|
||||||
field: 'orderType',
|
+ '<p>'
|
||||||
title: '订单类型',
|
+ '<small>' + value.goodsDesc + '</small><br>'
|
||||||
align: 'center',
|
+ '<small>创建时间:' + row.createTime + '</small><br>'
|
||||||
formatter: function(value, row, index) {
|
+ '<small>消费者:' + row.customerName + row.customerPhone + '</small><br>'
|
||||||
return $.table.selectDictLabel(orderTypes, value);
|
+ '<small>预约时间:' + row.expectTimeStart + ' - ' + row.expectTimeEnd + '</small><br>'
|
||||||
|
+ '<small>总金额:' + row.financialMasterMoney + '元 应得金额:' + row.financialDetailMoney + '元</small><br>'
|
||||||
|
+ '<p/>'
|
||||||
|
+ '</div>'
|
||||||
|
+ '</div>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'orderStatus',
|
field: 'orderStatus',
|
||||||
title: '订单状态',
|
title: '订单状态',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: function(value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
return $.table.selectDictLabel(orderStatus, value);
|
return $.table.selectDictLabel(orderStatus, value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'orderType',
|
||||||
|
title: '订单类型',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return $.table.selectDictLabel(orderTypes, value);
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'payType',
|
field: 'payType',
|
||||||
title: '付款类型',
|
title: '付款类型',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: function(value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
return $.table.selectDictLabel(payTypes, value);
|
return $.table.selectDictLabel(payTypes, value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -131,7 +148,7 @@
|
||||||
field: 'payStatus',
|
field: 'payStatus',
|
||||||
title: '付款状态',
|
title: '付款状态',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
formatter: function(value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
return $.table.selectDictLabel(payStatus, value);
|
return $.table.selectDictLabel(payStatus, value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -140,23 +157,21 @@
|
||||||
title: '付款时间'
|
title: '付款时间'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'workerName',
|
field: 'worker',
|
||||||
title: '接单师傅'
|
title: '接单信息',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return '<small>' + value.name + value.phone + '</small><br>'
|
||||||
|
+ '<small>接单时间:' + row.revTime + '</small>'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'revTime',
|
|
||||||
title: '接单时间'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'createTime',
|
|
||||||
title: '创建时间',
|
|
||||||
sortable: true
|
|
||||||
}, {
|
|
||||||
title: '操作',
|
title: '操作',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
var actions = [];
|
var actions = [];
|
||||||
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
|
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="detail(\''
|
||||||
|
+ row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
|
||||||
return actions.join('');
|
return actions.join('');
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,9 @@ package com.ghy.customer.mapper;
|
||||||
import com.ghy.customer.domain.Customer;
|
import com.ghy.customer.domain.Customer;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author clunt
|
* @author clunt
|
||||||
|
|
@ -56,9 +58,9 @@ public interface CustomerMapper {
|
||||||
/**
|
/**
|
||||||
* 根据消费者id集合信息进行批量查询数据
|
* 根据消费者id集合信息进行批量查询数据
|
||||||
*
|
*
|
||||||
* @param customerIdList 消费者id集合信息。
|
* @param customerIds 消费者id集合信息。
|
||||||
* @return Customer实体集合信息
|
* @return Customer实体集合信息
|
||||||
*/
|
*/
|
||||||
List<Customer> getByCustomerIdList(@Param("customerIdList") List<Long> customerIdList);
|
List<Customer> selectByIds(@Param("customerIds") Collection<Long> customerIds);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.ghy.customer.domain.Customer;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author clunt
|
* @author clunt
|
||||||
|
|
@ -67,4 +68,9 @@ public interface CustomerService {
|
||||||
*/
|
*/
|
||||||
Map<Long, Customer> byCustomerUseridInMap(List<Long> customerUserIdList);
|
Map<Long, Customer> byCustomerUseridInMap(List<Long> customerUserIdList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param customerIds 消费者ID
|
||||||
|
* @return Customer
|
||||||
|
*/
|
||||||
|
List<Customer> selectByIds(Set<Long> customerIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,10 @@ import com.ghy.customer.domain.Customer;
|
||||||
import com.ghy.customer.mapper.CustomerMapper;
|
import com.ghy.customer.mapper.CustomerMapper;
|
||||||
import com.ghy.customer.service.CustomerService;
|
import com.ghy.customer.service.CustomerService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author clunt
|
* @author clunt
|
||||||
|
|
@ -41,21 +40,19 @@ public class CustomerServiceImpl implements CustomerService {
|
||||||
@Override
|
@Override
|
||||||
public Customer selectByOpenId(Customer customer) {
|
public Customer selectByOpenId(Customer customer) {
|
||||||
List<Customer> list = customerMapper.getCustomerList(customer);
|
List<Customer> list = customerMapper.getCustomerList(customer);
|
||||||
if(StringUtils.isNotEmpty(list)){
|
if (StringUtils.isNotEmpty(list)) {
|
||||||
return list.get(0);
|
return list.get(0);
|
||||||
}else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int deleteByIds(String ids) {
|
public int deleteByIds(String ids) {
|
||||||
Long [] customerIds = Convert.toLongArray(ids);
|
Long[] customerIds = Convert.toLongArray(ids);
|
||||||
for (Long customerId : customerIds)
|
for (Long customerId : customerIds) {
|
||||||
{
|
|
||||||
Customer customer = selectByCustomerId(customerId);
|
Customer customer = selectByCustomerId(customerId);
|
||||||
if (countUserCustomer(customer) > 0)
|
if (countUserCustomer(customer) > 0) {
|
||||||
{
|
|
||||||
throw new ServiceException(String.format("%1$s正在使用,不能删除", customer.getName()));
|
throw new ServiceException(String.format("%1$s正在使用,不能删除", customer.getName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -65,8 +62,7 @@ public class CustomerServiceImpl implements CustomerService {
|
||||||
@Override
|
@Override
|
||||||
public int deleteByCustomerId(Long customerId) {
|
public int deleteByCustomerId(Long customerId) {
|
||||||
Customer customer = selectByCustomerId(customerId);
|
Customer customer = selectByCustomerId(customerId);
|
||||||
if (countUserCustomer(customer) > 0)
|
if (countUserCustomer(customer) > 0) {
|
||||||
{
|
|
||||||
throw new ServiceException(String.format("%1$s正在使用,不能删除", customer.getName()));
|
throw new ServiceException(String.format("%1$s正在使用,不能删除", customer.getName()));
|
||||||
}
|
}
|
||||||
return customerMapper.deleteByCustomerId(customerId);
|
return customerMapper.deleteByCustomerId(customerId);
|
||||||
|
|
@ -85,10 +81,10 @@ public class CustomerServiceImpl implements CustomerService {
|
||||||
@Override
|
@Override
|
||||||
public Map<Long, Customer> byCustomerUseridInMap(List<Long> customerUserIdList) {
|
public Map<Long, Customer> byCustomerUseridInMap(List<Long> customerUserIdList) {
|
||||||
Map<Long, Customer> longCustomerMap = new HashMap<>();
|
Map<Long, Customer> longCustomerMap = new HashMap<>();
|
||||||
if(customerUserIdList != null && customerUserIdList.size() > 0){
|
if (customerUserIdList != null && customerUserIdList.size() > 0) {
|
||||||
List<Customer> customerList = customerMapper.getByCustomerIdList(customerUserIdList);
|
List<Customer> customerList = customerMapper.selectByIds(customerUserIdList);
|
||||||
if(customerList != null && customerList.size() > 0){
|
if (customerList != null && customerList.size() > 0) {
|
||||||
for(Customer customer : customerList){
|
for (Customer customer : customerList) {
|
||||||
longCustomerMap.put(customer.getCustomerId(), customer);
|
longCustomerMap.put(customer.getCustomerId(), customer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -100,4 +96,12 @@ public class CustomerServiceImpl implements CustomerService {
|
||||||
//TODO 需要校验用户是否在被使用。
|
//TODO 需要校验用户是否在被使用。
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Customer> selectByIds(Set<Long> customerIds) {
|
||||||
|
if (CollectionUtils.isEmpty(customerIds)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return customerMapper.selectByIds(customerIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -136,11 +136,11 @@
|
||||||
where customer_id = #{customerId}
|
where customer_id = #{customerId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="getByCustomerIdList" resultMap="CustomerResult">
|
<select id="selectByIds" resultMap="CustomerResult">
|
||||||
<include refid="selectCustomer" />
|
<include refid="selectCustomer" />
|
||||||
<where>
|
<where>
|
||||||
and customer_id in
|
AND customer_id IN
|
||||||
<foreach item="item" index="customerIdList" collection="customerIdList" open="(" separator="," close=")">
|
<foreach item="item" index="customerIds" collection="customerIds" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</where>
|
</where>
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,11 @@ package com.ghy.order.domain;
|
||||||
|
|
||||||
import com.ghy.common.annotation.Excel;
|
import com.ghy.common.annotation.Excel;
|
||||||
import com.ghy.common.core.domain.BaseEntity;
|
import com.ghy.common.core.domain.BaseEntity;
|
||||||
|
import com.ghy.goods.domain.Goods;
|
||||||
|
import com.ghy.worker.domain.Worker;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -34,6 +37,12 @@ public class OrderDetail extends BaseEntity {
|
||||||
@Excel(name = "消费者用户id", cellType = Excel.ColumnType.NUMERIC)
|
@Excel(name = "消费者用户id", cellType = Excel.ColumnType.NUMERIC)
|
||||||
private Long customerId;
|
private Long customerId;
|
||||||
|
|
||||||
|
@Excel(name = "消费者", cellType = Excel.ColumnType.STRING)
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
@Excel(name = "消费者电话", cellType = Excel.ColumnType.STRING)
|
||||||
|
private String customerPhone;
|
||||||
|
|
||||||
@Excel(name = "订单类型", cellType = Excel.ColumnType.NUMERIC)
|
@Excel(name = "订单类型", cellType = Excel.ColumnType.NUMERIC)
|
||||||
private Integer orderType;
|
private Integer orderType;
|
||||||
|
|
||||||
|
|
@ -43,6 +52,8 @@ public class OrderDetail extends BaseEntity {
|
||||||
@Excel(name = "接单师傅id", cellType = Excel.ColumnType.NUMERIC)
|
@Excel(name = "接单师傅id", cellType = Excel.ColumnType.NUMERIC)
|
||||||
private Long workerId;
|
private Long workerId;
|
||||||
|
|
||||||
|
private Worker worker;
|
||||||
|
|
||||||
@Excel(name = "接单时间", cellType = Excel.ColumnType.STRING)
|
@Excel(name = "接单时间", cellType = Excel.ColumnType.STRING)
|
||||||
private Date revTime;
|
private Date revTime;
|
||||||
|
|
||||||
|
|
@ -62,6 +73,7 @@ public class OrderDetail extends BaseEntity {
|
||||||
|
|
||||||
private Long goodsCategoryId;
|
private Long goodsCategoryId;
|
||||||
|
|
||||||
|
private Goods goods;
|
||||||
private String goodsName;
|
private String goodsName;
|
||||||
|
|
||||||
private Long countryId;
|
private Long countryId;
|
||||||
|
|
@ -90,4 +102,16 @@ public class OrderDetail extends BaseEntity {
|
||||||
* 发起提现时间 draw_cash_date
|
* 发起提现时间 draw_cash_date
|
||||||
*/
|
*/
|
||||||
private Date drawCashDate;
|
private Date drawCashDate;
|
||||||
|
|
||||||
|
@Excel(name = "付款类型", cellType = Excel.ColumnType.NUMERIC)
|
||||||
|
private Integer payType;
|
||||||
|
|
||||||
|
@Excel(name = "付款状态", cellType = Excel.ColumnType.NUMERIC)
|
||||||
|
private Integer payStatus;
|
||||||
|
|
||||||
|
@Excel(name = "付款时间", cellType = Excel.ColumnType.STRING)
|
||||||
|
private Date payTime;
|
||||||
|
|
||||||
|
private BigDecimal financialMasterMoney;
|
||||||
|
private BigDecimal financialDetailMoney;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.ghy.order.mapper;
|
||||||
import com.ghy.order.domain.OrderMaster;
|
import com.ghy.order.domain.OrderMaster;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -85,4 +86,5 @@ public interface OrderMasterMapper {
|
||||||
*/
|
*/
|
||||||
List<OrderMaster> selectUnfinished();
|
List<OrderMaster> selectUnfinished();
|
||||||
|
|
||||||
|
List<OrderMaster> selectByIds(@Param("orderMasterId") Collection<Long> orderMasterIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ import com.ghy.order.domain.OrderMaster;
|
||||||
import com.ghy.order.request.AppOrderRequest;
|
import com.ghy.order.request.AppOrderRequest;
|
||||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主订单接口
|
* 主订单接口
|
||||||
|
|
@ -115,4 +117,6 @@ public interface OrderMasterService {
|
||||||
* @return 主订单
|
* @return 主订单
|
||||||
*/
|
*/
|
||||||
List<OrderMaster> selectUnfinished();
|
List<OrderMaster> selectUnfinished();
|
||||||
|
|
||||||
|
List<OrderMaster> selectByIds(Collection<Long> masterIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -397,4 +397,12 @@ public class OrderMasterServiceImpl implements OrderMasterService {
|
||||||
public List<OrderMaster> selectUnfinished() {
|
public List<OrderMaster> selectUnfinished() {
|
||||||
return orderMasterMapper.selectUnfinished();
|
return orderMasterMapper.selectUnfinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OrderMaster> selectByIds(Collection<Long> masterIds) {
|
||||||
|
if (CollectionUtils.isEmpty(masterIds)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return orderMasterMapper.selectByIds(masterIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,8 @@
|
||||||
create_by,
|
create_by,
|
||||||
create_time,
|
create_time,
|
||||||
remark,
|
remark,
|
||||||
all_self_assigned
|
all_self_assigned,
|
||||||
|
goods_id
|
||||||
FROM order_master
|
FROM order_master
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="selectOrderMasterMoreInfo">
|
<sql id="selectOrderMasterMoreInfo">
|
||||||
|
|
@ -330,4 +331,15 @@
|
||||||
WHERE `order_status` < 5
|
WHERE `order_status` < 5
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectByIds" resultMap="OrderMasterResult">
|
||||||
|
<include refid="selectOrderMaster"/>
|
||||||
|
<where>
|
||||||
|
AND id IN
|
||||||
|
<foreach item="item" index="orderMasterId" collection="orderMasterId" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ import com.ghy.payment.domain.FinancialDetail;
|
||||||
import com.ghy.payment.response.FinancialCountResponse;
|
import com.ghy.payment.response.FinancialCountResponse;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 财务细单(转派后产生的订单)的mapper层
|
* 财务细单(转派后产生的订单)的mapper层
|
||||||
|
|
@ -73,10 +75,10 @@ public interface FinancialDetailMapper {
|
||||||
/**
|
/**
|
||||||
* 根据订单id集合信息进行批量数据查询
|
* 根据订单id集合信息进行批量数据查询
|
||||||
*
|
*
|
||||||
* @param orderIdList 订单Id集合信息。
|
* @param orderDetailIds 订单Id集合信息。
|
||||||
* @return FinancialDetail实体集合信息。
|
* @return FinancialDetail实体集合信息。
|
||||||
*/
|
*/
|
||||||
List<FinancialDetail> getByOrderIdList(@Param("orderIdList") List<Long> orderIdList);
|
List<FinancialDetail> selectByOrderDetailIds(@Param("orderDetailIds") Collection<Long> orderDetailIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 撤销支付成功
|
* 撤销支付成功
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.ghy.payment.domain.FinancialMaster;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主财务单的mapper层
|
* 主财务单的mapper层
|
||||||
|
|
@ -47,10 +48,10 @@ public interface FinancialMasterMapper {
|
||||||
/**
|
/**
|
||||||
* 支付成功
|
* 支付成功
|
||||||
*
|
*
|
||||||
* @param id ID
|
* @param id ID
|
||||||
* @param payType 支付渠道
|
* @param payType 支付渠道
|
||||||
*/
|
*/
|
||||||
void paySucceeded(@Param(value = "paymentId")String paymentId, @Param(value = "id") Long id, @Param(value = "payType") int payType);
|
void paySucceeded(@Param(value = "paymentId") String paymentId, @Param(value = "id") Long id, @Param(value = "payType") int payType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付成功
|
* 支付成功
|
||||||
|
|
@ -74,4 +75,6 @@ public interface FinancialMasterMapper {
|
||||||
* @param paymentId 支付ID
|
* @param paymentId 支付ID
|
||||||
*/
|
*/
|
||||||
FinancialMaster selectByPaymentId(String paymentId);
|
FinancialMaster selectByPaymentId(String paymentId);
|
||||||
|
|
||||||
|
List<FinancialMaster> selectByOrderMasterIds(@Param(value = "orderMasterIds") Set<Long> orderMasterIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.ghy.payment.response.FinancialCountResponse;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 财务细单接口
|
* 财务细单接口
|
||||||
|
|
@ -60,6 +61,8 @@ public interface FinancialDetailService {
|
||||||
*/
|
*/
|
||||||
List<FinancialDetail> selectByFinancialMasterId(Long financialMasterId);
|
List<FinancialDetail> selectByFinancialMasterId(Long financialMasterId);
|
||||||
|
|
||||||
|
List<FinancialDetail> selectByOrderDetailIds(Set<Long> orderDetailIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ids 财务细单ids
|
* @param ids 财务细单ids
|
||||||
* @return 删除结果
|
* @return 删除结果
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.ghy.common.adapay.model.PaymentDTO;
|
||||||
import com.ghy.payment.domain.FinancialMaster;
|
import com.ghy.payment.domain.FinancialMaster;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主财务单接口
|
* 主财务单接口
|
||||||
|
|
@ -68,6 +69,8 @@ public interface FinancialMasterService {
|
||||||
*/
|
*/
|
||||||
FinancialMaster selectByOrderMasterId(Long orderMasterId);
|
FinancialMaster selectByOrderMasterId(Long orderMasterId);
|
||||||
|
|
||||||
|
List<FinancialMaster> selectByOrderMasterIds(Set<Long> orderMasterIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存一条支付记录
|
* 保存一条支付记录
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,7 @@ import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.format.DateTimeFormatterBuilder;
|
import java.time.format.DateTimeFormatterBuilder;
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
|
||||||
import static java.time.temporal.ChronoField.*;
|
import static java.time.temporal.ChronoField.*;
|
||||||
|
|
@ -154,7 +152,7 @@ public class FinancialDetailServiceImpl implements FinancialDetailService {
|
||||||
public Map<Long, FinancialDetail> byOrderIdInMap(List<Long> orderIdList) {
|
public Map<Long, FinancialDetail> byOrderIdInMap(List<Long> orderIdList) {
|
||||||
Map<Long, FinancialDetail> longFinancialDetailHashMap = new HashMap<>();
|
Map<Long, FinancialDetail> longFinancialDetailHashMap = new HashMap<>();
|
||||||
if (orderIdList != null && orderIdList.size() > 0) {
|
if (orderIdList != null && orderIdList.size() > 0) {
|
||||||
List<FinancialDetail> financialDetailList = financialDetailMapper.getByOrderIdList(orderIdList);
|
List<FinancialDetail> financialDetailList = financialDetailMapper.selectByOrderDetailIds(orderIdList);
|
||||||
if (financialDetailList != null && financialDetailList.size() > 0) {
|
if (financialDetailList != null && financialDetailList.size() > 0) {
|
||||||
for (FinancialDetail financialDetail : financialDetailList) {
|
for (FinancialDetail financialDetail : financialDetailList) {
|
||||||
longFinancialDetailHashMap.put(financialDetail.getOrderDetailId(), financialDetail);
|
longFinancialDetailHashMap.put(financialDetail.getOrderDetailId(), financialDetail);
|
||||||
|
|
@ -163,4 +161,12 @@ public class FinancialDetailServiceImpl implements FinancialDetailService {
|
||||||
}
|
}
|
||||||
return longFinancialDetailHashMap;
|
return longFinancialDetailHashMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FinancialDetail> selectByOrderDetailIds(Set<Long> orderDetailIds) {
|
||||||
|
if (CollectionUtils.isEmpty(orderDetailIds)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return financialDetailMapper.selectByOrderDetailIds(orderDetailIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,10 @@ import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.format.DateTimeFormatterBuilder;
|
import java.time.format.DateTimeFormatterBuilder;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
|
||||||
import static java.time.temporal.ChronoField.*;
|
import static java.time.temporal.ChronoField.*;
|
||||||
|
|
@ -67,13 +69,13 @@ public class FinancialMasterServiceImpl implements FinancialMasterService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<FinancialMaster> selectAppList(FinancialMaster request) {
|
public List<FinancialMaster> selectAppList(FinancialMaster request) {
|
||||||
List<FinancialMaster> masterList =this.selectFinancialMasterList(request);
|
List<FinancialMaster> masterList = this.selectFinancialMasterList(request);
|
||||||
masterList.forEach(master->{
|
masterList.forEach(master -> {
|
||||||
FinancialDetail param = new FinancialDetail();
|
FinancialDetail param = new FinancialDetail();
|
||||||
param.setFinancialMasterId(master.getId());
|
param.setFinancialMasterId(master.getId());
|
||||||
param.setPayeeId(request.getUserId());
|
param.setPayeeId(request.getUserId());
|
||||||
List<FinancialDetail> details = financialDetailService.selectFinancialDetailList(param);
|
List<FinancialDetail> details = financialDetailService.selectFinancialDetailList(param);
|
||||||
details.forEach(detail->{
|
details.forEach(detail -> {
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -105,9 +107,9 @@ public class FinancialMasterServiceImpl implements FinancialMasterService {
|
||||||
FinancialMaster param = new FinancialMaster();
|
FinancialMaster param = new FinancialMaster();
|
||||||
param.setOrderMasterCode(orderMasterCode);
|
param.setOrderMasterCode(orderMasterCode);
|
||||||
List<FinancialMaster> result = financialMasterMapper.selectFinancialMasterList(param);
|
List<FinancialMaster> result = financialMasterMapper.selectFinancialMasterList(param);
|
||||||
if(!CollectionUtils.isEmpty(result)){
|
if (!CollectionUtils.isEmpty(result)) {
|
||||||
financialMasterMapper.updateOrderStatus(result.get(0).getOrderMasterCode(), PayStatus.PAID.getCode());
|
financialMasterMapper.updateOrderStatus(result.get(0).getOrderMasterCode(), PayStatus.PAID.getCode());
|
||||||
if(StringUtils.isEmpty(result.get(0).getPaymentId())){
|
if (StringUtils.isEmpty(result.get(0).getPaymentId())) {
|
||||||
financialMasterMapper.paySucceeded(paymentId, result.get(0).getId(), payType);
|
financialMasterMapper.paySucceeded(paymentId, result.get(0).getId(), payType);
|
||||||
}
|
}
|
||||||
FinancialDetail request = new FinancialDetail();
|
FinancialDetail request = new FinancialDetail();
|
||||||
|
|
@ -116,7 +118,7 @@ public class FinancialMasterServiceImpl implements FinancialMasterService {
|
||||||
request.setPayType(payType);
|
request.setPayType(payType);
|
||||||
request.setPayTime(new Date());
|
request.setPayTime(new Date());
|
||||||
financialDetailService.updateByFinancialMasterId(request);
|
financialDetailService.updateByFinancialMasterId(request);
|
||||||
}else {
|
} else {
|
||||||
logger.error("原单不存在!");
|
logger.error("原单不存在!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -153,4 +155,11 @@ public class FinancialMasterServiceImpl implements FinancialMasterService {
|
||||||
return financialMasterMapper.selectByPaymentId(paymentId);
|
return financialMasterMapper.selectByPaymentId(paymentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FinancialMaster> selectByOrderMasterIds(Set<Long> orderMasterIds) {
|
||||||
|
if (CollectionUtils.isEmpty(orderMasterIds)) {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return financialMasterMapper.selectByOrderMasterIds(orderMasterIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -218,11 +218,11 @@
|
||||||
WHERE `code` = #{financialDetailCode} LIMIT 1
|
WHERE `code` = #{financialDetailCode} LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getByOrderIdList" resultMap="FinancialDetailResult">
|
<select id="selectByOrderDetailIds" resultMap="FinancialDetailResult">
|
||||||
<include refid="selectFinancialDetail" />
|
<include refid="selectFinancialDetail" />
|
||||||
<where>
|
<where>
|
||||||
and order_detail_id in
|
and order_detail_id in
|
||||||
<foreach item="item" index="orderIdList" collection="orderIdList" open="(" separator="," close=")">
|
<foreach item="item" index="orderDetailIds" collection="orderDetailIds" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</where>
|
</where>
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,13 @@
|
||||||
<include refid="selectFinancialMaster"/> WHERE payment_id = #{paymentId}
|
<include refid="selectFinancialMaster"/> WHERE payment_id = #{paymentId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByOrderMasterIds" resultMap="FinancialMasterResult">
|
||||||
|
<include refid="selectFinancialMaster"/> WHERE order_master_id IN
|
||||||
|
<foreach collection="orderMasterIds" item="orderMasterId" open="(" separator="," close=")">
|
||||||
|
#{orderMasterId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
<delete id="deleteFinancialMasterByIds" parameterType="Long">
|
<delete id="deleteFinancialMasterByIds" parameterType="Long">
|
||||||
DELETE FROM financial_master WHERE id IN
|
DELETE FROM financial_master WHERE id IN
|
||||||
<foreach collection="array" item="financialMasterId" open="(" separator="," close=")">
|
<foreach collection="array" item="financialMasterId" open="(" separator="," close=")">
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.ghy.worker.mapper;
|
||||||
import com.ghy.worker.domain.Worker;
|
import com.ghy.worker.domain.Worker;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface WorkerMapper {
|
public interface WorkerMapper {
|
||||||
|
|
@ -35,8 +36,8 @@ public interface WorkerMapper {
|
||||||
/**
|
/**
|
||||||
* 根据师傅id集合信息进行批量数据查询
|
* 根据师傅id集合信息进行批量数据查询
|
||||||
*
|
*
|
||||||
* @param workIdList 师傅Id集合信息。
|
* @param workIds 师傅Id集合信息。
|
||||||
* @return Worker实体集合信息。
|
* @return Worker实体集合信息。
|
||||||
*/
|
*/
|
||||||
List<Worker> getByWorkIdList(@Param("workIdList") List<Long> workIdList);
|
List<Worker> selectByIds(@Param("workIds") Collection<Long> workIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,10 @@ package com.ghy.worker.service;
|
||||||
|
|
||||||
import com.ghy.worker.domain.Worker;
|
import com.ghy.worker.domain.Worker;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public interface WorkerService {
|
public interface WorkerService {
|
||||||
|
|
||||||
|
|
@ -53,4 +55,6 @@ public interface WorkerService {
|
||||||
* @return 键值队列数据, key-> 师傅Id value-> 师傅实体信息
|
* @return 键值队列数据, key-> 师傅Id value-> 师傅实体信息
|
||||||
*/
|
*/
|
||||||
Map<Long, Worker> byWorkUserIdInMap(List<Long> workUserIdList);
|
Map<Long, Worker> byWorkUserIdInMap(List<Long> workUserIdList);
|
||||||
|
|
||||||
|
List<Worker> selectByIds(Set<Long> workerIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,7 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class WorkerServiceImpl implements WorkerService {
|
public class WorkerServiceImpl implements WorkerService {
|
||||||
|
|
@ -65,7 +63,7 @@ public class WorkerServiceImpl implements WorkerService {
|
||||||
public Map<Long, Worker> byWorkUserIdInMap(List<Long> workUserIdList) {
|
public Map<Long, Worker> byWorkUserIdInMap(List<Long> workUserIdList) {
|
||||||
Map<Long, Worker> longWorkerMap = new HashMap<>();
|
Map<Long, Worker> longWorkerMap = new HashMap<>();
|
||||||
if(workUserIdList != null && workUserIdList.size() > 0){
|
if(workUserIdList != null && workUserIdList.size() > 0){
|
||||||
List<Worker> workerList = workerMapper.getByWorkIdList(workUserIdList);
|
List<Worker> workerList = workerMapper.selectByIds(workUserIdList);
|
||||||
if(workerList != null && workerList.size() > 0){
|
if(workerList != null && workerList.size() > 0){
|
||||||
for(Worker worker : workerList){
|
for(Worker worker : workerList){
|
||||||
longWorkerMap.put(worker.getWorkerId(), worker);
|
longWorkerMap.put(worker.getWorkerId(), worker);
|
||||||
|
|
@ -74,4 +72,12 @@ public class WorkerServiceImpl implements WorkerService {
|
||||||
}
|
}
|
||||||
return longWorkerMap;
|
return longWorkerMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Worker> selectByIds(Set<Long> workerIds) {
|
||||||
|
if (CollectionUtils.isEmpty(workerIds)){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
return workerMapper.selectByIds(workerIds);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -137,11 +137,11 @@
|
||||||
where worker_id = #{workerId}
|
where worker_id = #{workerId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="getByWorkIdList" resultMap="WorkerResult">
|
<select id="selectByIds" resultMap="WorkerResult">
|
||||||
<include refid="selectWorker" />
|
<include refid="selectWorker" />
|
||||||
<where>
|
<where>
|
||||||
and w.worker_id in
|
and w.worker_id in
|
||||||
<foreach item="item" index="workIdList" collection="workIdList" open="(" separator="," close=")">
|
<foreach item="item" index="workIds" collection="workIds" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</where>
|
</where>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue