feat(sip): 更新订单和发货单状态时间

- 在 DeliveryListMapper 中添加 updateTimeByOrderId 方法,用于更新发货单状态时间
- 在 OrderInfoMapper 中添加 updateTimeByDeliveryId 方法,用于更新订单状态时间
- 在 DeliveryListServiceImpl 和 OrderInfoServiceImpl 中调用新增的方法,以更新相关记录的时间戳
master
chenhao 2025-07-07 18:21:58 +08:00
parent 7b7da68519
commit ef534b6069
6 changed files with 27 additions and 0 deletions

View File

@ -70,4 +70,6 @@ public interface DeliveryListMapper
void deleteDeliveryListByDeliveryId(Long deliveryId);
void deleteDeliveryListByDeliveryIds(String[] strArray);
void updateTimeByOrderId(List<Long> longs);
}

View File

@ -115,4 +115,6 @@ public interface OrderInfoMapper
Integer selectUniqueCount(OrderInfo orderInfo);
List<StatisticsDetailDto> homePageData(HomepageQueryDto dto);
void updateTimeByDeliveryId(List<Long> deliveryId);
}

View File

@ -141,6 +141,8 @@ public class DeliveryListServiceImpl implements IDeliveryListService {
return AjaxResult.error(errMsg.toString());
}
deliveryListMapper.insertBatch(deliveryList);
infoMapper.updateTimeByDeliveryId(Collections.singletonList(deliveryId));
return AjaxResult.success("导入成功");
}

View File

@ -21,6 +21,7 @@ import com.ruoyi.sip.dto.ApiDataQueryDto;
import com.ruoyi.sip.dto.HomepageQueryDto;
import com.ruoyi.sip.dto.StatisticsDetailDto;
import com.ruoyi.sip.dto.StatisticsDto;
import com.ruoyi.sip.mapper.DeliveryListMapper;
import com.ruoyi.sip.service.IAgentInfoService;
import com.ruoyi.sip.service.ICustomerInfoService;
import com.ruoyi.sip.service.IProductInfoService;
@ -38,6 +39,8 @@ import com.ruoyi.sip.service.IOrderInfoService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
/**
* Service
*
@ -55,6 +58,8 @@ public class OrderInfoServiceImpl implements IOrderInfoService
private ICustomerInfoService customerInfoService;
@Autowired
private IProductInfoService productInfoService;
@Resource
private DeliveryListMapper deliveryListMapper;
/**
*
*
@ -149,6 +154,7 @@ public class OrderInfoServiceImpl implements IOrderInfoService
// }
// orderInfoMapper.updateListBatch(orderListList);
// }
deliveryListMapper.updateTimeByOrderId(Collections.singletonList(orderInfo.getId()));
return orderInfoMapper.updateOrderInfo(orderInfo);
}

View File

@ -135,6 +135,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where id = #{id}
</update>
<update id="updateTimeByOrderId">
update delivery_list set updated_at = now()
where delivery_id in (select id from order_delivery where order_id in
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>)
</update>
<delete id="deleteDeliveryListById" parameterType="Long">
delete from delivery_list where id = #{id}

View File

@ -378,6 +378,14 @@
where id = #{item.id}
</foreach>
</update>
<update id="updateTimeByDeliveryId">
update order_info
set
updated_at=now()
where id in (select order_id from order_delivery where id in
<foreach collection="list" item="item" open="(" close=")" separator=",">#{item}</foreach>
)
</update>
<delete id="deleteOrderInfoById" parameterType="Long">
update order_info