增加字段
This commit is contained in:
parent
624921d776
commit
87bcdda6f8
|
|
@ -470,6 +470,8 @@ public class OrderController extends BaseController {
|
||||||
od.setExpectTimeStart(om.getExpectTimeStart());
|
od.setExpectTimeStart(om.getExpectTimeStart());
|
||||||
od.setExpectTimeEnd(om.getExpectTimeEnd());
|
od.setExpectTimeEnd(om.getExpectTimeEnd());
|
||||||
od.setWorkBeginTime(new Date());
|
od.setWorkBeginTime(new Date());
|
||||||
|
// 将主单的师傅备注复制到子单
|
||||||
|
od.setWorkerRemark(om.getWorkerRemark());
|
||||||
orderDetailService.insertOrderDetail(od);
|
orderDetailService.insertOrderDetail(od);
|
||||||
logger.info("子订单是否创建完成{}", od);
|
logger.info("子订单是否创建完成{}", od);
|
||||||
// 批量生成订单商品
|
// 批量生成订单商品
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ghy.order.domain;
|
package com.ghy.order.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
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.common.enums.OrderStatus;
|
import com.ghy.common.enums.OrderStatus;
|
||||||
|
|
@ -260,4 +261,17 @@ public class OrderDetail extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
@Excel(name = "售后状态:0-无售后,1-售后纠纷")
|
@Excel(name = "售后状态:0-无售后,1-售后纠纷")
|
||||||
private Integer afterServiceStatus;
|
private Integer afterServiceStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分账倒计时结束时间
|
||||||
|
*/
|
||||||
|
@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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分账倒计时时长(小时)
|
||||||
|
*/
|
||||||
|
@Excel(name = "分账倒计时时长(小时)")
|
||||||
|
private Integer shareAccountCountdownDuration;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -329,4 +329,17 @@ public class OrderMaster extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
@Excel(name = "售后状态:0-无售后,1-售后纠纷")
|
@Excel(name = "售后状态:0-无售后,1-售后纠纷")
|
||||||
private Integer afterServiceStatus;
|
private Integer afterServiceStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分账倒计时结束时间(workFinishTime + 设置的倒计时字段)
|
||||||
|
*/
|
||||||
|
@Excel(name = "分账倒计时结束时间", cellType = Excel.ColumnType.STRING)
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date shareAccountCountdownEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分账倒计时时长(单位:小时)
|
||||||
|
*/
|
||||||
|
@Excel(name = "分账倒计时时长", cellType = Excel.ColumnType.NUMERIC)
|
||||||
|
private Integer shareAccountCountdownDuration;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,8 @@
|
||||||
<result property="returnReasonDetail" column="return_reason_detail"/>
|
<result property="returnReasonDetail" column="return_reason_detail"/>
|
||||||
<result property="returnImages" column="return_images"/>
|
<result property="returnImages" column="return_images"/>
|
||||||
<result property="workerRemark" column="worker_remark"/>
|
<result property="workerRemark" column="worker_remark"/>
|
||||||
|
<result property="shareAccountCountdownEndTime" column="share_account_countdown_end_time"/>
|
||||||
|
<result property="shareAccountCountdownDuration" column="share_account_countdown_duration"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectOrderDetail">
|
<sql id="selectOrderDetail">
|
||||||
|
|
@ -81,7 +83,9 @@
|
||||||
return_reason_detail,
|
return_reason_detail,
|
||||||
return_images,
|
return_images,
|
||||||
worker_remark,
|
worker_remark,
|
||||||
after_service_status
|
after_service_status,
|
||||||
|
share_account_countdown_end_time,
|
||||||
|
share_account_countdown_duration
|
||||||
FROM order_detail
|
FROM order_detail
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
@ -122,7 +126,9 @@
|
||||||
od.return_reason_detail,
|
od.return_reason_detail,
|
||||||
od.return_images,
|
od.return_images,
|
||||||
od.worker_remark,
|
od.worker_remark,
|
||||||
od.after_service_status
|
od.after_service_status,
|
||||||
|
od.share_account_countdown_end_time,
|
||||||
|
od.share_account_countdown_duration
|
||||||
FROM order_detail od
|
FROM order_detail od
|
||||||
LEFT JOIN order_master om ON om.id = od.order_master_id
|
LEFT JOIN order_master om ON om.id = od.order_master_id
|
||||||
LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id
|
LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id
|
||||||
|
|
@ -400,6 +406,8 @@
|
||||||
<if test="returnImages != null">return_images = #{returnImages},</if>
|
<if test="returnImages != null">return_images = #{returnImages},</if>
|
||||||
<if test="workerRemark != null">worker_remark = #{workerRemark},</if>
|
<if test="workerRemark != null">worker_remark = #{workerRemark},</if>
|
||||||
<if test="afterServiceStatus != null">after_service_status = #{afterServiceStatus},</if>
|
<if test="afterServiceStatus != null">after_service_status = #{afterServiceStatus},</if>
|
||||||
|
<if test="shareAccountCountdownEndTime != null">share_account_countdown_end_time = #{shareAccountCountdownEndTime},</if>
|
||||||
|
<if test="shareAccountCountdownDuration != null">share_account_countdown_duration = #{shareAccountCountdownDuration},</if>
|
||||||
update_time = SYSDATE()
|
update_time = SYSDATE()
|
||||||
</set>
|
</set>
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
|
|
@ -463,6 +471,8 @@
|
||||||
<if test="returnReasonDetail != null">return_reason_detail,</if>
|
<if test="returnReasonDetail != null">return_reason_detail,</if>
|
||||||
<if test="returnImages != null">return_images,</if>
|
<if test="returnImages != null">return_images,</if>
|
||||||
<if test="workerRemark != null">worker_remark,</if>
|
<if test="workerRemark != null">worker_remark,</if>
|
||||||
|
<if test="shareAccountCountdownEndTime != null">share_account_countdown_end_time,</if>
|
||||||
|
<if test="shareAccountCountdownDuration != null">share_account_countdown_duration,</if>
|
||||||
<if test="expectTimeStart != null">expect_time_start,</if>
|
<if test="expectTimeStart != null">expect_time_start,</if>
|
||||||
<if test="expectTimeEnd != null">expect_time_end,</if>
|
<if test="expectTimeEnd != null">expect_time_end,</if>
|
||||||
<if test="workBeginTime != null">work_begin_time,</if>
|
<if test="workBeginTime != null">work_begin_time,</if>
|
||||||
|
|
@ -487,6 +497,8 @@
|
||||||
<if test="returnReasonDetail != null">#{returnReasonDetail},</if>
|
<if test="returnReasonDetail != null">#{returnReasonDetail},</if>
|
||||||
<if test="returnImages != null">#{returnImages},</if>
|
<if test="returnImages != null">#{returnImages},</if>
|
||||||
<if test="workerRemark != null">#{workerRemark},</if>
|
<if test="workerRemark != null">#{workerRemark},</if>
|
||||||
|
<if test="shareAccountCountdownEndTime != null">#{shareAccountCountdownEndTime},</if>
|
||||||
|
<if test="shareAccountCountdownDuration != null">#{shareAccountCountdownDuration},</if>
|
||||||
<if test="expectTimeStart != null">#{expectTimeStart},</if>
|
<if test="expectTimeStart != null">#{expectTimeStart},</if>
|
||||||
<if test="expectTimeEnd != null">#{expectTimeEnd},</if>
|
<if test="expectTimeEnd != null">#{expectTimeEnd},</if>
|
||||||
<if test="workBeginTime != null">#{workBeginTime},</if>
|
<if test="workBeginTime != null">#{workBeginTime},</if>
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,8 @@
|
||||||
<result property="returnReasonDetail" column="return_reason_detail"/>
|
<result property="returnReasonDetail" column="return_reason_detail"/>
|
||||||
<result property="returnImages" column="return_images"/>
|
<result property="returnImages" column="return_images"/>
|
||||||
<result property="workerRemark" column="worker_remark"/>
|
<result property="workerRemark" column="worker_remark"/>
|
||||||
|
<result property="shareAccountCountdownEndTime" column="share_account_countdown_end_time"/>
|
||||||
|
<result property="shareAccountCountdownDuration" column="share_account_countdown_duration"/>
|
||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
@ -137,7 +139,9 @@
|
||||||
return_reason_detail,
|
return_reason_detail,
|
||||||
return_images,
|
return_images,
|
||||||
worker_remark,
|
worker_remark,
|
||||||
after_service_status
|
after_service_status,
|
||||||
|
share_account_countdown_end_time,
|
||||||
|
share_account_countdown_duration
|
||||||
FROM order_master
|
FROM order_master
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="selectOrderMasterMoreInfo">
|
<sql id="selectOrderMasterMoreInfo">
|
||||||
|
|
@ -204,7 +208,9 @@
|
||||||
om.return_reason_detail,
|
om.return_reason_detail,
|
||||||
om.return_images,
|
om.return_images,
|
||||||
om.worker_remark,
|
om.worker_remark,
|
||||||
om.after_service_status
|
om.after_service_status,
|
||||||
|
om.share_account_countdown_end_time,
|
||||||
|
om.share_account_countdown_duration
|
||||||
FROM order_master om
|
FROM order_master om
|
||||||
LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id
|
LEFT JOIN customer_address ca ON ca.customer_address_id = om.address_id
|
||||||
LEFT JOIN goods g ON g.goods_id = om.goods_id
|
LEFT JOIN goods g ON g.goods_id = om.goods_id
|
||||||
|
|
@ -518,6 +524,8 @@
|
||||||
<if test="returnImages != null">return_images = #{returnImages},</if>
|
<if test="returnImages != null">return_images = #{returnImages},</if>
|
||||||
<if test="workerRemark != null">worker_remark = #{workerRemark},</if>
|
<if test="workerRemark != null">worker_remark = #{workerRemark},</if>
|
||||||
<if test="afterServiceStatus != null">after_service_status = #{afterServiceStatus},</if>
|
<if test="afterServiceStatus != null">after_service_status = #{afterServiceStatus},</if>
|
||||||
|
<if test="shareAccountCountdownEndTime != null">share_account_countdown_end_time = #{shareAccountCountdownEndTime},</if>
|
||||||
|
<if test="shareAccountCountdownDuration != null">share_account_countdown_duration = #{shareAccountCountdownDuration},</if>
|
||||||
update_time = SYSDATE()
|
update_time = SYSDATE()
|
||||||
</set>
|
</set>
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
|
|
@ -590,6 +598,8 @@
|
||||||
<if test="returnReasonDetail != null">return_reason_detail,</if>
|
<if test="returnReasonDetail != null">return_reason_detail,</if>
|
||||||
<if test="returnImages != null">return_images,</if>
|
<if test="returnImages != null">return_images,</if>
|
||||||
<if test="workerRemark != null">worker_remark,</if>
|
<if test="workerRemark != null">worker_remark,</if>
|
||||||
|
<if test="shareAccountCountdownEndTime != null">share_account_countdown_end_time,</if>
|
||||||
|
<if test="shareAccountCountdownDuration != null">share_account_countdown_duration,</if>
|
||||||
create_time
|
create_time
|
||||||
)VALUES(
|
)VALUES(
|
||||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||||
|
|
@ -643,6 +653,8 @@
|
||||||
<if test="returnReasonDetail != null">#{returnReasonDetail},</if>
|
<if test="returnReasonDetail != null">#{returnReasonDetail},</if>
|
||||||
<if test="returnImages != null">#{returnImages},</if>
|
<if test="returnImages != null">#{returnImages},</if>
|
||||||
<if test="workerRemark != null">#{workerRemark},</if>
|
<if test="workerRemark != null">#{workerRemark},</if>
|
||||||
|
<if test="shareAccountCountdownEndTime != null">#{shareAccountCountdownEndTime},</if>
|
||||||
|
<if test="shareAccountCountdownDuration != null">#{shareAccountCountdownDuration},</if>
|
||||||
SYSDATE()
|
SYSDATE()
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
|
||||||
|
|
@ -659,7 +659,7 @@ public class OrderServiceImpl implements OrderService {
|
||||||
List<OrderDetail> orderDetails = orderDetailService.selectByStatus(Collections.singletonList(OrderStatus.FINISH_CHECK.code()));
|
List<OrderDetail> orderDetails = orderDetailService.selectByStatus(Collections.singletonList(OrderStatus.FINISH_CHECK.code()));
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
//TODO:测试完毕以后改为60分钟
|
//TODO:测试完毕以后改为60分钟
|
||||||
long day14ago = now - (10 * 60 * 1000L);
|
long day14ago = now - (60 * 60 * 1000L);
|
||||||
// long day14ago = now - 10000L;
|
// long day14ago = now - 10000L;
|
||||||
for (OrderDetail orderDetail : orderDetails) {
|
for (OrderDetail orderDetail : orderDetails) {
|
||||||
// 筛选符合自动确认的订单
|
// 筛选符合自动确认的订单
|
||||||
|
|
@ -1439,18 +1439,25 @@ public class OrderServiceImpl implements OrderService {
|
||||||
|
|
||||||
long waitTimeMillis;
|
long waitTimeMillis;
|
||||||
|
|
||||||
|
// 获取发货类型并检查是否为null
|
||||||
|
Integer deliveryType = orderMaster.getDeliveryType();
|
||||||
|
if (deliveryType == null) {
|
||||||
|
log.warn("订单[{}]发货类型为null,跳过处理", orderDetail.getCode());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// 根据发货类型判断等待时间
|
// 根据发货类型判断等待时间
|
||||||
if (orderMaster.getDeliveryType() == 2 || orderMaster.getDeliveryType() == 3) {
|
if (deliveryType == 2 || deliveryType == 3) {
|
||||||
// 送货上门或自提:8小时
|
// 送货上门或自提:8小时
|
||||||
waitTimeMillis = 8 * 60 * 60 * 1000L; // 8小时的毫秒数
|
waitTimeMillis = 8 * 60 * 60 * 1000L; // 8小时的毫秒数
|
||||||
logType = orderMaster.getDeliveryType() == 2 ? "送货上门" : "自提";
|
logType = deliveryType == 2 ? "送货上门" : "自提";
|
||||||
} else if (orderMaster.getDeliveryType() == 1) {
|
} else if (deliveryType == 1) {
|
||||||
// 发快递/物流:4天
|
// 发快递/物流:4天
|
||||||
waitTimeMillis = 4 * 24 * 60 * 60 * 1000L; // 4天的毫秒数
|
waitTimeMillis = 4 * 24 * 60 * 60 * 1000L; // 4天的毫秒数
|
||||||
logType = "发快递/物流";
|
logType = "发快递/物流";
|
||||||
} else {
|
} else {
|
||||||
// 未知发货类型,跳过处理
|
// 未知发货类型,跳过处理
|
||||||
log.warn("订单[{}]发货类型未知[{}],跳过处理", orderDetail.getCode(), orderMaster.getDeliveryType());
|
log.warn("订单[{}]发货类型未知[{}],跳过处理", orderDetail.getCode(), deliveryType);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue