Merge remote-tracking branch 'origin/master'

This commit is contained in:
刘名喜 2024-10-30 19:44:54 +08:00
commit 70e3773647
14 changed files with 673 additions and 174 deletions

View File

@ -1,36 +0,0 @@
# ktg-mes
#### Description
一款开源、免费的MES生产执行管理系统
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

132
README.md
View File

@ -1,130 +1,2 @@
<p align="center">
<img alt="logo" width="96px" src="https://gitee.com/kutangguo/ktg-mes-ui/raw/master/src/assets/logo/logo.png">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">苦糖果MES</h1>
<h4 align="center">专业、通用、开源、免费的MES系统</h4>
<p align="center">
<a href='https://gitee.com/kutangguo/ktg-mes/stargazers'><img src='https://gitee.com/kutangguo/ktg-mes/badge/star.svg?theme=dark' alt='star'></img></a>
<a href="https://gitee.com/kutangguo/ktg-mes/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
</p>
# ktg-mes
### 系统简介
苦糖果MES系统是一款B/S结构、开源、免费的生产执行管理系统。
此系统基于本人多年离散智造行业的业务经验及J2EE项目经验开发。
主要目的是为国内离散制造业的中小企业提供一个专业化、通用性、低成本的MES系统解决方案。
系统将提供“售前”、“实施”、“用户培训”、“运维”等多个阶段的指导文档和教学视频以帮助非IT专业人士顺利完成MES项目的实施应用。
- 前端代码地址https://gitee.com/kutangguo/ktg-mes-ui
- 触控屏端地址https://gitee.com/kutangguo/ktg-mes-pad
- PC端在线体验地址 [http://www.029tec.com](http://www.029tec.com/) <font color='red'>【请不要修改账户密码,以免影响其他人体验】</font>
- 当前开发进度请参考doc->开发进度->进度甘特图.xlsx
- 第一版售前PPT请查看doc->售前资料->《苦糖果MES系统产品介绍A4横板.pptx》
- 操作手册/软件说明书请参考doc->售前资料->《苦糖果生产执行管理系统-【软件说明书】.docx》
欢迎交流沟通QQ411641505
支持作者请Star
### 系统架构
当前版本基于RuoYi前后端分离版本开发。详情请参照https://gitee.com/y_project/RuoYi-Vue
触控屏端请参考Uniapp相关文档
### 功能简介
PC端
- 系统管理
- 主数据
- 物料产品管理
![](https://gitee.com/kutangguo/ktg-mes/raw/master/doc/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3/%E5%8E%9F%E5%9E%8B%E8%AE%BE%E8%AE%A1/%E6%88%AA%E5%9B%BE/%E7%89%A9%E6%96%99%E4%BA%A7%E5%93%81%E8%AE%BE%E7%BD%AE.png)
- 工作站设置
![](https://gitee.com/kutangguo/ktg-mes/raw/master/doc/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3/%E5%8E%9F%E5%9E%8B%E8%AE%BE%E8%AE%A1/%E6%88%AA%E5%9B%BE/%E5%B7%A5%E4%BD%9C%E7%AB%99%E8%AE%BE%E7%BD%AE.png)
- 生产管理
- 生产排产
![](https://gitee.com/kutangguo/ktg-mes/raw/master/doc/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3/%E5%8E%9F%E5%9E%8B%E8%AE%BE%E8%AE%A1/%E6%88%AA%E5%9B%BE/%E7%94%9F%E4%BA%A7%E6%8E%92%E4%BA%A7.png)
- 质量管理
- 生产排班
- 节假日/工作日设置
![](https://gitee.com/kutangguo/ktg-mes/raw/master/doc/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3/%E5%8E%9F%E5%9E%8B%E8%AE%BE%E8%AE%A1/%E6%88%AA%E5%9B%BE/%E8%8A%82%E5%81%87%E6%97%A5%E8%AE%BE%E7%BD%AE.png)
- 排班日历
![](https://gitee.com/kutangguo/ktg-mes/raw/master/doc/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3/%E5%8E%9F%E5%9E%8B%E8%AE%BE%E8%AE%A1/%E6%88%AA%E5%9B%BE/%E6%8E%92%E7%8F%AD%E6%97%A5%E5%8E%86.png)
- 仓储管理
- 库存现有量
![](https://gitee.com/kutangguo/ktg-mes/raw/master/doc/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3/%E5%8E%9F%E5%9E%8B%E8%AE%BE%E8%AE%A1/%E6%88%AA%E5%9B%BE/%E5%BA%93%E5%AD%98%E7%8E%B0%E6%9C%89%E9%87%8F.png)
- 条码管理
![](https://gitee.com/kutangguo/ktg-mes/raw/master/doc/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3/%E5%8E%9F%E5%9E%8B%E8%AE%BE%E8%AE%A1/%E6%88%AA%E5%9B%BE/%E6%9D%A1%E7%A0%81%E7%AE%A1%E7%90%86.png)
- 设备管理
- 统计报表
![](https://gitee.com/kutangguo/ktg-mes/raw/master/doc/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3/%E5%8E%9F%E5%9E%8B%E8%AE%BE%E8%AE%A1/%E6%88%AA%E5%9B%BE/%E6%8A%A5%E8%A1%A8%E8%AE%BE%E8%AE%A1.png)
- 大屏展示
Android端
- 生产管理
- 质量管理
- 仓储管理
- 设备管理
触控屏端:
- 登录
![](https://gitee.com/kutangguo/ktg-mes/raw/master/doc/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3/%E5%8E%9F%E5%9E%8B%E8%AE%BE%E8%AE%A1/%E6%88%AA%E5%9B%BE/%E8%A7%A6%E6%8E%A7%E5%B1%8F-%E7%99%BB%E5%BD%95%E9%A1%B5%E9%9D%A2.png)
- 生产
- 质量
![](https://gitee.com/kutangguo/ktg-mes/raw/master/doc/%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3/%E5%8E%9F%E5%9E%8B%E8%AE%BE%E8%AE%A1/%E6%88%AA%E5%9B%BE/%E8%A7%A6%E6%8E%A7%E5%B1%8F-%E8%B4%A8%E9%87%8F%E7%AE%A1%E7%90%86.png)
- 工序
- 设备
PDA
- 仓储
- 生产
完整功能清单及简介请参照doc->设计文档->功能设计->《功能清单.xml》
### 安装部署
请参照doc->实施文档
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">工刀具库WMS</h1>
<p align="center">

View File

@ -4,6 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ktg.common.constant.UserConstants;
import com.ktg.mes.wm.domain.vo.AreaVo;
import com.ktg.mes.wm.utils.WmBarCodeUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
@ -47,7 +48,7 @@ public class WmStorageAreaController extends BaseController
public TableDataInfo list(WmStorageArea wmStorageArea)
{
startPage();
List<WmStorageArea> list = wmStorageAreaService.selectWmStorageAreaList(wmStorageArea);
List<AreaVo> list = wmStorageAreaService.selectWmStorageAreaListVo(wmStorageArea);
return getDataTable(list);
}
@ -71,7 +72,7 @@ public class WmStorageAreaController extends BaseController
@GetMapping(value = "/{areaId}")
public AjaxResult getInfo(@PathVariable("areaId") Long areaId)
{
return AjaxResult.success(wmStorageAreaService.selectWmStorageAreaByAreaId(areaId));
return AjaxResult.success(wmStorageAreaService.selectWmStorageAreaByAreaIdVo(areaId));
}
/**

View File

@ -4,6 +4,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ktg.common.constant.UserConstants;
import com.ktg.mes.wm.domain.vo.WmStorageLocationVo;
import com.ktg.mes.wm.service.IWmStorageAreaService;
import com.ktg.mes.wm.utils.WmBarCodeUtil;
import org.springframework.security.access.prepost.PreAuthorize;
@ -52,7 +53,7 @@ public class WmStorageLocationController extends BaseController
public TableDataInfo list(WmStorageLocation wmStorageLocation)
{
startPage();
List<WmStorageLocation> list = wmStorageLocationService.selectWmStorageLocationList(wmStorageLocation);
List<WmStorageLocationVo> list = wmStorageLocationService.selectWmStorageLocationListVo(wmStorageLocation);
return getDataTable(list);
}
@ -76,7 +77,7 @@ public class WmStorageLocationController extends BaseController
@GetMapping(value = "/{locationId}")
public AjaxResult getInfo(@PathVariable("locationId") Long locationId)
{
return AjaxResult.success(wmStorageLocationService.selectWmStorageLocationByLocationId(locationId));
return AjaxResult.success(wmStorageLocationService.selectWmStorageLocationVoByLocationId(locationId));
}
/**

View File

@ -0,0 +1,248 @@
package com.ktg.mes.wm.domain.vo;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
public class AreaVo extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 库位ID */
private Long areaId;
/** 库区名称 */
private String locationName;
/** 上级库位 */
private String superiorName;
/** 库位编码 */
@Excel(name = "库位编码")
private String areaCode;
/** 库位名称 */
@Excel(name = "库位名称")
private String areaName;
/** 库区ID */
@Excel(name = "库区ID")
private Long locationId;
/** 面积 */
@Excel(name = "面积")
private BigDecimal area;
/** 最大载重量 */
@Excel(name = "最大载重量")
private BigDecimal maxLoa;
/** 库位位置X */
@Excel(name = "库位位置X")
private Long positionX;
/** 库位位置y */
@Excel(name = "库位位置y")
private Long positionY;
/** 库位位置z */
@Excel(name = "库位位置z")
private Long positionZ;
/** 是否启用 */
@Excel(name = "是否启用")
private String enableFlag;
private String frozenFlag;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
public void setAreaId(Long areaId)
{
this.areaId = areaId;
}
public Long getAreaId()
{
return areaId;
}
public void setAreaCode(String areaCode)
{
this.areaCode = areaCode;
}
public String getAreaCode()
{
return areaCode;
}
public void setAreaName(String areaName)
{
this.areaName = areaName;
}
public String getAreaName()
{
return areaName;
}
public void setLocationId(Long locationId)
{
this.locationId = locationId;
}
public Long getLocationId()
{
return locationId;
}
public void setArea(BigDecimal area)
{
this.area = area;
}
public BigDecimal getArea()
{
return area;
}
public void setMaxLoa(BigDecimal maxLoa)
{
this.maxLoa = maxLoa;
}
public BigDecimal getMaxLoa()
{
return maxLoa;
}
public void setPositionX(Long positionX)
{
this.positionX = positionX;
}
public Long getPositionX()
{
return positionX;
}
public void setPositionY(Long positionY)
{
this.positionY = positionY;
}
public Long getPositionY()
{
return positionY;
}
public void setPositionZ(Long positionZ)
{
this.positionZ = positionZ;
}
public Long getPositionZ()
{
return positionZ;
}
public void setEnableFlag(String enableFlag)
{
this.enableFlag = enableFlag;
}
public String getEnableFlag()
{
return enableFlag;
}
public String getFrozenFlag() {
return frozenFlag;
}
public void setFrozenFlag(String frozenFlag) {
this.frozenFlag = frozenFlag;
}
public void setAttr1(String attr1)
{
this.attr1 = attr1;
}
public String getAttr1()
{
return attr1;
}
public void setAttr2(String attr2)
{
this.attr2 = attr2;
}
public String getAttr2()
{
return attr2;
}
public void setAttr3(Long attr3)
{
this.attr3 = attr3;
}
public Long getAttr3()
{
return attr3;
}
public void setAttr4(Long attr4)
{
this.attr4 = attr4;
}
public Long getAttr4()
{
return attr4;
}
public String getLocationName() {
return locationName;
}
public void setLocationName(String locationName) {
this.locationName = locationName;
}
public String getSuperiorName() {
return superiorName;
}
public void setSuperiorName(String superiorName) {
this.superiorName = superiorName;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("areaId", getAreaId())
.append("areaCode", getAreaCode())
.append("areaName", getAreaName())
.append("locationId", getLocationId())
.append("area", getArea())
.append("maxLoa", getMaxLoa())
.append("positionX", getPositionX())
.append("positionY", getPositionY())
.append("positionZ", getPositionZ())
.append("enableFlag", getEnableFlag())
.append("remark", getRemark())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,193 @@
package com.ktg.mes.wm.domain.vo;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity;
import com.ktg.mes.wm.domain.WmStorageArea;
import java.math.BigDecimal;
import java.util.List;
/**
* 库区返回结果集
*
*/
public class WmStorageLocationVo extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 库区ID */
private Long locationId;
/** 仓库名称*/
private String warehouseName;
/** 库区编码 */
@Excel(name = "库区编码")
private String locationCode;
/** 库区名称 */
@Excel(name = "库区名称")
private String locationName;
/** 仓库ID */
@Excel(name = "仓库ID")
private Long warehouseId;
/** 面积 */
@Excel(name = "面积")
private BigDecimal area;
/** 是否开启库位管理 */
@Excel(name = "是否开启库位管理")
private String areaFlag;
private String frozenFlag;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
private List<WmStorageArea> children;
public String getWarehouseName() {
return warehouseName;
}
public void setWarehouseName(String warehouseName) {
this.warehouseName = warehouseName;
}
public void setLocationId(Long locationId)
{
this.locationId = locationId;
}
public Long getLocationId()
{
return locationId;
}
public void setLocationCode(String locationCode)
{
this.locationCode = locationCode;
}
public String getLocationCode()
{
return locationCode;
}
public void setLocationName(String locationName)
{
this.locationName = locationName;
}
public String getLocationName()
{
return locationName;
}
public void setWarehouseId(Long warehouseId)
{
this.warehouseId = warehouseId;
}
public Long getWarehouseId()
{
return warehouseId;
}
public void setArea(BigDecimal area)
{
this.area = area;
}
public BigDecimal getArea()
{
return area;
}
public void setAreaFlag(String areaFlag)
{
this.areaFlag = areaFlag;
}
public String getAreaFlag()
{
return areaFlag;
}
public String getFrozenFlag() {
return frozenFlag;
}
public void setFrozenFlag(String frozenFlag) {
this.frozenFlag = frozenFlag;
}
public void setAttr1(String attr1)
{
this.attr1 = attr1;
}
public String getAttr1()
{
return attr1;
}
public void setAttr2(String attr2)
{
this.attr2 = attr2;
}
public String getAttr2()
{
return attr2;
}
public void setAttr3(Long attr3)
{
this.attr3 = attr3;
}
public Long getAttr3()
{
return attr3;
}
public void setAttr4(Long attr4)
{
this.attr4 = attr4;
}
public Long getAttr4()
{
return attr4;
}
public List<WmStorageArea> getChildren() {
return children;
}
public void setChildren(List<WmStorageArea> children) {
this.children = children;
}
@Override
public String toString() {
return "WmStorageLocation{" +
"locationId=" + locationId +
", locationCode='" + locationCode + '\'' +
", locationName='" + locationName + '\'' +
", warehouseId=" + warehouseId +
", area=" + area +
", areaFlag='" + areaFlag + '\'' +
", attr1='" + attr1 + '\'' +
", attr2='" + attr2 + '\'' +
", attr3=" + attr3 +
", attr4=" + attr4 +
", children=" + children +
'}';
}
}

View File

@ -2,6 +2,8 @@ package com.ktg.mes.wm.mapper;
import java.util.List;
import com.ktg.mes.wm.domain.WmStorageArea;
import com.ktg.mes.wm.domain.vo.AreaVo;
import org.apache.ibatis.annotations.Select;
/**
* 库位设置Mapper接口
@ -9,8 +11,13 @@ import com.ktg.mes.wm.domain.WmStorageArea;
* @author yinjinlu
* @date 2022-05-08
*/
public interface WmStorageAreaMapper
public interface WmStorageAreaMapper
{
/**
* 获取所有库位
*/
public List<WmStorageArea> getAll();
/**
* 查询库位设置
*
@ -19,6 +26,14 @@ public interface WmStorageAreaMapper
*/
public WmStorageArea selectWmStorageAreaByAreaId(Long areaId);
/**
* 查询库位Vo设置
*
* @param areaId 库位设置主键
* @return 库位设置
*/
public AreaVo selectWmStorageAreaByAreaIdVo(Long areaId);
/**
* 根据库位编码查询库位
@ -35,6 +50,14 @@ public interface WmStorageAreaMapper
*/
public List<WmStorageArea> selectWmStorageAreaList(WmStorageArea wmStorageArea);
/**
* 查询库位vo设置列表
*
* @param wmStorageArea 库位设置
* @return 库位设置集合
*/
public List<AreaVo> selectWmStorageAreaListVo(WmStorageArea wmStorageArea);
/**
* 新增库位设置
*

View File

@ -2,6 +2,7 @@ package com.ktg.mes.wm.mapper;
import java.util.List;
import com.ktg.mes.wm.domain.WmStorageLocation;
import com.ktg.mes.wm.domain.vo.WmStorageLocationVo;
/**
* 库区设置Mapper接口
@ -19,6 +20,14 @@ public interface WmStorageLocationMapper
*/
public WmStorageLocation selectWmStorageLocationByLocationId(Long locationId);
/**
* 查询库区设置
*
* @param locationId 库区设置主键
* @return 库区设置
*/
public WmStorageLocationVo selectWmStorageLocationByVoLocationId(Long locationId);
/**
* 根据库区编码查询库区
* @param locationCode
@ -34,6 +43,14 @@ public interface WmStorageLocationMapper
*/
public List<WmStorageLocation> selectWmStorageLocationList(WmStorageLocation wmStorageLocation);
/**
* 查询库区Vo设置列表
*
* @param wmStorageLocation 库区设置
* @return 库区设置集合
*/
public List<WmStorageLocationVo> selectWmStorageLocationListVo(WmStorageLocation wmStorageLocation);
public WmStorageLocation checkLocationCodeUnique(WmStorageLocation wmStorageLocation);
public WmStorageLocation checkLocationNameUnique(WmStorageLocation wmStorageLocation);

View File

@ -2,6 +2,7 @@ package com.ktg.mes.wm.service;
import java.util.List;
import com.ktg.mes.wm.domain.WmStorageArea;
import com.ktg.mes.wm.domain.vo.AreaVo;
/**
* 库位设置Service接口
@ -19,6 +20,14 @@ public interface IWmStorageAreaService
*/
public WmStorageArea selectWmStorageAreaByAreaId(Long areaId);
/**
* 查询库位vo设置
*
* @param areaId 库位设置主键
* @return 库位设置
*/
public AreaVo selectWmStorageAreaByAreaIdVo(Long areaId);
/**
* 根据库位编码查询库位
@ -35,6 +44,14 @@ public interface IWmStorageAreaService
*/
public List<WmStorageArea> selectWmStorageAreaList(WmStorageArea wmStorageArea);
/**
* 查询库位Vo列表
*
* @param wmStorageArea 库位设置
* @return 库位设置集合
*/
public List<AreaVo> selectWmStorageAreaListVo(WmStorageArea wmStorageArea);
/**
* 新增库位设置
*

View File

@ -2,6 +2,7 @@ package com.ktg.mes.wm.service;
import java.util.List;
import com.ktg.mes.wm.domain.WmStorageLocation;
import com.ktg.mes.wm.domain.vo.WmStorageLocationVo;
/**
* 库区设置Service接口
@ -19,6 +20,14 @@ public interface IWmStorageLocationService
*/
public WmStorageLocation selectWmStorageLocationByLocationId(Long locationId);
/**
* 查询库区
*
* @param locationId 库区设置主键
* @return 库区设置
*/
public WmStorageLocationVo selectWmStorageLocationVoByLocationId(Long locationId);
/**
* 根据库区编码查询库区
@ -36,6 +45,13 @@ public interface IWmStorageLocationService
*/
public List<WmStorageLocation> selectWmStorageLocationList(WmStorageLocation wmStorageLocation);
/**
* 查询库区Vo设置列表
*
* @param wmStorageLocation 库区设置
* @return 库区设置集合
*/
public List<WmStorageLocationVo> selectWmStorageLocationListVo(WmStorageLocation wmStorageLocation);
/**
* 检查库区编码是否唯一

View File

@ -2,6 +2,7 @@ package com.ktg.mes.wm.service.impl;
import java.util.List;
import com.ktg.common.utils.DateUtils;
import com.ktg.mes.wm.domain.vo.AreaVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktg.mes.wm.mapper.WmStorageAreaMapper;
@ -32,6 +33,21 @@ public class WmStorageAreaServiceImpl implements IWmStorageAreaService
return wmStorageAreaMapper.selectWmStorageAreaByAreaId(areaId);
}
/**
* 查询库位Vo设置
*
* @param areaId 库位设置主键
* @return 库位设置
*/
@Override
public AreaVo selectWmStorageAreaByAreaIdVo(Long areaId)
{
AreaVo areaVo = wmStorageAreaMapper.selectWmStorageAreaByAreaIdVo(areaId);
AreaVo areaVo1 = wmStorageAreaMapper.selectWmStorageAreaByAreaIdVo(Long.parseLong(areaVo.getAttr1()));
areaVo.setSuperiorName(areaVo1.getAreaName());
return areaVo;
}
@Override
public WmStorageArea selectWmStorageAreaByAreaCode(String areaCode) {
return wmStorageAreaMapper.selectWmStorageAreaByAreaCode(areaCode);
@ -49,6 +65,28 @@ public class WmStorageAreaServiceImpl implements IWmStorageAreaService
return wmStorageAreaMapper.selectWmStorageAreaList(wmStorageArea);
}
/**
* 查询库位Vo设置列表
*
* @param wmStorageArea 库位设置
* @return 库位设置
*/
@Override
public List<AreaVo> selectWmStorageAreaListVo(WmStorageArea wmStorageArea)
{
List<AreaVo> areaVos = wmStorageAreaMapper.selectWmStorageAreaListVo(wmStorageArea);
List<WmStorageArea> areaVos1 = wmStorageAreaMapper.getAll();
for (WmStorageArea vo : areaVos1) {
for (AreaVo vo1 : areaVos)
if (vo.getAreaId().toString().equals("")&&vo1.getAttr1().equals("")){
if (vo1.getAttr1().equals(vo.getAreaId().toString()))
vo1.setSuperiorName(vo.getAreaName());
}
}
return areaVos;
}
/**
* 新增库位设置
*

View File

@ -5,6 +5,7 @@ import java.util.List;
import com.ktg.common.constant.UserConstants;
import com.ktg.common.utils.DateUtils;
import com.ktg.common.utils.StringUtils;
import com.ktg.mes.wm.domain.vo.WmStorageLocationVo;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -36,6 +37,17 @@ public class WmStorageLocationServiceImpl implements IWmStorageLocationService
return wmStorageLocationMapper.selectWmStorageLocationByLocationId(locationId);
}
/**
* 查询库区设置
*
* @param locationId 库区设置主键
* @return 库区设置
*/
@Override
public WmStorageLocationVo selectWmStorageLocationVoByLocationId(Long locationId)
{
return wmStorageLocationMapper.selectWmStorageLocationByVoLocationId(locationId);
}
@Override
public WmStorageLocation selectWmStorageLocationByLocationCode(String locationCode) {
return wmStorageLocationMapper.selectWmStorageLocationByLocationCode(locationCode);
@ -53,6 +65,18 @@ public class WmStorageLocationServiceImpl implements IWmStorageLocationService
return wmStorageLocationMapper.selectWmStorageLocationList(wmStorageLocation);
}
/**
* 查询库区Vo设置列表
*
* @param wmStorageLocation 库区设置
* @return 库区设置
*/
@Override
public List<WmStorageLocationVo> selectWmStorageLocationListVo(WmStorageLocation wmStorageLocation)
{
return wmStorageLocationMapper.selectWmStorageLocationListVo(wmStorageLocation);
}
@Override
public String checkLocationCodeUnique(WmStorageLocation wmStorageLocation) {
WmStorageLocation location = wmStorageLocationMapper.checkLocationCodeUnique(wmStorageLocation);

View File

@ -27,6 +27,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
</resultMap>
<resultMap type="AreaVo" id="WmStorageAreaVoResult">
<result property="areaId" column="area_id" />
<result property="areaCode" column="area_code" />
<result property="locationName" column="location_name" />
<result property="areaName" column="area_name" />
<result property="locationId" column="location_id" />
<result property="area" column="area" />
<result property="maxLoa" column="max_loa" />
<result property="positionX" column="position_x" />
<result property="positionY" column="position_y" />
<result property="positionZ" column="position_z" />
<result property="enableFlag" column="enable_flag" />
<result property="frozenFlag" column="frozen_flag" />
<result property="remark" column="remark" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectWmStorageAreaVo">
select area_id, area_code, area_name, location_id, area, max_loa, position_x, position_y, position_z, enable_flag, frozen_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_storage_area
</sql>
@ -45,17 +69,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
</where>
</select>
<select id="selectWmStorageAreaListVo" parameterType="AreaVo" resultMap="WmStorageAreaVoResult">
select w.*,l.location_name from wm_storage_area w join wm_storage_location l on w.location_id = l.location_id
<where>
<if test="areaCode != null and areaCode != ''"> and area_code = #{areaCode}</if>
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
<if test="locationId != null "> and w.location_id = #{locationId}</if>
<if test="area != null "> and area = #{area}</if>
<if test="maxLoa != null "> and max_loa = #{maxLoa}</if>
<if test="positionX != null and positionX !=0 "> and position_x = #{positionX}</if>
<if test="positionY != null and positionY !=0"> and position_y = #{positionY}</if>
<if test="positionZ != null and positionZ !=0"> and position_z = #{positionZ}</if>
<if test="enableFlag != null and enableFlag != ''"> and enable_flag = #{enableFlag}</if>
</where>
</select>
<select id="selectWmStorageAreaByAreaId" parameterType="Long" resultMap="WmStorageAreaResult">
<include refid="selectWmStorageAreaVo"/>
where area_id = #{areaId}
</select>
<select id="selectWmStorageAreaByAreaIdVo" parameterType="Long" resultMap="WmStorageAreaVoResult">
select w.*,l.location_name from wm_storage_area w join wm_storage_location l on w.location_id = l.location_id
where area_id = #{areaId}
</select>
<select id="selectWmStorageAreaByAreaCode" parameterType="String" resultMap="WmStorageAreaResult">
<include refid="selectWmStorageAreaVo"/>
where area_code = #{areaCode}
</select>
<select id="getAll" resultType="com.ktg.mes.wm.domain.WmStorageArea" resultMap="WmStorageAreaResult">
SELECT * FROM wm_storage_area
</select>
<insert id="insertWmStorageArea" parameterType="WmStorageArea" useGeneratedKeys="true" keyProperty="areaId">
insert into wm_storage_area
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -144,7 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteByLocationId" parameterType="Long">
delete form wm_storage_area where location_id = #{locationId}
delete from wm_storage_area where location_id = #{locationId}
</delete>
</mapper>

View File

@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ktg.mes.wm.mapper.WmStorageLocationMapper">
<resultMap type="WmStorageLocation" id="WmStorageLocationResult">
<result property="locationId" column="location_id" />
<result property="locationCode" column="location_code" />
@ -23,6 +23,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
</resultMap>
<resultMap type="WmStorageLocationVo" id="WmStorageLocationVoResult">
<result property="locationId" column="location_id" />
<result property="locationCode" column="location_code" />
<result property="locationName" column="location_name" />
<result property="warehouseId" column="warehouse_id" />
<result property="area" column="area" />
<result property="areaFlag" column="area_flag" />
<result property="frozenFlag" column="frozen_flag" />
<result property="remark" column="remark" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="attr4" column="attr4" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="warehouseName" column="warehouse_name" />
</resultMap>
<sql id="selectWmStorageLocationVo">
select location_id, location_code, location_name, warehouse_id, area, area_flag, frozen_flag, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from wm_storage_location
</sql>
@ -37,11 +57,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="areaFlag != null and areaFlag != ''"> and area_flag = #{areaFlag}</if>
</where>
</select>
<select id="selectWmStorageLocationListVo" parameterType="WmStorageLocation" resultMap="WmStorageLocationVoResult">
SELECT l.*, w.warehouse_name
FROM wm_storage_location l
JOIN wm_warehouse w ON w.warehouse_id = l.warehouse_id
<where>
<if test="locationCode != null and locationCode != ''"> AND l.location_code = #{locationCode}</if>
<if test="locationName != null and locationName != ''"> AND l.location_name LIKE CONCAT('%', #{locationName}, '%')</if>
<if test="warehouseId != null"> AND l.warehouse_id = #{warehouseId}</if> <!-- 指定表别名 -->
<if test="area != null"> AND l.area = #{area}</if>
<if test="areaFlag != null and areaFlag != ''"> AND l.area_flag = #{areaFlag}</if>
</where>
</select>
<select id="selectWmStorageLocationByLocationId" parameterType="Long" resultMap="WmStorageLocationResult">
<include refid="selectWmStorageLocationVo"/>
where location_id = #{locationId}
</select>
<select id="selectWmStorageLocationByVoLocationId" parameterType="Long" resultMap="WmStorageLocationVoResult">
select l.* ,w.warehouse_name from wm_storage_location l
join wm_warehouse w on w.warehouse_id = l.warehouse_id
where location_id = #{locationId}
</select>
<select id="selectWmStorageLocationByLocationCode" parameterType="String" resultMap="WmStorageLocationResult">
<include refid="selectWmStorageLocationVo"/>