master
rdpnr_hemingxia 2025-04-11 17:45:23 +08:00
commit 93e854d0b8
3 changed files with 15 additions and 0 deletions

View File

@ -59,4 +59,6 @@ public interface DeliveryListMapper
* @return
*/
public int deleteDeliveryListByIds(String[] ids);
List<DeliveryList> listBySerialNumberList(List<DeliveryList> deliveryList);
}

View File

@ -124,6 +124,11 @@ public class DeliveryListServiceImpl implements IDeliveryListService {
for (DeliveryList list : deliveryList) {
list.setDeliveryId(deliveryId);
}
List<DeliveryList> deliveryLists = deliveryListMapper.listBySerialNumberList(deliveryList);
if (!deliveryLists.isEmpty()){
throw new ServiceException("产品序列号为[" + deliveryLists.stream().map(DeliveryList::getSerialNumber).collect(Collectors.joining(",")) + "]的产品已存在,请确认后重试;");
}
deliveryListMapper.insertBatch(deliveryList);
}

View File

@ -43,6 +43,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectDeliveryListVo"/>
where id = #{id}
</select>
<select id="listBySerialNumberList" resultType="com.ruoyi.sip.domain.DeliveryList">
<include refid="selectDeliveryListVo"/>
where serial_number in
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item.serialNumber}
</foreach>
</select>
<insert id="insertDeliveryList" parameterType="DeliveryList" useGeneratedKeys="true" keyProperty="id">
insert into delivery_list