盘点差异管理的审核状态筛选与审核按钮功能
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.check.DifferenceRecordFinish.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.check.DifferenceRecordFinish.domain.CheckDifferenceRecordFinish;
|
||||
import com.ruoyi.check.DifferenceRecordFinish.service.ICheckDifferenceRecordFinishService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 盘点差异历史Controller
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/check/DifferenceRecordFinish")
|
||||
public class CheckDifferenceRecordFinishController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICheckDifferenceRecordFinishService checkDifferenceRecordFinishService;
|
||||
|
||||
/**
|
||||
* 查询盘点差异历史列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('check:DifferenceRecordFinish:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CheckDifferenceRecordFinish checkDifferenceRecordFinish)
|
||||
{
|
||||
startPage();
|
||||
List<CheckDifferenceRecordFinish> list = checkDifferenceRecordFinishService.selectCheckDifferenceRecordFinishList(checkDifferenceRecordFinish);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出盘点差异历史列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('check:DifferenceRecordFinish:export')")
|
||||
@Log(title = "盘点差异历史", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CheckDifferenceRecordFinish checkDifferenceRecordFinish)
|
||||
{
|
||||
List<CheckDifferenceRecordFinish> list = checkDifferenceRecordFinishService.selectCheckDifferenceRecordFinishList(checkDifferenceRecordFinish);
|
||||
ExcelUtil<CheckDifferenceRecordFinish> util = new ExcelUtil<CheckDifferenceRecordFinish>(CheckDifferenceRecordFinish.class);
|
||||
util.exportExcel(response, list, "盘点差异历史数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取盘点差异历史详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('check:DifferenceRecordFinish:query')")
|
||||
@GetMapping(value = "/{checkGuid}")
|
||||
public AjaxResult getInfo(@PathVariable("checkGuid") String checkGuid)
|
||||
{
|
||||
return success(checkDifferenceRecordFinishService.selectCheckDifferenceRecordFinishByCheckGuid(checkGuid));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增盘点差异历史
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('check:DifferenceRecordFinish:add')")
|
||||
@Log(title = "盘点差异历史", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CheckDifferenceRecordFinish checkDifferenceRecordFinish)
|
||||
{
|
||||
return toAjax(checkDifferenceRecordFinishService.insertCheckDifferenceRecordFinish(checkDifferenceRecordFinish));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改盘点差异历史
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('check:DifferenceRecordFinish:edit')")
|
||||
@Log(title = "盘点差异历史", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CheckDifferenceRecordFinish checkDifferenceRecordFinish)
|
||||
{
|
||||
return toAjax(checkDifferenceRecordFinishService.updateCheckDifferenceRecordFinish(checkDifferenceRecordFinish));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除盘点差异历史
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('check:DifferenceRecordFinish:remove')")
|
||||
@Log(title = "盘点差异历史", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{checkGuids}")
|
||||
public AjaxResult remove(@PathVariable String[] checkGuids)
|
||||
{
|
||||
return toAjax(checkDifferenceRecordFinishService.deleteCheckDifferenceRecordFinishByCheckGuids(checkGuids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
package com.ruoyi.check.DifferenceRecordFinish.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;
|
||||
|
||||
/**
|
||||
* 盘点差异历史对象 check_difference_record_finish
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
public class CheckDifferenceRecordFinish extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 盘点id */
|
||||
private String checkGuid;
|
||||
|
||||
/** 库存id */
|
||||
@Excel(name = "库存id")
|
||||
private String stockId;
|
||||
|
||||
/** 托盘 */
|
||||
@Excel(name = "托盘")
|
||||
private String trayCode;
|
||||
|
||||
/** 货位id */
|
||||
@Excel(name = "货位id")
|
||||
private String cargoSpaceId;
|
||||
|
||||
/** 物料id */
|
||||
@Excel(name = "物料id")
|
||||
private String productId;
|
||||
|
||||
/** 批次号 */
|
||||
@Excel(name = "批次号")
|
||||
private String lotNo;
|
||||
|
||||
/** 供应商 */
|
||||
@Excel(name = "供应商")
|
||||
private String supplier;
|
||||
|
||||
/** 客户 */
|
||||
@Excel(name = "客户")
|
||||
private String customer;
|
||||
|
||||
/** 原值 */
|
||||
@Excel(name = "原值")
|
||||
private String oldQuantity;
|
||||
|
||||
/** 新值 */
|
||||
@Excel(name = "新值")
|
||||
private String newQuantity;
|
||||
|
||||
/** 操作方式 */
|
||||
@Excel(name = "操作方式")
|
||||
private Long recordType;
|
||||
|
||||
/** 物料guid */
|
||||
@Excel(name = "物料guid")
|
||||
private String productGuid;
|
||||
|
||||
/** 盘点单据id */
|
||||
@Excel(name = "盘点单据id")
|
||||
private String checkStockDetailId;
|
||||
|
||||
/** 审核状态 */
|
||||
@Excel(name = "审核状态")
|
||||
private String status;
|
||||
|
||||
public void setCheckGuid(String checkGuid)
|
||||
{
|
||||
this.checkGuid = checkGuid;
|
||||
}
|
||||
|
||||
public String getCheckGuid()
|
||||
{
|
||||
return checkGuid;
|
||||
}
|
||||
|
||||
public void setStockId(String stockId)
|
||||
{
|
||||
this.stockId = stockId;
|
||||
}
|
||||
|
||||
public String getStockId()
|
||||
{
|
||||
return stockId;
|
||||
}
|
||||
|
||||
public void setTrayCode(String trayCode)
|
||||
{
|
||||
this.trayCode = trayCode;
|
||||
}
|
||||
|
||||
public String getTrayCode()
|
||||
{
|
||||
return trayCode;
|
||||
}
|
||||
|
||||
public void setCargoSpaceId(String cargoSpaceId)
|
||||
{
|
||||
this.cargoSpaceId = cargoSpaceId;
|
||||
}
|
||||
|
||||
public String getCargoSpaceId()
|
||||
{
|
||||
return cargoSpaceId;
|
||||
}
|
||||
|
||||
public void setProductId(String productId)
|
||||
{
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public String getProductId()
|
||||
{
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setLotNo(String lotNo)
|
||||
{
|
||||
this.lotNo = lotNo;
|
||||
}
|
||||
|
||||
public String getLotNo()
|
||||
{
|
||||
return lotNo;
|
||||
}
|
||||
|
||||
public void setSupplier(String supplier)
|
||||
{
|
||||
this.supplier = supplier;
|
||||
}
|
||||
|
||||
public String getSupplier()
|
||||
{
|
||||
return supplier;
|
||||
}
|
||||
|
||||
public void setCustomer(String customer)
|
||||
{
|
||||
this.customer = customer;
|
||||
}
|
||||
|
||||
public String getCustomer()
|
||||
{
|
||||
return customer;
|
||||
}
|
||||
|
||||
public void setOldQuantity(String oldQuantity)
|
||||
{
|
||||
this.oldQuantity = oldQuantity;
|
||||
}
|
||||
|
||||
public String getOldQuantity()
|
||||
{
|
||||
return oldQuantity;
|
||||
}
|
||||
|
||||
public void setNewQuantity(String newQuantity)
|
||||
{
|
||||
this.newQuantity = newQuantity;
|
||||
}
|
||||
|
||||
public String getNewQuantity()
|
||||
{
|
||||
return newQuantity;
|
||||
}
|
||||
|
||||
public void setRecordType(Long recordType)
|
||||
{
|
||||
this.recordType = recordType;
|
||||
}
|
||||
|
||||
public Long getRecordType()
|
||||
{
|
||||
return recordType;
|
||||
}
|
||||
|
||||
public void setProductGuid(String productGuid)
|
||||
{
|
||||
this.productGuid = productGuid;
|
||||
}
|
||||
|
||||
public String getProductGuid()
|
||||
{
|
||||
return productGuid;
|
||||
}
|
||||
|
||||
public void setCheckStockDetailId(String checkStockDetailId)
|
||||
{
|
||||
this.checkStockDetailId = checkStockDetailId;
|
||||
}
|
||||
|
||||
public String getCheckStockDetailId()
|
||||
{
|
||||
return checkStockDetailId;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("checkGuid", getCheckGuid())
|
||||
.append("stockId", getStockId())
|
||||
.append("trayCode", getTrayCode())
|
||||
.append("cargoSpaceId", getCargoSpaceId())
|
||||
.append("productId", getProductId())
|
||||
.append("lotNo", getLotNo())
|
||||
.append("supplier", getSupplier())
|
||||
.append("customer", getCustomer())
|
||||
.append("oldQuantity", getOldQuantity())
|
||||
.append("newQuantity", getNewQuantity())
|
||||
.append("recordType", getRecordType())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("productGuid", getProductGuid())
|
||||
.append("checkStockDetailId", getCheckStockDetailId())
|
||||
.append("status", getStatus())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.check.DifferenceRecordFinish.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.check.DifferenceRecordFinish.domain.CheckDifferenceRecordFinish;
|
||||
|
||||
/**
|
||||
* 盘点差异历史Mapper接口
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
public interface CheckDifferenceRecordFinishMapper
|
||||
{
|
||||
/**
|
||||
* 查询盘点差异历史
|
||||
*
|
||||
* @param checkGuid 盘点差异历史主键
|
||||
* @return 盘点差异历史
|
||||
*/
|
||||
public CheckDifferenceRecordFinish selectCheckDifferenceRecordFinishByCheckGuid(String checkGuid);
|
||||
|
||||
/**
|
||||
* 查询盘点差异历史列表
|
||||
*
|
||||
* @param checkDifferenceRecordFinish 盘点差异历史
|
||||
* @return 盘点差异历史集合
|
||||
*/
|
||||
public List<CheckDifferenceRecordFinish> selectCheckDifferenceRecordFinishList(CheckDifferenceRecordFinish checkDifferenceRecordFinish);
|
||||
|
||||
/**
|
||||
* 新增盘点差异历史
|
||||
*
|
||||
* @param checkDifferenceRecordFinish 盘点差异历史
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCheckDifferenceRecordFinish(CheckDifferenceRecordFinish checkDifferenceRecordFinish);
|
||||
|
||||
/**
|
||||
* 修改盘点差异历史
|
||||
*
|
||||
* @param checkDifferenceRecordFinish 盘点差异历史
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCheckDifferenceRecordFinish(CheckDifferenceRecordFinish checkDifferenceRecordFinish);
|
||||
|
||||
/**
|
||||
* 删除盘点差异历史
|
||||
*
|
||||
* @param checkGuid 盘点差异历史主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCheckDifferenceRecordFinishByCheckGuid(String checkGuid);
|
||||
|
||||
/**
|
||||
* 批量删除盘点差异历史
|
||||
*
|
||||
* @param checkGuids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCheckDifferenceRecordFinishByCheckGuids(String[] checkGuids);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.check.DifferenceRecordFinish.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.check.DifferenceRecordFinish.domain.CheckDifferenceRecordFinish;
|
||||
|
||||
/**
|
||||
* 盘点差异历史Service接口
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
public interface ICheckDifferenceRecordFinishService
|
||||
{
|
||||
/**
|
||||
* 查询盘点差异历史
|
||||
*
|
||||
* @param checkGuid 盘点差异历史主键
|
||||
* @return 盘点差异历史
|
||||
*/
|
||||
public CheckDifferenceRecordFinish selectCheckDifferenceRecordFinishByCheckGuid(String checkGuid);
|
||||
|
||||
/**
|
||||
* 查询盘点差异历史列表
|
||||
*
|
||||
* @param checkDifferenceRecordFinish 盘点差异历史
|
||||
* @return 盘点差异历史集合
|
||||
*/
|
||||
public List<CheckDifferenceRecordFinish> selectCheckDifferenceRecordFinishList(CheckDifferenceRecordFinish checkDifferenceRecordFinish);
|
||||
|
||||
/**
|
||||
* 新增盘点差异历史
|
||||
*
|
||||
* @param checkDifferenceRecordFinish 盘点差异历史
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCheckDifferenceRecordFinish(CheckDifferenceRecordFinish checkDifferenceRecordFinish);
|
||||
|
||||
/**
|
||||
* 修改盘点差异历史
|
||||
*
|
||||
* @param checkDifferenceRecordFinish 盘点差异历史
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCheckDifferenceRecordFinish(CheckDifferenceRecordFinish checkDifferenceRecordFinish);
|
||||
|
||||
/**
|
||||
* 批量删除盘点差异历史
|
||||
*
|
||||
* @param checkGuids 需要删除的盘点差异历史主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCheckDifferenceRecordFinishByCheckGuids(String[] checkGuids);
|
||||
|
||||
/**
|
||||
* 删除盘点差异历史信息
|
||||
*
|
||||
* @param checkGuid 盘点差异历史主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCheckDifferenceRecordFinishByCheckGuid(String checkGuid);
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.ruoyi.check.DifferenceRecordFinish.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.check.DifferenceRecordFinish.mapper.CheckDifferenceRecordFinishMapper;
|
||||
import com.ruoyi.check.DifferenceRecordFinish.domain.CheckDifferenceRecordFinish;
|
||||
import com.ruoyi.check.DifferenceRecordFinish.service.ICheckDifferenceRecordFinishService;
|
||||
|
||||
/**
|
||||
* 盘点差异历史Service业务层处理
|
||||
*
|
||||
* @author gw
|
||||
* @date 2025-06-25
|
||||
*/
|
||||
@Service
|
||||
public class CheckDifferenceRecordFinishServiceImpl implements ICheckDifferenceRecordFinishService
|
||||
{
|
||||
@Autowired
|
||||
private CheckDifferenceRecordFinishMapper checkDifferenceRecordFinishMapper;
|
||||
|
||||
/**
|
||||
* 查询盘点差异历史
|
||||
*
|
||||
* @param checkGuid 盘点差异历史主键
|
||||
* @return 盘点差异历史
|
||||
*/
|
||||
@Override
|
||||
public CheckDifferenceRecordFinish selectCheckDifferenceRecordFinishByCheckGuid(String checkGuid)
|
||||
{
|
||||
return checkDifferenceRecordFinishMapper.selectCheckDifferenceRecordFinishByCheckGuid(checkGuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询盘点差异历史列表
|
||||
*
|
||||
* @param checkDifferenceRecordFinish 盘点差异历史
|
||||
* @return 盘点差异历史
|
||||
*/
|
||||
@Override
|
||||
public List<CheckDifferenceRecordFinish> selectCheckDifferenceRecordFinishList(CheckDifferenceRecordFinish checkDifferenceRecordFinish)
|
||||
{
|
||||
return checkDifferenceRecordFinishMapper.selectCheckDifferenceRecordFinishList(checkDifferenceRecordFinish);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增盘点差异历史
|
||||
*
|
||||
* @param checkDifferenceRecordFinish 盘点差异历史
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCheckDifferenceRecordFinish(CheckDifferenceRecordFinish checkDifferenceRecordFinish)
|
||||
{
|
||||
checkDifferenceRecordFinish.setCreateTime(DateUtils.getNowDate());
|
||||
return checkDifferenceRecordFinishMapper.insertCheckDifferenceRecordFinish(checkDifferenceRecordFinish);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改盘点差异历史
|
||||
*
|
||||
* @param checkDifferenceRecordFinish 盘点差异历史
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCheckDifferenceRecordFinish(CheckDifferenceRecordFinish checkDifferenceRecordFinish)
|
||||
{
|
||||
return checkDifferenceRecordFinishMapper.updateCheckDifferenceRecordFinish(checkDifferenceRecordFinish);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除盘点差异历史
|
||||
*
|
||||
* @param checkGuids 需要删除的盘点差异历史主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCheckDifferenceRecordFinishByCheckGuids(String[] checkGuids)
|
||||
{
|
||||
return checkDifferenceRecordFinishMapper.deleteCheckDifferenceRecordFinishByCheckGuids(checkGuids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除盘点差异历史信息
|
||||
*
|
||||
* @param checkGuid 盘点差异历史主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCheckDifferenceRecordFinishByCheckGuid(String checkGuid)
|
||||
{
|
||||
return checkDifferenceRecordFinishMapper.deleteCheckDifferenceRecordFinishByCheckGuid(checkGuid);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,14 @@
|
||||
package com.ruoyi.check.difference.controller;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.bas.basJobId.service.IBasJobIdService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
@@ -18,6 +23,11 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.check.difference.domain.CheckDifferenceRecord;
|
||||
import com.ruoyi.check.difference.service.ICheckDifferenceRecordService;
|
||||
import com.ruoyi.check.DifferenceRecordFinish.domain.CheckDifferenceRecordFinish;
|
||||
import com.ruoyi.check.DifferenceRecordFinish.service.ICheckDifferenceRecordFinishService;
|
||||
import com.ruoyi.stock.stock.domain.BasStock;
|
||||
import com.ruoyi.common.domain.ExtraField;
|
||||
import com.ruoyi.stock.stock.service.IBasStockService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
@@ -29,8 +39,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/check/difference")
|
||||
public class CheckDifferenceRecordController extends BaseController
|
||||
{
|
||||
public class CheckDifferenceRecordController extends BaseController {
|
||||
@Autowired
|
||||
private ICheckDifferenceRecordService checkDifferenceRecordService;
|
||||
|
||||
@@ -39,8 +48,7 @@ public class CheckDifferenceRecordController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('check:difference:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CheckDifferenceRecord checkDifferenceRecord)
|
||||
{
|
||||
public TableDataInfo list(CheckDifferenceRecord checkDifferenceRecord) {
|
||||
startPage();
|
||||
List<CheckDifferenceRecord> list = checkDifferenceRecordService.selectCheckDifferenceRecordList(checkDifferenceRecord);
|
||||
return getDataTable(list);
|
||||
@@ -52,8 +60,7 @@ public class CheckDifferenceRecordController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('check:difference:export')")
|
||||
@Log(title = "盘点差异", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CheckDifferenceRecord checkDifferenceRecord)
|
||||
{
|
||||
public void export(HttpServletResponse response, CheckDifferenceRecord checkDifferenceRecord) {
|
||||
List<CheckDifferenceRecord> list = checkDifferenceRecordService.selectCheckDifferenceRecordList(checkDifferenceRecord);
|
||||
ExcelUtil<CheckDifferenceRecord> util = new ExcelUtil<CheckDifferenceRecord>(CheckDifferenceRecord.class);
|
||||
util.exportExcel(response, list, "盘点差异数据");
|
||||
@@ -64,8 +71,7 @@ public class CheckDifferenceRecordController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('check:difference:query')")
|
||||
@GetMapping(value = "/{checkGuid}")
|
||||
public AjaxResult getInfo(@PathVariable("checkGuid") String checkGuid)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable("checkGuid") String checkGuid) {
|
||||
return success(checkDifferenceRecordService.selectCheckDifferenceRecordByCheckGuid(checkGuid));
|
||||
}
|
||||
|
||||
@@ -75,8 +81,7 @@ public class CheckDifferenceRecordController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('check:difference:add')")
|
||||
@Log(title = "盘点差异", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CheckDifferenceRecord checkDifferenceRecord)
|
||||
{
|
||||
public AjaxResult add(@RequestBody CheckDifferenceRecord checkDifferenceRecord) {
|
||||
return checkDifferenceRecordService.insertCheckDifferenceRecord(checkDifferenceRecord);
|
||||
}
|
||||
|
||||
@@ -86,8 +91,7 @@ public class CheckDifferenceRecordController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('check:difference:edit')")
|
||||
@Log(title = "盘点差异", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CheckDifferenceRecord checkDifferenceRecord)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody CheckDifferenceRecord checkDifferenceRecord) {
|
||||
return toAjax(checkDifferenceRecordService.updateCheckDifferenceRecord(checkDifferenceRecord));
|
||||
}
|
||||
|
||||
@@ -96,9 +100,117 @@ public class CheckDifferenceRecordController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('check:difference:remove')")
|
||||
@Log(title = "盘点差异", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{checkGuids}")
|
||||
public AjaxResult remove(@PathVariable String[] checkGuids)
|
||||
{
|
||||
@DeleteMapping("/{checkGuids}")
|
||||
public AjaxResult remove(@PathVariable String[] checkGuids) {
|
||||
return toAjax(checkDifferenceRecordService.deleteCheckDifferenceRecordByCheckGuids(checkGuids));
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private IBasStockService basStockService;
|
||||
@Autowired
|
||||
private ICheckDifferenceRecordFinishService checkDifferenceRecordFinishService;
|
||||
@Autowired
|
||||
private IBasJobIdService basJobIdService;
|
||||
/**
|
||||
* 审核盘点差异
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('check:difference:audit')")
|
||||
@Log(title = "盘点差异", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/audit")
|
||||
public AjaxResult audit(@RequestBody String[] checkGuids)
|
||||
{
|
||||
List<CheckDifferenceRecord> records = new ArrayList<>();
|
||||
for (String checkGuid : checkGuids) {
|
||||
CheckDifferenceRecord record = checkDifferenceRecordService.selectCheckDifferenceRecordByCheckGuid(checkGuid);
|
||||
if (record != null) {
|
||||
records.add(record);
|
||||
}
|
||||
}
|
||||
|
||||
for (CheckDifferenceRecord record : records) {
|
||||
String recordType = String.valueOf(record.getRecordType());
|
||||
|
||||
if ("1".equals(recordType)) { // 更新数据
|
||||
// 根据stockId、trayCode、oldQuantity查找库存记录
|
||||
BasStock queryStock = new BasStock();
|
||||
queryStock.setStockId(record.getStockId());
|
||||
queryStock.setTrayCode(record.getTrayCode());
|
||||
queryStock.setQuantity(record.getOldQuantity());
|
||||
List<BasStock> stocks = basStockService.selectBasStockList(queryStock);
|
||||
|
||||
if (stocks.isEmpty()) {
|
||||
return AjaxResult.error("没有在库存中找到该条记录:库存ID=" + record.getStockId() + ", 托盘号=" + record.getTrayCode());
|
||||
}
|
||||
|
||||
// 更新库存数量和状态
|
||||
BasStock stock = stocks.get(0);
|
||||
stock.setQuantity(record.getNewQuantity());
|
||||
stock.setProductStatus("1");
|
||||
basStockService.updateBasStock(stock);
|
||||
}
|
||||
else if ("2".equals(recordType)) { // 新增数据
|
||||
// 检查物料ID是否存在
|
||||
if (record.getProductId() == null || record.getProductId().trim().isEmpty()) {
|
||||
return AjaxResult.error("物料ID不能为空");
|
||||
}
|
||||
|
||||
// 检查库存是否已存在
|
||||
BasStock queryStock = new BasStock();
|
||||
queryStock.setStockId(record.getStockId());
|
||||
queryStock.setTrayCode(record.getTrayCode());
|
||||
List<BasStock> stocks = basStockService.selectBasStockList(queryStock);
|
||||
// 创建新的库存记录
|
||||
BasStock newStock = new BasStock();
|
||||
// 先设置必要字段
|
||||
newStock.setTrayCode(record.getTrayCode());
|
||||
newStock.setQuantity(record.getNewQuantity());
|
||||
newStock.setProductStatus("1");
|
||||
newStock.setCargoSpaceId(record.getCargoSpaceId());
|
||||
newStock.setLotNo(record.getLotNo());
|
||||
newStock.setProductGuid(record.getProductGuid());
|
||||
newStock.setProductId(record.getProductId());
|
||||
newStock.setStockStatus("1"); // 设置库存状态为正常
|
||||
// 初始化extraField对象
|
||||
ExtraField extraField = new ExtraField();
|
||||
extraField.setProductId(record.getProductId());
|
||||
// 物料名称和其他信息会通过关联查询自动填充
|
||||
newStock.setExtraField(extraField);
|
||||
|
||||
// 最后设置库存ID
|
||||
newStock.setStockId(basJobIdService.getJobId("KC"));
|
||||
basStockService.insertBasStock(newStock);
|
||||
}
|
||||
else if ("3".equals(recordType)) { // 删除数据
|
||||
// 检查要删除的库存是否存在
|
||||
BasStock queryStock = new BasStock();
|
||||
queryStock.setStockId(record.getStockId());
|
||||
queryStock.setTrayCode(record.getTrayCode());
|
||||
List<BasStock> stocks = basStockService.selectBasStockList(queryStock);
|
||||
|
||||
if (stocks.isEmpty()) {
|
||||
return AjaxResult.error("没有在库存中找到该条记录:库存ID=" + record.getStockId() + ", 托盘号=" + record.getTrayCode());
|
||||
}
|
||||
|
||||
basStockService.deleteBasStockByStockId(record.getStockId());
|
||||
}
|
||||
|
||||
// 设置审核状态为已审核
|
||||
record.setStatus("1");
|
||||
|
||||
// 创建历史记录前先检查是否已存在
|
||||
CheckDifferenceRecordFinish queryFinish = checkDifferenceRecordFinishService.selectCheckDifferenceRecordFinishByCheckGuid(record.getCheckGuid());
|
||||
|
||||
// 创建历史记录
|
||||
CheckDifferenceRecordFinish finishRecord = new CheckDifferenceRecordFinish();
|
||||
BeanUtils.copyProperties(record, finishRecord);
|
||||
checkDifferenceRecordFinishService.insertCheckDifferenceRecordFinish(finishRecord);
|
||||
|
||||
// 删除原记录
|
||||
checkDifferenceRecordService.deleteCheckDifferenceRecordByCheckGuid(record.getCheckGuid());
|
||||
}
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@ public class CheckDifferenceRecord extends BaseEntity
|
||||
@Excel(name = "物料guid")
|
||||
private String productGuid;
|
||||
|
||||
/** 审核状态 */
|
||||
@Excel(name = "审核状态")
|
||||
private String status;
|
||||
|
||||
public String getStatus() {
|
||||
|
||||
@@ -124,4 +124,6 @@ public class CheckDifferenceRecordServiceImpl implements ICheckDifferenceRecordS
|
||||
{
|
||||
return checkDifferenceRecordMapper.deleteCheckDifferenceRecordByCheckGuid(checkGuid);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -37,6 +37,14 @@ public interface IBasStockService
|
||||
*/
|
||||
public int insertBasStock(BasStock basStock);
|
||||
|
||||
/**
|
||||
* 新增库存信息(不记录维护记录)
|
||||
*
|
||||
* @param basStock 库存信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBasStockWithoutMaintainRecord(BasStock basStock);
|
||||
|
||||
/**
|
||||
* 修改库存信息
|
||||
*
|
||||
|
||||
@@ -80,7 +80,7 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
}
|
||||
|
||||
private void insertMaintainRecord(BasStock oldStock, BasStock basStock, String operate) {
|
||||
if (!oldStock.getQuantity().equals(basStock.getQuantity())){
|
||||
if ((oldStock==null && operate.equals("1")) || !oldStock.getQuantity().equals(basStock.getQuantity())){
|
||||
BasStockMaintainRecord basStockMaintainRecord = new BasStockMaintainRecord();
|
||||
basStockMaintainRecord.setWhGuid(IdUtil.fastSimpleUUID());
|
||||
basStockMaintainRecord.setStockId(basStock.getStockId());
|
||||
@@ -176,4 +176,15 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
public List<BasStock> selectKtpStock(BasStock basStock) {
|
||||
return basStockMapper.selectKtpStock(basStock);
|
||||
}
|
||||
/**
|
||||
* 新增库存信息(不记录维护记录)
|
||||
*
|
||||
* @param basStock 库存信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBasStockWithoutMaintainRecord(BasStock basStock)
|
||||
{
|
||||
return basStockMapper.insertBasStock(basStock);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
<?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.check.DifferenceRecordFinish.mapper.CheckDifferenceRecordFinishMapper">
|
||||
|
||||
<resultMap type="CheckDifferenceRecordFinish" id="CheckDifferenceRecordFinishResult">
|
||||
<result property="checkGuid" column="check_guid" />
|
||||
<result property="stockId" column="stock_id" />
|
||||
<result property="trayCode" column="tray_code" />
|
||||
<result property="cargoSpaceId" column="cargo_space_id" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="lotNo" column="lot_no" />
|
||||
<result property="supplier" column="supplier" />
|
||||
<result property="customer" column="customer" />
|
||||
<result property="oldQuantity" column="old_quantity" />
|
||||
<result property="newQuantity" column="new_quantity" />
|
||||
<result property="recordType" column="record_type" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="productGuid" column="product_guid" />
|
||||
<result property="checkStockDetailId" column="check_stock_detail_id" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCheckDifferenceRecordFinishVo">
|
||||
select check_guid, stock_id, tray_code, cargo_space_id, product_id, lot_no, supplier, customer, old_quantity, new_quantity, record_type, create_time, product_guid, check_stock_detail_id, status from check_difference_record_finish
|
||||
</sql>
|
||||
|
||||
<select id="selectCheckDifferenceRecordFinishList" parameterType="CheckDifferenceRecordFinish" resultMap="CheckDifferenceRecordFinishResult">
|
||||
<include refid="selectCheckDifferenceRecordFinishVo"/>
|
||||
<where>
|
||||
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id = #{cargoSpaceId}</if>
|
||||
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
|
||||
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
|
||||
<if test="supplier != null and supplier != ''"> and supplier = #{supplier}</if>
|
||||
<if test="customer != null and customer != ''"> and customer = #{customer}</if>
|
||||
<if test="oldQuantity != null and oldQuantity != ''"> and old_quantity = #{oldQuantity}</if>
|
||||
<if test="newQuantity != null and newQuantity != ''"> and new_quantity = #{newQuantity}</if>
|
||||
<if test="recordType != null "> and record_type = #{recordType}</if>
|
||||
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
|
||||
<if test="checkStockDetailId != null and checkStockDetailId != ''"> and check_stock_detail_id = #{checkStockDetailId}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCheckDifferenceRecordFinishByCheckGuid" parameterType="String" resultMap="CheckDifferenceRecordFinishResult">
|
||||
<include refid="selectCheckDifferenceRecordFinishVo"/>
|
||||
where check_guid = #{checkGuid}
|
||||
</select>
|
||||
|
||||
<insert id="insertCheckDifferenceRecordFinish" parameterType="CheckDifferenceRecordFinish">
|
||||
insert into check_difference_record_finish
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="checkGuid != null">check_guid,</if>
|
||||
<if test="stockId != null">stock_id,</if>
|
||||
<if test="trayCode != null">tray_code,</if>
|
||||
<if test="cargoSpaceId != null">cargo_space_id,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
<if test="lotNo != null">lot_no,</if>
|
||||
<if test="supplier != null">supplier,</if>
|
||||
<if test="customer != null">customer,</if>
|
||||
<if test="oldQuantity != null">old_quantity,</if>
|
||||
<if test="newQuantity != null">new_quantity,</if>
|
||||
<if test="recordType != null">record_type,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="productGuid != null">product_guid,</if>
|
||||
<if test="checkStockDetailId != null">check_stock_detail_id,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="checkGuid != null">#{checkGuid},</if>
|
||||
<if test="stockId != null">#{stockId},</if>
|
||||
<if test="trayCode != null">#{trayCode},</if>
|
||||
<if test="cargoSpaceId != null">#{cargoSpaceId},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
<if test="lotNo != null">#{lotNo},</if>
|
||||
<if test="supplier != null">#{supplier},</if>
|
||||
<if test="customer != null">#{customer},</if>
|
||||
<if test="oldQuantity != null">#{oldQuantity},</if>
|
||||
<if test="newQuantity != null">#{newQuantity},</if>
|
||||
<if test="recordType != null">#{recordType},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="productGuid != null">#{productGuid},</if>
|
||||
<if test="checkStockDetailId != null">#{checkStockDetailId},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCheckDifferenceRecordFinish" parameterType="CheckDifferenceRecordFinish">
|
||||
update check_difference_record_finish
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="stockId != null">stock_id = #{stockId},</if>
|
||||
<if test="trayCode != null">tray_code = #{trayCode},</if>
|
||||
<if test="cargoSpaceId != null">cargo_space_id = #{cargoSpaceId},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="lotNo != null">lot_no = #{lotNo},</if>
|
||||
<if test="supplier != null">supplier = #{supplier},</if>
|
||||
<if test="customer != null">customer = #{customer},</if>
|
||||
<if test="oldQuantity != null">old_quantity = #{oldQuantity},</if>
|
||||
<if test="newQuantity != null">new_quantity = #{newQuantity},</if>
|
||||
<if test="recordType != null">record_type = #{recordType},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="productGuid != null">product_guid = #{productGuid},</if>
|
||||
<if test="checkStockDetailId != null">check_stock_detail_id = #{checkStockDetailId},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim>
|
||||
where check_guid = #{checkGuid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCheckDifferenceRecordFinishByCheckGuid" parameterType="String">
|
||||
delete from check_difference_record_finish where check_guid = #{checkGuid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCheckDifferenceRecordFinishByCheckGuids" parameterType="String">
|
||||
delete from check_difference_record_finish where check_guid in
|
||||
<foreach item="checkGuid" collection="array" open="(" separator="," close=")">
|
||||
#{checkGuid}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -19,10 +19,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="recordType" column="record_type" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="productGuid" column="product_guid" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCheckDifferenceRecordVo">
|
||||
select check_guid, check_stock_detail_id, stock_id, tray_code, cargo_space_id, product_id, lot_no, supplier, customer, old_quantity, new_quantity, record_type, create_time, product_guid from check_difference_record
|
||||
select check_guid, check_stock_detail_id, stock_id, tray_code, cargo_space_id, product_id, lot_no, supplier, customer, old_quantity, new_quantity, record_type, create_time, product_guid ,status from check_difference_record
|
||||
</sql>
|
||||
|
||||
<select id="selectCheckDifferenceRecordList" parameterType="CheckDifferenceRecord" resultMap="CheckDifferenceRecordResult">
|
||||
@@ -40,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="newQuantity != null and newQuantity != ''"> and new_quantity = #{newQuantity}</if>
|
||||
<if test="recordType != null "> and record_type = #{recordType}</if>
|
||||
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
@@ -103,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="recordType != null">record_type = #{recordType},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="productGuid != null">product_guid = #{productGuid},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim>
|
||||
where check_guid = #{checkGuid}
|
||||
</update>
|
||||
|
||||
@@ -128,6 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare4 != null">spare4,</if>
|
||||
<if test="spare5 != null">spare5,</if>
|
||||
<if test="spare6 != null">spare6,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="stockId != null and stockId != ''">#{stockId},</if>
|
||||
@@ -154,6 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare4 != null">#{spare4},</if>
|
||||
<if test="spare5 != null">#{spare5},</if>
|
||||
<if test="spare6 != null">#{spare6},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertBasStockList">
|
||||
|
||||
44
ruoyi-ui/src/api/check/DifferenceRecordFinish.js
Normal file
44
ruoyi-ui/src/api/check/DifferenceRecordFinish.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询盘点差异历史列表
|
||||
export function listDifferenceRecordFinish(query) {
|
||||
return request({
|
||||
url: '/check/DifferenceRecordFinish/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询盘点差异历史详细
|
||||
export function getDifferenceRecordFinish(checkGuid) {
|
||||
return request({
|
||||
url: '/check/DifferenceRecordFinish/' + checkGuid,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增盘点差异历史
|
||||
export function addDifferenceRecordFinish(data) {
|
||||
return request({
|
||||
url: '/check/DifferenceRecordFinish',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改盘点差异历史
|
||||
export function updateDifferenceRecordFinish(data) {
|
||||
return request({
|
||||
url: '/check/DifferenceRecordFinish',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除盘点差异历史
|
||||
export function delDifferenceRecordFinish(checkGuid) {
|
||||
return request({
|
||||
url: '/check/DifferenceRecordFinish/' + checkGuid,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -42,3 +42,12 @@ export function delDifference(checkGuid) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 审核盘点差异
|
||||
export function auditDifference(checkGuids) {
|
||||
return request({
|
||||
url: '/check/difference/audit',
|
||||
method: 'put',
|
||||
data: checkGuids
|
||||
})
|
||||
}
|
||||
|
||||
@@ -585,6 +585,11 @@ export default {
|
||||
},
|
||||
// ****************盘点差异管理*****************
|
||||
checkDifference: {
|
||||
unaudited:'unaudited',
|
||||
audited:'audited',
|
||||
inputStatus:'Please Select Status',
|
||||
status:'status',
|
||||
audit:'audit',
|
||||
createTime: 'createTime',
|
||||
checkGuid: 'Check ID',
|
||||
checkStockDetailId: 'Check Document ID',
|
||||
|
||||
@@ -562,6 +562,11 @@ export default {
|
||||
},
|
||||
// ****************盘点差异管理*****************
|
||||
checkDifference: {
|
||||
unaudited:'未审核',
|
||||
audited:'已审核',
|
||||
inputStatus:'请选择审核状态',
|
||||
status:'审核状态',
|
||||
audit:'审核',
|
||||
createTime: '创建时间',
|
||||
checkGuid: '盘点id',
|
||||
checkStockDetailId: '盘点单据id',
|
||||
|
||||
@@ -81,65 +81,40 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
<!-- <el-form-item label="物料guid" prop="productGuid">
|
||||
<el-form-item :label="$t('checkDifference.status')" prop="status"> <!-- 审核状态 -->
|
||||
<el-select v-model="queryParams.status" :placeholder="$t('checkDifference.inputStatus')" clearable>
|
||||
<el-option :label="$t('checkDifference.unaudited')" value="0" /> <!-- 未审核 -->
|
||||
<el-option :label="$t('checkDifference.audited')" value="1" /> <!-- 已审核 -->
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('checkDifference.productGuid')" prop="productGuid"> 物料guid
|
||||
<el-input
|
||||
v-model="queryParams.productGuid"
|
||||
placeholder="请输入物料guid"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>-->
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{$t('checkDifference.search')}}</el-button> <!-- 搜索 -->
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{$t('checkDifference.reset')}}</el-button> <!-- 重置 -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- <el-row :gutter="10" class="mb8">-->
|
||||
<!--<!– <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-plus"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleAdd"-->
|
||||
<!-- v-hasPermi="['check:difference:add']"-->
|
||||
<!-- >新增</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="success"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="single"-->
|
||||
<!-- @click="handleUpdate"-->
|
||||
<!-- v-hasPermi="['check:difference:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- @click="handleDelete"-->
|
||||
<!-- v-hasPermi="['check:difference:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </el-col>–>-->
|
||||
<!--<!– <el-col :span="1.5">–>-->
|
||||
<!--<!– <el-button–>-->
|
||||
<!--<!– type="warning"–>-->
|
||||
<!--<!– plain–>-->
|
||||
<!--<!– icon="el-icon-download"–>-->
|
||||
<!--<!– size="mini"–>-->
|
||||
<!--<!– @click="handleExport"–>-->
|
||||
<!--<!– v-hasPermi="['check:difference:export']"–>-->
|
||||
<!--<!– >导出</el-button>–>-->
|
||||
<!--<!– </el-col>–>-->
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
||||
<!-- </el-row>-->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:disabled="multiple || queryParams.status === '1'"
|
||||
@click="handleAudit"
|
||||
v-hasPermi="['check:difference:audit']"
|
||||
>{{$t('checkDifference.audit')}}</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="differenceList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
@@ -156,6 +131,11 @@
|
||||
<el-table-column :label="$t('checkDifference.newQuantity')" align="center" prop="newQuantity" /> <!-- 新值 -->
|
||||
<el-table-column :label="$t('checkDifference.recordType')" align="center" prop="recordType" /> <!-- 操作方式 -->
|
||||
<el-table-column :label="$t('checkDifference.createTime')" align="center" prop="createTime" /> <!-- 创建时间 -->
|
||||
<el-table-column :label="$t('checkDifference.status')" align="center" prop="status"> <!-- 审核状态 -->
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="[{ label: $t('checkDifference.unaudited'), value: '0', raw: { listClass: 'info' } }, { label: $t('checkDifference.audited'), value: '1', raw: { listClass: 'success' } }]" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column :label="$t('checkDifference.productGuid')" align="center" prop="productGuid" /> <!– 物料guid –>-->
|
||||
<!-- <el-table-column :label="$t('checkDifference.operation')" align="center" class-name="small-padding fixed-width"> <!– 操作 –>
|
||||
<template slot-scope="scope">
|
||||
@@ -231,10 +211,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listDifference, getDifference, delDifference, addDifference, updateDifference } from "@/api/check/difference"
|
||||
import { listDifference, getDifference, delDifference, addDifference, updateDifference, auditDifference } from "@/api/check/difference"
|
||||
import { listDifferenceRecordFinish } from "@/api/check/DifferenceRecordFinish"
|
||||
import DictTag from "@/components/DictTag"
|
||||
|
||||
export default {
|
||||
name: "Difference",
|
||||
components: {
|
||||
DictTag
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@@ -270,7 +255,8 @@ export default {
|
||||
oldQuantity: null,
|
||||
newQuantity: null,
|
||||
recordType: null,
|
||||
productGuid: null
|
||||
productGuid: null,
|
||||
status: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@@ -286,11 +272,21 @@ export default {
|
||||
/** 查询盘点差异列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listDifference(this.queryParams).then(response => {
|
||||
this.differenceList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
if (this.queryParams.status === '1') {
|
||||
// 已审核,查询历史表
|
||||
listDifferenceRecordFinish(this.queryParams).then(response => {
|
||||
this.differenceList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
// 未审核或未选择状态,查询差异表
|
||||
listDifference(this.queryParams).then(response => {
|
||||
this.differenceList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
@@ -313,7 +309,8 @@ export default {
|
||||
newQuantity: null,
|
||||
recordType: null,
|
||||
createTime: null,
|
||||
productGuid: null
|
||||
productGuid: null,
|
||||
status: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
@@ -384,7 +381,17 @@ export default {
|
||||
this.download('check/difference/export', {
|
||||
...this.queryParams
|
||||
}, `difference_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
},
|
||||
/** 审核按钮操作 */
|
||||
handleAudit() {
|
||||
const checkGuids = this.ids
|
||||
this.$modal.confirm('是否确认审核选中的' + checkGuids.length + '条数据?').then(function() {
|
||||
return auditDifference(checkGuids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("审核成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user