现场wms使用优化
This commit is contained in:
@@ -66,7 +66,7 @@ public class ToWcsServiceImpl implements IToWcsService {
|
||||
|
||||
|
||||
@Override
|
||||
@Scheduled(fixedDelay=1500)
|
||||
//@Scheduled(fixedDelay=1500)
|
||||
public void pushOutMydoJob() {
|
||||
//查询所有未推送的料箱出库作业
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
@@ -156,15 +156,6 @@ public class ToWcsServiceImpl implements IToWcsService {
|
||||
param.setWarehouseId(requestEnter.getWarehouseId());
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobListApi(param);
|
||||
if (CollUtil.isEmpty(mydoJobs)){
|
||||
/*//生成杂料入库任务
|
||||
TrayCodeMsg trayCodeMsg = new TrayCodeMsg();
|
||||
trayCodeMsg.setTrayCode(requestEnter.getTrayCode());
|
||||
trayCodeMsg.setWarehouseId(requestEnter.getWarehouseId());
|
||||
pdaService.zlin(trayCodeMsg);
|
||||
mydoJobs = mydoJobService.selectMydoJobListApi(param);
|
||||
if (CollUtil.isEmpty(mydoJobs)){
|
||||
return AjaxResult.error("杂料入库任务生成失败", requestEnter.getTrayCode());
|
||||
}*/
|
||||
if ("02".equals(requestEnter.getWarehouseId())){
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", requestEnter.getTrayCode());
|
||||
@@ -219,6 +210,7 @@ public class ToWcsServiceImpl implements IToWcsService {
|
||||
basCargoSpaceParam.setRule1(null);
|
||||
basCargoSpaceParam.setRule2(null);
|
||||
basCargoSpaceParam.setTheFloor(null);
|
||||
basCargoSpaceParam.setCargoHight(null);
|
||||
basCargoSpace = basCargoSpaceService.selectEmptyCargoSpaceByWarehouseId(basCargoSpaceParam);
|
||||
if (ObjUtil.isNull(basCargoSpace)){
|
||||
return AjaxResult.error("没有空货位");
|
||||
|
||||
@@ -136,6 +136,16 @@ public class MydoJob extends BaseEntity
|
||||
|
||||
private String productId;
|
||||
|
||||
private List<String> warehouseIdList;
|
||||
|
||||
public List<String> getWarehouseIdList() {
|
||||
return warehouseIdList;
|
||||
}
|
||||
|
||||
public void setWarehouseIdList(List<String> warehouseIdList) {
|
||||
this.warehouseIdList = warehouseIdList;
|
||||
}
|
||||
|
||||
public String getProductId() {
|
||||
return productId;
|
||||
}
|
||||
|
||||
@@ -116,16 +116,19 @@ public class MydoJobServiceImpl implements IMydoJobService {
|
||||
}
|
||||
if ("1".equals(mydoJob.getInOut()) || "3".equals(mydoJob.getInOut())){
|
||||
//入库需要查看本部门任务
|
||||
mydoJob.setDepartmentId(Convert.toStr(SecurityUtils.getDeptId()));
|
||||
Optional<SysRole> first = roles.stream().filter(x -> "role1".equals(x.getRoleKey())).findFirst();
|
||||
if (first.isPresent()){
|
||||
//二联合普通人员
|
||||
mydoJob.setWarehouseId("02");
|
||||
mydoJob.setDepartmentId(Convert.toStr(SecurityUtils.getDeptId()));
|
||||
|
||||
}
|
||||
Optional<SysRole> first1 = roles.stream().filter(x -> "role2".equals(x.getRoleKey())).findFirst();
|
||||
if (first1.isPresent()){
|
||||
//三联合普通人员
|
||||
mydoJob.setWarehouseId("01");
|
||||
mydoJob.setDepartmentId(Convert.toStr(SecurityUtils.getDeptId()));
|
||||
|
||||
}
|
||||
Optional<SysRole> first2 = roles.stream().filter(x -> "role3".equals(x.getRoleKey())).findFirst();
|
||||
if (first2.isPresent()){
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
package com.ruoyi.kpi.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargoSpace.mapper.BasCargoSpaceMapper;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.utils.MessageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||
import com.ruoyi.job.mydojobfinish.domain.MydoJobFinish;
|
||||
import com.ruoyi.job.mydojobfinish.mapper.MydoJobFinishMapper;
|
||||
import com.ruoyi.kpi.service.KpiService;
|
||||
import com.ruoyi.stock.stock.domain.BasStock;
|
||||
import com.ruoyi.stock.stock.mapper.BasStockMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -26,6 +30,7 @@ import java.util.stream.Collectors;
|
||||
* @date 2025-05-21
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class KpiServiceImpl implements KpiService
|
||||
{
|
||||
@Autowired
|
||||
@@ -497,6 +502,43 @@ public class KpiServiceImpl implements KpiService
|
||||
mydoJobParam.setDateStart(startTime);
|
||||
mydoJobParam.setDateEnd(endTime);
|
||||
mydoJobParam.setInOut(inOut);
|
||||
try {
|
||||
if (!"admin".equals(SecurityUtils.getUsername())){
|
||||
List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
|
||||
if (CollUtil.isEmpty(roles)) {
|
||||
//如果未设置角色 ,直接返回空列表
|
||||
return AjaxResult.error("没有权限!");
|
||||
}
|
||||
ArrayList<String> warehouseIdList = new ArrayList<>();
|
||||
Optional<SysRole> first = roles.stream().filter(x -> "role1".equals(x.getRoleKey())).findFirst();
|
||||
if (first.isPresent()){
|
||||
//二联合普通人员
|
||||
mydoJobParam.setDepartmentId(SecurityUtils.getDeptId().toString());
|
||||
warehouseIdList.add("02");
|
||||
warehouseIdList.add("03");
|
||||
}
|
||||
Optional<SysRole> first1 = roles.stream().filter(x -> "role2".equals(x.getRoleKey())).findFirst();
|
||||
if (first1.isPresent()){
|
||||
//三联合普通人员
|
||||
mydoJobParam.setDepartmentId(SecurityUtils.getDeptId().toString());
|
||||
warehouseIdList.add("01");
|
||||
}
|
||||
Optional<SysRole> first2 = roles.stream().filter(x -> "role3".equals(x.getRoleKey())).findFirst();
|
||||
if (first2.isPresent()){
|
||||
//二联合管理员
|
||||
warehouseIdList.add("02");
|
||||
warehouseIdList.add("03");
|
||||
}
|
||||
Optional<SysRole> first3 = roles.stream().filter(x -> "role4".equals(x.getRoleKey())).findFirst();
|
||||
if (first3.isPresent()){
|
||||
//三联合管理员
|
||||
warehouseIdList.add("01");
|
||||
}
|
||||
mydoJobParam.setWarehouseIdList(warehouseIdList);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
List<DateTime> datesBetween = DateUtil.rangeToList(DateUtil.parseDate(startTime), DateUtil.parseDate(endTime), DateField.DAY_OF_MONTH);
|
||||
List<MydoJob> list = mydoJobFinishMapper.selectMydoJobFinishListByMydoJob(mydoJobParam);
|
||||
|
||||
|
||||
@@ -172,6 +172,16 @@ public class ViewHandAllotStock extends BaseEntity
|
||||
private String theType;
|
||||
private String theTypeName;
|
||||
|
||||
private String deptName;
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getTheType() {
|
||||
return theType;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ public class ViewInJobFlowServiceImpl implements IViewInJobFlowService
|
||||
public List<ViewInJobFlow> selectViewInJobFlowList(ViewInJobFlow viewInJobFlow)
|
||||
{
|
||||
if (!"admin".equals(SecurityUtils.getUsername())){
|
||||
viewInJobFlow.setDepartmentId(SecurityUtils.getDeptId().toString());
|
||||
List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
|
||||
if (CollUtil.isEmpty(roles)) {
|
||||
//如果未设置角色 ,直接返回空列表
|
||||
@@ -60,11 +59,15 @@ public class ViewInJobFlowServiceImpl implements IViewInJobFlowService
|
||||
if (first.isPresent()){
|
||||
//二联合普通人员
|
||||
viewInJobFlow.setWarehouseId("02");
|
||||
viewInJobFlow.setDepartmentId(SecurityUtils.getDeptId().toString());
|
||||
|
||||
}
|
||||
Optional<SysRole> first1 = roles.stream().filter(x -> "role2".equals(x.getRoleKey())).findFirst();
|
||||
if (first1.isPresent()){
|
||||
//三联合普通人员
|
||||
viewInJobFlow.setWarehouseId("01");
|
||||
viewInJobFlow.setDepartmentId(SecurityUtils.getDeptId().toString());
|
||||
|
||||
}
|
||||
Optional<SysRole> first2 = roles.stream().filter(x -> "role3".equals(x.getRoleKey())).findFirst();
|
||||
if (first2.isPresent()){
|
||||
|
||||
@@ -50,7 +50,6 @@ public class ViewOutJobFlowServiceImpl implements IViewOutJobFlowService
|
||||
public List<ViewOutJobFlow> selectViewOutJobFlowList(ViewOutJobFlow viewOutJobFlow)
|
||||
{
|
||||
if (!"admin".equals(SecurityUtils.getUsername())){
|
||||
viewOutJobFlow.setDepartmentId(SecurityUtils.getDeptId().toString());
|
||||
List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
|
||||
if (CollUtil.isEmpty(roles)) {
|
||||
//如果未设置角色 ,直接返回空列表
|
||||
@@ -60,11 +59,15 @@ public class ViewOutJobFlowServiceImpl implements IViewOutJobFlowService
|
||||
if (first.isPresent()){
|
||||
//二联合普通人员
|
||||
viewOutJobFlow.setWarehouseId("02");
|
||||
viewOutJobFlow.setDepartmentId(SecurityUtils.getDeptId().toString());
|
||||
|
||||
}
|
||||
Optional<SysRole> first1 = roles.stream().filter(x -> "role2".equals(x.getRoleKey())).findFirst();
|
||||
if (first1.isPresent()){
|
||||
//三联合普通人员
|
||||
viewOutJobFlow.setWarehouseId("01");
|
||||
viewOutJobFlow.setDepartmentId(SecurityUtils.getDeptId().toString());
|
||||
|
||||
}
|
||||
Optional<SysRole> first2 = roles.stream().filter(x -> "role3".equals(x.getRoleKey())).findFirst();
|
||||
if (first2.isPresent()){
|
||||
|
||||
@@ -49,7 +49,6 @@ public class ViewStockDetailServiceImpl implements IViewStockDetailService
|
||||
public List<ViewStockDetail> selectViewStockDetailList(ViewStockDetail viewStockDetail)
|
||||
{
|
||||
if (!"admin".equals(SecurityUtils.getUsername())){
|
||||
viewStockDetail.setModel(SecurityUtils.getDeptId().toString());
|
||||
List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
|
||||
if (CollUtil.isEmpty(roles)) {
|
||||
//如果未设置角色 ,直接返回空列表
|
||||
@@ -59,11 +58,15 @@ public class ViewStockDetailServiceImpl implements IViewStockDetailService
|
||||
if (first.isPresent()){
|
||||
//二联合普通人员
|
||||
viewStockDetail.setWarehouseId("02");
|
||||
viewStockDetail.setModel(SecurityUtils.getDeptId().toString());
|
||||
|
||||
}
|
||||
Optional<SysRole> first1 = roles.stream().filter(x -> "role2".equals(x.getRoleKey())).findFirst();
|
||||
if (first1.isPresent()){
|
||||
//三联合普通人员
|
||||
viewStockDetail.setWarehouseId("01");
|
||||
viewStockDetail.setModel(SecurityUtils.getDeptId().toString());
|
||||
|
||||
}
|
||||
Optional<SysRole> first2 = roles.stream().filter(x -> "role3".equals(x.getRoleKey())).findFirst();
|
||||
if (first2.isPresent()){
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.ruoyi.search.traycodeStatic.controller;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.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.search.traycodeStatic.domain.ViewTraycodeStatic;
|
||||
import com.ruoyi.search.traycodeStatic.service.IViewTraycodeStaticService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 托盘统计Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-01-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/search/traycodeStatic")
|
||||
public class ViewTraycodeStaticController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IViewTraycodeStaticService viewTraycodeStaticService;
|
||||
|
||||
/**
|
||||
* 查询托盘统计列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('search:traycodeStatic:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ViewTraycodeStatic viewTraycodeStatic)
|
||||
{
|
||||
startPage();
|
||||
List<ViewTraycodeStatic> list = viewTraycodeStaticService.selectViewTraycodeStaticList(viewTraycodeStatic);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出托盘统计列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('search:traycodeStatic:export')")
|
||||
@Log(title = "托盘统计", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ViewTraycodeStatic viewTraycodeStatic)
|
||||
{
|
||||
List<ViewTraycodeStatic> list = viewTraycodeStaticService.selectViewTraycodeStaticList(viewTraycodeStatic);
|
||||
ExcelUtil<ViewTraycodeStatic> util = new ExcelUtil<ViewTraycodeStatic>(ViewTraycodeStatic.class);
|
||||
util.exportExcel(response, list, "托盘统计数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取托盘统计详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('search:traycodeStatic:query')")
|
||||
@GetMapping(value = "/{warehouseId}")
|
||||
public AjaxResult getInfo(@PathVariable("warehouseId") String warehouseId)
|
||||
{
|
||||
return success(viewTraycodeStaticService.selectViewTraycodeStaticByWarehouseId(warehouseId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增托盘统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('search:traycodeStatic:add')")
|
||||
@Log(title = "托盘统计", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ViewTraycodeStatic viewTraycodeStatic)
|
||||
{
|
||||
return toAjax(viewTraycodeStaticService.insertViewTraycodeStatic(viewTraycodeStatic));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改托盘统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('search:traycodeStatic:edit')")
|
||||
@Log(title = "托盘统计", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ViewTraycodeStatic viewTraycodeStatic)
|
||||
{
|
||||
return toAjax(viewTraycodeStaticService.updateViewTraycodeStatic(viewTraycodeStatic));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除托盘统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('search:traycodeStatic:remove')")
|
||||
@Log(title = "托盘统计", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{warehouseIds}")
|
||||
public AjaxResult remove(@PathVariable String[] warehouseIds)
|
||||
{
|
||||
return toAjax(viewTraycodeStaticService.deleteViewTraycodeStaticByWarehouseIds(warehouseIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
package com.ruoyi.search.traycodeStatic.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;
|
||||
|
||||
/**
|
||||
* 托盘统计对象 view_traycode_static
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-01-23
|
||||
*/
|
||||
public class ViewTraycodeStatic extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 仓库编码 */
|
||||
@Excel(name = "仓库编码")
|
||||
private String warehouseId;
|
||||
|
||||
/** 仓库名称 */
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
/** 货位编码 */
|
||||
@Excel(name = "货位编码")
|
||||
private String cargoSpaceId;
|
||||
|
||||
/** 货位名称 */
|
||||
@Excel(name = "货位名称")
|
||||
private String cargoSpaceName;
|
||||
|
||||
/** 巷道 */
|
||||
@Excel(name = "巷道")
|
||||
private String roadwayId;
|
||||
|
||||
/** 排 */
|
||||
@Excel(name = "排")
|
||||
private Long thePlatoon;
|
||||
|
||||
/** 列 */
|
||||
@Excel(name = "列")
|
||||
private Long theColumn;
|
||||
|
||||
/** 层 */
|
||||
@Excel(name = "层")
|
||||
private Long theFloor;
|
||||
|
||||
/** 托盘号 */
|
||||
@Excel(name = "托盘号")
|
||||
private String trayCode;
|
||||
|
||||
/** 部门 */
|
||||
@Excel(name = "部门")
|
||||
private String model;
|
||||
|
||||
/** 部门名称 */
|
||||
@Excel(name = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
/** 入库时间 */
|
||||
@Excel(name = "入库时间")
|
||||
private String inDate;
|
||||
|
||||
public void setWarehouseId(String warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public String getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
|
||||
public void setWarehouseName(String warehouseName)
|
||||
{
|
||||
this.warehouseName = warehouseName;
|
||||
}
|
||||
|
||||
public String getWarehouseName()
|
||||
{
|
||||
return warehouseName;
|
||||
}
|
||||
|
||||
public void setCargoSpaceId(String cargoSpaceId)
|
||||
{
|
||||
this.cargoSpaceId = cargoSpaceId;
|
||||
}
|
||||
|
||||
public String getCargoSpaceId()
|
||||
{
|
||||
return cargoSpaceId;
|
||||
}
|
||||
|
||||
public void setCargoSpaceName(String cargoSpaceName)
|
||||
{
|
||||
this.cargoSpaceName = cargoSpaceName;
|
||||
}
|
||||
|
||||
public String getCargoSpaceName()
|
||||
{
|
||||
return cargoSpaceName;
|
||||
}
|
||||
|
||||
public void setRoadwayId(String roadwayId)
|
||||
{
|
||||
this.roadwayId = roadwayId;
|
||||
}
|
||||
|
||||
public String getRoadwayId()
|
||||
{
|
||||
return roadwayId;
|
||||
}
|
||||
|
||||
public void setThePlatoon(Long thePlatoon)
|
||||
{
|
||||
this.thePlatoon = thePlatoon;
|
||||
}
|
||||
|
||||
public Long getThePlatoon()
|
||||
{
|
||||
return thePlatoon;
|
||||
}
|
||||
|
||||
public void setTheColumn(Long theColumn)
|
||||
{
|
||||
this.theColumn = theColumn;
|
||||
}
|
||||
|
||||
public Long getTheColumn()
|
||||
{
|
||||
return theColumn;
|
||||
}
|
||||
|
||||
public void setTheFloor(Long theFloor)
|
||||
{
|
||||
this.theFloor = theFloor;
|
||||
}
|
||||
|
||||
public Long getTheFloor()
|
||||
{
|
||||
return theFloor;
|
||||
}
|
||||
|
||||
public void setTrayCode(String trayCode)
|
||||
{
|
||||
this.trayCode = trayCode;
|
||||
}
|
||||
|
||||
public String getTrayCode()
|
||||
{
|
||||
return trayCode;
|
||||
}
|
||||
|
||||
public void setModel(String model)
|
||||
{
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public String getModel()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName)
|
||||
{
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getDeptName()
|
||||
{
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setInDate(String inDate)
|
||||
{
|
||||
this.inDate = inDate;
|
||||
}
|
||||
|
||||
public String getInDate()
|
||||
{
|
||||
return inDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("warehouseName", getWarehouseName())
|
||||
.append("cargoSpaceId", getCargoSpaceId())
|
||||
.append("cargoSpaceName", getCargoSpaceName())
|
||||
.append("roadwayId", getRoadwayId())
|
||||
.append("thePlatoon", getThePlatoon())
|
||||
.append("theColumn", getTheColumn())
|
||||
.append("theFloor", getTheFloor())
|
||||
.append("trayCode", getTrayCode())
|
||||
.append("model", getModel())
|
||||
.append("deptName", getDeptName())
|
||||
.append("inDate", getInDate())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.search.traycodeStatic.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.search.traycodeStatic.domain.ViewTraycodeStatic;
|
||||
|
||||
/**
|
||||
* 托盘统计Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-01-23
|
||||
*/
|
||||
public interface ViewTraycodeStaticMapper
|
||||
{
|
||||
/**
|
||||
* 查询托盘统计
|
||||
*
|
||||
* @param warehouseId 托盘统计主键
|
||||
* @return 托盘统计
|
||||
*/
|
||||
public ViewTraycodeStatic selectViewTraycodeStaticByWarehouseId(String warehouseId);
|
||||
|
||||
/**
|
||||
* 查询托盘统计列表
|
||||
*
|
||||
* @param viewTraycodeStatic 托盘统计
|
||||
* @return 托盘统计集合
|
||||
*/
|
||||
public List<ViewTraycodeStatic> selectViewTraycodeStaticList(ViewTraycodeStatic viewTraycodeStatic);
|
||||
|
||||
/**
|
||||
* 新增托盘统计
|
||||
*
|
||||
* @param viewTraycodeStatic 托盘统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertViewTraycodeStatic(ViewTraycodeStatic viewTraycodeStatic);
|
||||
|
||||
/**
|
||||
* 修改托盘统计
|
||||
*
|
||||
* @param viewTraycodeStatic 托盘统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateViewTraycodeStatic(ViewTraycodeStatic viewTraycodeStatic);
|
||||
|
||||
/**
|
||||
* 删除托盘统计
|
||||
*
|
||||
* @param warehouseId 托盘统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteViewTraycodeStaticByWarehouseId(String warehouseId);
|
||||
|
||||
/**
|
||||
* 批量删除托盘统计
|
||||
*
|
||||
* @param warehouseIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteViewTraycodeStaticByWarehouseIds(String[] warehouseIds);
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.search.traycodeStatic.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.search.traycodeStatic.domain.ViewTraycodeStatic;
|
||||
|
||||
/**
|
||||
* 托盘统计Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-01-23
|
||||
*/
|
||||
public interface IViewTraycodeStaticService
|
||||
{
|
||||
/**
|
||||
* 查询托盘统计
|
||||
*
|
||||
* @param warehouseId 托盘统计主键
|
||||
* @return 托盘统计
|
||||
*/
|
||||
public ViewTraycodeStatic selectViewTraycodeStaticByWarehouseId(String warehouseId);
|
||||
|
||||
/**
|
||||
* 查询托盘统计列表
|
||||
*
|
||||
* @param viewTraycodeStatic 托盘统计
|
||||
* @return 托盘统计集合
|
||||
*/
|
||||
public List<ViewTraycodeStatic> selectViewTraycodeStaticList(ViewTraycodeStatic viewTraycodeStatic);
|
||||
|
||||
/**
|
||||
* 新增托盘统计
|
||||
*
|
||||
* @param viewTraycodeStatic 托盘统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertViewTraycodeStatic(ViewTraycodeStatic viewTraycodeStatic);
|
||||
|
||||
/**
|
||||
* 修改托盘统计
|
||||
*
|
||||
* @param viewTraycodeStatic 托盘统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateViewTraycodeStatic(ViewTraycodeStatic viewTraycodeStatic);
|
||||
|
||||
/**
|
||||
* 批量删除托盘统计
|
||||
*
|
||||
* @param warehouseIds 需要删除的托盘统计主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteViewTraycodeStaticByWarehouseIds(String[] warehouseIds);
|
||||
|
||||
/**
|
||||
* 删除托盘统计信息
|
||||
*
|
||||
* @param warehouseId 托盘统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteViewTraycodeStaticByWarehouseId(String warehouseId);
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
package com.ruoyi.search.traycodeStatic.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.search.traycodeStatic.mapper.ViewTraycodeStaticMapper;
|
||||
import com.ruoyi.search.traycodeStatic.domain.ViewTraycodeStatic;
|
||||
import com.ruoyi.search.traycodeStatic.service.IViewTraycodeStaticService;
|
||||
|
||||
/**
|
||||
* 托盘统计Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-01-23
|
||||
*/
|
||||
@Service
|
||||
public class ViewTraycodeStaticServiceImpl implements IViewTraycodeStaticService
|
||||
{
|
||||
@Autowired
|
||||
private ViewTraycodeStaticMapper viewTraycodeStaticMapper;
|
||||
|
||||
/**
|
||||
* 查询托盘统计
|
||||
*
|
||||
* @param warehouseId 托盘统计主键
|
||||
* @return 托盘统计
|
||||
*/
|
||||
@Override
|
||||
public ViewTraycodeStatic selectViewTraycodeStaticByWarehouseId(String warehouseId)
|
||||
{
|
||||
return viewTraycodeStaticMapper.selectViewTraycodeStaticByWarehouseId(warehouseId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询托盘统计列表
|
||||
*
|
||||
* @param viewTraycodeStatic 托盘统计
|
||||
* @return 托盘统计
|
||||
*/
|
||||
@Override
|
||||
public List<ViewTraycodeStatic> selectViewTraycodeStaticList(ViewTraycodeStatic viewTraycodeStatic)
|
||||
{
|
||||
if (!"admin".equals(SecurityUtils.getUsername())){
|
||||
List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
|
||||
if (CollUtil.isEmpty(roles)) {
|
||||
//如果未设置角色 ,直接返回空列表
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Optional<SysRole> first = roles.stream().filter(x -> "role1".equals(x.getRoleKey())).findFirst();
|
||||
if (first.isPresent()){
|
||||
//二联合普通人员
|
||||
viewTraycodeStatic.setWarehouseId("02");
|
||||
viewTraycodeStatic.setModel(SecurityUtils.getDeptId().toString());
|
||||
|
||||
}
|
||||
Optional<SysRole> first1 = roles.stream().filter(x -> "role2".equals(x.getRoleKey())).findFirst();
|
||||
if (first1.isPresent()){
|
||||
//三联合普通人员
|
||||
viewTraycodeStatic.setWarehouseId("01");
|
||||
viewTraycodeStatic.setModel(SecurityUtils.getDeptId().toString());
|
||||
|
||||
}
|
||||
Optional<SysRole> first2 = roles.stream().filter(x -> "role3".equals(x.getRoleKey())).findFirst();
|
||||
if (first2.isPresent()){
|
||||
//二联合管理员
|
||||
viewTraycodeStatic.setWarehouseId("02");
|
||||
}
|
||||
Optional<SysRole> first3 = roles.stream().filter(x -> "role4".equals(x.getRoleKey())).findFirst();
|
||||
if (first3.isPresent()){
|
||||
//三联合管理员
|
||||
viewTraycodeStatic.setWarehouseId("01");
|
||||
}
|
||||
}
|
||||
return viewTraycodeStaticMapper.selectViewTraycodeStaticList(viewTraycodeStatic);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增托盘统计
|
||||
*
|
||||
* @param viewTraycodeStatic 托盘统计
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertViewTraycodeStatic(ViewTraycodeStatic viewTraycodeStatic)
|
||||
{
|
||||
return viewTraycodeStaticMapper.insertViewTraycodeStatic(viewTraycodeStatic);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改托盘统计
|
||||
*
|
||||
* @param viewTraycodeStatic 托盘统计
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateViewTraycodeStatic(ViewTraycodeStatic viewTraycodeStatic)
|
||||
{
|
||||
return viewTraycodeStaticMapper.updateViewTraycodeStatic(viewTraycodeStatic);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除托盘统计
|
||||
*
|
||||
* @param warehouseIds 需要删除的托盘统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteViewTraycodeStaticByWarehouseIds(String[] warehouseIds)
|
||||
{
|
||||
return viewTraycodeStaticMapper.deleteViewTraycodeStaticByWarehouseIds(warehouseIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除托盘统计信息
|
||||
*
|
||||
* @param warehouseId 托盘统计主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteViewTraycodeStaticByWarehouseId(String warehouseId)
|
||||
{
|
||||
return viewTraycodeStaticMapper.deleteViewTraycodeStaticByWarehouseId(warehouseId);
|
||||
}
|
||||
}
|
||||
@@ -20,4 +20,5 @@ public class BasStockSummary {
|
||||
private String theFloor;
|
||||
private String theType;
|
||||
private String theTypeName;
|
||||
private String issDouble;
|
||||
}
|
||||
|
||||
@@ -73,4 +73,6 @@ public interface BasStockMapper
|
||||
List<BasStockSummary> selectBasStockSummary(BasStock basStock);
|
||||
|
||||
int updateBasStockDept(BasStock basStock);
|
||||
|
||||
int selectCountByTrayCodeAndWarehouseId(String trayCode, String warehouseId);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
package com.ruoyi.stock.stock.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.bas.basJobId.service.IBasJobIdService;
|
||||
import com.ruoyi.bas.cargoSpace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.common.annotation.DataScope;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.in.stockindetail.domain.InStockinDetail;
|
||||
import com.ruoyi.in.stockindetail.service.IInStockinDetailService;
|
||||
import com.ruoyi.stock.freeze.domain.BasStockFreezeRecord;
|
||||
import com.ruoyi.stock.freeze.service.IBasStockFreezeRecordService;
|
||||
import com.ruoyi.stock.maintain.domain.BasStockMaintainRecord;
|
||||
@@ -21,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -45,6 +49,8 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
@Autowired
|
||||
private IBasJobIdService basJobIdService;
|
||||
@Autowired
|
||||
private IInStockinDetailService stockinDetailService;
|
||||
|
||||
/**
|
||||
* 查询库存信息
|
||||
@@ -91,6 +97,7 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult insertBasStock(BasStock basStock)
|
||||
{
|
||||
if (!"admin".equals(SecurityUtils.getUsername())) {
|
||||
@@ -110,7 +117,33 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
basStock.setModel(SecurityUtils.getDeptId().toString());
|
||||
basStock.setProductStatus("1");
|
||||
basStock.setInDate(DateUtil.formatDateTime(new Date()));
|
||||
int i =basStockMapper.insertBasStock(basStock);
|
||||
if (StrUtil.isNotEmpty(basStock.getStockinDetailId())) {
|
||||
InStockinDetail inStockinDetail = stockinDetailService.selectInStockinDetailByStockinDetailId(basStock.getStockinDetailId());
|
||||
if (inStockinDetail != null) {
|
||||
BigDecimal scanNum = Convert.toBigDecimal(inStockinDetail.getScanNum());
|
||||
BigDecimal assignNum = Convert.toBigDecimal(inStockinDetail.getAssignNum());
|
||||
inStockinDetail.setScanNum(Convert.toStr(scanNum.add(Convert.toBigDecimal(basStock.getQuantity()))));
|
||||
inStockinDetail.setAssignNum(Convert.toStr(assignNum.add(Convert.toBigDecimal(basStock.getQuantity()))));
|
||||
stockinDetailService.updateInStockinDetail(inStockinDetail);
|
||||
}
|
||||
}
|
||||
BasStock param = new BasStock();
|
||||
param.setWarehouseId(basStock.getWarehouseId());
|
||||
param.setTrayCode(basStock.getTrayCode());
|
||||
param.setProductId(basStock.getProductId());
|
||||
param.setOrderId(basStock.getOrderId());
|
||||
param.setPower(basStock.getPower());
|
||||
param.setDistribution(basStock.getDistribution());
|
||||
param.setSpare5(basStock.getSpare5());
|
||||
List<BasStock> basStocks = basStockMapper.selectBasStockList(param);
|
||||
int i = 0;
|
||||
if (CollUtil.isNotEmpty(basStocks)) {
|
||||
BasStock oldStock = basStocks.get(0);
|
||||
oldStock.setQuantity(Convert.toBigDecimal(oldStock.getQuantity()).add(Convert.toBigDecimal(basStock.getQuantity())).toString());
|
||||
i = basStockMapper.updateBasStock(oldStock);
|
||||
} else {
|
||||
i = basStockMapper.insertBasStock(basStock);
|
||||
}
|
||||
if (i > 0){
|
||||
return AjaxResult.success();
|
||||
}else {
|
||||
@@ -202,6 +235,22 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
BasStock oldBasStock = basStockMapper.selectBasStockByStockId(basStock.getStockId());
|
||||
insertMaintainRecord(oldBasStock,basStock,"2");
|
||||
insertFreezeRecord(oldBasStock,basStock);
|
||||
String stockinDetailId = oldBasStock.getStockinDetailId();
|
||||
if (StrUtil.isNotEmpty(stockinDetailId)){
|
||||
InStockinDetail inStockinDetail = stockinDetailService.selectInStockinDetailByStockinDetailId(basStock.getStockinDetailId());
|
||||
if (inStockinDetail != null){
|
||||
BigDecimal scanNum = Convert.toBigDecimal(inStockinDetail.getScanNum());
|
||||
BigDecimal assignNum = Convert.toBigDecimal(inStockinDetail.getAssignNum());
|
||||
BigDecimal oldQuantity = Convert.toBigDecimal(oldBasStock.getQuantity());
|
||||
BigDecimal newQuantity = Convert.toBigDecimal(basStock.getQuantity());
|
||||
BigDecimal subtract = newQuantity.subtract(oldQuantity);
|
||||
BigDecimal newAssignNum = assignNum.subtract(subtract);
|
||||
BigDecimal newScanNum = scanNum.subtract(subtract);
|
||||
inStockinDetail.setScanNum(newScanNum.toString());
|
||||
inStockinDetail.setAssignNum(newAssignNum.toString());
|
||||
stockinDetailService.updateInStockinDetail(inStockinDetail);
|
||||
}
|
||||
}
|
||||
int i = basStockMapper.updateBasStock(basStock);
|
||||
if (i > 0){
|
||||
return AjaxResult.success();
|
||||
@@ -257,15 +306,33 @@ public class BasStockServiceImpl implements IBasStockService
|
||||
}
|
||||
}
|
||||
|
||||
String warehouseId = "";
|
||||
String trayCode = "";
|
||||
for (String stockId : stockIds) {
|
||||
BasStock oldBasStock = basStockMapper.selectBasStockByStockId(stockId);
|
||||
insertMaintainRecord(oldBasStock,oldBasStock,"3");
|
||||
basStockMapper.deleteBasStockByStockId(stockId);
|
||||
warehouseId = oldBasStock.getWarehouseId();
|
||||
trayCode = oldBasStock.getTrayCode();
|
||||
//判断是否是最后一件货物
|
||||
int count = basStockMapper.selectCountByTrayCodeAndWarehouseId(trayCode, warehouseId);
|
||||
if (count == 0){
|
||||
BasStock ktpStock = new BasStock();
|
||||
ktpStock.setStockId(basJobIdService.getJobId("KC"));
|
||||
ktpStock.setCargoSpaceId(oldBasStock.getCargoSpaceId());
|
||||
ktpStock.setStockStatus("1");
|
||||
ktpStock.setProductStatus("1");
|
||||
ktpStock.setProductGuid("KTP0001");
|
||||
ktpStock.setQuantity("1");
|
||||
ktpStock.setTrayCode(oldBasStock.getTrayCode());
|
||||
ktpStock.setOutQuantity("0");
|
||||
ktpStock.setWarehouseId(oldBasStock.getWarehouseId());
|
||||
ktpStock.setProductId("KTP0001");
|
||||
ktpStock.setModel(oldBasStock.getModel());
|
||||
basStockMapper.insertBasStock(ktpStock);
|
||||
}
|
||||
}
|
||||
int i = basStockMapper.deleteBasStockByStockIds(stockIds);
|
||||
if (i > 0){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -184,7 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and locked = 'N'
|
||||
and warehouse_id = #{warehouseId}
|
||||
and roadway_id = #{roadwayId}
|
||||
and cargo_hight = #{cargoHight}
|
||||
<if test="cargoHight !=null and cargoHight != ''">and cargo_hight = #{cargoHight}</if>"
|
||||
<if test="thePlatoon != null">and the_platoon = #{thePlatoon}</if>
|
||||
<if test="rule1 != null and theFloor != null">and the_floor < #{theFloor}</if>
|
||||
<if test="rule2 != null and theFloor != null">and the_floor >= #{theFloor}</if>
|
||||
|
||||
@@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<sql id="selectInStockinDetailVo">
|
||||
select
|
||||
isd.stockin_detail_id, isd.stockin_guid, isd.stockin_id, isd.lot_no, isd.product_guid,
|
||||
isd.product_id, isd.quantity, isd.quantity_x, isd.quantity_j, isd.price, bp.cargo_no, isd.remark,
|
||||
isd.product_id, isd.quantity, (CAST(isd.quantity AS INT) - CAST(isd.scan_num AS INT)) as quantity_x, isd.quantity_j, isd.price, bp.cargo_no, isd.remark,
|
||||
isd.assign_num, isd.assign_num_x, isd.assign_num_j, isd.print_date, isd.stock_status,
|
||||
isd.supplier_id, isd.customer_id, bp.unit, bp.spec, isd.spare1, isd.spare2, isd.spare3, isd.spare4,
|
||||
isd.spare5, isd.spare6, isd.scan_num, isd.scan_num_x, isd.scan_num_j,
|
||||
@@ -94,8 +94,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare2 != null and spare2 != ''"> and isd.spare2 = #{spare2}</if>
|
||||
<if test="spare3 != null and spare3 != ''"> and isd.spare3 = #{spare3}</if>
|
||||
<if test="spare4 != null and spare4 != ''"> and isd.spare4 = #{spare4}</if>
|
||||
<if test="spare5 != null and spare5 != ''"> and isd.spare5 = #{spare5}</if>
|
||||
<if test="spare6 != null and spare6 != ''"> and isd.spare6 = #{spare6}</if>
|
||||
<if test="spare5 != null and spare5 != ''"> and isd.spare5 like concat('%',#{spare5},'%') </if>
|
||||
<if test="spare6 != null and spare6 != ''"> and isd.spare6 like concat('%',#{spare6},'%') </if>
|
||||
<if test="spare7 != null and spare7 != ''"> and isd.spare7 like concat('%',#{spare7},'%') </if>
|
||||
<if test="spare9 != null and spare9 != ''"> and isd.spare9 like concat('%',#{spare9},'%') </if>
|
||||
<if test="scanNum != null and scanNum != ''"> and isd.scan_num = #{scanNum}</if>
|
||||
<if test="scanNumX != null and scanNumX != ''"> and isd.scan_num_x = #{scanNumX}</if>
|
||||
<if test="scanNumJ != null and scanNumJ != ''"> and isd.scan_num_j = #{scanNumJ}</if>
|
||||
|
||||
@@ -142,6 +142,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</if>
|
||||
<if test="dateStart != null and dateStart != ''"> and mj.create_time >= #{dateStart}</if>
|
||||
<if test="dateEnd != null and dateEnd != ''"> and mj.create_time <= #{dateEnd}</if>
|
||||
<if test="warehouseIdList != null and warehouseIdList.size() > 0">
|
||||
and bs.warehouse_id in
|
||||
<foreach collection="warehouseIdList" open="(" close=")" item="it" separator=",">
|
||||
#{it}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
|
||||
${params.warehouseDataScope}
|
||||
</if>
|
||||
|
||||
@@ -48,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="roadwayId" column="roadway_id" />
|
||||
<result property="theType" column="the_type" />
|
||||
<result property="theTypeName" column="the_type_name" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectViewHandAllotStockVo">
|
||||
@@ -56,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
the_column,
|
||||
the_floor,
|
||||
the_type,
|
||||
the_type_name from view_hand_allot_stock vhat
|
||||
the_type_name,dept_name from view_hand_allot_stock vhat
|
||||
</sql>
|
||||
|
||||
<select id="selectViewHandAllotStockList" parameterType="ViewHandAllotStock" resultMap="ViewHandAllotStockResult">
|
||||
|
||||
@@ -99,8 +99,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
|
||||
${params.warehouseDataScope}
|
||||
</if>
|
||||
order by create_time asc
|
||||
</where>
|
||||
order by create_time asc
|
||||
</select>
|
||||
|
||||
<select id="selectViewInJobFlowByJobDetailId" parameterType="String" resultMap="ViewInJobFlowResult">
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
<?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.search.traycodeStatic.mapper.ViewTraycodeStaticMapper">
|
||||
|
||||
<resultMap type="ViewTraycodeStatic" id="ViewTraycodeStaticResult">
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="warehouseName" column="warehouse_name" />
|
||||
<result property="cargoSpaceId" column="cargo_space_id" />
|
||||
<result property="cargoSpaceName" column="cargo_space_name" />
|
||||
<result property="roadwayId" column="roadway_id" />
|
||||
<result property="thePlatoon" column="the_platoon" />
|
||||
<result property="theColumn" column="the_column" />
|
||||
<result property="theFloor" column="the_floor" />
|
||||
<result property="trayCode" column="tray_code" />
|
||||
<result property="model" column="model" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="inDate" column="in_date" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectViewTraycodeStaticVo">
|
||||
select warehouse_id, warehouse_name, cargo_space_id, cargo_space_name, roadway_id, the_platoon, the_column, the_floor, tray_code, model, dept_name, in_date from view_traycode_static
|
||||
</sql>
|
||||
|
||||
<select id="selectViewTraycodeStaticList" parameterType="ViewTraycodeStatic" resultMap="ViewTraycodeStaticResult">
|
||||
<include refid="selectViewTraycodeStaticVo"/>
|
||||
<where>
|
||||
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
|
||||
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id = #{cargoSpaceId}</if>
|
||||
<if test="cargoSpaceName != null and cargoSpaceName != ''"> and cargo_space_name like concat('%', #{cargoSpaceName}, '%')</if>
|
||||
<if test="roadwayId != null and roadwayId != ''"> and roadway_id = #{roadwayId}</if>
|
||||
<if test="thePlatoon != null "> and the_platoon = #{thePlatoon}</if>
|
||||
<if test="theColumn != null "> and the_column = #{theColumn}</if>
|
||||
<if test="theFloor != null "> and the_floor = #{theFloor}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
<if test="model != null and model != ''"> and model = #{model}</if>
|
||||
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="inDate != null and inDate != ''"> and in_date = #{inDate}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectViewTraycodeStaticByWarehouseId" parameterType="String" resultMap="ViewTraycodeStaticResult">
|
||||
<include refid="selectViewTraycodeStaticVo"/>
|
||||
where warehouse_id = #{warehouseId}
|
||||
</select>
|
||||
|
||||
<insert id="insertViewTraycodeStatic" parameterType="ViewTraycodeStatic">
|
||||
insert into view_traycode_static
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="warehouseName != null">warehouse_name,</if>
|
||||
<if test="cargoSpaceId != null">cargo_space_id,</if>
|
||||
<if test="cargoSpaceName != null">cargo_space_name,</if>
|
||||
<if test="roadwayId != null">roadway_id,</if>
|
||||
<if test="thePlatoon != null">the_platoon,</if>
|
||||
<if test="theColumn != null">the_column,</if>
|
||||
<if test="theFloor != null">the_floor,</if>
|
||||
<if test="trayCode != null">tray_code,</if>
|
||||
<if test="model != null">model,</if>
|
||||
<if test="deptName != null">dept_name,</if>
|
||||
<if test="inDate != null">in_date,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="warehouseName != null">#{warehouseName},</if>
|
||||
<if test="cargoSpaceId != null">#{cargoSpaceId},</if>
|
||||
<if test="cargoSpaceName != null">#{cargoSpaceName},</if>
|
||||
<if test="roadwayId != null">#{roadwayId},</if>
|
||||
<if test="thePlatoon != null">#{thePlatoon},</if>
|
||||
<if test="theColumn != null">#{theColumn},</if>
|
||||
<if test="theFloor != null">#{theFloor},</if>
|
||||
<if test="trayCode != null">#{trayCode},</if>
|
||||
<if test="model != null">#{model},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
<if test="inDate != null">#{inDate},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateViewTraycodeStatic" parameterType="ViewTraycodeStatic">
|
||||
update view_traycode_static
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="warehouseName != null">warehouse_name = #{warehouseName},</if>
|
||||
<if test="cargoSpaceId != null">cargo_space_id = #{cargoSpaceId},</if>
|
||||
<if test="cargoSpaceName != null">cargo_space_name = #{cargoSpaceName},</if>
|
||||
<if test="roadwayId != null">roadway_id = #{roadwayId},</if>
|
||||
<if test="thePlatoon != null">the_platoon = #{thePlatoon},</if>
|
||||
<if test="theColumn != null">the_column = #{theColumn},</if>
|
||||
<if test="theFloor != null">the_floor = #{theFloor},</if>
|
||||
<if test="trayCode != null">tray_code = #{trayCode},</if>
|
||||
<if test="model != null">model = #{model},</if>
|
||||
<if test="deptName != null">dept_name = #{deptName},</if>
|
||||
<if test="inDate != null">in_date = #{inDate},</if>
|
||||
</trim>
|
||||
where warehouse_id = #{warehouseId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteViewTraycodeStaticByWarehouseId" parameterType="String">
|
||||
delete from view_traycode_static where warehouse_id = #{warehouseId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteViewTraycodeStaticByWarehouseIds" parameterType="String">
|
||||
delete from view_traycode_static where warehouse_id in
|
||||
<foreach item="warehouseId" collection="array" open="(" separator="," close=")">
|
||||
#{warehouseId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -349,6 +349,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
from bas_stock bs
|
||||
left join bas_cargo_space bcs on bs.cargo_space_id = bcs.cargo_space_id and bs.tray_code = bcs.tray_code
|
||||
left join bas_warehouse bw on bcs.warehouse_id = bw.warehouse_id
|
||||
left join bas_product bp on bs.product_id = bp.product_id
|
||||
WHERE bcs.status = '2'
|
||||
<if test="model != null and model != ''">
|
||||
and (bs.model = #{model} or bs.model is null or bs.model = '')
|
||||
@@ -381,7 +382,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and bs.power like concat('%',#{power},'%')
|
||||
</if>
|
||||
<if test="productName != null and productName != ''">
|
||||
and bs.product_name like concat('%',#{productName},'%')
|
||||
and bp.product_name like concat('%',#{productName},'%')
|
||||
</if>
|
||||
<if test="warehouseIdList != null and warehouseIdList.size() > 0">
|
||||
and bs.warehouse_id in
|
||||
@@ -392,4 +393,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
|
||||
</select>
|
||||
<select id="selectCountByTrayCodeAndWarehouseId" resultType="java.lang.Integer">
|
||||
select count(1) from bas_stock where tray_code = #{trayCode} and warehouse_id = #{warehouseId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user