From 9e73c3f38b419a20d0c5ce50cd615d7e627952e8 Mon Sep 17 00:00:00 2001 From: chenhao <852066789@qq.com> Date: Thu, 5 Jun 2025 17:12:20 +0800 Subject: [PATCH] =?UTF-8?q?refactor(sip):=20=E4=BC=98=E5=8C=96=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E5=90=8D=E7=A7=B0=E7=9B=B8=E5=85=B3=E6=9C=AF=E8=AF=AD?= =?UTF-8?q?=E5=B9=B6=E5=AE=8C=E5=96=84=E5=8F=91=E8=B4=A7=E5=8D=95=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将"客户名称"统一修改为"最终客户名称",以提升术语一致性 - 在 DeliveryListMapper 中新增删除多条发货记录的功能 - 优化 ProjectInfoServiceImpl 中的日志记录方法 - 修复 OrderDeliveryServiceImpl 中删除发货单的逻辑 --- .../main/resources/templates/manage/order/add.html | 2 +- .../resources/templates/manage/order/edit.html | 2 +- .../resources/templates/manage/order/order.html | 4 ++-- .../resources/templates/project/order/order.html | 5 +---- .../resources/templates/system/customer/add.html | 2 +- .../resources/templates/system/customer/edit.html | 2 +- .../resources/templates/system/customer/info.html | 4 ++-- .../com/ruoyi/sip/mapper/DeliveryListMapper.java | 2 ++ .../sip/service/impl/OrderDeliveryServiceImpl.java | 8 ++++++++ .../sip/service/impl/ProjectInfoServiceImpl.java | 14 +++++++------- .../resources/mapper/manage/DeliveryListMapper.xml | 8 +++++++- 11 files changed, 33 insertions(+), 20 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/manage/order/add.html b/ruoyi-admin/src/main/resources/templates/manage/order/add.html index 95af87c3..e1f5c253 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/order/add.html +++ b/ruoyi-admin/src/main/resources/templates/manage/order/add.html @@ -106,7 +106,7 @@
- +
- +
  • - +
  • @@ -94,7 +94,7 @@ }, { field: 'customerName', - title: '客户名称' + title: '最终客户名称' }, { field: 'orderType', diff --git a/ruoyi-admin/src/main/resources/templates/project/order/order.html b/ruoyi-admin/src/main/resources/templates/project/order/order.html index b33331ff..d1d40de1 100644 --- a/ruoyi-admin/src/main/resources/templates/project/order/order.html +++ b/ruoyi-admin/src/main/resources/templates/project/order/order.html @@ -10,10 +10,7 @@
      -
    • - - -
    • +
    • diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/add.html b/ruoyi-admin/src/main/resources/templates/system/customer/add.html index cfec85ed..39fe7c32 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customer/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/customer/add.html @@ -17,7 +17,7 @@
    - +
    diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/edit.html b/ruoyi-admin/src/main/resources/templates/system/customer/edit.html index f4869fba..41fb4d81 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customer/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/customer/edit.html @@ -18,7 +18,7 @@
    - +
    diff --git a/ruoyi-admin/src/main/resources/templates/system/customer/info.html b/ruoyi-admin/src/main/resources/templates/system/customer/info.html index ec0ecf57..1457dff7 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customer/info.html +++ b/ruoyi-admin/src/main/resources/templates/system/customer/info.html @@ -15,7 +15,7 @@
  • - +
  • @@ -101,7 +101,7 @@ }, { field: 'customerName', - title: '客户名称' + title: '最终客户名称' }, { field: 'customerPostcode', diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/DeliveryListMapper.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/DeliveryListMapper.java index f45b0bb8..038a8681 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/DeliveryListMapper.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/mapper/DeliveryListMapper.java @@ -68,4 +68,6 @@ public interface DeliveryListMapper List listNumberInfo(ApiDataQueryDto dto); void deleteDeliveryListByDeliveryId(Long deliveryId); + + void deleteDeliveryListByDeliveryIds(String[] strArray); } diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderDeliveryServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderDeliveryServiceImpl.java index 2dea7abe..c5578823 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderDeliveryServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OrderDeliveryServiceImpl.java @@ -5,6 +5,7 @@ import java.util.List; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.sip.domain.CodeGenTable; +import com.ruoyi.sip.mapper.DeliveryListMapper; import com.ruoyi.sip.service.ICodeGenTableService; import com.ruoyi.sip.utils.CodeGeneratorUtil; import org.springframework.beans.factory.annotation.Autowired; @@ -13,6 +14,9 @@ import com.ruoyi.sip.mapper.OrderDeliveryMapper; import com.ruoyi.sip.domain.OrderDelivery; import com.ruoyi.sip.service.IOrderDeliveryService; import com.ruoyi.common.core.text.Convert; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; /** * 发货记录Service业务层处理 @@ -25,6 +29,8 @@ public class OrderDeliveryServiceImpl implements IOrderDeliveryService { @Autowired private OrderDeliveryMapper orderDeliveryMapper; + @Resource + private DeliveryListMapper deliveryListMapper; @Autowired private ICodeGenTableService codeGenTableService; @@ -87,8 +93,10 @@ public class OrderDeliveryServiceImpl implements IOrderDeliveryService * @return 结果 */ @Override + @Transactional(rollbackFor = Exception.class) public int deleteOrderDeliveryByIds(String ids) { + deliveryListMapper.deleteDeliveryListByDeliveryIds(Convert.toStrArray(ids)); return orderDeliveryMapper.deleteOrderDeliveryByIds(Convert.toStrArray(ids)); } diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java index 12153368..d980b1a8 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectInfoServiceImpl.java @@ -11,6 +11,7 @@ import com.ruoyi.common.utils.StringUtils; import com.ruoyi.sip.domain.*; import com.ruoyi.sip.mapper.ProjectInfoMapper; import com.ruoyi.sip.service.*; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -30,6 +31,7 @@ import java.util.stream.Stream; * @author ruoyi * @date 2025-05-29 */ +@Slf4j @Service @Transactional(rollbackFor = Exception.class) public class ProjectInfoServiceImpl implements IProjectInfoService { @@ -321,13 +323,11 @@ public class ProjectInfoServiceImpl implements IProjectInfoService { private int compareField(StringBuilder logContent, int index, String fieldName, Object oldValue, Object newValue) { if (!Objects.equals(oldValue, newValue)) { - logContent.append(index).append(".") - .append(fieldName) - .append("由‘") - .append(oldValue == null ? "" : oldValue) - .append("’变更为‘") - .append(newValue == null ? "" : oldValue) - .append("’\n"); + logContent.append(StringUtils.format("{}.{}由[{}]变更为[{}]\n", + index, + fieldName, + oldValue == null ? "空" : oldValue, + newValue == null ? "空" : oldValue)); index++; } return index; diff --git a/ruoyi-sip/src/main/resources/mapper/manage/DeliveryListMapper.xml b/ruoyi-sip/src/main/resources/mapper/manage/DeliveryListMapper.xml index e03a2bc5..234c7ca8 100644 --- a/ruoyi-sip/src/main/resources/mapper/manage/DeliveryListMapper.xml +++ b/ruoyi-sip/src/main/resources/mapper/manage/DeliveryListMapper.xml @@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select t1.id, t1.delivery_id, t1.product_code, t1.serial_number, t1.remark, t1.created_at, t1.updated_at, t1.deleted_at ,t2.delivery_code from delivery_list t1 - left join order_delivery t2 on t1.delivery_id=t2.id + inner join order_delivery t2 on (t1.delivery_id=t2.id and t2.status=0) where t1.serial_number in @@ -149,5 +149,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from delivery_list where delivery_id = #{deliveryId} + + delete from delivery_list where delivery_id in + + #{id} + + \ No newline at end of file