订单信息页补充
This commit is contained in:
parent
b0477d02ca
commit
59f084baf4
|
|
@ -138,16 +138,22 @@ public class OrderDetailController extends BaseController {
|
|||
Map<Long, FinancialDetail> financialDetailMap = financialDetailService.selectByOrderDetailIds(orderDetailIds)
|
||||
.stream().collect(Collectors.toMap(FinancialDetail::getOrderDetailId, x -> x, (x, y) -> y));
|
||||
|
||||
Map<Long, FinancialChangeRecord> fcMap = financialChangeRecordService.selectByOrderDetailIds(orderDetailIds)
|
||||
.stream().collect(Collectors.toMap(FinancialChangeRecord::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));
|
||||
List<Goods> goods = goodsService.selectByIds(goodsIds);
|
||||
Map<Long, Goods> goodsMap = goods.stream().collect(Collectors.toMap(Goods::getGoodsId, x -> x, (x, y) -> y));
|
||||
|
||||
Set<Long> workerIds = orderDetails.stream().map(OrderDetail::getWorkerId).collect(Collectors.toSet());
|
||||
workerIds.addAll(goods.stream().map(Goods::getWorkerId).collect(Collectors.toSet()));
|
||||
Map<Long, Worker> workerMap = workerService.selectByIds(workerIds)
|
||||
.stream().collect(Collectors.toMap(Worker::getWorkerId, x -> x, (x, y) -> y));
|
||||
|
||||
for (OrderDetail detail : orderDetails) {
|
||||
Customer customer = customerMap.get(detail.getCustomerId());
|
||||
detail.setWorker(workerMap.get(detail.getWorkerId()));
|
||||
if (customer != null) {
|
||||
detail.setCustomerName(customer.getName());
|
||||
detail.setCustomerPhone(customer.getPhone());
|
||||
|
|
@ -157,17 +163,24 @@ public class OrderDetailController extends BaseController {
|
|||
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());
|
||||
}
|
||||
Goods good = goodsMap.get(orderMaster.getGoodsId());
|
||||
if (good != null) {
|
||||
detail.setGoods(good);
|
||||
detail.setGoodsWorker(workerMap.get(good.getWorkerId()));
|
||||
}
|
||||
}
|
||||
FinancialDetail fd = financialDetailMap.get(detail.getId());
|
||||
if (fd != null) {
|
||||
detail.setFinancialDetailMoney(fd.getPayMoney());
|
||||
}
|
||||
detail.setWorker(workerMap.get(detail.getWorkerId()));
|
||||
FinancialChangeRecord fc = fcMap.get(detail.getId());
|
||||
if (fc != null) {
|
||||
detail.setChangeMoney(fc.getChangeMoney());
|
||||
}
|
||||
}
|
||||
|
||||
return getDataTable(orderDetails);
|
||||
|
|
|
|||
|
|
@ -96,10 +96,6 @@
|
|||
title: '订单ID',
|
||||
visible: false
|
||||
},
|
||||
// {
|
||||
// field: 'code',
|
||||
// title: '订单编号'
|
||||
// },
|
||||
{
|
||||
field: 'goods',
|
||||
title: '订单信息',
|
||||
|
|
@ -107,15 +103,13 @@
|
|||
return '<div style="display:flex">'
|
||||
+ '<img decoding="async" src="' + value.goodsImgUrl + '" width="120" height="120" />'
|
||||
+ '<div>'
|
||||
+ '<h3>' + row.code + '<h3/>'
|
||||
+ '<h3>' + value.goodsName + '<h3/>'
|
||||
+ '<p>'
|
||||
+ '<small>' + value.goodsDesc + '</small><br>'
|
||||
+ '<small>创建时间:' + row.createTime + '</small><br>'
|
||||
+ '<small>消费者:' + row.customerName + row.customerPhone + '</small><br>'
|
||||
+ '<small>预约时间:' + row.expectTimeStart + ' - ' + row.expectTimeEnd + '</small><br>'
|
||||
+ '<small>总金额:' + row.financialMasterMoney + '元 应得金额:' + row.financialDetailMoney + '元</small><br>'
|
||||
+ '<p/>'
|
||||
+ '<small> 订单编号:' + row.code + '<small/> <br>'
|
||||
+ '<h4> ' + value.goodsName + '<h4/>'
|
||||
+ '<small> ' + value.goodsDesc + '</small> <br>'
|
||||
+ '<small> 创建时间:' + row.createTime + '</small> <br>'
|
||||
+ '<small> 消费者:' + row.customerName + row.customerPhone + '</small> <br>'
|
||||
+ '<small> 预约时间:' + row.expectTimeStart + ' - ' + row.expectTimeEnd + '</small> <br>'
|
||||
+ '<small> 总金额:' + row.financialMasterMoney + '元 应得金额:' + row.financialDetailMoney + '元</small> <br>'
|
||||
+ '</div>'
|
||||
+ '</div>';
|
||||
}
|
||||
|
|
@ -159,21 +153,33 @@
|
|||
{
|
||||
field: 'worker',
|
||||
title: '接单信息',
|
||||
align: 'center',
|
||||
formatter: function (value, row, index) {
|
||||
return '<small>' + value.name + value.phone + '</small><br>'
|
||||
+ '<small>接单时间:' + row.revTime + '</small>'
|
||||
+ '<small>接单时间:' + row.revTime + '</small>';
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'left',
|
||||
field: 'goodsWorker',
|
||||
title: '商家信息',
|
||||
formatter: function (value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="detail(\''
|
||||
+ row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
|
||||
return actions.join('');
|
||||
return '<small>' + value.name + '</small><br>'
|
||||
+ '<small>' + value.phone + '</small>';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'changeMoney',
|
||||
title: '商家追加金额',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'left'
|
||||
// formatter: function (value, row, index) {
|
||||
// var actions = [];
|
||||
// actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="detail(\''
|
||||
// + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
|
||||
// return actions.join('');
|
||||
// }
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,10 @@ public class OrderDetail extends BaseEntity {
|
|||
@Excel(name = "接单师傅id", cellType = Excel.ColumnType.NUMERIC)
|
||||
private Long workerId;
|
||||
|
||||
// 接单师傅
|
||||
private Worker worker;
|
||||
// 商品归属师傅
|
||||
private Worker goodsWorker;
|
||||
|
||||
@Excel(name = "接单时间", cellType = Excel.ColumnType.STRING)
|
||||
private Date revTime;
|
||||
|
|
@ -114,4 +117,5 @@ public class OrderDetail extends BaseEntity {
|
|||
|
||||
private BigDecimal financialMasterMoney;
|
||||
private BigDecimal financialDetailMoney;
|
||||
private BigDecimal changeMoney;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,13 +3,14 @@ package com.ghy.payment.service;
|
|||
import com.ghy.payment.domain.FinancialChangeRecord;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author clunt
|
||||
*/
|
||||
public interface FinancialChangeRecordService {
|
||||
|
||||
public FinancialChangeRecord selectNotPayRecordByDetailId(Long orderDetailId);
|
||||
FinancialChangeRecord selectNotPayRecordByDetailId(Long orderDetailId);
|
||||
|
||||
/**
|
||||
* 查询改价记录
|
||||
|
|
@ -17,7 +18,7 @@ public interface FinancialChangeRecordService {
|
|||
* @param id 改价记录主键
|
||||
* @return 改价记录
|
||||
*/
|
||||
public FinancialChangeRecord selectFinancialChangeRecordById(String id);
|
||||
FinancialChangeRecord selectFinancialChangeRecordById(String id);
|
||||
|
||||
/**
|
||||
* 查询改价记录列表
|
||||
|
|
@ -25,16 +26,19 @@ public interface FinancialChangeRecordService {
|
|||
* @param financialChangeRecord 改价记录
|
||||
* @return 改价记录集合
|
||||
*/
|
||||
public List<FinancialChangeRecord> selectFinancialChangeRecordList(FinancialChangeRecord financialChangeRecord);
|
||||
List<FinancialChangeRecord> selectFinancialChangeRecordList(FinancialChangeRecord financialChangeRecord);
|
||||
|
||||
List<FinancialChangeRecord> selectByDetailIds(String ids);
|
||||
|
||||
List<FinancialChangeRecord> selectByOrderDetailIds(Set<Long> orderDetailIds);
|
||||
|
||||
public List<FinancialChangeRecord> selectByDetailIds(String ids);
|
||||
/**
|
||||
* 新增改价记录
|
||||
*
|
||||
* @param financialChangeRecord 改价记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertFinancialChangeRecord(FinancialChangeRecord financialChangeRecord);
|
||||
int insertFinancialChangeRecord(FinancialChangeRecord financialChangeRecord);
|
||||
|
||||
/**
|
||||
* 修改改价记录
|
||||
|
|
@ -42,7 +46,7 @@ public interface FinancialChangeRecordService {
|
|||
* @param financialChangeRecord 改价记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateFinancialChangeRecord(FinancialChangeRecord financialChangeRecord);
|
||||
int updateFinancialChangeRecord(FinancialChangeRecord financialChangeRecord);
|
||||
|
||||
/**
|
||||
* 批量删除改价记录
|
||||
|
|
@ -50,7 +54,7 @@ public interface FinancialChangeRecordService {
|
|||
* @param ids 需要删除的改价记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFinancialChangeRecordByIds(String ids);
|
||||
int deleteFinancialChangeRecordByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除改价记录信息
|
||||
|
|
@ -58,6 +62,6 @@ public interface FinancialChangeRecordService {
|
|||
* @param id 改价记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteFinancialChangeRecordById(String id);
|
||||
int deleteFinancialChangeRecordById(String id);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,14 @@ import com.ghy.payment.domain.FinancialChangeRecord;
|
|||
import com.ghy.payment.mapper.FinancialChangeRecordMapper;
|
||||
import com.ghy.payment.service.FinancialChangeRecordService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* @author clunt
|
||||
|
|
@ -17,7 +20,7 @@ import java.util.List;
|
|||
@Service
|
||||
public class FinancialChangeRecordServiceImpl implements FinancialChangeRecordService {
|
||||
|
||||
@Autowired
|
||||
@Resource
|
||||
private FinancialChangeRecordMapper financialChangeRecordMapper;
|
||||
|
||||
@Override
|
||||
|
|
@ -32,8 +35,7 @@ public class FinancialChangeRecordServiceImpl implements FinancialChangeRecordSe
|
|||
* @return 改价记录
|
||||
*/
|
||||
@Override
|
||||
public FinancialChangeRecord selectFinancialChangeRecordById(String id)
|
||||
{
|
||||
public FinancialChangeRecord selectFinancialChangeRecordById(String id) {
|
||||
return financialChangeRecordMapper.selectFinancialChangeRecordById(id);
|
||||
}
|
||||
|
||||
|
|
@ -44,19 +46,28 @@ public class FinancialChangeRecordServiceImpl implements FinancialChangeRecordSe
|
|||
* @return 改价记录
|
||||
*/
|
||||
@Override
|
||||
public List<FinancialChangeRecord> selectFinancialChangeRecordList(FinancialChangeRecord financialChangeRecord)
|
||||
{
|
||||
public List<FinancialChangeRecord> selectFinancialChangeRecordList(FinancialChangeRecord financialChangeRecord) {
|
||||
return financialChangeRecordMapper.selectFinancialChangeRecordList(financialChangeRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FinancialChangeRecord> selectByDetailIds(String ids) {
|
||||
if (StringUtils.isBlank(ids)) {
|
||||
return new ArrayList<FinancialChangeRecord>();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return financialChangeRecordMapper.selectByDetailIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FinancialChangeRecord> selectByOrderDetailIds(Set<Long> orderDetailIds) {
|
||||
if (CollectionUtils.isEmpty(orderDetailIds)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
StringJoiner joiner = new StringJoiner(",");
|
||||
orderDetailIds.forEach(x -> joiner.add(x.toString()));
|
||||
return financialChangeRecordMapper.selectByDetailIds(joiner.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增改价记录
|
||||
*
|
||||
|
|
@ -64,8 +75,7 @@ public class FinancialChangeRecordServiceImpl implements FinancialChangeRecordSe
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertFinancialChangeRecord(FinancialChangeRecord financialChangeRecord)
|
||||
{
|
||||
public int insertFinancialChangeRecord(FinancialChangeRecord financialChangeRecord) {
|
||||
financialChangeRecord.setLeftMoney(financialChangeRecord.getChangeMoney());
|
||||
return financialChangeRecordMapper.insertFinancialChangeRecord(financialChangeRecord);
|
||||
}
|
||||
|
|
@ -77,8 +87,7 @@ public class FinancialChangeRecordServiceImpl implements FinancialChangeRecordSe
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateFinancialChangeRecord(FinancialChangeRecord financialChangeRecord)
|
||||
{
|
||||
public int updateFinancialChangeRecord(FinancialChangeRecord financialChangeRecord) {
|
||||
return financialChangeRecordMapper.updateFinancialChangeRecord(financialChangeRecord);
|
||||
}
|
||||
|
||||
|
|
@ -89,8 +98,7 @@ public class FinancialChangeRecordServiceImpl implements FinancialChangeRecordSe
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFinancialChangeRecordByIds(String ids)
|
||||
{
|
||||
public int deleteFinancialChangeRecordByIds(String ids) {
|
||||
return financialChangeRecordMapper.deleteFinancialChangeRecordByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
|
|
@ -101,8 +109,7 @@ public class FinancialChangeRecordServiceImpl implements FinancialChangeRecordSe
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteFinancialChangeRecordById(String id)
|
||||
{
|
||||
public int deleteFinancialChangeRecordById(String id) {
|
||||
return financialChangeRecordMapper.deleteFinancialChangeRecordById(id);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue