feat(inventory): 添加发货明细管理功能
- 新增发货明细实体类 OmsInventoryDeliveryDetail 及其相关 Mapper、Service 实现 - 在 InventoryDeliveryController 中增加获取发货明细并传递至前端的功能 - 扩展 InventoryInfoMapper.xml 支持通过产品序列号列表查询库存信息 - 在 InventoryDeliveryServiceImpl 中实现保存发货明细逻辑,并在删除发货单时同步删除明细 - 增加应付单生成功能,初始化应付单基本信息 - 前端页面 view.html 更新以支持发货明细查询参数传递及显示逻辑调整dev_1.0.0
parent
8b2372db42
commit
b0c8ac235c
|
|
@ -74,6 +74,7 @@
|
|||
</form>
|
||||
<form id="query-product-sn">
|
||||
<input type="hidden" name="inventoryStatus" value="1">
|
||||
<input type="hidden" name="deliveryId" th:value="${inventoryDelivery.id}">
|
||||
<input type="hidden" id="outCode" name="outerCode" th:value="${inventoryDelivery.outerCode}">
|
||||
<input type="hidden" name="warehouseId" th:value="${inventoryDelivery.warehouseId}">
|
||||
</form>
|
||||
|
|
@ -106,7 +107,21 @@
|
|||
id: 'bootstrap-table',
|
||||
url: productPrefix + "/list",
|
||||
modalName: "出库单",
|
||||
queryParams: function (params) {
|
||||
table.set(id);
|
||||
var curParams = {
|
||||
// 传递参数查询参数
|
||||
pageSize: params.limit,
|
||||
pageNum: params.offset / params.limit + 1,
|
||||
searchValue: params.search,
|
||||
orderByColumn: params.sort,
|
||||
isAsc: params.order,
|
||||
productSnList:[[${productSnList}]]
|
||||
};
|
||||
var currentId = $.common.isEmpty(table.options.formId) ? $('form').attr('id') : table.options.formId;
|
||||
return $.extend(curParams, $.common.formToJSON(currentId));
|
||||
|
||||
},
|
||||
onCheck: (row, $ele) => {
|
||||
updateTotal()
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2,9 +2,12 @@ package com.ruoyi.sip.controller;
|
|||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.sip.domain.OmsInventoryDeliveryDetail;
|
||||
import com.ruoyi.sip.service.IInventoryAuthService;
|
||||
import com.ruoyi.sip.service.IOmsInventoryDeliveryDetailService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
|
@ -34,6 +37,8 @@ public class InventoryDeliveryController extends BaseController
|
|||
@Autowired
|
||||
private IInventoryDeliveryService inventoryDeliveryService;
|
||||
@Autowired
|
||||
private IOmsInventoryDeliveryDetailService deliveryDetailServiceService;
|
||||
@Autowired
|
||||
private IInventoryAuthService inventoryAuthService;
|
||||
|
||||
@RequiresPermissions("inventory:delivery:view")
|
||||
|
|
@ -124,6 +129,7 @@ public class InventoryDeliveryController extends BaseController
|
|||
{
|
||||
InventoryDelivery inventoryDelivery = inventoryDeliveryService.selectInventoryDeliveryById(id);
|
||||
mmap.put("inventoryDelivery", inventoryDelivery);
|
||||
mmap.put("productSnList", deliveryDetailServiceService.selectOmsInventoryDeliveryDetailByDeliveryId(id).stream().map(OmsInventoryDeliveryDetail::getProductSn).collect(Collectors.toList()));
|
||||
return prefix + "/view";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ public class InventoryInfo extends BaseEntity
|
|||
/** 产品序列号 */
|
||||
@Excel(name = "产品序列号")
|
||||
private String productSn;
|
||||
private List<String> productSnList;
|
||||
|
||||
/** 库存状态(0 入库 1出库) */
|
||||
@Excel(name = "库存状态(0 入库 1出库)")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,67 @@
|
|||
package com.ruoyi.sip.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 产品库存对象 oms_inventory_delivery_detail
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-10-24
|
||||
*/
|
||||
public class OmsInventoryDeliveryDetail extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 发货id */
|
||||
@Excel(name = "发货id")
|
||||
private Long deliveryId;
|
||||
|
||||
/** 产品序列号 */
|
||||
@Excel(name = "产品序列号")
|
||||
private String productSn;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setDeliveryId(Long deliveryId)
|
||||
{
|
||||
this.deliveryId = deliveryId;
|
||||
}
|
||||
|
||||
public Long getDeliveryId()
|
||||
{
|
||||
return deliveryId;
|
||||
}
|
||||
|
||||
public void setProductSn(String productSn)
|
||||
{
|
||||
this.productSn = productSn;
|
||||
}
|
||||
|
||||
public String getProductSn()
|
||||
{
|
||||
return productSn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("deliveryId", getDeliveryId())
|
||||
.append("productSn", getProductSn())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.ruoyi.sip.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.sip.domain.OmsInventoryDeliveryDetail;
|
||||
|
||||
/**
|
||||
* 产品库存Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-10-24
|
||||
*/
|
||||
public interface OmsInventoryDeliveryDetailMapper
|
||||
{
|
||||
/**
|
||||
* 查询产品库存
|
||||
*
|
||||
* @param id 产品库存主键
|
||||
* @return 产品库存
|
||||
*/
|
||||
public OmsInventoryDeliveryDetail selectOmsInventoryDeliveryDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 查询产品库存列表
|
||||
*
|
||||
* @param omsInventoryDeliveryDetail 产品库存
|
||||
* @return 产品库存集合
|
||||
*/
|
||||
public List<OmsInventoryDeliveryDetail> selectOmsInventoryDeliveryDetailList(OmsInventoryDeliveryDetail omsInventoryDeliveryDetail);
|
||||
|
||||
/**
|
||||
* 新增产品库存
|
||||
*
|
||||
* @param omsInventoryDeliveryDetail 产品库存
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertOmsInventoryDeliveryDetail(OmsInventoryDeliveryDetail omsInventoryDeliveryDetail);
|
||||
|
||||
/**
|
||||
* 修改产品库存
|
||||
*
|
||||
* @param omsInventoryDeliveryDetail 产品库存
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateOmsInventoryDeliveryDetail(OmsInventoryDeliveryDetail omsInventoryDeliveryDetail);
|
||||
|
||||
/**
|
||||
* 删除产品库存
|
||||
*
|
||||
* @param id 产品库存主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOmsInventoryDeliveryDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除产品库存
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOmsInventoryDeliveryDetailByIds(String[] ids);
|
||||
|
||||
void saveBatch(List<OmsInventoryDeliveryDetail> detailList);
|
||||
|
||||
void deleteOmsInventoryDeliveryDetailByDeliveryId(Long id);
|
||||
|
||||
List<OmsInventoryDeliveryDetail> selectOmsInventoryDeliveryDetailByDeliveryId(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.ruoyi.sip.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.sip.domain.OmsInventoryDeliveryDetail;
|
||||
|
||||
/**
|
||||
* 产品库存Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-10-24
|
||||
*/
|
||||
public interface IOmsInventoryDeliveryDetailService
|
||||
{
|
||||
/**
|
||||
* 查询产品库存
|
||||
*
|
||||
* @param id 产品库存主键
|
||||
* @return 产品库存
|
||||
*/
|
||||
public OmsInventoryDeliveryDetail selectOmsInventoryDeliveryDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 查询产品库存列表
|
||||
*
|
||||
* @param omsInventoryDeliveryDetail 产品库存
|
||||
* @return 产品库存集合
|
||||
*/
|
||||
public List<OmsInventoryDeliveryDetail> selectOmsInventoryDeliveryDetailList(OmsInventoryDeliveryDetail omsInventoryDeliveryDetail);
|
||||
|
||||
/**
|
||||
* 新增产品库存
|
||||
*
|
||||
* @param omsInventoryDeliveryDetail 产品库存
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertOmsInventoryDeliveryDetail(OmsInventoryDeliveryDetail omsInventoryDeliveryDetail);
|
||||
|
||||
/**
|
||||
* 修改产品库存
|
||||
*
|
||||
* @param omsInventoryDeliveryDetail 产品库存
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateOmsInventoryDeliveryDetail(OmsInventoryDeliveryDetail omsInventoryDeliveryDetail);
|
||||
|
||||
/**
|
||||
* 批量删除产品库存
|
||||
*
|
||||
* @param ids 需要删除的产品库存主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOmsInventoryDeliveryDetailByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除产品库存信息
|
||||
*
|
||||
* @param id 产品库存主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOmsInventoryDeliveryDetailById(Long id);
|
||||
|
||||
void saveBatch(List<OmsInventoryDeliveryDetail> detailList);
|
||||
|
||||
void deleteOmsInventoryDeliveryDetailByDeliveryId(Long id);
|
||||
/**
|
||||
* 查询产品库存
|
||||
*
|
||||
* @param id 产品库存主键
|
||||
* @return 产品库存
|
||||
*/
|
||||
public List<OmsInventoryDeliveryDetail> selectOmsInventoryDeliveryDetailByDeliveryId(Long id);
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@ import com.ruoyi.sip.mapper.InventoryOuterMapper;
|
|||
import com.ruoyi.sip.service.*;
|
||||
import com.ruoyi.sip.vo.DeliveryInfoVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.sip.mapper.InventoryDeliveryMapper;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
|
@ -45,6 +46,14 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
private IProjectOrderInfoService projectOrderInfoService;
|
||||
@Autowired
|
||||
private IProductInfoService productInfoService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private IVendorInfoService vendorInfoService;
|
||||
|
||||
@Autowired
|
||||
private IOmsInventoryDeliveryDetailService deliveryDetailService;
|
||||
@Autowired
|
||||
private IOmsPayableBillService payableBillService;
|
||||
|
||||
/**
|
||||
* 查询产品库存
|
||||
|
|
@ -91,7 +100,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
if (CollUtil.isEmpty(productSnList) && CollUtil.isEmpty(productSnDataList)) {
|
||||
throw new ServiceException("发货清单为空,保存失败");
|
||||
}
|
||||
|
||||
List<OmsInventoryDeliveryDetail> detailList=new ArrayList<>();
|
||||
if (CollUtil.isEmpty(productSnDataList)) {
|
||||
List<InventoryInfo> inventoryInfoList = productSnList.stream().map(item -> {
|
||||
InventoryInfo info = new InventoryInfo();
|
||||
|
|
@ -100,6 +109,10 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
info.setInventoryStatus(InventoryInfo.InventoryStatusEnum.OUTER.getCode());
|
||||
info.setUpdateBy(currentUserId);
|
||||
info.setUpdateTime(nowDate);
|
||||
OmsInventoryDeliveryDetail detail = new OmsInventoryDeliveryDetail();
|
||||
detail.setProductSn(item);
|
||||
detailList.add(detail);
|
||||
|
||||
return info;
|
||||
}).collect(Collectors.toList());
|
||||
inventoryInfoService.saveBatch(inventoryInfoList);
|
||||
|
|
@ -109,10 +122,20 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
inventoryInfo.setOuterCode(inventoryDelivery.getOuterCode());
|
||||
inventoryInfo.setUpdateBy(currentUserId);
|
||||
inventoryInfo.setUpdateTime(nowDate);
|
||||
OmsInventoryDeliveryDetail detail = new OmsInventoryDeliveryDetail();
|
||||
detail.setProductSn(inventoryInfo.getProductSn());
|
||||
detailList.add(detail);
|
||||
}
|
||||
omsInventoryInnerService.importByOuter(productSnDataList,inventoryDelivery.getProductCode());
|
||||
}
|
||||
return inventoryDeliveryMapper.insertInventoryDelivery(inventoryDelivery);
|
||||
int i = inventoryDeliveryMapper.insertInventoryDelivery(inventoryDelivery);
|
||||
if (CollUtil.isNotEmpty(detailList)){
|
||||
for (OmsInventoryDeliveryDetail detail : detailList) {
|
||||
detail.setDeliveryId(inventoryDelivery.getId());
|
||||
}
|
||||
deliveryDetailService.saveBatch(detailList);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -202,6 +225,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
if (CollUtil.isNotEmpty(inventoryInfos)) {
|
||||
inventoryInfoService.clearOutInfo(inventoryInfos.stream().map(InventoryInfo::getId).collect(Collectors.toList()));
|
||||
}
|
||||
deliveryDetailService.deleteOmsInventoryDeliveryDetailByDeliveryId(id);
|
||||
return inventoryDeliveryMapper.deleteInventoryDeliveryById(id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,6 +69,11 @@ public class InventoryInfoServiceImpl implements IInventoryInfoService {
|
|||
return inventoryInfoMapper.selectInventoryInfoList(inventoryInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InventoryInfo> listByProductSnList(List<String> productSnList) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品库存
|
||||
*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,110 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.sip.mapper.OmsInventoryDeliveryDetailMapper;
|
||||
import com.ruoyi.sip.domain.OmsInventoryDeliveryDetail;
|
||||
import com.ruoyi.sip.service.IOmsInventoryDeliveryDetailService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 产品库存Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-10-24
|
||||
*/
|
||||
@Service
|
||||
public class OmsInventoryDeliveryDetailServiceImpl implements IOmsInventoryDeliveryDetailService
|
||||
{
|
||||
@Autowired
|
||||
private OmsInventoryDeliveryDetailMapper omsInventoryDeliveryDetailMapper;
|
||||
|
||||
/**
|
||||
* 查询产品库存
|
||||
*
|
||||
* @param id 产品库存主键
|
||||
* @return 产品库存
|
||||
*/
|
||||
@Override
|
||||
public OmsInventoryDeliveryDetail selectOmsInventoryDeliveryDetailById(Long id)
|
||||
{
|
||||
return omsInventoryDeliveryDetailMapper.selectOmsInventoryDeliveryDetailById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品库存列表
|
||||
*
|
||||
* @param omsInventoryDeliveryDetail 产品库存
|
||||
* @return 产品库存
|
||||
*/
|
||||
@Override
|
||||
public List<OmsInventoryDeliveryDetail> selectOmsInventoryDeliveryDetailList(OmsInventoryDeliveryDetail omsInventoryDeliveryDetail)
|
||||
{
|
||||
return omsInventoryDeliveryDetailMapper.selectOmsInventoryDeliveryDetailList(omsInventoryDeliveryDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品库存
|
||||
*
|
||||
* @param omsInventoryDeliveryDetail 产品库存
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertOmsInventoryDeliveryDetail(OmsInventoryDeliveryDetail omsInventoryDeliveryDetail)
|
||||
{
|
||||
return omsInventoryDeliveryDetailMapper.insertOmsInventoryDeliveryDetail(omsInventoryDeliveryDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品库存
|
||||
*
|
||||
* @param omsInventoryDeliveryDetail 产品库存
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateOmsInventoryDeliveryDetail(OmsInventoryDeliveryDetail omsInventoryDeliveryDetail)
|
||||
{
|
||||
return omsInventoryDeliveryDetailMapper.updateOmsInventoryDeliveryDetail(omsInventoryDeliveryDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除产品库存
|
||||
*
|
||||
* @param ids 需要删除的产品库存主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOmsInventoryDeliveryDetailByIds(String ids)
|
||||
{
|
||||
return omsInventoryDeliveryDetailMapper.deleteOmsInventoryDeliveryDetailByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品库存信息
|
||||
*
|
||||
* @param id 产品库存主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOmsInventoryDeliveryDetailById(Long id)
|
||||
{
|
||||
return omsInventoryDeliveryDetailMapper.deleteOmsInventoryDeliveryDetailById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveBatch(List<OmsInventoryDeliveryDetail> detailList) {
|
||||
omsInventoryDeliveryDetailMapper.saveBatch(detailList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOmsInventoryDeliveryDetailByDeliveryId(Long id) {
|
||||
omsInventoryDeliveryDetailMapper.deleteOmsInventoryDeliveryDetailByDeliveryId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OmsInventoryDeliveryDetail> selectOmsInventoryDeliveryDetailByDeliveryId(Long id) {
|
||||
return omsInventoryDeliveryDetailMapper.selectOmsInventoryDeliveryDetailByDeliveryId(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -39,6 +39,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</if>
|
||||
<if test="productSn != null and productSn != ''">and t1.product_sn = #{productSn}</if>
|
||||
<if test="productSnList != null and productSnList != ''">and t1.product_sn in
|
||||
<foreach item="item" index="index" collection="productSnList" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="inventoryStatus != null and inventoryStatus != ''">and t1.inventory_status = #{inventoryStatus}
|
||||
</if>
|
||||
<if test="innerCode != null and innerCode != ''">and t1.inner_code = #{innerCode}</if>
|
||||
|
|
@ -46,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="warehouseId != null ">and t1.warehouse_id = #{warehouseId}</if>
|
||||
<if test="innerPrice != null ">and t1.inner_price = #{innerPrice}</if>
|
||||
<if test="outerPrice != null ">and t1.outer_price = #{outerPrice}</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.sip.mapper.OmsInventoryDeliveryDetailMapper">
|
||||
|
||||
<resultMap type="OmsInventoryDeliveryDetail" id="OmsInventoryDeliveryDetailResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="deliveryId" column="delivery_id" />
|
||||
<result property="productSn" column="product_sn" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOmsInventoryDeliveryDetailVo">
|
||||
select id, delivery_id, product_sn from oms_inventory_delivery_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectOmsInventoryDeliveryDetailList" parameterType="OmsInventoryDeliveryDetail" resultMap="OmsInventoryDeliveryDetailResult">
|
||||
<include refid="selectOmsInventoryDeliveryDetailVo"/>
|
||||
<where>
|
||||
<if test="deliveryId != null "> and delivery_id = #{deliveryId}</if>
|
||||
<if test="productSn != null and productSn != ''"> and product_sn = #{productSn}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectOmsInventoryDeliveryDetailById" parameterType="Long" resultMap="OmsInventoryDeliveryDetailResult">
|
||||
<include refid="selectOmsInventoryDeliveryDetailVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectOmsInventoryDeliveryDetailByDeliveryId"
|
||||
resultType="com.ruoyi.sip.domain.OmsInventoryDeliveryDetail">
|
||||
<include refid="selectOmsInventoryDeliveryDetailVo"/>
|
||||
where delivery_id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertOmsInventoryDeliveryDetail" parameterType="OmsInventoryDeliveryDetail" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into oms_inventory_delivery_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deliveryId != null">delivery_id,</if>
|
||||
<if test="productSn != null and productSn != ''">product_sn,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deliveryId != null">#{deliveryId},</if>
|
||||
<if test="productSn != null and productSn != ''">#{productSn},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="saveBatch">
|
||||
insert into oms_inventory_delivery_detail( delivery_id, product_sn)
|
||||
values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(
|
||||
<if test="item.deliveryId != null">#{item.deliveryId},</if>
|
||||
<if test="item.productSn != null and item.productSn != ''">#{item.productSn}</if>
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateOmsInventoryDeliveryDetail" parameterType="OmsInventoryDeliveryDetail">
|
||||
update oms_inventory_delivery_detail
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deliveryId != null">delivery_id = #{deliveryId},</if>
|
||||
<if test="productSn != null and productSn != ''">product_sn = #{productSn},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteOmsInventoryDeliveryDetailById" parameterType="Long">
|
||||
delete from oms_inventory_delivery_detail where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteOmsInventoryDeliveryDetailByIds" parameterType="String">
|
||||
delete from oms_inventory_delivery_detail where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<delete id="deleteOmsInventoryDeliveryDetailByDeliveryId">
|
||||
delete from oms_inventory_delivery_detail where delivery_id =#{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue