Merge remote-tracking branch 'origin/master'

master
夜笙歌 6 months ago
commit 1dd28a8891

@ -47,7 +47,7 @@ public class MesBaseStationInfo extends BaseEntity {
*
*/
@Excel(name = "楼层")
private Long floor;
private Integer floor;
/**
*
@ -103,11 +103,11 @@ public class MesBaseStationInfo extends BaseEntity {
return processId;
}
public void setFloor(Long floor) {
public void setFloor(Integer floor) {
this.floor = floor;
}
public Long getFloor() {
public Integer getFloor() {
return floor;
}

@ -8,6 +8,7 @@ import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.domain.MesMaterialBom;
import com.hw.mes.domain.MesProductPlan;
import com.hw.mes.domain.MesProductPlanDetail;
@ -29,6 +30,10 @@ import java.util.Map;
@RestController
@RequestMapping("/api")
public class MesApiController extends BaseController {
@Autowired
private IMesBaseStationInfoService mesBaseStationInfoService;
@Autowired
private IMesMaterialBomService mesMaterialBomService;
@ -41,6 +46,18 @@ public class MesApiController extends BaseController {
@Autowired
private IMesBaseBarcodeInfoService mesBaseBarcodeInfoService;
/**
*
*/
@GetMapping("/getLoginStationInfo")
public AjaxResult getLoginStationInfo()
{
MesBaseStationInfo loginStationInfo = mesBaseStationInfoService.getLoginStationInfo();
return success(loginStationInfo);
}
/**
* BOM
*/
@ -222,4 +239,19 @@ public class MesApiController extends BaseController {
return getDataTable(productPlanService.selectMaterialInstallationCircumstance(hashMap));
}
/**
*
*/
@Log(title = "领料", businessType = BusinessType.COMPLETE)
@PostMapping(("/completeCollectMaterials"))
public AjaxResult completeCollectMaterials() {
//todo
/*http://IP:5001/wcs/RecieveRcs/agvComplete 装配区背负式Agv通知任务完成
{
"endStationCode": "string",//工位
}*/
return null;
}
}

@ -108,8 +108,6 @@ public class MesBaseStationInfoController extends BaseController
}
/**
*
*/

@ -59,4 +59,13 @@ public interface IMesBaseStationInfoService
* @return
*/
public int deleteMesBaseStationInfoByStationId(Long stationId);
/**
*
*
* @return
*/
public MesBaseStationInfo getLoginStationInfo();
}

@ -1,7 +1,10 @@
package com.hw.mes.service.impl;
import java.util.List;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.ip.IpUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseStationInfo;
import org.springframework.beans.factory.annotation.Autowired;
@ -16,8 +19,7 @@ import com.hw.mes.service.IMesBaseStationInfoService;
* @date 2024-01-26
*/
@Service
public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
{
public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService {
@Autowired
private MesBaseStationInfoMapper mesBaseStationInfoMapper;
@ -28,8 +30,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
* @return
*/
@Override
public MesBaseStationInfo selectMesBaseStationInfoByStationId(Long stationId)
{
public MesBaseStationInfo selectMesBaseStationInfoByStationId(Long stationId) {
return mesBaseStationInfoMapper.selectMesBaseStationInfoByStationId(stationId);
}
@ -40,8 +41,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
* @return
*/
@Override
public List<MesBaseStationInfo> selectMesBaseStationInfoList(MesBaseStationInfo mesBaseStationInfo)
{
public List<MesBaseStationInfo> selectMesBaseStationInfoList(MesBaseStationInfo mesBaseStationInfo) {
return mesBaseStationInfoMapper.selectMesBaseStationInfoList(mesBaseStationInfo);
}
@ -52,8 +52,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
* @return
*/
@Override
public int insertMesBaseStationInfo(MesBaseStationInfo mesBaseStationInfo)
{
public int insertMesBaseStationInfo(MesBaseStationInfo mesBaseStationInfo) {
mesBaseStationInfo.setCreateTime(DateUtils.getNowDate());
mesBaseStationInfo.setCreateBy(SecurityUtils.getUsername());
return mesBaseStationInfoMapper.insertMesBaseStationInfo(mesBaseStationInfo);
@ -66,8 +65,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
* @return
*/
@Override
public int updateMesBaseStationInfo(MesBaseStationInfo mesBaseStationInfo)
{
public int updateMesBaseStationInfo(MesBaseStationInfo mesBaseStationInfo) {
mesBaseStationInfo.setUpdateTime(DateUtils.getNowDate());
mesBaseStationInfo.setUpdateBy(SecurityUtils.getUsername());
return mesBaseStationInfoMapper.updateMesBaseStationInfo(mesBaseStationInfo);
@ -80,8 +78,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
* @return
*/
@Override
public int deleteMesBaseStationInfoByStationIds(Long[] stationIds)
{
public int deleteMesBaseStationInfoByStationIds(Long[] stationIds) {
return mesBaseStationInfoMapper.deleteMesBaseStationInfoByStationIds(stationIds);
}
@ -92,8 +89,26 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
* @return
*/
@Override
public int deleteMesBaseStationInfoByStationId(Long stationId)
{
public int deleteMesBaseStationInfoByStationId(Long stationId) {
return mesBaseStationInfoMapper.deleteMesBaseStationInfoByStationId(stationId);
}
/**
*
*
* @return
*/
@Override
public MesBaseStationInfo getLoginStationInfo() {
String ipAddress = SecurityUtils.getLoginUser().getIpaddr();
ipAddress = "192.168.2.20";//TODO:正式时需要删除
MesBaseStationInfo mesBaseStationInfo = mesBaseStationInfoMapper.selectMesBaseStationInfoByStationIp(ipAddress);
Integer processFloor = SecurityUtils.getProcessFloor();
if (mesBaseStationInfo != null && mesBaseStationInfo.getFloor() != null && !mesBaseStationInfo.getFloor().equals(processFloor)) {
throw new ServiceException("请在" + processFloor + "楼登录此工序");
}
return mesBaseStationInfo;
}
}

@ -1,102 +1,183 @@
package com.hw.system.domain;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.util.List;
import com.hw.common.core.xss.Xss;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
import com.hw.common.core.xss.Xss;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* sys_notice
*
* @author ruoyi
* sys_notice
*
* @author YinQ
* @date 2024-07-12
*/
public class SysNotice extends BaseEntity
{
public class SysNotice extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 公告ID */
/**
* ID
*/
private Long noticeId;
/** 公告标题 */
/**
*
*/
@Excel(name = "公告标题")
private String noticeTitle;
/** 公告类型1通知 2公告 */
/**
* 1 2
*/
@Excel(name = "公告类型", readConverterExp = "1=通知,2=公告")
private String noticeType;
/** 公告内容 */
/**
*
*/
@Excel(name = "公告内容")
private String noticeContent;
/** 公告状态0正常 1关闭 */
/**
* 0 1
*/
@Excel(name = "公告状态", readConverterExp = "0=正常,1=关闭")
private String status;
public Long getNoticeId()
{
return noticeId;
/**
* ID
*/
@Excel(name = "通知工位ID")
private String stationId;
/**
* ID
*/
@Excel(name = "用户组ID")
private String userGroupId;
/**
*
*/
@Excel(name = "附件路径")
private String attachPath;
/**
*
*/
private List<SysUserNotice> sysUserNoticeList;
/**
*
* List
*/
private List<Long> userNoticeList;
public List<Long> getUserNoticeList() {
return userNoticeList;
}
public void setUserNoticeList(List<Long> userNoticeList) {
this.userNoticeList = userNoticeList;
}
public void setNoticeId(Long noticeId)
{
public void setNoticeId(Long noticeId) {
this.noticeId = noticeId;
}
public void setNoticeTitle(String noticeTitle)
{
public Long getNoticeId() {
return noticeId;
}
public void setNoticeTitle(String noticeTitle) {
this.noticeTitle = noticeTitle;
}
@Xss(message = "公告标题不能包含脚本字符")
@NotBlank(message = "公告标题不能为空")
@Size(min = 0, max = 50, message = "公告标题不能超过50个字符")
public String getNoticeTitle()
{
public String getNoticeTitle() {
return noticeTitle;
}
public void setNoticeType(String noticeType)
{
public void setNoticeType(String noticeType) {
this.noticeType = noticeType;
}
public String getNoticeType()
{
public String getNoticeType() {
return noticeType;
}
public void setNoticeContent(String noticeContent)
{
public void setNoticeContent(String noticeContent) {
this.noticeContent = noticeContent;
}
public String getNoticeContent()
{
public String getNoticeContent() {
return noticeContent;
}
public void setStatus(String status)
{
public void setStatus(String status) {
this.status = status;
}
public String getStatus()
{
public String getStatus() {
return status;
}
public void setStationId(String stationId) {
this.stationId = stationId;
}
public String getStationId() {
return stationId;
}
public void setUserGroupId(String userGroupId) {
this.userGroupId = userGroupId;
}
public String getUserGroupId() {
return userGroupId;
}
public void setAttachPath(String attachPath) {
this.attachPath = attachPath;
}
public String getAttachPath() {
return attachPath;
}
public List<SysUserNotice> getSysUserNoticeList() {
return sysUserNoticeList;
}
public void setSysUserNoticeList(List<SysUserNotice> sysUserNoticeList) {
this.sysUserNoticeList = sysUserNoticeList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("noticeId", getNoticeId())
.append("noticeTitle", getNoticeTitle())
.append("noticeType", getNoticeType())
.append("noticeContent", getNoticeContent())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("noticeId", getNoticeId())
.append("noticeTitle", getNoticeTitle())
.append("noticeType", getNoticeType())
.append("noticeContent", getNoticeContent())
.append("status", getStatus())
.append("stationId", getStationId())
.append("userGroupId", getUserGroupId())
.append("attachPath", getAttachPath())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("sysUserNoticeList", getSysUserNoticeList())
.toString();
}
}

@ -0,0 +1,115 @@
package com.hw.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
/**
* sys_user_notice
*
* @author YinQ
* @date 2024-07-12
*/
public class SysUserNotice extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long noticeId;
/**
* ID
*/
private Long userId;
/**
* 0 1
*/
@Excel(name = "查看状态", readConverterExp = "0=未查看,1=已查看")
private String checkStatus;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "查看时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date checkTime;
/**
* 0 1
*/
@Excel(name = "下载状态", readConverterExp = "0=未下载,1=已下载")
private String downloadStatus;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "下载时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date downloadTime;
public void setNoticeId(Long noticeId) {
this.noticeId = noticeId;
}
public Long getNoticeId() {
return noticeId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getUserId() {
return userId;
}
public void setCheckStatus(String checkStatus) {
this.checkStatus = checkStatus;
}
public String getCheckStatus() {
return checkStatus;
}
public void setCheckTime(Date checkTime) {
this.checkTime = checkTime;
}
public Date getCheckTime() {
return checkTime;
}
public void setDownloadStatus(String downloadStatus) {
this.downloadStatus = downloadStatus;
}
public String getDownloadStatus() {
return downloadStatus;
}
public void setDownloadTime(Date downloadTime) {
this.downloadTime = downloadTime;
}
public Date getDownloadTime() {
return downloadTime;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("noticeId", getNoticeId())
.append("userId", getUserId())
.append("checkStatus", getCheckStatus())
.append("checkTime", getCheckTime())
.append("downloadStatus", getDownloadStatus())
.append("downloadTime", getDownloadTime())
.toString();
}
}

@ -2,6 +2,7 @@ package com.hw.system.mapper;
import java.util.List;
import com.hw.system.domain.SysNotice;
import com.hw.system.domain.SysUserNotice;
/**
*
@ -57,4 +58,28 @@ public interface SysNoticeMapper
* @return
*/
public int deleteNoticeByIds(Long[] noticeIds);
/**
*
*
* @param noticeIds
* @return
*/
public int deleteSysUserNoticeByNoticeIds(Long[] noticeIds);
/**
*
*
* @param sysUserNoticeList
* @return
*/
public int batchSysUserNotice(List<SysUserNotice> sysUserNoticeList);
/**
*
*
* @param noticeId ID
* @return
*/
public int deleteSysUserNoticeByNoticeId(Long noticeId);
}

@ -1,11 +1,17 @@
package com.hw.system.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.hw.common.core.utils.StringUtils;
import com.hw.system.common.mapper.SysPointRouterMapper;
import com.hw.system.domain.SysUserNotice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.system.domain.SysNotice;
import com.hw.system.mapper.SysNoticeMapper;
import com.hw.system.service.ISysNoticeService;
import org.springframework.transaction.annotation.Transactional;
/**
*
@ -18,6 +24,9 @@ public class SysNoticeServiceImpl implements ISysNoticeService
@Autowired
private SysNoticeMapper noticeMapper;
@Autowired
private SysPointRouterMapper pointRouterMapper;
/**
*
*
@ -48,10 +57,13 @@ public class SysNoticeServiceImpl implements ISysNoticeService
* @param notice
* @return
*/
@Transactional
@Override
public int insertNotice(SysNotice notice)
{
return noticeMapper.insertNotice(notice);
int rows = noticeMapper.insertNotice(notice);
insertSysUserNotice(notice);
return rows;
}
/**
@ -60,9 +72,12 @@ public class SysNoticeServiceImpl implements ISysNoticeService
* @param notice
* @return
*/
@Transactional
@Override
public int updateNotice(SysNotice notice)
{
noticeMapper.deleteSysUserNoticeByNoticeId(notice.getNoticeId());
insertSysUserNotice(notice);
return noticeMapper.updateNotice(notice);
}
@ -72,9 +87,11 @@ public class SysNoticeServiceImpl implements ISysNoticeService
* @param noticeId ID
* @return
*/
@Transactional
@Override
public int deleteNoticeById(Long noticeId)
{
noticeMapper.deleteSysUserNoticeByNoticeId(noticeId);
return noticeMapper.deleteNoticeById(noticeId);
}
@ -84,9 +101,36 @@ public class SysNoticeServiceImpl implements ISysNoticeService
* @param noticeIds ID
* @return
*/
@Transactional
@Override
public int deleteNoticeByIds(Long[] noticeIds)
{
noticeMapper.deleteSysUserNoticeByNoticeIds(noticeIds);
return noticeMapper.deleteNoticeByIds(noticeIds);
}
/**
*
*
* @param sysNotice
*/
public void insertSysUserNotice(SysNotice sysNotice)
{
List<SysUserNotice> sysUserNoticeList = sysNotice.getSysUserNoticeList();
Long noticeId = sysNotice.getNoticeId();
if (StringUtils.isNotNull(sysUserNoticeList))
{
List<SysUserNotice> list = new ArrayList<>();
for (SysUserNotice sysUserNotice : sysUserNoticeList)
{
sysUserNotice.setNoticeId(noticeId);
list.add(sysUserNotice);
}
if (list.size() > 0)
{
noticeMapper.batchSysUserNotice(list);
}
}
}
}

@ -5,26 +5,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.hw.system.mapper.SysNoticeMapper">
<resultMap type="SysNotice" id="SysNoticeResult">
<result property="noticeId" column="notice_id" />
<result property="noticeId" column="notice_id" />
<result property="noticeTitle" column="notice_title" />
<result property="noticeType" column="notice_type" />
<result property="noticeContent" column="notice_content" />
<result property="status" column="status" />
<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="remark" column="remark" />
<result property="noticeType" column="notice_type" />
<result property="noticeContent" column="notice_content" />
<result property="status" column="status" />
<result property="stationId" column="station_id" />
<result property="userGroupId" column="user_group_id" />
<result property="attachPath" column="attach_path" />
<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="remark" column="remark" />
</resultMap>
<resultMap id="SysNoticeSysUserNoticeResult" type="SysNotice" extends="SysNoticeResult">
<collection property="sysUserNoticeList" notNullColumn="sub_notice_id" javaType="java.util.List" resultMap="SysUserNoticeResult" />
<collection property="userNoticeList" ofType="java.lang.Long">
<id column="sub_user_id" property="userNoticeList" />
</collection>
</resultMap>
<resultMap type="SysUserNotice" id="SysUserNoticeResult">
<result property="noticeId" column="sub_notice_id" />
<result property="userId" column="sub_user_id" />
<result property="checkStatus" column="sub_check_status" />
<result property="checkTime" column="sub_check_time" />
<result property="downloadStatus" column="sub_download_status" />
<result property="downloadTime" column="sub_download_time" />
</resultMap>
<sql id="selectNoticeVo">
select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark
select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, station_id, user_group_id, attach_path, create_by, create_time, update_by, update_time, remark
from sys_notice
</sql>
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
<include refid="selectNoticeVo"/>
where notice_id = #{noticeId}
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeSysUserNoticeResult">
select a.notice_id, a.notice_title, a.notice_type, a.notice_content, a.status, a.station_id, a.user_group_id, a.attach_path, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
b.notice_id as sub_notice_id, b.user_id as sub_user_id, b.check_status as sub_check_status, b.check_time as sub_check_time, b.download_status as sub_download_status, b.download_time as sub_download_time
from sys_notice a
left join sys_user_notice b on b.notice_id = a.notice_id
where a.notice_id = #{noticeId}
</select>
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
@ -42,12 +64,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<insert id="insertNotice" parameterType="SysNotice">
<insert id="insertNotice" parameterType="SysNotice" useGeneratedKeys="true" keyProperty="noticeId">
insert into sys_notice (
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
<if test="status != null and status != '' ">status, </if>
<if test="stationId != null">station_id,</if>
<if test="userGroupId != null">user_group_id,</if>
<if test="attachPath != null">attach_path,</if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
@ -56,6 +81,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
<if test="status != null and status != ''">#{status}, </if>
<if test="stationId != null">#{stationId},</if>
<if test="userGroupId != null">#{userGroupId},</if>
<if test="attachPath != null and attachPath != ''">#{attachPath},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
@ -69,6 +97,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
<if test="noticeContent != null">notice_content = #{noticeContent}, </if>
<if test="status != null and status != ''">status = #{status}, </if>
<if test="stationId != null">station_id = #{stationId},</if>
<if test="userGroupId != null">user_group_id = #{userGroupId},</if>
<if test="attachPath != null">attach_path = #{attachPath},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
@ -85,5 +116,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{noticeId}
</foreach>
</delete>
<delete id="deleteSysUserNoticeByNoticeIds" parameterType="String">
delete from sys_user_notice where notice_id in
<foreach item="noticeId" collection="array" open="(" separator="," close=")">
#{noticeId}
</foreach>
</delete>
<delete id="deleteSysUserNoticeByNoticeId" parameterType="Long">
delete from sys_user_notice where notice_id = #{noticeId}
</delete>
<insert id="batchSysUserNotice">
insert into sys_user_notice( notice_id, user_id) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.noticeId}, #{item.userId})
</foreach>
</insert>
</mapper>

@ -35,8 +35,7 @@ import com.hw.common.core.web.page.TableDataInfo;
*/
@RestController
@RequestMapping("/wmswarehouse")
public class WmsBaseWarehouseController extends BaseController
{
public class WmsBaseWarehouseController extends BaseController {
@Autowired
private IWmsBaseWarehouseService wmsBaseWarehouseService;
@ -51,8 +50,7 @@ public class WmsBaseWarehouseController extends BaseController
*/
@RequiresPermissions("wms:wmswarehouse:list")
@GetMapping("/list")
public TableDataInfo list(WmsBaseWarehouse wmsBaseWarehouse)
{
public TableDataInfo list(WmsBaseWarehouse wmsBaseWarehouse) {
startPage();
List<WmsBaseWarehouse> list = wmsBaseWarehouseService.selectWmsBaseWarehouseJoinList(wmsBaseWarehouse);
return getDataTable(list);
@ -64,8 +62,7 @@ public class WmsBaseWarehouseController extends BaseController
@RequiresPermissions("wms:wmswarehouse:export")
@Log(title = "仓库管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, WmsBaseWarehouse wmsBaseWarehouse)
{
public void export(HttpServletResponse response, WmsBaseWarehouse wmsBaseWarehouse) {
List<WmsBaseWarehouse> list = wmsBaseWarehouseService.selectWmsBaseWarehouseJoinList(wmsBaseWarehouse);
ExcelUtil<WmsBaseWarehouse> util = new ExcelUtil<WmsBaseWarehouse>(WmsBaseWarehouse.class);
util.exportExcel(response, list, "仓库数据");
@ -76,8 +73,7 @@ public class WmsBaseWarehouseController extends BaseController
*/
@RequiresPermissions("wms:wmswarehouse:query")
@GetMapping(value = "/{warehouseId}")
public AjaxResult getInfo(@PathVariable("warehouseId") Long warehouseId)
{
public AjaxResult getInfo(@PathVariable("warehouseId") Long warehouseId) {
return success(wmsBaseWarehouseService.selectWmsBaseWarehouseByWarehouseId(warehouseId));
}
@ -87,8 +83,7 @@ public class WmsBaseWarehouseController extends BaseController
@RequiresPermissions("wms:wmswarehouse:add")
@Log(title = "仓库管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WmsBaseWarehouse wmsBaseWarehouse)
{
public AjaxResult add(@RequestBody WmsBaseWarehouse wmsBaseWarehouse) {
return toAjax(wmsBaseWarehouseService.insertWmsBaseWarehouse(wmsBaseWarehouse));
}
@ -98,8 +93,7 @@ public class WmsBaseWarehouseController extends BaseController
@RequiresPermissions("wms:wmswarehouse:edit")
@Log(title = "仓库管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WmsBaseWarehouse wmsBaseWarehouse)
{
public AjaxResult edit(@RequestBody WmsBaseWarehouse wmsBaseWarehouse) {
return toAjax(wmsBaseWarehouseService.updateWmsBaseWarehouse(wmsBaseWarehouse));
}
@ -108,9 +102,8 @@ public class WmsBaseWarehouseController extends BaseController
*/
@RequiresPermissions("wms:wmswarehouse:remove")
@Log(title = "仓库管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{warehouseIds}")
public AjaxResult remove(@PathVariable Long[] warehouseIds)
{
@DeleteMapping("/{warehouseIds}")
public AjaxResult remove(@PathVariable Long[] warehouseIds) {
//todo:判断是否有引用或者改为状态9
return toAjax(wmsBaseWarehouseService.deleteWmsBaseWarehouseByWarehouseIds(warehouseIds));
}
@ -121,8 +114,7 @@ public class WmsBaseWarehouseController extends BaseController
*/
@RequiresPermissions("wms:wmswarehouse:list")
@GetMapping("/getWarehouseCategories")
public AjaxResult getWarehouseCategories(WmsBaseCategory wmsBaseCategory)
{
public AjaxResult getWarehouseCategories(WmsBaseCategory wmsBaseCategory) {
List<WmsBaseCategory> list = wmsBaseCategoryService.selectWmsBaseCategoryList(wmsBaseCategory);
return success(list);
}
@ -132,8 +124,7 @@ public class WmsBaseWarehouseController extends BaseController
*/
@RequiresPermissions("wms:wmswarehouse:materialallocate")
@GetMapping("/selectWmsWarehouseMaterialList")
public TableDataInfo selectWmsWarehouseMaterialList(WmsWarehouseMaterial wmsWarehouseMaterial)
{
public TableDataInfo selectWmsWarehouseMaterialList(WmsWarehouseMaterial wmsWarehouseMaterial) {
startPage();
List<WmsWarehouseMaterial> warehouseMaterials = wmsWarehouseMaterialService.selectWmsWarehouseMaterialJoinList(wmsWarehouseMaterial);
return getDataTable(warehouseMaterials);
@ -145,9 +136,8 @@ public class WmsBaseWarehouseController extends BaseController
@RequiresPermissions("wms:wmswarehouse:materialallocate")
@Log(title = "仓库管理", businessType = BusinessType.ALLOCATE)
@PutMapping("/allocateMaterials")
public AjaxResult allocateMaterials(Long warehouseId, Long[] materialIds)
{
wmsWarehouseMaterialService.batchInsertWarehouseMaterial(warehouseId, materialIds);
public AjaxResult allocateMaterials(Long warehouseId, Integer warehouseFloor, Long[] materialIds) {
wmsWarehouseMaterialService.batchInsertWarehouseMaterial(warehouseId, warehouseFloor, materialIds);
return success();
}
@ -158,8 +148,7 @@ public class WmsBaseWarehouseController extends BaseController
@RequiresPermissions("wms:wmswarehouse:materialallocate")
@Log(title = "仓库管理", businessType = BusinessType.UNALLOCATE)
@PostMapping("/unallocateMaterials")
public AjaxResult unallocateMaterials(Long[] warehouseMaterialIds)
{
public AjaxResult unallocateMaterials(Long[] warehouseMaterialIds) {
return toAjax(wmsWarehouseMaterialService.deleteWmsWarehouseMaterialByWarehouseMaterialIds(warehouseMaterialIds));
}

@ -20,6 +20,8 @@ public class WmsWarehouseMaterial extends BaseEntity
/** 仓库ID */
private Long warehouseId;
private Integer warehouseFloor;
/** 库位编码;单独需要针对库位设置的,后续扩展使用 */
private String locationCode;
@ -50,6 +52,15 @@ public class WmsWarehouseMaterial extends BaseEntity
{
return warehouseId;
}
public Integer getWarehouseFloor() {
return warehouseFloor;
}
public void setWarehouseFloor(Integer warehouseFloor) {
this.warehouseFloor = warehouseFloor;
}
public void setLocationCode(String locationCode)
{
this.locationCode = locationCode;

@ -71,8 +71,9 @@ public interface IWmsWarehouseMaterialService
/**
*
*
* @param warehouseId ID
* @param materialIds
* @param warehouseId ID
* @param warehouseFloor
* @param materialIds
*/
public void batchInsertWarehouseMaterial(Long warehouseId, Long[] materialIds);
public void batchInsertWarehouseMaterial(Long warehouseId, Integer warehouseFloor, Long[] materialIds);
}

@ -260,11 +260,11 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
String materialBarcode = wmsRawBackVo.getMaterialBarcode();
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料码有误");
throw new ServiceException("物料码有误");
}
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) {
throw new ServiceException("物料码有误");
throw new ServiceException("物料码有误");
}
//判断此柜体是否已跟拆分门板绑定,如果未绑定不允许返库

@ -538,8 +538,8 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsStockTotal.setUpdateBy(userName);
wmsStockTotalMapper.updateWmsStockTotal(wmsStockTotal);
WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(baseWarehouse, planCode, planDetailCode,
rawOutstockDetail.getMaterialId(), taskCode, taskType, wmsRawOutstock.getApplyReason(),
WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(baseWarehouse, wmsRawOutstock,
rawOutstockDetail.getMaterialId(), taskCode, taskType,
planAmount, currentDate, userName, wmsStockTotal.getStockTotalId());
toInsertedRawOutstocks.add(toInsertedRawOutstock);
@ -562,8 +562,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
*
*
* @param baseWarehouse
* @param planCode
* @param planDetailCode
* @param wmsRawOutstockParam
* @param materialId
* @param taskCode
* @param planAmount
@ -571,8 +570,8 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
* @param userName
* @return
*/
private WmsRawOutstock getWmsRawOutstock(WmsBaseWarehouse baseWarehouse,
String planCode, String planDetailCode, Long materialId, String taskCode, String taskType, String applyReason,
private WmsRawOutstock getWmsRawOutstock(WmsBaseWarehouse baseWarehouse, WmsRawOutstock wmsRawOutstockParam,
Long materialId, String taskCode, String taskType,
BigDecimal planAmount, Date currentDate, String userName, Long stockTotalId) {
//出库要求 0申请出库1申请审核出库2直接出库
String outRequirement = baseWarehouse.getOutRequirement();
@ -596,18 +595,18 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
toInsertedRawOutstock.setTaskCode(taskCode);
toInsertedRawOutstock.setWarehouseId(baseWarehouse.getWarehouseId());
// toInsertedRawOutstock.setLocationCode(wmsRawStock.getLocationCode());
toInsertedRawOutstock.setStationId(SecurityUtils.getStationId());
toInsertedRawOutstock.setStationId(wmsRawOutstockParam.getStationId());
toInsertedRawOutstock.setStockTotalId(stockTotalId);
// toInsertedRawOutstock.setPalletInfoCode(wmsRawStock.getPalletInfoCode());
toInsertedRawOutstock.setOperationType(operationType);
toInsertedRawOutstock.setApplyBy(userName);
toInsertedRawOutstock.setApplyReason(applyReason);
toInsertedRawOutstock.setApplyReason(wmsRawOutstockParam.getApplyReason());
toInsertedRawOutstock.setApplyDate(currentDate);
toInsertedRawOutstock.setEndStationCode(SecurityUtils.getStationCode());
toInsertedRawOutstock.setEndStationCode(wmsRawOutstockParam.getEndStationCode());
toInsertedRawOutstock.setMaterialId(materialId);
toInsertedRawOutstock.setOutstockAmount(planAmount);
toInsertedRawOutstock.setPlanCode(planCode);
toInsertedRawOutstock.setPlanDetailCode(planDetailCode);
toInsertedRawOutstock.setPlanCode(wmsRawOutstockParam.getPlanCode());
toInsertedRawOutstock.setPlanDetailCode(wmsRawOutstockParam.getPlanDetailCode());
// toInsertedRawOutstock.setMaterialBatch(wmsRawStock.getInstockBatch());//申请出库时不指定某个物料
toInsertedRawOutstock.setTaskType(taskType);
toInsertedRawOutstock.setCreateTime(currentDate);
@ -634,7 +633,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
}
wmsRawOutstock.setTaskCode(Seq.getId(Seq.rawOutstockSeqType, Seq.rawOutstockSeqCode));
wmsRawOutstock.setStationId(SecurityUtils.getStationId());
// wmsRawOutstock.setStationId(SecurityUtils.getStationId());
wmsRawOutstock.setOperationType(operationType);
wmsRawOutstock.setApplyBy(userName);
@ -650,12 +649,12 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
toInsertedRawOutstock.setTaskCode(Seq.getId(Seq.rawOutstockSeqType, Seq.rawOutstockSeqCode));
toInsertedRawOutstock.setWarehouseId(wmsRawOutstock.getWarehouseId());
toInsertedRawOutstock.setLocationCode(wmsRawOutstockDetail.getLocationCode());
toInsertedRawOutstock.setStationId(SecurityUtils.getStationId());
// toInsertedRawOutstock.setStationId(SecurityUtils.getStationId());
toInsertedRawOutstock.setPalletInfoCode(wmsRawOutstockDetail.getPalletInfoCode());
toInsertedRawOutstock.setOperationType(operationType);
toInsertedRawOutstock.setApplyBy(userName);
toInsertedRawOutstock.setApplyDate(currentDate);
toInsertedRawOutstock.setEndStationCode(SecurityUtils.getStationCode());
// toInsertedRawOutstock.setEndStationCode(SecurityUtils.getStationCode());
toInsertedRawOutstock.setPlanCode(wmsRawOutstock.getPlanCode());
toInsertedRawOutstock.setPlanDetailCode(wmsRawOutstock.getPlanDetailCode());
toInsertedRawOutstock.setMaterialBatch(wmsRawOutstockDetail.getInstockBatch());
@ -1120,7 +1119,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawOutstock.setTaskCode(Seq.getId(Seq.rawOutstockSeqType, Seq.rawOutstockSeqCode));
wmsRawOutstock.setWarehouseId(baseLocation.getWarehouseId());
wmsRawOutstock.setStationId(SecurityUtils.getStationId());
// wmsRawOutstock.setStationId(SecurityUtils.getStationId());
wmsRawOutstock.setMaterialId(baseBarcodeInfo.getMaterialId());
wmsRawOutstock.setMaterialBatch(baseBarcodeInfo.getBatchCode());
wmsRawOutstock.setRealOutstockAmount(outstockAmount);

@ -107,11 +107,12 @@ public class WmsWarehouseMaterialServiceImpl implements IWmsWarehouseMaterialSer
/**
*
*
* @param warehouseId ID
* @param materialIds
* @param warehouseId ID
* @param warehouseFloor
* @param materialIds
*/
@Override
public void batchInsertWarehouseMaterial(Long warehouseId, Long[] materialIds) {
public void batchInsertWarehouseMaterial(Long warehouseId, Integer warehouseFloor, Long[] materialIds) {
if (StringUtils.isNotEmpty(materialIds)) {
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
@ -120,6 +121,7 @@ public class WmsWarehouseMaterialServiceImpl implements IWmsWarehouseMaterialSer
for (Long materialId : materialIds) {
WmsWarehouseMaterial warehouseMaterial = new WmsWarehouseMaterial();
warehouseMaterial.setWarehouseId(warehouseId);
warehouseMaterial.setWarehouseFloor(warehouseFloor);
warehouseMaterial.setStorageType(WmsConstants.WMS_WAREHOUSE_MATERIAL_STORAGE_TYPE_MATERIAL);
warehouseMaterial.setStorageId(materialId);
warehouseMaterial.setCreateBy(userName);

@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="WmsWarehouseMaterial" id="WmsWarehouseMaterialResult">
<result property="warehouseMaterialId" column="warehouse_material_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseFloor" column="warehouse_floor" />
<result property="locationCode" column="location_code" />
<result property="storageType" column="storage_type" />
<result property="storageId" column="storage_id" />
@ -17,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectWmsWarehouseMaterialVo">
select warehouse_id, location_code, storage_type, storage_id, create_time, create_by from wms_warehouse_material
select warehouse_id,warehouse_floor, location_code, storage_type, storage_id, create_time, create_by from wms_warehouse_material
</sql>
<select id="selectWmsWarehouseMaterialList" parameterType="WmsWarehouseMaterial" resultMap="WmsWarehouseMaterialResult">
@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into wms_warehouse_material
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="warehouseId != null">warehouse_id,</if>
<if test="warehouseFloor != null">warehouse_floor,</if>
<if test="locationCode != null">location_code,</if>
<if test="storageType != null">storage_type,</if>
<if test="storageId != null">storage_id,</if>
@ -43,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warehouseId != null">#{warehouseId},</if>
<if test="warehouseFloor != null">#{warehouseFloor},</if>
<if test="locationCode != null">#{locationCode},</if>
<if test="storageType != null">#{storageType},</if>
<if test="storageId != null">#{storageId},</if>
@ -78,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWmsWarehouseMaterialJoinList" parameterType="WmsWarehouseMaterial" resultMap="WmsWarehouseMaterialResult">
select wwm.warehouse_material_id,wwm.warehouse_id, wwm.location_code, wwm.storage_type, wwm.storage_id, wwm.create_time, wwm.create_by,
select wwm.warehouse_material_id,wwm.warehouse_id, wwm.warehouse_floor,wwm.location_code, wwm.storage_type, wwm.storage_id, wwm.create_time, wwm.create_by,
mbm.material_code,mbm.material_name
from wms_warehouse_material wwm left join mes_base_material_info mbm on wwm.storage_id=mbm.material_id and wwm.storage_type='1'
<where>
@ -87,9 +90,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="batchInsertWarehouseMaterial">
insert into wms_warehouse_material(warehouse_id, storage_type,storage_id,create_time,create_by) values
insert into wms_warehouse_material(warehouse_id,warehouse_floor, storage_type,storage_id,create_time,create_by) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.warehouseId},#{item.storageType},#{item.storageId},#{item.createTime},#{item.createBy})
(#{item.warehouseId},#{item.warehouseFloor},#{item.storageType},#{item.storageId},#{item.createTime},#{item.createBy})
</foreach>
</insert>

@ -287,7 +287,7 @@
<el-table-column label="序号" align="center" prop="index"/>
<el-table-column label="关联人员" align="center" prop="prodlineId">
<template slot-scope="scope">
<el-select v-model="scope.row.userId" filterable placeholder="请选择关联人员" clearable>
<el-select v-model="scope.row.userId" filterable placeholder="请选择关联人员" clearable @input="handleSelectUser(scope.row)">
<el-option
v-for="item in userList"
:key="item.userId"
@ -616,7 +616,13 @@ export default {
obj.userName = "";
this.mesBaseProcessUserList.push(obj);
},
//username
handleSelectUser(){
const selected = this.userList.find(option => option.value === newValue);
},
/** 工序关联人员删除按钮操作 */
handleDeleteMesBaseProcessUser() {
if (this.checkedMesBaseProcessUser.length == 0) {
this.$modal.msgError("请先选择要删除的工序关联人员数据");

@ -143,7 +143,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
@ -154,9 +154,22 @@
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="通知用户" v-if="userVisible">
<el-select v-model="form.userNoticeList" placeholder="请选择通知用户" multiple>
<el-option
v-for="item in userList"
:key="item.userId"
:label="item.nickName"
:value="item.userId"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="内容">
<editor v-model="form.noticeContent" :min-height="192"/>
<fileUpload v-model="form.attachPath"/>
</el-form-item>
</el-col>
</el-row>
@ -171,6 +184,7 @@
<script>
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
import {findUserList} from "@/api/system/user";
export default {
name: "Notice",
@ -187,6 +201,8 @@ export default {
multiple: true,
//
showSearch: true,
//
userVisible: false,
//
total: 0,
//
@ -213,9 +229,19 @@ export default {
noticeType: [
{ required: true, message: "公告类型不能为空", trigger: "change" }
]
}
},
//List
userList: []
};
},
watch: {
// form.noticeType
'form.noticeType': {
handler(val) {
this.userVisible = (val === '1');
},
}
},
created() {
this.getList();
},
@ -241,6 +267,8 @@ export default {
noticeTitle: undefined,
noticeType: undefined,
noticeContent: undefined,
sysUserNoticeList: [],
userNoticeList: [],
status: "0"
};
this.resetForm("form");
@ -264,12 +292,18 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.reset();
findUserList({}).then(response => {
this.userList = response.data;
});
this.open = true;
this.title = "添加公告";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
findUserList({}).then(response => {
this.userList = response.data;
});
const noticeId = row.noticeId || this.ids
getNotice(noticeId).then(response => {
this.form = response.data;
@ -279,6 +313,12 @@ export default {
},
/** 提交按钮 */
submitForm: function() {
if (this.form.userNoticeList.length > 0){
this.form.sysUserNoticeList = this.form.userNoticeList.map(userId => ({ userId }));
}
if (this.form.noticeType == '2'){
this.form.sysUserNoticeList = this.userList.map(user => ({ userId: user.userId }));
}
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.noticeId != undefined) {
@ -309,4 +349,4 @@ export default {
}
}
};
</script>
</script>

@ -212,6 +212,7 @@ export default {
this.materialQueryParams.warehouseId = warehouseId;
this.warehouseInfoForm.warehouseCode = this.$route.query && this.$route.query.warehouseCode;
this.warehouseInfoForm.warehouseName = this.$route.query && this.$route.query.warehouseName;
this.warehouseInfoForm.warehouseFloor = this.$route.query && this.$route.query.warehouseFloor;
this.getAllocateMaterialList();
this.getMaterialList();
@ -293,8 +294,9 @@ export default {
submitForm() {
this.allocateMaterialBtnDisable = true;
const warehouseId = this.allocateMaterialQueryParams.warehouseId;
const warehouseFloor = this.warehouseInfoForm.warehouseFloor;
const materialIds = this.materialIds.join(",");
allocateMaterials({ warehouseId: warehouseId, materialIds: materialIds }).then((response) => {
allocateMaterials({ warehouseId: warehouseId, warehouseFloor:warehouseFloor, materialIds: materialIds }).then((response) => {
this.$modal.msgSuccess("保存成功");
this.getAllocateMaterialList();
this.getMaterialList();

@ -738,7 +738,8 @@ export default {
const warehouseId = row.warehouseId;
const warehouseName = row.warehouseName;
const warehouseCode = row.warehouseCode;
const params = {warehouseCode:warehouseCode,warehouseName:warehouseName};
const warehouseFloor = row.warehouseFloor;
const params = {warehouseCode:warehouseCode,warehouseName:warehouseName,warehouseFloor:warehouseFloor};
this.$tab.openPage("仓库物料配置[" + warehouseName + "]", '/warehouse/allocateMaterial/index/' + warehouseId, params);
},

Loading…
Cancel
Save