增加类目设置倒计时 以及实付备注字段显示

This commit is contained in:
cb 2025-09-11 15:37:03 +08:00
parent 5cc6d5736d
commit 4783b4b077
8 changed files with 89 additions and 14 deletions

View File

@ -511,6 +511,10 @@ public class OrderDetailController extends BaseController {
orderListResponse.setDeliveryImages(orderMaster.getDeliveryImages());
orderListResponse.setDeliveryRemark(orderMaster.getDeliveryRemark());
orderListResponse.setDeliveryType(orderMaster.getDeliveryType());
orderListResponse.setShareAccountCountdownEndTime(detail.getShareAccountCountdownEndTime());
orderListResponse.setShareAccountCountdownDuration(detail.getShareAccountCountdownDuration());
orderListResponse.setHandoverImages(detail.getHandoverImages());
orderListResponse.setHandoverRemark(detail.getHandoverRemark());
orderListResponse.setAddMoneyRemark(addMoneyRemark);
orderListResponse.setAddMoney(addMoneyTotal);
@ -783,6 +787,7 @@ public class OrderDetailController extends BaseController {
orderListResponse.setOriginalWorkerId(orderMaster.getOriginalWorkerId());
orderListResponse.setConfirmStartTime(detail.getConfirmStartTime());
orderListResponse.setDeliveryType(orderMaster.getDeliveryType());
orderListResponse.setWorkerRemark(detail.getWorkerRemark());
orderListResponse.setOrderType(orderMaster.getOrderType());
orderListResponse.setHasServiceOrder(orderMaster.getHasServiceOrder());
@ -1262,17 +1267,20 @@ public class OrderDetailController extends BaseController {
OrderGoods firstOrderGoods = orderGoodsList.get(0);
GoodsStandard goodsStandard = goodsStandardService.selectById(firstOrderGoods.getGoodsStandardId());
if (goodsStandard != null && goodsStandard.getDeptGoodsCategoryId() != null) {
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goodsStandard.getDeptGoodsCategoryId());
if (deptGoodsCategory != null && deptGoodsCategory.getCountdownHours() != null) {
// 递归查找类目的倒计时小时数
Integer countdownHours = deptGoodsCategoryService.findCountdownHoursRecursively(goodsStandard.getDeptGoodsCategoryId());
if (countdownHours != null) {
// 计算分账倒计时结束时间workFinishTime + 倒计时小时数
long countdownMillis = deptGoodsCategory.getCountdownHours() * 60 * 60 * 1000L;
long countdownMillis = countdownHours * 60 * 60 * 1000L;
Date shareAccountCountdownEndTime = new Date(workFinishTime.getTime() + countdownMillis);
updateOrderDetail.setShareAccountCountdownEndTime(shareAccountCountdownEndTime);
updateOrderDetail.setShareAccountCountdownDuration(deptGoodsCategory.getCountdownHours());
updateOrderDetail.setShareAccountCountdownDuration(countdownHours);
logger.info("订单[{}]设置分账倒计时:完单时间={}, 倒计时小时数={}, 分账倒计时结束时间={}",
request.getOrderDetailId(), workFinishTime, deptGoodsCategory.getCountdownHours(), shareAccountCountdownEndTime);
request.getOrderDetailId(), workFinishTime, countdownHours, shareAccountCountdownEndTime);
} else {
logger.warn("订单[{}]未找到类目倒计时小时数配置,跳过分账倒计时设置", request.getOrderDetailId());
}
}
}

View File

@ -1167,7 +1167,7 @@ public class OrderMasterController extends BaseController {
orderListResponse.setOrderImages(master.getOrderImages());
orderListResponse.setIsInvoiced(master.getIsInvoiced());
orderListResponse.setOriginalWorkerId(master.getOriginalWorkerId());
orderListResponse.setWorkerRemark(master.getWorkerRemark());
orderListResponse.setOrderType(master.getOrderType());
orderListResponse.setHasServiceOrder(master.getHasServiceOrder());
orderListResponse.setPaymentMoney(paymentMoney);
@ -1842,6 +1842,7 @@ public class OrderMasterController extends BaseController {
serverMoney=serverMoney.add(leaderMoney);
logger.info("大师傅的服务金额{}大师傅的分成{}",serverMoney,leaderMoney);
// 编辑返回属性
orderListResponse.setOrderImages(orderMaster.getOrderImages());
orderListResponse.setOrderMasterId(orderMaster.getId());
orderListResponse.setOrderMasterCode(orderMaster.getCode());
orderListResponse.setGoodsName(goods.getGoodsName());

View File

@ -272,9 +272,27 @@ public class OrderListResponse {
@Excel(name = "发货图片", cellType = Excel.ColumnType.STRING)
private String deliveryImages;
@Excel(name = "交货图片", cellType = Excel.ColumnType.STRING)
private String handoverImages;
@Excel(name = "交货备注", cellType = Excel.ColumnType.STRING)
private String handoverRemark;
/**
* 快递单号
*/
private String trackingNumber;
/**
* 分账倒计时结束时间
*/
@Excel(name = "分账倒计时结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date shareAccountCountdownEndTime;
/**
* 分账倒计时时长小时
*/
@Excel(name = "分账倒计时时长(小时)")
private Integer shareAccountCountdownDuration;
}

View File

@ -81,4 +81,12 @@ public interface DeptGoodsCategoryService {
*/
AjaxResult batchAdd(Long parentId, Long[] checked);
/**
* 递归查找类目的倒计时小时数如果当前类目没有设置则查找上级类目
*
* @param deptGoodsCategoryId 分公司类目ID
* @return 倒计时小时数如果所有上级类目都没有设置则返回null
*/
Integer findCountdownHoursRecursively(Long deptGoodsCategoryId);
}

View File

@ -214,4 +214,42 @@ public class DeptGoodsCategoryServiceImpl implements DeptGoodsCategoryService {
}
return ztrees;
}
@Override
public Integer findCountdownHoursRecursively(Long deptGoodsCategoryId) {
if (deptGoodsCategoryId == null) {
log.warn("分公司类目ID为空无法查找倒计时小时数");
return null;
}
// 查询当前类目
DeptGoodsCategory currentCategory = deptGoodsCategoryMapper.selectById(deptGoodsCategoryId);
if (currentCategory == null) {
log.warn("未找到分公司类目ID: {}", deptGoodsCategoryId);
return null;
}
// 如果当前类目有设置倒计时小时数直接返回
if (currentCategory.getCountdownHours() != null) {
log.info("找到类目[{}]的倒计时小时数: {}", currentCategory.getGoodsCategoryName(), currentCategory.getCountdownHours());
return currentCategory.getCountdownHours();
}
// 如果当前类目没有设置查找上级类目
if (currentCategory.getParentCategoryId() != null) {
log.info("类目[{}]未设置倒计时小时数查找上级类目ID: {}", currentCategory.getGoodsCategoryName(), currentCategory.getParentCategoryId());
// 通过商品类目ID查找对应的分公司类目
DeptGoodsCategory parentDeptCategory = deptGoodsCategoryMapper.selectOneByGoodsCategoryId(currentCategory.getParentCategoryId());
if (parentDeptCategory != null) {
return findCountdownHoursRecursively(parentDeptCategory.getDeptGoodsCategoryId());
} else {
log.warn("未找到上级类目对应的分公司类目商品类目ID: {}", currentCategory.getParentCategoryId());
}
} else {
log.info("类目[{}]已是顶级类目,无上级类目可查找", currentCategory.getGoodsCategoryName());
}
return null;
}
}

View File

@ -266,7 +266,6 @@ public class OrderDetail extends BaseEntity {
* 分账倒计时结束时间
*/
@Excel(name = "分账倒计时结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date shareAccountCountdownEndTime;
/**

View File

@ -334,7 +334,7 @@ public class OrderMaster extends BaseEntity {
* 分账倒计时结束时间workFinishTime + 设置的倒计时字段
*/
@Excel(name = "分账倒计时结束时间", cellType = Excel.ColumnType.STRING)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date shareAccountCountdownEndTime;
/**

View File

@ -191,7 +191,7 @@ public class OrderServiceImpl implements OrderService {
flag = getOverTime(order.getUpdateTime(), 8 * 60 * 60 * 1000).before(now);
} else {
flag = getOverTime(createTime, 8 * 60 * 60 * 1000).before(now);
log.info("判断时间:{},当前时间:{},结果:{}", getOverTime(createTime, 45 * 60 * 1000), now, flag);
log.info("判断时间:{},当前时间:{},结果:{}", getOverTime(createTime, 8 * 60 * 60 * 1000), now, flag);
}
// 是否已经超时
boolean timeout = ONE.equals(order.getTimeout());
@ -1497,17 +1497,20 @@ public class OrderServiceImpl implements OrderService {
OrderGoods firstOrderGoods = orderGoodsList.get(0);
GoodsStandard goodsStandard = goodsStandardService.selectById(firstOrderGoods.getGoodsStandardId());
if (goodsStandard != null && goodsStandard.getDeptGoodsCategoryId() != null) {
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(goodsStandard.getDeptGoodsCategoryId());
if (deptGoodsCategory != null && deptGoodsCategory.getCountdownHours() != null) {
// 递归查找类目的倒计时小时数
Integer countdownHours = deptGoodsCategoryService.findCountdownHoursRecursively(goodsStandard.getDeptGoodsCategoryId());
if (countdownHours != null) {
// 计算分账倒计时结束时间workFinishTime + 倒计时小时数
long countdownMillis = deptGoodsCategory.getCountdownHours() * 60 * 60 * 1000L;
long countdownMillis = countdownHours * 60 * 60 * 1000L;
Date shareAccountCountdownEndTime = new Date(workFinishTime.getTime() + countdownMillis);
orderDetail.setShareAccountCountdownEndTime(shareAccountCountdownEndTime);
orderDetail.setShareAccountCountdownDuration(deptGoodsCategory.getCountdownHours());
orderDetail.setShareAccountCountdownDuration(countdownHours);
log.info("订单[{}]设置分账倒计时:完单时间={}, 倒计时小时数={}, 分账倒计时结束时间={}",
orderDetail.getCode(), workFinishTime, deptGoodsCategory.getCountdownHours(), shareAccountCountdownEndTime);
orderDetail.getCode(), workFinishTime, countdownHours, shareAccountCountdownEndTime);
} else {
log.warn("订单[{}]未找到类目倒计时小时数配置,跳过分账倒计时设置", orderDetail.getCode());
}
}
}