库存调拨
This commit is contained in:
parent
74729dc667
commit
fe9ffbeb81
|
|
@ -0,0 +1,119 @@
|
|||
package com.bonus.canteen.core.ims.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
//import com.bonus.canteen.core.ims.common.annotation.PreventRepeatSubmit;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.canteen.core.ims.domain.GoodsTransfer;
|
||||
import com.bonus.canteen.core.ims.service.IGoodsTransferService;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 货品调拨信息Controller
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-07-15
|
||||
*/
|
||||
@Api(tags = "货品调拨信息接口")
|
||||
@RestController
|
||||
@RequestMapping("/ims_goods_transfer")
|
||||
public class GoodsTransferController extends BaseController {
|
||||
@Autowired
|
||||
private IGoodsTransferService goodsTransferService;
|
||||
|
||||
/**
|
||||
* 查询货品调拨信息列表
|
||||
*/
|
||||
@ApiOperation(value = "查询货品调拨信息列表")
|
||||
//@RequiresPermissions("ims:transfer:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(GoodsTransfer goodsTransfer) {
|
||||
startPage();
|
||||
List<GoodsTransfer> list = goodsTransferService.selectGoodsTransferList(goodsTransfer);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出货品调拨信息列表
|
||||
*/
|
||||
@ApiOperation(value = "导出货品调拨信息列表")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("ims:transfer:export")
|
||||
@SysLog(title = "货品调拨信息", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出货品调拨信息")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, GoodsTransfer goodsTransfer) {
|
||||
List<GoodsTransfer> list = goodsTransferService.selectGoodsTransferList(goodsTransfer);
|
||||
ExcelUtil<GoodsTransfer> util = new ExcelUtil<GoodsTransfer>(GoodsTransfer.class);
|
||||
util.exportExcel(response, list, "货品调拨信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取货品调拨信息详细信息
|
||||
*/
|
||||
@ApiOperation(value = "获取货品调拨信息详细信息")
|
||||
//@RequiresPermissions("ims:transfer:query")
|
||||
@GetMapping(value = "/{goodsTransferId}")
|
||||
public AjaxResult getInfo(@PathVariable("goodsTransferId") Long goodsTransferId) {
|
||||
return success(goodsTransferService.selectGoodsTransferByGoodsTransferId(goodsTransferId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增货品调拨信息
|
||||
*/
|
||||
@ApiOperation(value = "新增货品调拨信息")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("ims:transfer:add")
|
||||
@SysLog(title = "货品调拨信息", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增货品调拨信息")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody GoodsTransfer goodsTransfer) {
|
||||
try {
|
||||
return toAjax(goodsTransferService.insertGoodsTransfer(goodsTransfer));
|
||||
} catch (Exception e) {
|
||||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改货品调拨信息
|
||||
*/
|
||||
@ApiOperation(value = "修改货品调拨信息")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("ims:transfer:edit")
|
||||
@SysLog(title = "货品调拨信息", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改货品调拨信息")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody GoodsTransfer goodsTransfer) {
|
||||
try {
|
||||
return toAjax(goodsTransferService.updateGoodsTransfer(goodsTransfer));
|
||||
} catch (Exception e) {
|
||||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除货品调拨信息
|
||||
*/
|
||||
@ApiOperation(value = "删除货品调拨信息")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("ims:transfer:remove")
|
||||
@SysLog(title = "货品调拨信息", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除货品调拨信息")
|
||||
@PostMapping("/del/{goodsTransferIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] goodsTransferIds) {
|
||||
return toAjax(goodsTransferService.deleteGoodsTransferByGoodsTransferIds(goodsTransferIds));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.bonus.canteen.core.ims.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 货品调拨信息对象 ims_goods_transfer
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-07-15
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class GoodsTransfer extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 货品调拨id */
|
||||
private Long goodsTransferId;
|
||||
|
||||
/** 调拨单号 */
|
||||
@Excel(name = "调拨单号")
|
||||
@ApiModelProperty(value = "调拨单号")
|
||||
private String goodsTransferCode;
|
||||
|
||||
/** 出库仓库id */
|
||||
@Excel(name = "出库仓库id")
|
||||
@ApiModelProperty(value = "出库仓库id")
|
||||
private Long outWarehouseId;
|
||||
|
||||
/** 入库仓库id */
|
||||
@Excel(name = "入库仓库id")
|
||||
@ApiModelProperty(value = "入库仓库id")
|
||||
private Long intoWarehouseId;
|
||||
|
||||
/** 期望调拨时间 */
|
||||
@ApiModelProperty(value = "期望调拨时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "期望调拨时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date requestArrivalTime;
|
||||
|
||||
/** 参考 DrpGoodsAllocationStatusEnum */
|
||||
@Excel(name = "参考 DrpGoodsAllocationStatusEnum")
|
||||
@ApiModelProperty(value = "参考 DrpGoodsAllocationStatusEnum")
|
||||
private Long transferStatus;
|
||||
|
||||
/** 审批流程Id */
|
||||
@Excel(name = "审批流程Id")
|
||||
@ApiModelProperty(value = "审批流程Id")
|
||||
private Long processInstanceId;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.bonus.canteen.core.ims.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 货品调拨明细对象 ims_goods_transfer_detail
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-07-15
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class GoodsTransferDetail extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 调拨明细id */
|
||||
private Long goodsTransferDetailId;
|
||||
|
||||
/** 货品调拨id */
|
||||
@Excel(name = "货品调拨id")
|
||||
@ApiModelProperty(value = "货品调拨id")
|
||||
private Long goodsTransferId;
|
||||
|
||||
/** 调拨单号 */
|
||||
@Excel(name = "调拨单号")
|
||||
@ApiModelProperty(value = "调拨单号")
|
||||
private String goodsTransferCode;
|
||||
|
||||
/** 原料id */
|
||||
@Excel(name = "原料id")
|
||||
@ApiModelProperty(value = "原料id")
|
||||
private Long materialId;
|
||||
|
||||
/** 计量单位id */
|
||||
@Excel(name = "计量单位id")
|
||||
@ApiModelProperty(value = "计量单位id")
|
||||
private Long unitId;
|
||||
|
||||
/** 规格 */
|
||||
@Excel(name = "规格")
|
||||
@ApiModelProperty(value = "规格")
|
||||
private String size;
|
||||
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
@ApiModelProperty(value = "数量")
|
||||
private BigDecimal orderNum;
|
||||
|
||||
/** 库存id */
|
||||
@Excel(name = "库存id")
|
||||
@ApiModelProperty(value = "库存id")
|
||||
private Long inventoryId;
|
||||
|
||||
/** 可调拨库存数量 */
|
||||
@Excel(name = "可调拨库存数量")
|
||||
@ApiModelProperty(value = "可调拨库存数量")
|
||||
private BigDecimal allowTransferNum;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.bonus.canteen.core.ims.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.bonus.canteen.core.ims.domain.GoodsTransferDetail;
|
||||
|
||||
/**
|
||||
* 货品调拨明细Mapper接口
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-07-15
|
||||
*/
|
||||
public interface GoodsTransferDetailMapper {
|
||||
/**
|
||||
* 查询货品调拨明细
|
||||
*
|
||||
* @param goodsTransferDetailId 货品调拨明细主键
|
||||
* @return 货品调拨明细
|
||||
*/
|
||||
public GoodsTransferDetail selectGoodsTransferDetailByGoodsTransferDetailId(Long goodsTransferDetailId);
|
||||
|
||||
/**
|
||||
* 查询货品调拨明细列表
|
||||
*
|
||||
* @param goodsTransferDetail 货品调拨明细
|
||||
* @return 货品调拨明细集合
|
||||
*/
|
||||
public List<GoodsTransferDetail> selectGoodsTransferDetailList(GoodsTransferDetail goodsTransferDetail);
|
||||
|
||||
/**
|
||||
* 新增货品调拨明细
|
||||
*
|
||||
* @param goodsTransferDetail 货品调拨明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGoodsTransferDetail(GoodsTransferDetail goodsTransferDetail);
|
||||
|
||||
/**
|
||||
* 修改货品调拨明细
|
||||
*
|
||||
* @param goodsTransferDetail 货品调拨明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateGoodsTransferDetail(GoodsTransferDetail goodsTransferDetail);
|
||||
|
||||
/**
|
||||
* 删除货品调拨明细
|
||||
*
|
||||
* @param goodsTransferDetailId 货品调拨明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGoodsTransferDetailByGoodsTransferDetailId(Long goodsTransferDetailId);
|
||||
|
||||
/**
|
||||
* 批量删除货品调拨明细
|
||||
*
|
||||
* @param goodsTransferDetailIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGoodsTransferDetailByGoodsTransferDetailIds(Long[] goodsTransferDetailIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.bonus.canteen.core.ims.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.bonus.canteen.core.ims.domain.GoodsTransfer;
|
||||
|
||||
/**
|
||||
* 货品调拨信息Mapper接口
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-07-15
|
||||
*/
|
||||
public interface GoodsTransferMapper {
|
||||
/**
|
||||
* 查询货品调拨信息
|
||||
*
|
||||
* @param goodsTransferId 货品调拨信息主键
|
||||
* @return 货品调拨信息
|
||||
*/
|
||||
public GoodsTransfer selectGoodsTransferByGoodsTransferId(Long goodsTransferId);
|
||||
|
||||
/**
|
||||
* 查询货品调拨信息列表
|
||||
*
|
||||
* @param goodsTransfer 货品调拨信息
|
||||
* @return 货品调拨信息集合
|
||||
*/
|
||||
public List<GoodsTransfer> selectGoodsTransferList(GoodsTransfer goodsTransfer);
|
||||
|
||||
/**
|
||||
* 新增货品调拨信息
|
||||
*
|
||||
* @param goodsTransfer 货品调拨信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGoodsTransfer(GoodsTransfer goodsTransfer);
|
||||
|
||||
/**
|
||||
* 修改货品调拨信息
|
||||
*
|
||||
* @param goodsTransfer 货品调拨信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateGoodsTransfer(GoodsTransfer goodsTransfer);
|
||||
|
||||
/**
|
||||
* 删除货品调拨信息
|
||||
*
|
||||
* @param goodsTransferId 货品调拨信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGoodsTransferByGoodsTransferId(Long goodsTransferId);
|
||||
|
||||
/**
|
||||
* 批量删除货品调拨信息
|
||||
*
|
||||
* @param goodsTransferIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGoodsTransferByGoodsTransferIds(Long[] goodsTransferIds);
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.bonus.canteen.core.ims.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.bonus.canteen.core.ims.domain.GoodsTransferDetail;
|
||||
|
||||
/**
|
||||
* 货品调拨明细Service接口
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-07-15
|
||||
*/
|
||||
public interface IGoodsTransferDetailService {
|
||||
/**
|
||||
* 查询货品调拨明细
|
||||
*
|
||||
* @param goodsTransferDetailId 货品调拨明细主键
|
||||
* @return 货品调拨明细
|
||||
*/
|
||||
public GoodsTransferDetail selectGoodsTransferDetailByGoodsTransferDetailId(Long goodsTransferDetailId);
|
||||
|
||||
/**
|
||||
* 查询货品调拨明细列表
|
||||
*
|
||||
* @param goodsTransferDetail 货品调拨明细
|
||||
* @return 货品调拨明细集合
|
||||
*/
|
||||
public List<GoodsTransferDetail> selectGoodsTransferDetailList(GoodsTransferDetail goodsTransferDetail);
|
||||
|
||||
/**
|
||||
* 新增货品调拨明细
|
||||
*
|
||||
* @param goodsTransferDetail 货品调拨明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGoodsTransferDetail(GoodsTransferDetail goodsTransferDetail);
|
||||
|
||||
/**
|
||||
* 修改货品调拨明细
|
||||
*
|
||||
* @param goodsTransferDetail 货品调拨明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateGoodsTransferDetail(GoodsTransferDetail goodsTransferDetail);
|
||||
|
||||
/**
|
||||
* 批量删除货品调拨明细
|
||||
*
|
||||
* @param goodsTransferDetailIds 需要删除的货品调拨明细主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGoodsTransferDetailByGoodsTransferDetailIds(Long[] goodsTransferDetailIds);
|
||||
|
||||
/**
|
||||
* 删除货品调拨明细信息
|
||||
*
|
||||
* @param goodsTransferDetailId 货品调拨明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGoodsTransferDetailByGoodsTransferDetailId(Long goodsTransferDetailId);
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.bonus.canteen.core.ims.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.bonus.canteen.core.ims.domain.GoodsTransfer;
|
||||
|
||||
/**
|
||||
* 货品调拨信息Service接口
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-07-15
|
||||
*/
|
||||
public interface IGoodsTransferService {
|
||||
/**
|
||||
* 查询货品调拨信息
|
||||
*
|
||||
* @param goodsTransferId 货品调拨信息主键
|
||||
* @return 货品调拨信息
|
||||
*/
|
||||
public GoodsTransfer selectGoodsTransferByGoodsTransferId(Long goodsTransferId);
|
||||
|
||||
/**
|
||||
* 查询货品调拨信息列表
|
||||
*
|
||||
* @param goodsTransfer 货品调拨信息
|
||||
* @return 货品调拨信息集合
|
||||
*/
|
||||
public List<GoodsTransfer> selectGoodsTransferList(GoodsTransfer goodsTransfer);
|
||||
|
||||
/**
|
||||
* 新增货品调拨信息
|
||||
*
|
||||
* @param goodsTransfer 货品调拨信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGoodsTransfer(GoodsTransfer goodsTransfer);
|
||||
|
||||
/**
|
||||
* 修改货品调拨信息
|
||||
*
|
||||
* @param goodsTransfer 货品调拨信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateGoodsTransfer(GoodsTransfer goodsTransfer);
|
||||
|
||||
/**
|
||||
* 批量删除货品调拨信息
|
||||
*
|
||||
* @param goodsTransferIds 需要删除的货品调拨信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGoodsTransferByGoodsTransferIds(Long[] goodsTransferIds);
|
||||
|
||||
/**
|
||||
* 删除货品调拨信息信息
|
||||
*
|
||||
* @param goodsTransferId 货品调拨信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGoodsTransferByGoodsTransferId(Long goodsTransferId);
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
package com.bonus.canteen.core.ims.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.canteen.core.ims.mapper.GoodsTransferDetailMapper;
|
||||
import com.bonus.canteen.core.ims.domain.GoodsTransferDetail;
|
||||
import com.bonus.canteen.core.ims.service.IGoodsTransferDetailService;
|
||||
|
||||
/**
|
||||
* 货品调拨明细Service业务层处理
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-07-15
|
||||
*/
|
||||
@Service
|
||||
public class GoodsTransferDetailServiceImpl implements IGoodsTransferDetailService {
|
||||
@Autowired
|
||||
private GoodsTransferDetailMapper goodsTransferDetailMapper;
|
||||
|
||||
/**
|
||||
* 查询货品调拨明细
|
||||
*
|
||||
* @param goodsTransferDetailId 货品调拨明细主键
|
||||
* @return 货品调拨明细
|
||||
*/
|
||||
@Override
|
||||
public GoodsTransferDetail selectGoodsTransferDetailByGoodsTransferDetailId(Long goodsTransferDetailId) {
|
||||
return goodsTransferDetailMapper.selectGoodsTransferDetailByGoodsTransferDetailId(goodsTransferDetailId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询货品调拨明细列表
|
||||
*
|
||||
* @param goodsTransferDetail 货品调拨明细
|
||||
* @return 货品调拨明细
|
||||
*/
|
||||
@Override
|
||||
public List<GoodsTransferDetail> selectGoodsTransferDetailList(GoodsTransferDetail goodsTransferDetail) {
|
||||
return goodsTransferDetailMapper.selectGoodsTransferDetailList(goodsTransferDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增货品调拨明细
|
||||
*
|
||||
* @param goodsTransferDetail 货品调拨明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertGoodsTransferDetail(GoodsTransferDetail goodsTransferDetail) {
|
||||
goodsTransferDetail.setCreateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
return goodsTransferDetailMapper.insertGoodsTransferDetail(goodsTransferDetail);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改货品调拨明细
|
||||
*
|
||||
* @param goodsTransferDetail 货品调拨明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateGoodsTransferDetail(GoodsTransferDetail goodsTransferDetail) {
|
||||
goodsTransferDetail.setUpdateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
return goodsTransferDetailMapper.updateGoodsTransferDetail(goodsTransferDetail);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除货品调拨明细
|
||||
*
|
||||
* @param goodsTransferDetailIds 需要删除的货品调拨明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGoodsTransferDetailByGoodsTransferDetailIds(Long[] goodsTransferDetailIds) {
|
||||
return goodsTransferDetailMapper.deleteGoodsTransferDetailByGoodsTransferDetailIds(goodsTransferDetailIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除货品调拨明细信息
|
||||
*
|
||||
* @param goodsTransferDetailId 货品调拨明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGoodsTransferDetailByGoodsTransferDetailId(Long goodsTransferDetailId) {
|
||||
return goodsTransferDetailMapper.deleteGoodsTransferDetailByGoodsTransferDetailId(goodsTransferDetailId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
package com.bonus.canteen.core.ims.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.canteen.core.ims.mapper.GoodsTransferMapper;
|
||||
import com.bonus.canteen.core.ims.domain.GoodsTransfer;
|
||||
import com.bonus.canteen.core.ims.service.IGoodsTransferService;
|
||||
|
||||
/**
|
||||
* 货品调拨信息Service业务层处理
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2025-07-15
|
||||
*/
|
||||
@Service
|
||||
public class GoodsTransferServiceImpl implements IGoodsTransferService {
|
||||
@Autowired
|
||||
private GoodsTransferMapper goodsTransferMapper;
|
||||
|
||||
/**
|
||||
* 查询货品调拨信息
|
||||
*
|
||||
* @param goodsTransferId 货品调拨信息主键
|
||||
* @return 货品调拨信息
|
||||
*/
|
||||
@Override
|
||||
public GoodsTransfer selectGoodsTransferByGoodsTransferId(Long goodsTransferId) {
|
||||
return goodsTransferMapper.selectGoodsTransferByGoodsTransferId(goodsTransferId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询货品调拨信息列表
|
||||
*
|
||||
* @param goodsTransfer 货品调拨信息
|
||||
* @return 货品调拨信息
|
||||
*/
|
||||
@Override
|
||||
public List<GoodsTransfer> selectGoodsTransferList(GoodsTransfer goodsTransfer) {
|
||||
return goodsTransferMapper.selectGoodsTransferList(goodsTransfer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增货品调拨信息
|
||||
*
|
||||
* @param goodsTransfer 货品调拨信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertGoodsTransfer(GoodsTransfer goodsTransfer) {
|
||||
goodsTransfer.setCreateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
return goodsTransferMapper.insertGoodsTransfer(goodsTransfer);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改货品调拨信息
|
||||
*
|
||||
* @param goodsTransfer 货品调拨信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateGoodsTransfer(GoodsTransfer goodsTransfer) {
|
||||
goodsTransfer.setUpdateTime(DateUtils.getNowDate());
|
||||
try {
|
||||
return goodsTransferMapper.updateGoodsTransfer(goodsTransfer);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除货品调拨信息
|
||||
*
|
||||
* @param goodsTransferIds 需要删除的货品调拨信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGoodsTransferByGoodsTransferIds(Long[] goodsTransferIds) {
|
||||
return goodsTransferMapper.deleteGoodsTransferByGoodsTransferIds(goodsTransferIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除货品调拨信息信息
|
||||
*
|
||||
* @param goodsTransferId 货品调拨信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGoodsTransferByGoodsTransferId(Long goodsTransferId) {
|
||||
return goodsTransferMapper.deleteGoodsTransferByGoodsTransferId(goodsTransferId);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
<?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.bonus.canteen.core.ims.mapper.GoodsTransferDetailMapper">
|
||||
<resultMap type="com.bonus.canteen.core.ims.domain.GoodsTransferDetail" id="GoodsTransferDetailResult">
|
||||
<result property="goodsTransferDetailId" column="goods_transfer_detail_id" />
|
||||
<result property="goodsTransferId" column="goods_transfer_id" />
|
||||
<result property="goodsTransferCode" column="goods_transfer_code" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="unitId" column="unit_id" />
|
||||
<result property="size" column="size" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="inventoryId" column="inventory_id" />
|
||||
<result property="allowTransferNum" column="allow_transfer_num" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGoodsTransferDetailVo">
|
||||
select goods_transfer_detail_id, goods_transfer_id, goods_transfer_code, material_id, unit_id, size, order_num, inventory_id, allow_transfer_num, create_by, create_time, update_by, update_time from ims_goods_transfer_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectGoodsTransferDetailList" parameterType="com.bonus.canteen.core.ims.domain.GoodsTransferDetail" resultMap="GoodsTransferDetailResult">
|
||||
<include refid="selectGoodsTransferDetailVo"/>
|
||||
<where>
|
||||
<if test="goodsTransferId != null "> and goods_transfer_id = #{goodsTransferId}</if>
|
||||
<if test="goodsTransferCode != null and goodsTransferCode != ''"> and goods_transfer_code = #{goodsTransferCode}</if>
|
||||
<if test="materialId != null "> and material_id = #{materialId}</if>
|
||||
<if test="unitId != null "> and unit_id = #{unitId}</if>
|
||||
<if test="size != null and size != ''"> and size = #{size}</if>
|
||||
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
||||
<if test="inventoryId != null "> and inventory_id = #{inventoryId}</if>
|
||||
<if test="allowTransferNum != null "> and allow_transfer_num = #{allowTransferNum}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectGoodsTransferDetailByGoodsTransferDetailId" parameterType="Long" resultMap="GoodsTransferDetailResult">
|
||||
<include refid="selectGoodsTransferDetailVo"/>
|
||||
where goods_transfer_detail_id = #{goodsTransferDetailId}
|
||||
</select>
|
||||
|
||||
<insert id="insertGoodsTransferDetail" parameterType="com.bonus.canteen.core.ims.domain.GoodsTransferDetail">
|
||||
insert into ims_goods_transfer_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="goodsTransferDetailId != null">goods_transfer_detail_id,</if>
|
||||
<if test="goodsTransferId != null">goods_transfer_id,</if>
|
||||
<if test="goodsTransferCode != null">goods_transfer_code,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="unitId != null">unit_id,</if>
|
||||
<if test="size != null">size,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="inventoryId != null">inventory_id,</if>
|
||||
<if test="allowTransferNum != null">allow_transfer_num,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="goodsTransferDetailId != null">#{goodsTransferDetailId},</if>
|
||||
<if test="goodsTransferId != null">#{goodsTransferId},</if>
|
||||
<if test="goodsTransferCode != null">#{goodsTransferCode},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="unitId != null">#{unitId},</if>
|
||||
<if test="size != null">#{size},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="inventoryId != null">#{inventoryId},</if>
|
||||
<if test="allowTransferNum != null">#{allowTransferNum},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateGoodsTransferDetail" parameterType="com.bonus.canteen.core.ims.domain.GoodsTransferDetail">
|
||||
update ims_goods_transfer_detail
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="goodsTransferId != null">goods_transfer_id = #{goodsTransferId},</if>
|
||||
<if test="goodsTransferCode != null">goods_transfer_code = #{goodsTransferCode},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="unitId != null">unit_id = #{unitId},</if>
|
||||
<if test="size != null">size = #{size},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="inventoryId != null">inventory_id = #{inventoryId},</if>
|
||||
<if test="allowTransferNum != null">allow_transfer_num = #{allowTransferNum},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where goods_transfer_detail_id = #{goodsTransferDetailId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteGoodsTransferDetailByGoodsTransferDetailId" parameterType="Long">
|
||||
delete from ims_goods_transfer_detail where goods_transfer_detail_id = #{goodsTransferDetailId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteGoodsTransferDetailByGoodsTransferDetailIds" parameterType="String">
|
||||
delete from ims_goods_transfer_detail where goods_transfer_detail_id in
|
||||
<foreach item="goodsTransferDetailId" collection="array" open="(" separator="," close=")">
|
||||
#{goodsTransferDetailId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
<?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.bonus.canteen.core.ims.mapper.GoodsTransferMapper">
|
||||
<resultMap type="com.bonus.canteen.core.ims.domain.GoodsTransfer" id="GoodsTransferResult">
|
||||
<result property="goodsTransferId" column="goods_transfer_id" />
|
||||
<result property="goodsTransferCode" column="goods_transfer_code" />
|
||||
<result property="outWarehouseId" column="out_warehouse_id" />
|
||||
<result property="intoWarehouseId" column="into_warehouse_id" />
|
||||
<result property="requestArrivalTime" column="request_arrival_time" />
|
||||
<result property="transferStatus" column="transfer_status" />
|
||||
<result property="processInstanceId" column="process_instance_id" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGoodsTransferVo">
|
||||
select goods_transfer_id, goods_transfer_code, out_warehouse_id, into_warehouse_id, request_arrival_time, transfer_status, process_instance_id, remark, create_by, create_time, update_by, update_time from ims_goods_transfer
|
||||
</sql>
|
||||
|
||||
<select id="selectGoodsTransferList" parameterType="com.bonus.canteen.core.ims.domain.GoodsTransfer" resultMap="GoodsTransferResult">
|
||||
<include refid="selectGoodsTransferVo"/>
|
||||
<where>
|
||||
<if test="goodsTransferCode != null and goodsTransferCode != ''"> and goods_transfer_code = #{goodsTransferCode}</if>
|
||||
<if test="outWarehouseId != null "> and out_warehouse_id = #{outWarehouseId}</if>
|
||||
<if test="intoWarehouseId != null "> and into_warehouse_id = #{intoWarehouseId}</if>
|
||||
<if test="requestArrivalTime != null "> and request_arrival_time = #{requestArrivalTime}</if>
|
||||
<if test="transferStatus != null "> and transfer_status = #{transferStatus}</if>
|
||||
<if test="processInstanceId != null "> and process_instance_id = #{processInstanceId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectGoodsTransferByGoodsTransferId" parameterType="Long" resultMap="GoodsTransferResult">
|
||||
<include refid="selectGoodsTransferVo"/>
|
||||
where goods_transfer_id = #{goodsTransferId}
|
||||
</select>
|
||||
|
||||
<insert id="insertGoodsTransfer" parameterType="com.bonus.canteen.core.ims.domain.GoodsTransfer" useGeneratedKeys="true" keyProperty="goodsTransferId">
|
||||
insert into ims_goods_transfer
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="goodsTransferCode != null">goods_transfer_code,</if>
|
||||
<if test="outWarehouseId != null">out_warehouse_id,</if>
|
||||
<if test="intoWarehouseId != null">into_warehouse_id,</if>
|
||||
<if test="requestArrivalTime != null">request_arrival_time,</if>
|
||||
<if test="transferStatus != null">transfer_status,</if>
|
||||
<if test="processInstanceId != null">process_instance_id,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="goodsTransferCode != null">#{goodsTransferCode},</if>
|
||||
<if test="outWarehouseId != null">#{outWarehouseId},</if>
|
||||
<if test="intoWarehouseId != null">#{intoWarehouseId},</if>
|
||||
<if test="requestArrivalTime != null">#{requestArrivalTime},</if>
|
||||
<if test="transferStatus != null">#{transferStatus},</if>
|
||||
<if test="processInstanceId != null">#{processInstanceId},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateGoodsTransfer" parameterType="com.bonus.canteen.core.ims.domain.GoodsTransfer">
|
||||
update ims_goods_transfer
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="goodsTransferCode != null">goods_transfer_code = #{goodsTransferCode},</if>
|
||||
<if test="outWarehouseId != null">out_warehouse_id = #{outWarehouseId},</if>
|
||||
<if test="intoWarehouseId != null">into_warehouse_id = #{intoWarehouseId},</if>
|
||||
<if test="requestArrivalTime != null">request_arrival_time = #{requestArrivalTime},</if>
|
||||
<if test="transferStatus != null">transfer_status = #{transferStatus},</if>
|
||||
<if test="processInstanceId != null">process_instance_id = #{processInstanceId},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where goods_transfer_id = #{goodsTransferId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteGoodsTransferByGoodsTransferId" parameterType="Long">
|
||||
delete from ims_goods_transfer where goods_transfer_id = #{goodsTransferId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteGoodsTransferByGoodsTransferIds" parameterType="String">
|
||||
delete from ims_goods_transfer where goods_transfer_id in
|
||||
<foreach item="goodsTransferId" collection="array" open="(" separator="," close=")">
|
||||
#{goodsTransferId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue