库存维护记录
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
package com.ruoyi.job.mydojob.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.job.mydojobfinish.service.IMydoJobFinishService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -28,11 +31,13 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/job/mydoJob")
|
||||
@RequestMapping("/job/inmydoJob")
|
||||
public class InMydoJobController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMydoJobService mydoJobService;
|
||||
@Autowired
|
||||
private IMydoJobFinishService mydoJobFinishService;
|
||||
|
||||
/**
|
||||
* 查询任务表列表
|
||||
@@ -42,7 +47,12 @@ public class InMydoJobController extends BaseController
|
||||
public TableDataInfo list(MydoJob mydoJob)
|
||||
{
|
||||
startPage();
|
||||
List<MydoJob> list = mydoJobService.selectMydoJobList(mydoJob);
|
||||
List<MydoJob> list = null;
|
||||
if(Integer.parseInt(mydoJob.getStatus())<4) {
|
||||
list = mydoJobService.selectMydoJobList(mydoJob);
|
||||
}else{
|
||||
list= mydoJobFinishService.selectMydoJobFinishListByMydoJob(mydoJob);
|
||||
}
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,10 +34,14 @@ public class MydoJob
|
||||
/** 供应商ID */
|
||||
@Excel(name = "供应商ID")
|
||||
private String supplierId;
|
||||
@Excel(name = "供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
/** 客户ID */
|
||||
@Excel(name = "客户ID")
|
||||
private String customerId;
|
||||
@Excel(name = "客户名称")
|
||||
private String customerName;
|
||||
|
||||
/** 部门ID */
|
||||
@Excel(name = "部门ID")
|
||||
@@ -54,6 +58,8 @@ public class MydoJob
|
||||
/** 货位ID */
|
||||
@Excel(name = "货位ID")
|
||||
private String cargoSpaceId;
|
||||
@Excel(name = "货位名称")
|
||||
private String cargoSpaceName;
|
||||
|
||||
/** 目标巷道ID */
|
||||
@Excel(name = "目标巷道ID")
|
||||
@@ -62,6 +68,8 @@ public class MydoJob
|
||||
/** 目标货位ID */
|
||||
@Excel(name = "目标货位ID")
|
||||
private String targetCargoSpaceId;
|
||||
@Excel(name = "目标货位名称")
|
||||
private String targetCargoSpaceName;
|
||||
|
||||
/** 产线ID */
|
||||
@Excel(name = "产线ID")
|
||||
@@ -110,6 +118,8 @@ public class MydoJob
|
||||
/** 仓库ID */
|
||||
@Excel(name = "仓库ID")
|
||||
private String warehouseId;
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
/** 重分标记 */
|
||||
@Excel(name = "重分标记")
|
||||
@@ -373,6 +383,40 @@ public class MydoJob
|
||||
return faultFlag;
|
||||
}
|
||||
|
||||
public String getSupplierName() {
|
||||
return supplierName;
|
||||
}
|
||||
|
||||
public void setSupplierName(String supplierName) {
|
||||
this.supplierName = supplierName;
|
||||
}
|
||||
|
||||
public String getCustomerName() {
|
||||
return customerName;
|
||||
}
|
||||
|
||||
public void setCustomerName(String customerName) {
|
||||
this.customerName = customerName;
|
||||
}
|
||||
|
||||
public String getCargoSpaceName() {
|
||||
return cargoSpaceName;
|
||||
}
|
||||
|
||||
public void setCargoSpaceName(String cargoSpaceName) {
|
||||
this.cargoSpaceName = cargoSpaceName;
|
||||
}
|
||||
|
||||
public String getTargetCargoSpaceName() {
|
||||
return targetCargoSpaceName;
|
||||
}
|
||||
|
||||
public void setTargetCargoSpaceName(String targetCargoSpaceName) {
|
||||
this.targetCargoSpaceName = targetCargoSpaceName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
package com.ruoyi.stock.stock.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.stock.maintain.domain.BasStockMaintainRecord;
|
||||
import com.ruoyi.stock.maintain.service.IBasStockMaintainRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.stock.stock.mapper.BasStockMapper;
|
||||
import com.ruoyi.stock.stock.domain.BasStock;
|
||||
import com.ruoyi.stock.stock.service.IBasStockService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 库存信息Service业务层处理
|
||||
@@ -18,6 +26,8 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
{
|
||||
@Autowired
|
||||
private BasStockMapper basStockMapper;
|
||||
@Autowired
|
||||
private IBasStockMaintainRecordService basStockMaintainRecordService;
|
||||
|
||||
/**
|
||||
* 查询库存信息
|
||||
@@ -52,9 +62,27 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
@Override
|
||||
public int insertBasStock(BasStock basStock)
|
||||
{
|
||||
insertMaintainRecord(null,basStock,"1");
|
||||
return basStockMapper.insertBasStock(basStock);
|
||||
}
|
||||
|
||||
private void insertMaintainRecord(BasStock oldStock,BasStock basStock, String operate) {
|
||||
BasStockMaintainRecord basStockMaintainRecord = new BasStockMaintainRecord();
|
||||
basStockMaintainRecord.setWhGuid(IdUtil.fastSimpleUUID());
|
||||
basStockMaintainRecord.setStockId(basStock.getStockId());
|
||||
basStockMaintainRecord.setCargoSpaceId(basStock.getCargoSpaceId());
|
||||
basStockMaintainRecord.setLotNo(basStock.getLotNo());
|
||||
basStockMaintainRecord.setTrayCode(basStock.getTrayCode());
|
||||
basStockMaintainRecord.setProductGuid(basStock.getProductGuid());
|
||||
basStockMaintainRecord.setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||
basStockMaintainRecord.setCreateTime(new Date());
|
||||
basStockMaintainRecord.setOldQuantity(oldStock!=null?oldStock.getQuantity():"0");
|
||||
basStockMaintainRecord.setQuantity(basStock.getQuantity());
|
||||
basStockMaintainRecord.setWarehouseId(basStock.getWarehouseId());
|
||||
basStockMaintainRecord.setMethod(operate);
|
||||
basStockMaintainRecordService.insertBasStockMaintainRecord(basStockMaintainRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存信息
|
||||
*
|
||||
@@ -64,6 +92,8 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
@Override
|
||||
public int updateBasStock(BasStock basStock)
|
||||
{
|
||||
BasStock oldBasStock = basStockMapper.selectBasStockByStockId(basStock.getStockId());
|
||||
insertMaintainRecord(oldBasStock,basStock,"2");
|
||||
return basStockMapper.updateBasStock(basStock);
|
||||
}
|
||||
|
||||
@@ -74,8 +104,13 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteBasStockByStockIds(String[] stockIds)
|
||||
{
|
||||
for (String stockId : stockIds) {
|
||||
BasStock oldBasStock = basStockMapper.selectBasStockByStockId(stockId);
|
||||
insertMaintainRecord(oldBasStock,oldBasStock,"3");
|
||||
}
|
||||
return basStockMapper.deleteBasStockByStockIds(stockIds);
|
||||
}
|
||||
|
||||
@@ -88,6 +123,8 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
@Override
|
||||
public int deleteBasStockByStockId(String stockId)
|
||||
{
|
||||
BasStock oldBasStock = basStockMapper.selectBasStockByStockId(stockId);
|
||||
insertMaintainRecord(oldBasStock,oldBasStock,"3");
|
||||
return basStockMapper.deleteBasStockByStockId(stockId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user