diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseStationInfo.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseStationInfo.java index 9ae275bc..92b14ea7 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseStationInfo.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseStationInfo.java @@ -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; } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java index db559a54..b4e86f87 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java @@ -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; + } + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseStationInfoController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseStationInfoController.java index 08530360..d29c6075 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseStationInfoController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesBaseStationInfoController.java @@ -108,8 +108,6 @@ public class MesBaseStationInfoController extends BaseController } - - /** * 查询工位信息列表 */ diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseStationInfoService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseStationInfoService.java index 2cd16ad1..b05c7f70 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseStationInfoService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesBaseStationInfoService.java @@ -59,4 +59,13 @@ public interface IMesBaseStationInfoService * @return 结果 */ public int deleteMesBaseStationInfoByStationId(Long stationId); + + + + /** + * 查询当前登录工位信息 + * + * @return 工位信息 + */ + public MesBaseStationInfo getLoginStationInfo(); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseStationInfoServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseStationInfoServiceImpl.java index c6afeafe..b9b4a0fc 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseStationInfoServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseStationInfoServiceImpl.java @@ -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 selectMesBaseStationInfoList(MesBaseStationInfo mesBaseStationInfo) - { + public List 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; + } } diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/domain/SysNotice.java b/hw-modules/hw-system/src/main/java/com/hw/system/domain/SysNotice.java index c2ef3d7f..73fbdbcb 100644 --- a/hw-modules/hw-system/src/main/java/com/hw/system/domain/SysNotice.java +++ b/hw-modules/hw-system/src/main/java/com/hw/system/domain/SysNotice.java @@ -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 sysUserNoticeList; + + /** + * 前端显示 + * 公告主键List + */ + private List userNoticeList; + + public List getUserNoticeList() { + return userNoticeList; + } + + public void setUserNoticeList(List 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 getSysUserNoticeList() { + return sysUserNoticeList; + } + + public void setSysUserNoticeList(List 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(); } } diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/domain/SysUserNotice.java b/hw-modules/hw-system/src/main/java/com/hw/system/domain/SysUserNotice.java new file mode 100644 index 00000000..5130c1c4 --- /dev/null +++ b/hw-modules/hw-system/src/main/java/com/hw/system/domain/SysUserNotice.java @@ -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(); + } +} diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/mapper/SysNoticeMapper.java b/hw-modules/hw-system/src/main/java/com/hw/system/mapper/SysNoticeMapper.java index 78f2a530..a5c07afe 100644 --- a/hw-modules/hw-system/src/main/java/com/hw/system/mapper/SysNoticeMapper.java +++ b/hw-modules/hw-system/src/main/java/com/hw/system/mapper/SysNoticeMapper.java @@ -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 sysUserNoticeList); + + /** + * 通过通知公告主键删除用户和公告关联信息 + * + * @param noticeId 通知公告ID + * @return 结果 + */ + public int deleteSysUserNoticeByNoticeId(Long noticeId); } \ No newline at end of file diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/service/impl/SysNoticeServiceImpl.java b/hw-modules/hw-system/src/main/java/com/hw/system/service/impl/SysNoticeServiceImpl.java index 6e226c03..6c2b3799 100644 --- a/hw-modules/hw-system/src/main/java/com/hw/system/service/impl/SysNoticeServiceImpl.java +++ b/hw-modules/hw-system/src/main/java/com/hw/system/service/impl/SysNoticeServiceImpl.java @@ -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 sysUserNoticeList = sysNotice.getSysUserNoticeList(); + Long noticeId = sysNotice.getNoticeId(); + if (StringUtils.isNotNull(sysUserNoticeList)) + { + List list = new ArrayList<>(); + for (SysUserNotice sysUserNotice : sysUserNoticeList) + { + sysUserNotice.setNoticeId(noticeId); + list.add(sysUserNotice); + } + if (list.size() > 0) + { + noticeMapper.batchSysUserNotice(list); + } + } + } + } diff --git a/hw-modules/hw-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/hw-modules/hw-system/src/main/resources/mapper/system/SysNoticeMapper.xml index fa7ef918..00073714 100644 --- a/hw-modules/hw-system/src/main/resources/mapper/system/SysNoticeMapper.xml +++ b/hw-modules/hw-system/src/main/resources/mapper/system/SysNoticeMapper.xml @@ -5,26 +5,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - 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 - + 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} - + insert into sys_notice ( notice_title, notice_type, notice_content, status, + station_id, + user_group_id, + attach_path, remark, create_by, create_time @@ -56,6 +81,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{noticeType}, #{noticeContent}, #{status}, + #{stationId}, + #{userGroupId}, + #{attachPath}, #{remark}, #{createBy}, sysdate() @@ -69,6 +97,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" notice_type = #{noticeType}, notice_content = #{noticeContent}, status = #{status}, + station_id = #{stationId}, + user_group_id = #{userGroupId}, + attach_path = #{attachPath}, update_by = #{updateBy}, update_time = sysdate() @@ -85,5 +116,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{noticeId} + + + delete from sys_user_notice where notice_id in + + #{noticeId} + + + + + delete from sys_user_notice where notice_id = #{noticeId} + + + + insert into sys_user_notice( notice_id, user_id) values + + ( #{item.noticeId}, #{item.userId}) + + \ No newline at end of file diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsBaseWarehouseController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsBaseWarehouseController.java index 20f8e415..8d3c120b 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsBaseWarehouseController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsBaseWarehouseController.java @@ -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 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 list = wmsBaseWarehouseService.selectWmsBaseWarehouseJoinList(wmsBaseWarehouse); ExcelUtil util = new ExcelUtil(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 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 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)); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsWarehouseMaterial.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsWarehouseMaterial.java index 05783810..d62e3a35 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsWarehouseMaterial.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/domain/WmsWarehouseMaterial.java @@ -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; diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsWarehouseMaterialService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsWarehouseMaterialService.java index 0459b9fb..6bc8b3c6 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsWarehouseMaterialService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsWarehouseMaterialService.java @@ -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); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java index f56e2fc4..24a24f09 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java @@ -260,11 +260,11 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { String materialBarcode = wmsRawBackVo.getMaterialBarcode(); R 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("物料条码有误"); } //判断此柜体是否已跟拆分门板绑定,如果未绑定不允许返库 diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java index 2cc84f5a..8564740f 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java @@ -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); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsWarehouseMaterialServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsWarehouseMaterialServiceImpl.java index 7fd5ae53..55905547 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsWarehouseMaterialServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsWarehouseMaterialServiceImpl.java @@ -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); diff --git a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsWarehouseMaterialMapper.xml b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsWarehouseMaterialMapper.xml index 85025480..5a44becd 100644 --- a/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsWarehouseMaterialMapper.xml +++ b/hw-modules/hw-wms/src/main/resources/mapper/wms/WmsWarehouseMaterialMapper.xml @@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -17,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 - 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' @@ -87,9 +90,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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 - (#{item.warehouseId},#{item.storageType},#{item.storageId},#{item.createTime},#{item.createBy}) + (#{item.warehouseId},#{item.warehouseFloor},#{item.storageType},#{item.storageId},#{item.createTime},#{item.createBy}) diff --git a/hw-ui/src/views/mes/processInfo/index.vue b/hw-ui/src/views/mes/processInfo/index.vue index 5f2a5b0d..8708da4a 100644 --- a/hw-ui/src/views/mes/processInfo/index.vue +++ b/hw-ui/src/views/mes/processInfo/index.vue @@ -287,7 +287,7 @@