Merge branch 'master' of http://git.unissense.tech/mula/unis_sip into dev
commit
93e854d0b8
|
@ -59,4 +59,6 @@ public interface DeliveryListMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDeliveryListByIds(String[] ids);
|
||||
|
||||
List<DeliveryList> listBySerialNumberList(List<DeliveryList> deliveryList);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue