增加类目设置倒计时 以及实付备注字段显示
This commit is contained in:
parent
5cc6d5736d
commit
4783b4b077
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,4 +81,12 @@ public interface DeptGoodsCategoryService {
|
|||
*/
|
||||
AjaxResult batchAdd(Long parentId, Long[] checked);
|
||||
|
||||
/**
|
||||
* 递归查找类目的倒计时小时数,如果当前类目没有设置则查找上级类目
|
||||
*
|
||||
* @param deptGoodsCategoryId 分公司类目ID
|
||||
* @return 倒计时小时数,如果所有上级类目都没有设置则返回null
|
||||
*/
|
||||
Integer findCountdownHoursRecursively(Long deptGoodsCategoryId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue