no message
This commit is contained in:
parent
61dcb7b25c
commit
9db20efd88
|
|
@ -1713,6 +1713,7 @@ public class OrderController extends BaseController {
|
|||
&& master.getWorkerId() != null;
|
||||
logger.info("是否为监控单{}主单id{}", condition, master);
|
||||
// 编辑返回属性
|
||||
orderListResponse.setWorkerRemark(master.getWorkerRemark());
|
||||
orderListResponse.setGoods(goods);
|
||||
orderListResponse.setIsNeedBill(master.getIsNeedBill());
|
||||
orderListResponse.setIsMonitoredOrder(master.getIsMonitoredOrder());
|
||||
|
|
@ -1786,7 +1787,9 @@ public class OrderController extends BaseController {
|
|||
orderListResponse.setProvinceName(array[0]);
|
||||
orderListResponse.setCityName(array[1]);
|
||||
orderListResponse.setCountryName(array[2]);
|
||||
if (array.length>3){
|
||||
orderListResponse.setStreetName(array[3]);
|
||||
}
|
||||
orderListResponse.setProvinceId(customerAddress.getProvinceId());
|
||||
orderListResponse.setCityId(customerAddress.getCityId());
|
||||
orderListResponse.setCountryId(customerAddress.getCountryId());
|
||||
|
|
@ -1899,6 +1902,7 @@ public class OrderController extends BaseController {
|
|||
// List<AfterServiceRecord> afterServiceRecordList =afterServiceRecordService.selectAfterServiceRecordList(afterServiceRecord);
|
||||
|
||||
// 编辑返回属性
|
||||
orderListResponse.setWorkerRemark(detail.getWorkerRemark());
|
||||
orderListResponse.setGoods(goods);
|
||||
orderListResponse.setGoodsBrand(orderMaster.getGoodsBrand());
|
||||
orderListResponse.setGoodsSpecification(orderMaster.getGoodsSpecification());
|
||||
|
|
@ -1960,7 +1964,9 @@ public class OrderController extends BaseController {
|
|||
orderListResponse.setProvinceName(array[0]);
|
||||
orderListResponse.setCityName(array[1]);
|
||||
orderListResponse.setCountryName(array[2]);
|
||||
if (array.length>3){
|
||||
orderListResponse.setStreetName(array[3]);
|
||||
}
|
||||
orderListResponse.setProvinceId(customerAddress.getProvinceId());
|
||||
orderListResponse.setCityId(customerAddress.getCityId());
|
||||
orderListResponse.setCountryId(customerAddress.getCountryId());
|
||||
|
|
|
|||
|
|
@ -151,13 +151,13 @@ public class OrderDetailController extends BaseController {
|
|||
// 直接使用afterServiceStatus字段查询售后纠纷订单
|
||||
orderDetail.setAfterServiceStatus(1);
|
||||
orderDetail.setOrderStatus(null); // 清除orderStatus条件,避免冲突
|
||||
} else if (orderDetail.getSearchAfterList() !=null && orderDetail.getSearchAfterList()) {
|
||||
} else if (orderDetail.getSearchAfterList() != null && orderDetail.getSearchAfterList()) {
|
||||
// 保持原有的售后查询逻辑
|
||||
List<?> rows = this.afterServiceList(orderDetail).getRows();
|
||||
StringBuilder detailIds = new StringBuilder();
|
||||
if(CollectionUtils.isNotEmpty(rows)){
|
||||
rows.forEach(model->{
|
||||
OrderListResponse response = (OrderListResponse)model;
|
||||
if (CollectionUtils.isNotEmpty(rows)) {
|
||||
rows.forEach(model -> {
|
||||
OrderListResponse response = (OrderListResponse) model;
|
||||
detailIds.append(response.getOrderDetailId()).append(",");
|
||||
});
|
||||
}
|
||||
|
|
@ -167,24 +167,24 @@ public class OrderDetailController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(orderDetail.getWorkerName()) || StringUtils.isNotEmpty(orderDetail.getWorkerPhone())){
|
||||
if (StringUtils.isNotEmpty(orderDetail.getWorkerName()) || StringUtils.isNotEmpty(orderDetail.getWorkerPhone())) {
|
||||
Worker param = new Worker();
|
||||
param.setName(orderDetail.getWorkerName());
|
||||
param.setPhone(orderDetail.getWorkerPhone());
|
||||
List<Worker> workList = workerService.getWorkList(param);
|
||||
List<Long> ids = workList.stream().map(Worker::getWorkerId).collect(Collectors.toList());
|
||||
orderDetail.setWorkerIds(ids);
|
||||
if(CollectionUtils.isEmpty(ids)){
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
if(orderDetail.getSysPayStatus() != null){
|
||||
if (orderDetail.getSysPayStatus() != null) {
|
||||
FinancialMaster param = new FinancialMaster();
|
||||
param.setPayStatus(orderDetail.getSysPayStatus());
|
||||
List<FinancialMaster> financialMasters = financialMasterService.selectFinancialMasterList(param);
|
||||
List<Long> masterIds = financialMasters.stream().map(FinancialMaster::getOrderMasterId).collect(Collectors.toList());
|
||||
orderDetail.setMasterIds(masterIds);
|
||||
if(CollectionUtils.isEmpty(masterIds)){
|
||||
if (CollectionUtils.isEmpty(masterIds)) {
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ public class OrderDetailController extends BaseController {
|
|||
.stream().collect(Collectors.toMap(Worker::getWorkerId, x -> x, (x, y) -> y));
|
||||
|
||||
for (OrderDetail detail : orderDetails) {
|
||||
if(StringUtils.isNotEmpty(orderDetail.getOrderStatusName())){
|
||||
if (StringUtils.isNotEmpty(orderDetail.getOrderStatusName())) {
|
||||
detail.setOrderStatusName(orderDetail.getOrderStatusName());
|
||||
}
|
||||
// 确保afterServiceStatus字段不为null
|
||||
|
|
@ -238,8 +238,8 @@ public class OrderDetailController extends BaseController {
|
|||
detail.setCustomerPhone(customer.getPhone());
|
||||
}
|
||||
OrderMaster orderMaster = orderMasterMap.get(detail.getOrderMasterId());
|
||||
if(orderMaster.getExpectTimeStart() != null && orderMaster.getExpectTimeEnd() != null){
|
||||
detail.setMixExpectTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm",orderMaster.getExpectTimeStart()) +"-"+ DateUtils.parseDateToStr("HH:mm",orderMaster.getExpectTimeEnd()));
|
||||
if (orderMaster.getExpectTimeStart() != null && orderMaster.getExpectTimeEnd() != null) {
|
||||
detail.setMixExpectTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm", orderMaster.getExpectTimeStart()) + "-" + DateUtils.parseDateToStr("HH:mm", orderMaster.getExpectTimeEnd()));
|
||||
}
|
||||
if (orderMaster != null) {
|
||||
detail.setPayStatus(orderMaster.getPayStatus());
|
||||
|
|
@ -253,27 +253,27 @@ public class OrderDetailController extends BaseController {
|
|||
if (good != null) {
|
||||
detail.setGoods(good);
|
||||
// 填充商品三级类目
|
||||
if(good.getDeptGoodsCategoryId() != null){
|
||||
if (good.getDeptGoodsCategoryId() != null) {
|
||||
Long categoryId = null;
|
||||
// 前端发单和后台派单
|
||||
if(StringUtils.isEmpty(orderMaster.getOrderMode())){
|
||||
if (StringUtils.isEmpty(orderMaster.getOrderMode())) {
|
||||
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.selectOneByGoodsCategoryId(good.getDeptGoodsCategoryId());
|
||||
if(deptGoodsCategory != null){
|
||||
if (deptGoodsCategory != null) {
|
||||
categoryId = deptGoodsCategory.getGoodsCategoryId();
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(good.getDeptGoodsCategoryId());
|
||||
if(deptGoodsCategory != null){
|
||||
if (deptGoodsCategory != null) {
|
||||
categoryId = deptGoodsCategory.getGoodsCategoryId();
|
||||
}
|
||||
}
|
||||
if(categoryId != null){
|
||||
if (categoryId != null) {
|
||||
GoodsCategory one = goodsCategoryService.selectById(categoryId);
|
||||
if(one != null && one.getParentCategoryId() != null){
|
||||
if (one != null && one.getParentCategoryId() != null) {
|
||||
GoodsCategory two = goodsCategoryService.selectById(one.getParentCategoryId());
|
||||
if(two != null && two.getParentCategoryId() != null){
|
||||
if (two != null && two.getParentCategoryId() != null) {
|
||||
GoodsCategory three = goodsCategoryService.selectById(two.getParentCategoryId());
|
||||
if(three != null){
|
||||
if (three != null) {
|
||||
int totalNum = orderGoodsService.selectByOrderDetailId(detail.getId()).stream().mapToInt(OrderGoods::getGoodsNum).sum();
|
||||
detail.setConsoleGoodsName("【" + three.getGoodsCategoryName()
|
||||
+ "-" + two.getGoodsCategoryName()
|
||||
|
|
@ -289,9 +289,9 @@ public class OrderDetailController extends BaseController {
|
|||
CustomerAddress customerAddress = addressService.selectByCustomerAddressId(orderMaster.getAddressId());
|
||||
if (customerAddress != null) {
|
||||
SysArea sysArea;
|
||||
if(customerAddress.getStreetId()!=null){
|
||||
if (customerAddress.getStreetId() != null) {
|
||||
sysArea = sysAreaService.selectById(customerAddress.getStreetId());
|
||||
}else {
|
||||
} else {
|
||||
sysArea = sysAreaService.selectById(customerAddress.getCountryId());
|
||||
}
|
||||
String completeAddress = sysArea.getMergerName().replaceAll(",", "") + customerAddress.getAddress();
|
||||
|
|
@ -308,9 +308,9 @@ public class OrderDetailController extends BaseController {
|
|||
orderCallRecordParam.setOrderType("01");
|
||||
orderCallRecordParam.setOrderId(detail.getOrderMasterId());
|
||||
List<OrderCallRecord> orderCallRecords = orderCallRecordService.selectOrderCallRecordList(orderCallRecordParam);
|
||||
if(CollectionUtils.isNotEmpty(orderCallRecords)){
|
||||
if (CollectionUtils.isNotEmpty(orderCallRecords)) {
|
||||
OrderCallRecord newOne = orderCallRecords.stream().sorted(Comparator.comparing(OrderCallRecord::getCallTime).reversed()).collect(Collectors.toList()).get(0);
|
||||
detail.setLastCallTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",newOne.getCallTime()) + " 拨号次数x" + orderCallRecords.size());
|
||||
detail.setLastCallTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", newOne.getCallTime()) + " 拨号次数x" + orderCallRecords.size());
|
||||
}
|
||||
FinancialChangeRecord fc = fcMap.get(detail.getId());
|
||||
if (fc != null) {
|
||||
|
|
@ -322,7 +322,7 @@ public class OrderDetailController extends BaseController {
|
|||
param.setImgType(ImgType.FINISH_IMG.getId());
|
||||
List<GoodsImgs> imgsList = goodsImgsService.qryGoodsImgs(param);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
imgsList.forEach(model->{
|
||||
imgsList.forEach(model -> {
|
||||
stringBuilder.append("<a target='_blank' href='").append(model.getImgUrl()).append("' >查看图片<a/>");
|
||||
});
|
||||
detail.setOrderImgs(stringBuilder.toString());
|
||||
|
|
@ -366,7 +366,7 @@ public class OrderDetailController extends BaseController {
|
|||
if (worker != null) {
|
||||
// 师傅实名信息
|
||||
workerRealInfo = workerCertificationService.selectByWorkerId(orderMaster.getWorkerId());
|
||||
workerName = workerRealInfo == null ? worker.getName() : workerRealInfo.getSurname()+ workerRealInfo.getName();
|
||||
workerName = workerRealInfo == null ? worker.getName() : workerRealInfo.getSurname() + workerRealInfo.getName();
|
||||
}
|
||||
workerRealInfo = null;
|
||||
// 大师傅信息
|
||||
|
|
@ -374,7 +374,7 @@ public class OrderDetailController extends BaseController {
|
|||
if (masterWorker != null) {
|
||||
// 大师傅实名信息
|
||||
workerRealInfo = workerCertificationService.selectByWorkerId(orderMaster.getWorkerId());
|
||||
masterWorkerName = workerRealInfo == null ? masterWorker.getName() : workerRealInfo.getSurname()+ workerRealInfo.getName();
|
||||
masterWorkerName = workerRealInfo == null ? masterWorker.getName() : workerRealInfo.getSurname() + workerRealInfo.getName();
|
||||
masterCompanyName = workerRealInfo == null ? null : workerRealInfo.getCompanyName();
|
||||
}
|
||||
|
||||
|
|
@ -390,27 +390,27 @@ public class OrderDetailController extends BaseController {
|
|||
Goods goods = goodsService.selectById(orderMaster.getGoodsId());
|
||||
if (goods != null) {
|
||||
// 填充商品三级类目
|
||||
if(goods.getDeptGoodsCategoryId() != null){
|
||||
if (goods.getDeptGoodsCategoryId() != null) {
|
||||
Long categoryId = null;
|
||||
// 前端发单和后台派单
|
||||
if(StringUtils.isEmpty(orderMaster.getOrderMode())){
|
||||
if (StringUtils.isEmpty(orderMaster.getOrderMode())) {
|
||||
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.selectOneByGoodsCategoryId(goods.getDeptGoodsCategoryId());
|
||||
if(deptGoodsCategory != null){
|
||||
if (deptGoodsCategory != null) {
|
||||
categoryId = deptGoodsCategory.getGoodsCategoryId();
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId());
|
||||
if(deptGoodsCategory != null){
|
||||
if (deptGoodsCategory != null) {
|
||||
categoryId = deptGoodsCategory.getGoodsCategoryId();
|
||||
}
|
||||
}
|
||||
if(categoryId != null){
|
||||
if (categoryId != null) {
|
||||
GoodsCategory one = goodsCategoryService.selectById(categoryId);
|
||||
if(one != null && one.getParentCategoryId() != null){
|
||||
if (one != null && one.getParentCategoryId() != null) {
|
||||
GoodsCategory two = goodsCategoryService.selectById(one.getParentCategoryId());
|
||||
if(two != null && two.getParentCategoryId() != null){
|
||||
if (two != null && two.getParentCategoryId() != null) {
|
||||
GoodsCategory three = goodsCategoryService.selectById(two.getParentCategoryId());
|
||||
if(three != null){
|
||||
if (three != null) {
|
||||
goods.setGoodsName(three.getGoodsCategoryName()
|
||||
+ "-" + two.getGoodsCategoryName()
|
||||
+ "-" + one.getGoodsCategoryName());
|
||||
|
|
@ -436,9 +436,9 @@ public class OrderDetailController extends BaseController {
|
|||
// 地址信息
|
||||
CustomerAddress customerAddress = addressService.selectByCustomerAddressId(orderMaster.getAddressId());
|
||||
SysArea sysArea;
|
||||
if(customerAddress.getStreetId()!=null){
|
||||
if (customerAddress.getStreetId() != null) {
|
||||
sysArea = sysAreaService.selectById(customerAddress.getStreetId());
|
||||
}else {
|
||||
} else {
|
||||
sysArea = sysAreaService.selectById(customerAddress.getCountryId());
|
||||
}
|
||||
String completeAddress = sysArea.getMergerName().replaceAll(",", "") + customerAddress.getAddress();
|
||||
|
|
@ -491,32 +491,32 @@ public class OrderDetailController extends BaseController {
|
|||
OrderAttachmentRecord param = new OrderAttachmentRecord();
|
||||
param.setOrderDetailId(detail.getId());
|
||||
List<OrderAttachmentRecord> orderAttachmentRecordList = orderAttachmentRecordService.selectOrderAttachmentRecordList(param);
|
||||
BigDecimal addMoneyTotal= BigDecimal.ZERO;
|
||||
String addMoneyRemark=null;
|
||||
BigDecimal addMoneyTotal = BigDecimal.ZERO;
|
||||
String addMoneyRemark = null;
|
||||
|
||||
for (FinancialChangeRecord financialChangeRecord:financialChangeRecords){
|
||||
addMoneyTotal= addMoneyTotal.add(financialChangeRecord.getChangeMoney());
|
||||
if (StringUtils.isNotEmpty(financialChangeRecord.getRemark())){
|
||||
addMoneyRemark=financialChangeRecord.getRemark();
|
||||
for (FinancialChangeRecord financialChangeRecord : financialChangeRecords) {
|
||||
addMoneyTotal = addMoneyTotal.add(financialChangeRecord.getChangeMoney());
|
||||
if (StringUtils.isNotEmpty(financialChangeRecord.getRemark())) {
|
||||
addMoneyRemark = financialChangeRecord.getRemark();
|
||||
}
|
||||
OrderAttachmentRecord param1 = new OrderAttachmentRecord();
|
||||
param1.setFinancialChangeRecordId(financialChangeRecord.getId());
|
||||
BigDecimal attachmentMoney= BigDecimal.ZERO;
|
||||
List<OrderAttachmentRecord> orderAttachmentRecords=orderAttachmentRecordService.selectOrderAttachmentRecordList(param1);
|
||||
logger.info("参数传递{},配件的金额查询为{}",orderAttachmentRecords,param1);
|
||||
if(orderAttachmentRecords!=null&&orderAttachmentRecords.size()>0){
|
||||
attachmentMoney= attachmentMoney.add(orderAttachmentRecords.get(0).getAttachMoney());
|
||||
BigDecimal attachmentMoney = BigDecimal.ZERO;
|
||||
List<OrderAttachmentRecord> orderAttachmentRecords = orderAttachmentRecordService.selectOrderAttachmentRecordList(param1);
|
||||
logger.info("参数传递{},配件的金额查询为{}", orderAttachmentRecords, param1);
|
||||
if (orderAttachmentRecords != null && orderAttachmentRecords.size() > 0) {
|
||||
attachmentMoney = attachmentMoney.add(orderAttachmentRecords.get(0).getAttachMoney());
|
||||
financialChangeRecord.setAttachmentMoney(attachmentMoney);
|
||||
logger.info("配件的金为{}",attachmentMoney);
|
||||
logger.info("配件的金为{}", attachmentMoney);
|
||||
}
|
||||
|
||||
}
|
||||
for (OrderAttachmentRecord orderAttachmentRecord:orderAttachmentRecordList){
|
||||
addMoneyTotal= addMoneyTotal.add(orderAttachmentRecord.getAttachMoney());
|
||||
for (OrderAttachmentRecord orderAttachmentRecord : orderAttachmentRecordList) {
|
||||
addMoneyTotal = addMoneyTotal.add(orderAttachmentRecord.getAttachMoney());
|
||||
}
|
||||
logger.info("所有的加价订单{}",financialChangeRecords);
|
||||
logger.info("所有的加价订单{}", financialChangeRecords);
|
||||
|
||||
Shop shop=shopService.getShop(goods.getShopId());
|
||||
Shop shop = shopService.getShop(goods.getShopId());
|
||||
|
||||
// 计算主单地址与店铺的距离
|
||||
shop = calculateShopDistance(orderMaster, shop);
|
||||
|
|
@ -548,13 +548,13 @@ public class OrderDetailController extends BaseController {
|
|||
orderListResponse.setMasterWorkerName(masterWorkerName);
|
||||
orderListResponse.setMasterCompanyName(masterCompanyName);
|
||||
orderListResponse.setMasterWorkerPhone(masterWorker == null ? "" : masterWorker.getPhone());
|
||||
orderListResponse.setCustomerName(org.apache.commons.lang3.StringUtils.isNotEmpty(orderMaster.getName())?orderMaster.getName():customerAddress.getName());
|
||||
orderListResponse.setCustomerPhone(org.apache.commons.lang3.StringUtils.isNotEmpty(orderMaster.getPhone())?orderMaster.getPhone():customerAddress.getPhone());
|
||||
orderListResponse.setCustomerName(org.apache.commons.lang3.StringUtils.isNotEmpty(orderMaster.getName()) ? orderMaster.getName() : customerAddress.getName());
|
||||
orderListResponse.setCustomerPhone(org.apache.commons.lang3.StringUtils.isNotEmpty(orderMaster.getPhone()) ? orderMaster.getPhone() : customerAddress.getPhone());
|
||||
orderListResponse.setOrderStatus(detail.getOrderStatus());
|
||||
orderListResponse.setPayStatus(orderMaster.getPayStatus());
|
||||
orderListResponse.setPayType(orderMaster.getPayType());
|
||||
orderListResponse.setStandardList(standardList);
|
||||
orderListResponse.setAddress(StringUtils.isNotEmpty(orderMaster.getAddress())?orderMaster.getAddress():completeAddress);
|
||||
orderListResponse.setAddress(StringUtils.isNotEmpty(orderMaster.getAddress()) ? orderMaster.getAddress() : completeAddress);
|
||||
orderListResponse.setServerTime(detail.getRevTime());
|
||||
orderListResponse.setExpectTimeStart(detail.getExpectTimeStart());
|
||||
orderListResponse.setExpectTimeEnd(detail.getExpectTimeEnd());
|
||||
|
|
@ -585,11 +585,13 @@ public class OrderDetailController extends BaseController {
|
|||
orderListResponse.setName(orderMaster.getName());
|
||||
String addressSysArea = sysArea.getMergerName();
|
||||
String[] array = addressSysArea.split(",");
|
||||
if (org.apache.commons.lang3.StringUtils.isEmpty(orderMaster.getProvinceName())){
|
||||
if (org.apache.commons.lang3.StringUtils.isEmpty(orderMaster.getProvinceName())) {
|
||||
orderListResponse.setProvinceName(array[0]);
|
||||
orderListResponse.setCityName(array[1]);
|
||||
orderListResponse.setCountryName(array[2]);
|
||||
if (array.length > 3) {
|
||||
orderListResponse.setStreetName(array[3]);
|
||||
}
|
||||
orderListResponse.setProvinceId(customerAddress.getProvinceId());
|
||||
orderListResponse.setCityId(customerAddress.getCityId());
|
||||
orderListResponse.setCountryId(customerAddress.getCountryId());
|
||||
|
|
@ -597,14 +599,14 @@ public class OrderDetailController extends BaseController {
|
|||
orderListResponse.setPhone(customerAddress.getPhone());
|
||||
orderListResponse.setName(customerAddress.getName());
|
||||
}
|
||||
if(orderMaster.getInsuranceId() != null){
|
||||
if (orderMaster.getInsuranceId() != null) {
|
||||
InsuranceManager manager = insuranceManagerService.selectInsuranceManagerById(orderMaster.getInsuranceId());
|
||||
if(manager != null){
|
||||
if (manager != null) {
|
||||
orderListResponse.setInsuranceManager(manager);
|
||||
}
|
||||
}
|
||||
|
||||
if(!CollectionUtils.isEmpty(financialChangeRecords)){
|
||||
if (!CollectionUtils.isEmpty(financialChangeRecords)) {
|
||||
BigDecimal totalAdd = financialChangeRecords.stream()
|
||||
.filter(record -> record.getPayStatus() == 1) // 筛选 paystatus == 1 的记录
|
||||
.map(FinancialChangeRecord::getChangeMoney) // 提取 changeMoney
|
||||
|
|
@ -654,7 +656,7 @@ public class OrderDetailController extends BaseController {
|
|||
masterFee = totalAdd.multiply(teamRete).setScale(2, RoundingMode.UP);
|
||||
}
|
||||
// 如果是大师傅自己接单,则不需要抽成
|
||||
if(detail.getWorkerId().equals(orderMaster.getWorkerId())){
|
||||
if (detail.getWorkerId().equals(orderMaster.getWorkerId())) {
|
||||
masterFee = BigDecimal.ZERO;
|
||||
}
|
||||
// 上门师傅应得加价的报酬
|
||||
|
|
@ -664,22 +666,22 @@ public class OrderDetailController extends BaseController {
|
|||
BigDecimal money = record.getWorkerMoney();
|
||||
return money != null ? money : BigDecimal.ZERO; // 处理 getWorkerMoney() 返回 null 的情况
|
||||
}).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
OrderAttachmentRecord orderAttachmentRecord=new OrderAttachmentRecord();
|
||||
OrderAttachmentRecord orderAttachmentRecord = new OrderAttachmentRecord();
|
||||
orderAttachmentRecord.setOrderDetailId(detail.getId());
|
||||
List<OrderAttachmentRecord> orderAttachmentRecords=orderAttachmentRecordService.selectOrderAttachmentRecordList(orderAttachmentRecord);
|
||||
List<OrderAttachmentRecord> orderAttachmentRecords = orderAttachmentRecordService.selectOrderAttachmentRecordList(orderAttachmentRecord);
|
||||
//配件费的实际获取金额计算费率
|
||||
BigDecimal rate = BigDecimal.valueOf(0.99);
|
||||
List<FinancialChangeRecord> changeRecords= financialChangeRecords.stream()
|
||||
List<FinancialChangeRecord> changeRecords = financialChangeRecords.stream()
|
||||
.filter(record -> record.getPayStatus() == 1).collect(Collectors.toList());
|
||||
BigDecimal attachmentMoney=BigDecimal.ZERO;
|
||||
if (!changeRecords.isEmpty()){
|
||||
BigDecimal attachmentMoney = BigDecimal.ZERO;
|
||||
if (!changeRecords.isEmpty()) {
|
||||
attachmentMoney = orderAttachmentRecords.stream()
|
||||
.filter(record -> StringUtils.isNotEmpty(record.getPaymentId()))
|
||||
.map(OrderAttachmentRecord::getAttachMoney)
|
||||
.map(attachMoney ->attachMoney.multiply(rate).setScale(2, RoundingMode.DOWN))
|
||||
.map(attachMoney -> attachMoney.multiply(rate).setScale(2, RoundingMode.DOWN))
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
@ -715,7 +717,7 @@ public class OrderDetailController extends BaseController {
|
|||
if (worker != null) {
|
||||
// 师傅实名信息
|
||||
workerRealInfo = workerCertificationService.selectByWorkerId(orderMaster.getWorkerId());
|
||||
workerName = workerRealInfo == null ? worker.getName() : workerRealInfo.getSurname()+ workerRealInfo.getName();
|
||||
workerName = workerRealInfo == null ? worker.getName() : workerRealInfo.getSurname() + workerRealInfo.getName();
|
||||
}
|
||||
|
||||
// 消费者信息
|
||||
|
|
@ -726,27 +728,27 @@ public class OrderDetailController extends BaseController {
|
|||
|
||||
Goods goods = goodsService.selectById(orderMaster.getGoodsId());
|
||||
// 填充商品三级类目
|
||||
if(goods.getDeptGoodsCategoryId() != null){
|
||||
if (goods.getDeptGoodsCategoryId() != null) {
|
||||
Long categoryId = null;
|
||||
// 前端发单和后台派单
|
||||
if(StringUtils.isEmpty(orderMaster.getOrderMode())){
|
||||
if (StringUtils.isEmpty(orderMaster.getOrderMode())) {
|
||||
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.selectOneByGoodsCategoryId(goods.getDeptGoodsCategoryId());
|
||||
if(deptGoodsCategory != null){
|
||||
if (deptGoodsCategory != null) {
|
||||
categoryId = deptGoodsCategory.getGoodsCategoryId();
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goods.getDeptGoodsCategoryId());
|
||||
if(deptGoodsCategory != null){
|
||||
if (deptGoodsCategory != null) {
|
||||
categoryId = deptGoodsCategory.getGoodsCategoryId();
|
||||
}
|
||||
}
|
||||
if(categoryId != null){
|
||||
if (categoryId != null) {
|
||||
GoodsCategory one = goodsCategoryService.selectById(categoryId);
|
||||
if(one != null && one.getParentCategoryId() != null){
|
||||
if (one != null && one.getParentCategoryId() != null) {
|
||||
GoodsCategory two = goodsCategoryService.selectById(one.getParentCategoryId());
|
||||
if(two != null && two.getParentCategoryId() != null){
|
||||
if (two != null && two.getParentCategoryId() != null) {
|
||||
GoodsCategory three = goodsCategoryService.selectById(two.getParentCategoryId());
|
||||
if(three != null){
|
||||
if (three != null) {
|
||||
goods.setGoodsName(three.getGoodsCategoryName()
|
||||
+ "-" + two.getGoodsCategoryName()
|
||||
+ "-" + one.getGoodsCategoryName());
|
||||
|
|
@ -766,9 +768,9 @@ public class OrderDetailController extends BaseController {
|
|||
// 地址信息
|
||||
CustomerAddress customerAddress = addressService.selectByCustomerAddressId(orderMaster.getAddressId());
|
||||
SysArea sysArea;
|
||||
if(customerAddress.getStreetId()!=null){
|
||||
if (customerAddress.getStreetId() != null) {
|
||||
sysArea = sysAreaService.selectById(customerAddress.getStreetId());
|
||||
}else {
|
||||
} else {
|
||||
sysArea = sysAreaService.selectById(customerAddress.getCountryId());
|
||||
}
|
||||
String completeAddress = sysArea.getMergerName().replaceAll(",", "") + customerAddress.getAddress();
|
||||
|
|
@ -824,13 +826,13 @@ public class OrderDetailController extends BaseController {
|
|||
orderListResponse.setMasterWorkerId(masterWorker.getWorkerId());
|
||||
orderListResponse.setWorkerPhone(worker == null ? "" : worker.getPhone());
|
||||
orderListResponse.setMasterWorkerName(masterWorker.getName());
|
||||
orderListResponse.setCustomerName(org.apache.commons.lang3.StringUtils.isNotEmpty(orderMaster.getName())?orderMaster.getName():customerAddress.getName());
|
||||
orderListResponse.setCustomerPhone(org.apache.commons.lang3.StringUtils.isNotEmpty(orderMaster.getPhone())?orderMaster.getPhone():customerAddress.getPhone());
|
||||
orderListResponse.setCustomerName(org.apache.commons.lang3.StringUtils.isNotEmpty(orderMaster.getName()) ? orderMaster.getName() : customerAddress.getName());
|
||||
orderListResponse.setCustomerPhone(org.apache.commons.lang3.StringUtils.isNotEmpty(orderMaster.getPhone()) ? orderMaster.getPhone() : customerAddress.getPhone());
|
||||
orderListResponse.setOrderStatus(detail.getOrderStatus());
|
||||
orderListResponse.setPayStatus(orderMaster.getPayStatus());
|
||||
orderListResponse.setPayType(orderMaster.getPayType());
|
||||
orderListResponse.setStandardList(standardList);
|
||||
orderListResponse.setAddress(StringUtils.isNotEmpty(orderMaster.getAddress())?orderMaster.getAddress():completeAddress);
|
||||
orderListResponse.setAddress(StringUtils.isNotEmpty(orderMaster.getAddress()) ? orderMaster.getAddress() : completeAddress);
|
||||
orderListResponse.setServerTime(detail.getRevTime());
|
||||
orderListResponse.setExpectTimeStart(detail.getExpectTimeStart());
|
||||
orderListResponse.setExpectTimeEnd(detail.getExpectTimeEnd());
|
||||
|
|
@ -868,11 +870,11 @@ public class OrderDetailController extends BaseController {
|
|||
orderListResponse.setName(orderMaster.getName());
|
||||
String addressSysArea = sysArea.getMergerName();
|
||||
String[] array = addressSysArea.split(",");
|
||||
if (org.apache.commons.lang3.StringUtils.isEmpty(orderMaster.getProvinceName())){
|
||||
if (org.apache.commons.lang3.StringUtils.isEmpty(orderMaster.getProvinceName())) {
|
||||
orderListResponse.setProvinceName(array[0]);
|
||||
orderListResponse.setCityName(array[1]);
|
||||
orderListResponse.setCountryName(array[2]);
|
||||
if (array.length>3){
|
||||
if (array.length > 3) {
|
||||
orderListResponse.setStreetName(array[3]);
|
||||
}
|
||||
orderListResponse.setProvinceId(customerAddress.getProvinceId());
|
||||
|
|
@ -882,9 +884,9 @@ public class OrderDetailController extends BaseController {
|
|||
orderListResponse.setPhone(customerAddress.getPhone());
|
||||
orderListResponse.setName(customerAddress.getName());
|
||||
}
|
||||
if(orderMaster.getInsuranceId() != null){
|
||||
if (orderMaster.getInsuranceId() != null) {
|
||||
InsuranceManager manager = insuranceManagerService.selectInsuranceManagerById(orderMaster.getInsuranceId());
|
||||
if(manager != null){
|
||||
if (manager != null) {
|
||||
orderListResponse.setInsuranceManager(manager);
|
||||
}
|
||||
}
|
||||
|
|
@ -930,7 +932,7 @@ public class OrderDetailController extends BaseController {
|
|||
if (worker != null) {
|
||||
// 师傅实名信息
|
||||
workerRealInfo = workerCertificationService.selectByWorkerId(orderMaster.getWorkerId());
|
||||
workerName = workerRealInfo == null ? worker.getName() : workerRealInfo.getSurname()+ workerRealInfo.getName();
|
||||
workerName = workerRealInfo == null ? worker.getName() : workerRealInfo.getSurname() + workerRealInfo.getName();
|
||||
}
|
||||
|
||||
// 消费者信息
|
||||
|
|
@ -962,9 +964,9 @@ public class OrderDetailController extends BaseController {
|
|||
// 地址信息
|
||||
CustomerAddress customerAddress = addressService.selectByCustomerAddressId(orderMaster.getAddressId());
|
||||
SysArea sysArea;
|
||||
if(customerAddress.getStreetId()!=null){
|
||||
if (customerAddress.getStreetId() != null) {
|
||||
sysArea = sysAreaService.selectById(customerAddress.getStreetId());
|
||||
}else {
|
||||
} else {
|
||||
sysArea = sysAreaService.selectById(customerAddress.getCountryId());
|
||||
}
|
||||
String completeAddress = sysArea.getMergerName().replaceAll(",", "") + customerAddress.getAddress();
|
||||
|
|
@ -1015,13 +1017,13 @@ public class OrderDetailController extends BaseController {
|
|||
orderListResponse.setTotalMoney(financialDetail.getTotalMoney());
|
||||
orderListResponse.setWorkerName(workerName);
|
||||
orderListResponse.setWorkerPhone(worker == null ? "" : worker.getPhone());
|
||||
orderListResponse.setCustomerName(org.apache.commons.lang3.StringUtils.isNotEmpty(orderMaster.getName())?orderMaster.getName():customerAddress.getName());
|
||||
orderListResponse.setCustomerPhone(org.apache.commons.lang3.StringUtils.isNotEmpty(orderMaster.getPhone())?orderMaster.getPhone():customerAddress.getPhone());
|
||||
orderListResponse.setCustomerName(org.apache.commons.lang3.StringUtils.isNotEmpty(orderMaster.getName()) ? orderMaster.getName() : customerAddress.getName());
|
||||
orderListResponse.setCustomerPhone(org.apache.commons.lang3.StringUtils.isNotEmpty(orderMaster.getPhone()) ? orderMaster.getPhone() : customerAddress.getPhone());
|
||||
orderListResponse.setOrderStatus(detail.getOrderStatus());
|
||||
orderListResponse.setPayStatus(orderMaster.getPayStatus());
|
||||
orderListResponse.setPayType(orderMaster.getPayType());
|
||||
orderListResponse.setStandardList(standardList);
|
||||
orderListResponse.setAddress(StringUtils.isNotEmpty(orderMaster.getAddress())?orderMaster.getAddress():completeAddress);
|
||||
orderListResponse.setAddress(StringUtils.isNotEmpty(orderMaster.getAddress()) ? orderMaster.getAddress() : completeAddress);
|
||||
orderListResponse.setServerTime(detail.getRevTime());
|
||||
orderListResponse.setExpectTimeStart(detail.getExpectTimeStart());
|
||||
orderListResponse.setExpectTimeEnd(detail.getExpectTimeEnd());
|
||||
|
|
@ -1048,11 +1050,13 @@ public class OrderDetailController extends BaseController {
|
|||
orderListResponse.setName(orderMaster.getName());
|
||||
String addressSysArea = sysArea.getMergerName();
|
||||
String[] array = addressSysArea.split(",");
|
||||
if (org.apache.commons.lang3.StringUtils.isEmpty(orderMaster.getProvinceName())){
|
||||
if (org.apache.commons.lang3.StringUtils.isEmpty(orderMaster.getProvinceName())) {
|
||||
orderListResponse.setProvinceName(array[0]);
|
||||
orderListResponse.setCityName(array[1]);
|
||||
orderListResponse.setCountryName(array[2]);
|
||||
if (array.length > 3) {
|
||||
orderListResponse.setStreetName(array[3]);
|
||||
}
|
||||
orderListResponse.setProvinceId(customerAddress.getProvinceId());
|
||||
orderListResponse.setCityId(customerAddress.getCityId());
|
||||
orderListResponse.setCountryId(customerAddress.getCountryId());
|
||||
|
|
@ -1144,7 +1148,7 @@ public class OrderDetailController extends BaseController {
|
|||
// 更新订单状态为上门
|
||||
try {
|
||||
insuranceService.clockInsurance(model.getId());
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
logger.error("订单上门返回异常:{}", e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
@ -1351,7 +1355,7 @@ public class OrderDetailController extends BaseController {
|
|||
orderDetail.setTimeout(0);
|
||||
}
|
||||
int i = orderDetailService.updateOrderDetail(orderDetail);
|
||||
if(i > 0){
|
||||
if (i > 0) {
|
||||
OrderCallRecord param = new OrderCallRecord();
|
||||
param.setOrderId(orderDetail.getId());
|
||||
param.setCallTime(new Date());
|
||||
|
|
@ -1406,7 +1410,7 @@ public class OrderDetailController extends BaseController {
|
|||
try {
|
||||
JSONObject response = adapayService.payReverse(om.getDeptId(), orderAttachmentRecord1.getPaymentId(),
|
||||
String.valueOf(orderAttachmentRecord1.getAttachMoney()), RefundType.RCG);
|
||||
logger.info("配件退款成功: paymentId={}, amount={},response{}", orderAttachmentRecord1.getPaymentId(), orderAttachmentRecord1.getAttachMoney(),response);
|
||||
logger.info("配件退款成功: paymentId={}, amount={},response{}", orderAttachmentRecord1.getPaymentId(), orderAttachmentRecord1.getAttachMoney(), response);
|
||||
} catch (BaseAdaPayException e) {
|
||||
logger.error("配件退款失败: paymentId={}, amount={}, error={}",
|
||||
orderAttachmentRecord1.getPaymentId(), orderAttachmentRecord1.getAttachMoney(), e.getMessage(), e);
|
||||
|
|
@ -1437,7 +1441,7 @@ public class OrderDetailController extends BaseController {
|
|||
orderMaster2Update.setOrderStatus(OrderStatus.PLAIN.code());
|
||||
// 查询是否还有派单记录,没有的话需要重置主单是否自己承接的字段为NULL
|
||||
// List<OrderGoods> existOrderGoods = orderGoodsService.selectByOrderMasterId(od.getOrderMasterId());
|
||||
List<OrderDetail> orderDetailList=orderDetailService.selectByOrderMasterId(od.getOrderMasterId());
|
||||
List<OrderDetail> orderDetailList = orderDetailService.selectByOrderMasterId(od.getOrderMasterId());
|
||||
if (CollectionUtils.isEmpty(orderDetailList)) {
|
||||
orderMaster2Update.setResetAllSelfAssigned(true);
|
||||
}
|
||||
|
|
@ -1453,9 +1457,9 @@ public class OrderDetailController extends BaseController {
|
|||
|
||||
// 拒单
|
||||
|
||||
logger.info("师傅资料{}",masterWorker);
|
||||
logger.info("师傅资料{}", masterWorker);
|
||||
WorkerCertification workerRealInfo = workerCertificationService.selectByWorkerId(od.getWorkerId());
|
||||
logger.info("认证师傅资料{}",workerRealInfo);
|
||||
logger.info("认证师傅资料{}", workerRealInfo);
|
||||
try {
|
||||
// 推送公众号通知数据。
|
||||
// 消息组装。
|
||||
|
|
@ -1467,7 +1471,7 @@ public class OrderDetailController extends BaseController {
|
|||
CustomerAddress address = addressService.selectByCustomerAddressId(om.getAddressId());
|
||||
|
||||
//拒单人员
|
||||
paramsNew.put("thing13",workerRealInfo.getSurname()+ workerRealInfo.getName());
|
||||
paramsNew.put("thing13", workerRealInfo.getSurname() + workerRealInfo.getName());
|
||||
paramsNew.put("thing7", address.getName());
|
||||
// 预约时间
|
||||
paramsNew.put("time5", com.ghy.common.utils.DateUtils.parseDateToStr("yyyy年MM月dd日 HH:mm", new Date()));
|
||||
|
|
@ -1484,7 +1488,7 @@ public class OrderDetailController extends BaseController {
|
|||
public AjaxResult changePrice(@Valid @RequestBody OrderChangePriceRequest request) {
|
||||
try {
|
||||
Assert.notNull(request.getChangeMoney(), "报价不能为空");
|
||||
return toAjax(orderDetailService.changePrice(request.getOrderDetailId(), request.getChangeMoney(), request.getType(), request.getRemark(),request.getUrls(),request.getFileNames(),request.getReason()));
|
||||
return toAjax(orderDetailService.changePrice(request.getOrderDetailId(), request.getChangeMoney(), request.getType(), request.getRemark(), request.getUrls(), request.getFileNames(), request.getReason()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error(ExceptionUtil.getExceptionMessage(e));
|
||||
|
|
@ -1551,24 +1555,24 @@ public class OrderDetailController extends BaseController {
|
|||
@GetMapping("/count")
|
||||
@ResponseBody
|
||||
public AjaxResult orderDetailCount(OrderDetail orderDetail) {
|
||||
if(StringUtils.isNotEmpty(orderDetail.getWorkerName()) || StringUtils.isNotEmpty(orderDetail.getWorkerPhone())){
|
||||
if (StringUtils.isNotEmpty(orderDetail.getWorkerName()) || StringUtils.isNotEmpty(orderDetail.getWorkerPhone())) {
|
||||
Worker param = new Worker();
|
||||
param.setName(orderDetail.getWorkerName());
|
||||
param.setPhone(orderDetail.getWorkerPhone());
|
||||
List<Worker> workList = workerService.getWorkList(param);
|
||||
List<Long> ids = workList.stream().map(Worker::getWorkerId).collect(Collectors.toList());
|
||||
orderDetail.setWorkerIds(ids);
|
||||
if(CollectionUtils.isEmpty(ids)){
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return AjaxResult.success(0);
|
||||
}
|
||||
}
|
||||
if(orderDetail.getSysPayStatus() != null){
|
||||
if (orderDetail.getSysPayStatus() != null) {
|
||||
FinancialMaster param = new FinancialMaster();
|
||||
param.setPayStatus(orderDetail.getSysPayStatus());
|
||||
List<FinancialMaster> financialMasters = financialMasterService.selectFinancialMasterList(param);
|
||||
List<Long> masterIds = financialMasters.stream().map(FinancialMaster::getOrderMasterId).collect(Collectors.toList());
|
||||
orderDetail.setMasterIds(masterIds);
|
||||
if(CollectionUtils.isEmpty(masterIds)){
|
||||
if (CollectionUtils.isEmpty(masterIds)) {
|
||||
return AjaxResult.success(0);
|
||||
}
|
||||
}
|
||||
|
|
@ -1719,6 +1723,7 @@ public class OrderDetailController extends BaseController {
|
|||
|
||||
/**
|
||||
* 计算商家与主单地址之间的距离
|
||||
*
|
||||
* @param orderMaster 主单信息
|
||||
* @param shop 商家信息
|
||||
* @return 带有距离信息的商家对象
|
||||
|
|
@ -1777,7 +1782,7 @@ public class OrderDetailController extends BaseController {
|
|||
logger.info("通过地址获取到经纬度:longitude={}, latitude={}", lng, lat);
|
||||
|
||||
// 计算距离
|
||||
if (shop.getLongitude() != null && shop.getLatitude() != null ) {
|
||||
if (shop.getLongitude() != null && shop.getLatitude() != null) {
|
||||
|
||||
double distance = LocationUtils.getDistanceInMeters(
|
||||
lat.doubleValue(),
|
||||
|
|
|
|||
|
|
@ -1628,6 +1628,7 @@ public class OrderMasterController extends BaseController {
|
|||
OrderMaster orderMaster = orderMasterService.selectById(request.getId());
|
||||
|
||||
List<OrderDetail> orderDetailList = orderDetailService.selectByOrderMasterId(orderMaster.getId());
|
||||
Collections.reverse(orderDetailList);
|
||||
List<OrderStandardDetail> orderStandardDetails = new ArrayList<>();
|
||||
|
||||
// 财务信息
|
||||
|
|
|
|||
Loading…
Reference in New Issue