no message

This commit is contained in:
cb 2025-10-11 16:18:34 +08:00
parent 5489aaa620
commit 642038eef5
4 changed files with 48 additions and 20 deletions

View File

@ -580,12 +580,14 @@ public class OrderController extends BaseController {
if (workIds.size() > 1 || !workIds.contains(om.getWorkerId())) { if (workIds.size() > 1 || !workIds.contains(om.getWorkerId())) {
// 派完单 并且有其他师傅接单包含其他人监控单需要显示 // 派完单 并且有其他师傅接单包含其他人监控单需要显示
om2up.setHasDispatchedAll(1); om2up.setHasDispatchedAll(1);
om2up.setAllSelfAssigned(1); // 1表示有其他师傅参与 om2up.setAllSelfAssigned(0); // 保持原有含义0表示有其他师傅参与
om2up.setShowInMonitor(1); // 新字段1表示显示在监控单
om2up.setOrderStatus(OrderStatus.PLAIN.code()); om2up.setOrderStatus(OrderStatus.PLAIN.code());
} else { } else {
// 派完单 但是只有自己接单只有自己监控单不显示 // 派完单 但是只有自己接单只有自己监控单不显示
om2up.setHasDispatchedAll(1); om2up.setHasDispatchedAll(1);
om2up.setAllSelfAssigned(0); // 0表示只有自己承接 om2up.setAllSelfAssigned(1); // 保持原有含义1表示只有自己承接
om2up.setShowInMonitor(0); // 新字段0表示不显示在监控单
if (request.getIsQuicklyDelivery() != null && request.getIsQuicklyDelivery() == 1) { if (request.getIsQuicklyDelivery() != null && request.getIsQuicklyDelivery() == 1) {
om2up.setOrderStatus(OrderStatus.SERVER.code()); om2up.setOrderStatus(OrderStatus.SERVER.code());
} else { } else {
@ -593,10 +595,23 @@ public class OrderController extends BaseController {
} }
} }
} else { } else {
// 未派完单还未完全派单暂不显示在监控单 // 未派完单但需要检查是否派给了非自己的师傅
om2up.setAllSelfAssigned(0); // 0表示未完成派单或只有自己 Set<Long> assignedWorkIds = orderDetailService.selectByOrderMasterId(om.getId()).stream()
.map(OrderDetail::getWorkerId).collect(Collectors.toSet());
if (assignedWorkIds.size() > 1 || (assignedWorkIds.size() == 1 && !assignedWorkIds.contains(om.getWorkerId()))) {
// 未派完单但派给了非自己的师傅需要显示在监控单
om2up.setAllSelfAssigned(0); // 保持原有含义0表示有其他师傅参与
om2up.setShowInMonitor(1); // 新字段1表示显示在监控单
om2up.setHasDispatchedAll(0); om2up.setHasDispatchedAll(0);
om2up.setOrderStatus(OrderStatus.PLAIN.code()); om2up.setOrderStatus(OrderStatus.PLAIN.code());
} else {
// 未派完单且只派给了自己或还没有派单不显示在监控单
om2up.setAllSelfAssigned(1); // 保持原有含义1示未完成派单或只有自己
om2up.setShowInMonitor(0); // 新字段0表示不显示在监控单
om2up.setHasDispatchedAll(0);
om2up.setOrderStatus(OrderStatus.PLAIN.code());
}
} }
orderMasterService.updateOrderMaster(om2up); orderMasterService.updateOrderMaster(om2up);
logger.info("是否已经全部派完单{}", om2up); logger.info("是否已经全部派完单{}", om2up);
@ -2422,23 +2437,25 @@ public class OrderController extends BaseController {
logger.warn("配件订单[{}]未找到对应的财务主单,无法扣除服务金额", accessoryOrderMaster.getCode()); logger.warn("配件订单[{}]未找到对应的财务主单,无法扣除服务金额", accessoryOrderMaster.getCode());
} }
if (!CollectionUtils.isEmpty(serviceGoodsList)) { // 获取配件订单的商品信息
Goods firstServiceGoods = serviceGoodsList.get(0); // 取第一个服务商品 List<OrderGoods> accessoryOrderGoodsList = orderGoodsService.selectByOrderMasterId(accessoryOrderMaster.getId());
if (!CollectionUtils.isEmpty(accessoryOrderGoodsList)) {
OrderGoods firstAccessoryGoods = accessoryOrderGoodsList.get(0); // 取第一个配件商品
OrderGoods serviceOrderGoods = new OrderGoods(); OrderGoods serviceOrderGoods = new OrderGoods();
serviceOrderGoods.setOrderId(serviceOrderMaster.getId()); serviceOrderGoods.setOrderId(serviceOrderMaster.getId());
serviceOrderGoods.setGoodsStandardId(firstServiceGoods.getDeptGoodsCategoryId()); // 用标准ID serviceOrderGoods.setGoodsStandardId(firstAccessoryGoods.getGoodsStandardId()); // 使配件商品的标准ID
serviceOrderGoods.setGoodsName(firstServiceGoods.getGoodsName()); serviceOrderGoods.setGoodsName(firstAccessoryGoods.getGoodsName()); // 使用配件商品的名称
serviceOrderGoods.setGoodsNum(1); // 数量为1 serviceOrderGoods.setGoodsNum(firstAccessoryGoods.getGoodsNum()); // 使用配件商品的数量
serviceOrderGoods.setRemark("由配件订单自动生成的服务商品,服务金额:" + serviceMoney); serviceOrderGoods.setRemark("由配件订单[" + accessoryOrderMaster.getCode() + "]自动生成的服务商品,服务金额:" + serviceMoney);
serviceOrderGoods.setCreateTime(new Date()); serviceOrderGoods.setCreateTime(new Date());
// 保存OrderGoods // 保存OrderGoods
orderGoodsService.insertOrderGoods(serviceOrderGoods); orderGoodsService.insertOrderGoods(serviceOrderGoods);
logger.info("为服务订单[{}]生成服务商品[{}],商品ID{},金额:{}", logger.info("为服务订单[{}]生成服务商品[{}],商品标准ID{},数量{},金额:{}",
serviceOrderMaster.getCode(), firstServiceGoods.getGoodsName(), serviceOrderMaster.getCode(), firstAccessoryGoods.getGoodsName(),
firstServiceGoods.getGoodsId(), serviceMoney); firstAccessoryGoods.getGoodsStandardId(), firstAccessoryGoods.getGoodsNum(), serviceMoney);
} else { } else {
logger.warn("服务店铺[{}]没有找到服务商品无法生成OrderGoods", serviceShopId); logger.warn("配件订单[{}]没有找到商品信息无法生成OrderGoods", accessoryOrderMaster.getCode());
} }
// 更新配件主单关联生成的服务订单并标记已派发服务订单 // 更新配件主单关联生成的服务订单并标记已派发服务订单

View File

@ -1982,6 +1982,7 @@ public class OrderMasterController extends BaseController {
orderListResponse.setShop(shop); orderListResponse.setShop(shop);
orderListResponse.setServiceShop(serviceShop); orderListResponse.setServiceShop(serviceShop);
orderListResponse.setOriginalWorkerId(goodsOrderMaster != null ? goodsOrderMaster.getWorkerId() : null);
orderListResponse.setGoodsOrderMasterId(orderMaster.getGoodsOrderMasterId()); orderListResponse.setGoodsOrderMasterId(orderMaster.getGoodsOrderMasterId());
orderListResponse.setGoods(goods); orderListResponse.setGoods(goods);
orderListResponse.setTrackingNumber(orderMaster.getTrackingNumber()); orderListResponse.setTrackingNumber(orderMaster.getTrackingNumber());

View File

@ -348,6 +348,12 @@ public class OrderMaster extends BaseEntity {
*/ */
private Boolean includeOriginalWorker; private Boolean includeOriginalWorker;
/**
* 是否显示在监控单0=不显示1=显示在监控单
*/
@Excel(name = "是否显示在监控单", cellType = Excel.ColumnType.NUMERIC, readConverterExp = "0=不显示,1=显示在监控单")
private Integer showInMonitor;
/** /**
* 更新时间别名字段用于SQL查询中的update_time别名映射 * 更新时间别名字段用于SQL查询中的update_time别名映射
*/ */

View File

@ -73,6 +73,7 @@
<result property="workerRemark" column="worker_remark"/> <result property="workerRemark" column="worker_remark"/>
<result property="shareAccountCountdownEndTime" column="share_account_countdown_end_time"/> <result property="shareAccountCountdownEndTime" column="share_account_countdown_end_time"/>
<result property="shareAccountCountdownDuration" column="share_account_countdown_duration"/> <result property="shareAccountCountdownDuration" column="share_account_countdown_duration"/>
<result property="showInMonitor" column="show_in_monitor"/>
</resultMap> </resultMap>
@ -143,7 +144,8 @@
worker_remark, worker_remark,
after_service_status, after_service_status,
share_account_countdown_end_time, share_account_countdown_end_time,
share_account_countdown_duration share_account_countdown_duration,
show_in_monitor
FROM order_master FROM order_master
</sql> </sql>
<sql id="selectOrderMasterMoreInfo"> <sql id="selectOrderMasterMoreInfo">
@ -213,7 +215,8 @@
om.worker_remark, om.worker_remark,
om.after_service_status, om.after_service_status,
om.share_account_countdown_end_time, om.share_account_countdown_end_time,
om.share_account_countdown_duration om.share_account_countdown_duration,
om.show_in_monitor
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
@ -250,7 +253,7 @@
AND ca.country_id = #{district} AND ca.country_id = #{district}
</if> </if>
<if test="isMonitoredOrder"> <if test="isMonitoredOrder">
AND om.all_self_assigned = 1 AND om.order_status in (0,1,2,3,4) and om.worker_id is not null AND om.show_in_monitor = 1 AND om.order_status in (0,1,2,3,4) and om.worker_id is not null
</if> </if>
<if test="allSelfAssigned != null"> <if test="allSelfAssigned != null">
AND all_self_assigned = #{allSelfAssigned} AND all_self_assigned = #{allSelfAssigned}
@ -399,7 +402,7 @@
LEFT JOIN financial_master fm ON om.id = fm.order_master_id LEFT JOIN financial_master fm ON om.id = fm.order_master_id
<where> <where>
<if test="isMonitoredOrder"> <if test="isMonitoredOrder">
AND om.all_self_assigned = 1 AND om.order_status in (1,2,3,4) AND om.show_in_monitor = 1 AND om.order_status in (1,2,3,4)
</if> </if>
<if test="allSelfAssigned != null"> <if test="allSelfAssigned != null">
AND all_self_assigned = #{allSelfAssigned} AND all_self_assigned = #{allSelfAssigned}
@ -511,6 +514,7 @@
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="allSelfAssigned != null">all_self_assigned = #{allSelfAssigned},</if> <if test="allSelfAssigned != null">all_self_assigned = #{allSelfAssigned},</if>
<if test="resetAllSelfAssigned">all_self_assigned = null,</if> <if test="resetAllSelfAssigned">all_self_assigned = null,</if>
<if test="showInMonitor != null">show_in_monitor = #{showInMonitor},</if>
<if test="hasDispatchedAll != null">has_dispatched_all = #{hasDispatchedAll},</if> <if test="hasDispatchedAll != null">has_dispatched_all = #{hasDispatchedAll},</if>
<if test="isCall != null">is_call = #{isCall},</if> <if test="isCall != null">is_call = #{isCall},</if>
<if test="isCharge != null">is_charge = #{isCharge},</if> <if test="isCharge != null">is_charge = #{isCharge},</if>