refactor(sip): 优化客户名称相关术语并完善发货单删除功能

- 将"客户名称"统一修改为"最终客户名称",以提升术语一致性
- 在 DeliveryListMapper 中新增删除多条发货记录的功能
- 优化 ProjectInfoServiceImpl 中的日志记录方法
- 修复 OrderDeliveryServiceImpl 中删除发货单的逻辑
master
chenhao 2025-06-05 17:12:20 +08:00
parent ca58c7eafd
commit 9e73c3f38b
11 changed files with 33 additions and 20 deletions

View File

@ -106,7 +106,7 @@
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required"> 客户名称:</label> <label class="col-sm-4 control-label is-required"> 最终客户名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group"> <div class="input-group">
<input name="customerName" class="form-control" type="text" required <input name="customerName" class="form-control" type="text" required

View File

@ -105,7 +105,7 @@
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">客户名称:</label> <label class="col-sm-4 control-label is-required">最终客户名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group"> <div class="input-group">
<input name="customerName" th:field="*{customerName}" class="form-control" type="text" <input name="customerName" th:field="*{customerName}" class="form-control" type="text"

View File

@ -19,7 +19,7 @@
<input type="text" name="orderName"/> <input type="text" name="orderName"/>
</li> </li>
<li> <li>
<label>客户名称:</label> <label>最终客户名称:</label>
<input type="text" name="customerName"/> <input type="text" name="customerName"/>
</li> </li>
<li> <li>
@ -94,7 +94,7 @@
}, },
{ {
field: 'customerName', field: 'customerName',
title: '客户名称' title: '最终客户名称'
}, },
{ {
field: 'orderType', field: 'orderType',

View File

@ -10,10 +10,7 @@
<form id="formId"> <form id="formId">
<div class="select-list"> <div class="select-list">
<ul> <ul>
<li>
<label>项目主键:</label>
<input type="text" name="projectId"/>
</li>
<li> <li>
<label>地市:</label> <label>地市:</label>
<input type="text" name="city"/> <input type="text" name="city"/>

View File

@ -17,7 +17,7 @@
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">客户名称:</label> <label class="col-sm-4 control-label">最终客户名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="customerName" class="form-control" type="text"> <input name="customerName" class="form-control" type="text">
</div> </div>

View File

@ -18,7 +18,7 @@
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">客户名称:</label> <label class="col-sm-4 control-label">最终客户名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="customerName" th:field="*{customerName}" class="form-control" type="text"> <input name="customerName" th:field="*{customerName}" class="form-control" type="text">
</div> </div>

View File

@ -15,7 +15,7 @@
<input type="text" name="customerCode"/> <input type="text" name="customerCode"/>
</li> </li>
<li> <li>
<label>客户名称:</label> <label>最终客户名称:</label>
<input type="text" name="customerName"/> <input type="text" name="customerName"/>
</li> </li>
<li> <li>
@ -101,7 +101,7 @@
}, },
{ {
field: 'customerName', field: 'customerName',
title: '客户名称' title: '最终客户名称'
}, },
{ {
field: 'customerPostcode', field: 'customerPostcode',

View File

@ -68,4 +68,6 @@ public interface DeliveryListMapper
List<DeliveryInfoVo> listNumberInfo(ApiDataQueryDto dto); List<DeliveryInfoVo> listNumberInfo(ApiDataQueryDto dto);
void deleteDeliveryListByDeliveryId(Long deliveryId); void deleteDeliveryListByDeliveryId(Long deliveryId);
void deleteDeliveryListByDeliveryIds(String[] strArray);
} }

View File

@ -5,6 +5,7 @@ import java.util.List;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.sip.domain.CodeGenTable; import com.ruoyi.sip.domain.CodeGenTable;
import com.ruoyi.sip.mapper.DeliveryListMapper;
import com.ruoyi.sip.service.ICodeGenTableService; import com.ruoyi.sip.service.ICodeGenTableService;
import com.ruoyi.sip.utils.CodeGeneratorUtil; import com.ruoyi.sip.utils.CodeGeneratorUtil;
import org.springframework.beans.factory.annotation.Autowired; 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.domain.OrderDelivery;
import com.ruoyi.sip.service.IOrderDeliveryService; import com.ruoyi.sip.service.IOrderDeliveryService;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/** /**
* Service * Service
@ -25,6 +29,8 @@ public class OrderDeliveryServiceImpl implements IOrderDeliveryService
{ {
@Autowired @Autowired
private OrderDeliveryMapper orderDeliveryMapper; private OrderDeliveryMapper orderDeliveryMapper;
@Resource
private DeliveryListMapper deliveryListMapper;
@Autowired @Autowired
private ICodeGenTableService codeGenTableService; private ICodeGenTableService codeGenTableService;
@ -87,8 +93,10 @@ public class OrderDeliveryServiceImpl implements IOrderDeliveryService
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public int deleteOrderDeliveryByIds(String ids) public int deleteOrderDeliveryByIds(String ids)
{ {
deliveryListMapper.deleteDeliveryListByDeliveryIds(Convert.toStrArray(ids));
return orderDeliveryMapper.deleteOrderDeliveryByIds(Convert.toStrArray(ids)); return orderDeliveryMapper.deleteOrderDeliveryByIds(Convert.toStrArray(ids));
} }

View File

@ -11,6 +11,7 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.sip.domain.*; import com.ruoyi.sip.domain.*;
import com.ruoyi.sip.mapper.ProjectInfoMapper; import com.ruoyi.sip.mapper.ProjectInfoMapper;
import com.ruoyi.sip.service.*; import com.ruoyi.sip.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -30,6 +31,7 @@ import java.util.stream.Stream;
* @author ruoyi * @author ruoyi
* @date 2025-05-29 * @date 2025-05-29
*/ */
@Slf4j
@Service @Service
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class ProjectInfoServiceImpl implements IProjectInfoService { 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) { private int compareField(StringBuilder logContent, int index, String fieldName, Object oldValue, Object newValue) {
if (!Objects.equals(oldValue, newValue)) { if (!Objects.equals(oldValue, newValue)) {
logContent.append(index).append(".") logContent.append(StringUtils.format("{}.{}由[{}]变更为[{}]\n",
.append(fieldName) index,
.append("由‘") fieldName,
.append(oldValue == null ? "" : oldValue) oldValue == null ? "空" : oldValue,
.append("’变更为‘") newValue == null ? "空" : oldValue));
.append(newValue == null ? "" : oldValue)
.append("\n");
index++; index++;
} }
return index; return index;

View File

@ -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 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 ,t2.delivery_code
from delivery_list t1 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 where t1.serial_number in
<foreach item="item" index="index" collection="list" <foreach item="item" index="index" collection="list"
open="(" separator="," close=")"> open="(" separator="," close=")">
@ -149,5 +149,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteDeliveryListByDeliveryId"> <delete id="deleteDeliveryListByDeliveryId">
delete from delivery_list where delivery_id = #{deliveryId} delete from delivery_list where delivery_id = #{deliveryId}
</delete> </delete>
<delete id="deleteDeliveryListByDeliveryIds">
delete from delivery_list where delivery_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper> </mapper>