车间mes:
登录:按照工序登录
派工信息:根据工序和登录用户获取派工信息
master
xs 4 months ago
parent acce22d755
commit a832e6550c

@ -5,6 +5,7 @@ import com.hw.common.core.constant.ServiceNameConstants;
import com.hw.common.core.domain.R; import com.hw.common.core.domain.R;
import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo; import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesBaseProcessInfo;
import com.hw.mes.api.domain.MesBaseStationInfo; import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo; import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo;
import com.hw.mes.api.factory.RemoteMesFallbackFactory; import com.hw.mes.api.factory.RemoteMesFallbackFactory;
@ -59,4 +60,13 @@ public interface RemoteMesService {
@GetMapping("/barcode/getBarcodeByBindBarcode/{bindBarcode}") @GetMapping("/barcode/getBarcodeByBindBarcode/{bindBarcode}")
public R<MesBaseBarcodeInfo> getBarcodeByBindBarcode(@PathVariable("bindBarcode") String bindBarcode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); public R<MesBaseBarcodeInfo> getBarcodeByBindBarcode(@PathVariable("bindBarcode") String bindBarcode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*
*
* @param source
* @return
*/
@GetMapping("/processInfo/getProcesses")
public R<List<MesBaseProcessInfo>> getProcesses(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
} }

@ -0,0 +1,167 @@
package com.hw.mes.api.domain;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.List;
/**
* mes_base_process_info
*
* @author Yinq
* @date 2024-01-24
*/
public class MesBaseProcessInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long processId;
/**
*
*/
@Excel(name = "工序编号")
private String processCode;
/**
*
*/
@Excel(name = "工序名称")
private String processName;
/**
* 1-2-
*/
@Excel(name = "工序类别" , readConverterExp = "1=生产工序,2=质检工序")
private String processType;
/**
* ()
*/
@Excel(name = "标准工时(分钟)")
private Long productionTime;
/**
*
*/
@Excel(name = "标准工时(分钟)工序所在楼层")
private Integer processFloor;
/**
*
*/
@Excel(name = "激活标识")
private String activeFlag;
private Long processOrder;
/**
* 线
*/
private List<MesBaseProcessProdline> mesBaseProcessProdlineList;
/** 工序关联人员信息 */
private List<MesBaseProcessUser> mesBaseProcessUserList;
public List<MesBaseProcessUser> getMesBaseProcessUserList() {
return mesBaseProcessUserList;
}
public void setMesBaseProcessUserList(List<MesBaseProcessUser> mesBaseProcessUserList) {
this.mesBaseProcessUserList = mesBaseProcessUserList;
}
public void setProcessId(Long processId) {
this.processId = processId;
}
public Long getProcessId() {
return processId;
}
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
public String getProcessCode() {
return processCode;
}
public void setProcessName(String processName) {
this.processName = processName;
}
public String getProcessName() {
return processName;
}
public void setProcessType(String processType) {
this.processType = processType;
}
public String getProcessType() {
return processType;
}
public void setProductionTime(Long productionTime) {
this.productionTime = productionTime;
}
public Long getProductionTime() {
return productionTime;
}
public Integer getProcessFloor() {
return processFloor;
}
public void setProcessFloor(Integer processFloor) {
this.processFloor = processFloor;
}
public void setActiveFlag(String activeFlag) {
this.activeFlag = activeFlag;
}
public String getActiveFlag() {
return activeFlag;
}
public List<MesBaseProcessProdline> getMesBaseProcessProdlineList() {
return mesBaseProcessProdlineList;
}
public void setMesBaseProcessProdlineList(List<MesBaseProcessProdline> mesBaseProcessProdlineList) {
this.mesBaseProcessProdlineList = mesBaseProcessProdlineList;
}
public Long getProcessOrder() {
return processOrder;
}
public void setProcessOrder(Long processOrder) {
this.processOrder = processOrder;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("processId" , getProcessId())
.append("processCode" , getProcessCode())
.append("processName" , getProcessName())
.append("processType" , getProcessType())
.append("productionTime" , getProductionTime())
.append("activeFlag" , getActiveFlag())
.append("remark" , getRemark())
.append("createBy" , getCreateBy())
.append("createTime" , getCreateTime())
.append("updateBy" , getUpdateBy())
.append("updateTime" , getUpdateTime())
.append("mesBaseProcessProdlineList" , getMesBaseProcessProdlineList())
.toString();
}
}

@ -0,0 +1,51 @@
package com.hw.mes.api.domain;
import com.hw.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 线 mes_base_process_prodline
*
* @author Yinq
* @date 2024-01-24
*/
public class MesBaseProcessProdline extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 工序ID关联工序信息主键 */
private Long processId;
/** 所属产线ID关联产线主键 */
private Long prodlineId;
public void setProcessId(Long processId)
{
this.processId = processId;
}
public Long getProcessId()
{
return processId;
}
public void setProdlineId(Long prodlineId)
{
this.prodlineId = prodlineId;
}
public Long getProdlineId()
{
return prodlineId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("processId", getProcessId())
.append("prodlineId", getProdlineId())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.toString();
}
}

@ -0,0 +1,77 @@
package com.hw.mes.api.domain;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* mes_base_process_user
*
* @author Yinq
* @date 2024-01-29
*/
public class MesBaseProcessUser extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 工序ID关联工序主键 */
private Long processId;
/** 用户ID关联用户主键 */
private Long userId;
/** 用户名称关联sys_user的user_name */
@Excel(name = "用户名称")
private String userName;
private Long routeId;
public void setProcessId(Long processId)
{
this.processId = processId;
}
public Long getProcessId()
{
return processId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setUserName(String userName)
{
this.userName = userName;
}
public String getUserName()
{
return userName;
}
public Long getRouteId() {
return routeId;
}
public void setRouteId(Long routeId) {
this.routeId = routeId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("processId", getProcessId())
.append("userId", getUserId())
.append("userName", getUserName())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.toString();
}
}

@ -0,0 +1,124 @@
package com.hw.mes.api.domain;
import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 线 mes_base_prodline_info
*
* @author Yinq
* @date 2024-01-24
*/
public class MesBaseProdlineInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键标识 */
private Long prodlineId;
/** 产线编号 */
@Excel(name = "产线编号")
private String prodlineCode;
/** 产线名称 */
@Excel(name = "产线名称")
private String prodlineName;
/** 产线类型 */
@Excel(name = "产线类型")
private String prodlineType;
/** 所属工厂ID */
@Excel(name = "所属工厂ID")
private Long factoryId;
/** 所属工厂名称 */
@Excel(name = "所属工厂名称")
private String factoryName;
/** 是否标识 */
@Excel(name = "是否标识")
private String isFlag;
public String getFactoryName() {
return factoryName;
}
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
public void setProdlineId(Long prodlineId)
{
this.prodlineId = prodlineId;
}
public Long getProdlineId()
{
return prodlineId;
}
public void setProdlineCode(String prodlineCode)
{
this.prodlineCode = prodlineCode;
}
public String getProdlineCode()
{
return prodlineCode;
}
public void setProdlineName(String prodlineName)
{
this.prodlineName = prodlineName;
}
public String getProdlineName()
{
return prodlineName;
}
public void setProdlineType(String prodlineType)
{
this.prodlineType = prodlineType;
}
public String getProdlineType()
{
return prodlineType;
}
public void setFactoryId(Long factoryId)
{
this.factoryId = factoryId;
}
public Long getFactoryId()
{
return factoryId;
}
public void setIsFlag(String isFlag)
{
this.isFlag = isFlag;
}
public String getIsFlag()
{
return isFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("prodlineId", getProdlineId())
.append("prodlineCode", getProdlineCode())
.append("prodlineName", getProdlineName())
.append("prodlineType", getProdlineType())
.append("factoryId", getFactoryId())
.append("isFlag", getIsFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -61,6 +61,8 @@ public class MesBaseStationInfo extends BaseEntity {
@Excel(name = "激活标识") @Excel(name = "激活标识")
private String activeFlag; private String activeFlag;
private String ipAddress;
public String getProcessName() { public String getProcessName() {
return processName; return processName;
} }
@ -125,6 +127,14 @@ public class MesBaseStationInfo extends BaseEntity {
return activeFlag; return activeFlag;
} }
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -4,6 +4,7 @@ import com.hw.common.core.domain.R;
import com.hw.mes.api.RemoteMesService; import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo; import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesBaseProcessInfo;
import com.hw.mes.api.domain.MesBaseStationInfo; import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo; import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -45,6 +46,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
public R<MesBaseBarcodeInfo> getBarcodeByBindBarcode(String bindBarcode, String source) { public R<MesBaseBarcodeInfo> getBarcodeByBindBarcode(String bindBarcode, String source) {
return R.fail("获取绑定条码信息失败:" + throwable.getMessage()); return R.fail("获取绑定条码信息失败:" + throwable.getMessage());
} }
@Override
public R<List<MesBaseProcessInfo>> getProcesses(String source) {
return R.fail("获取工序列表信息失败:" + throwable.getMessage());
}
}; };
} }
} }

@ -59,14 +59,14 @@ public class LoginUser implements Serializable
private SysUser sysUser; private SysUser sysUser;
/** /**
* ID * ID
*/ */
private Long stationId; private Long processId;
/** /**
* *
*/ */
private String stationCode; private Integer processFloor;
public String getToken() public String getToken()
{ {
@ -158,19 +158,19 @@ public class LoginUser implements Serializable
this.sysUser = sysUser; this.sysUser = sysUser;
} }
public Long getStationId() { public Long getProcessId() {
return stationId; return processId;
} }
public void setStationId(Long stationId) { public void setProcessId(Long processId) {
this.stationId = stationId; this.processId = processId;
} }
public String getStationCode() { public Integer getProcessFloor() {
return stationCode; return processFloor;
} }
public void setStationCode(String stationCode) { public void setProcessFloor(Integer processFloor) {
this.stationCode = stationCode; this.processFloor = processFloor;
} }
} }

@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletRequest;
import com.hw.common.core.constant.SecurityConstants; import com.hw.common.core.constant.SecurityConstants;
import com.hw.mes.api.RemoteMesService; import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseProcessInfo;
import com.hw.mes.api.domain.MesBaseStationInfo; import com.hw.mes.api.domain.MesBaseStationInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -43,8 +44,8 @@ public class TokenController
{ {
// 用户登录 // 用户登录
LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword()); LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword());
userInfo.setStationId(form.getStationId()); userInfo.setProcessId(form.getProcessId());
userInfo.setStationCode(form.getStationCode()); userInfo.setProcessFloor(form.getProcessFloor());
// 获取登录token // 获取登录token
return R.ok(tokenService.createToken(userInfo)); return R.ok(tokenService.createToken(userInfo));
} }
@ -107,4 +108,16 @@ public class TokenController
return R.ok(resultR.getData()); return R.ok(resultR.getData());
} }
/**
*
* @return
*/
@GetMapping("getProcesses")
public R<?> getProcesses()
{
R<List<MesBaseProcessInfo>> resultR = remoteMesService.getProcesses(SecurityConstants.INNER);
return R.ok(resultR.getData());
}
} }

@ -19,14 +19,14 @@ public class LoginBody
/** /**
* ID * ID
*/ */
private Long stationId; private Long processId;
/** /**
* *
*/ */
private String stationCode; private Integer processFloor;
public String getUsername() public String getUsername()
{ {
@ -48,19 +48,20 @@ public class LoginBody
this.password = password; this.password = password;
} }
public Long getStationId() {
return stationId; public Long getProcessId() {
return processId;
} }
public void setStationId(Long stationId) { public void setProcessId(Long processId) {
this.stationId = stationId; this.processId = processId;
} }
public String getStationCode() { public Integer getProcessFloor() {
return stationCode; return processFloor;
} }
public void setStationCode(String stationCode) { public void setProcessFloor(Integer processFloor) {
this.stationCode = stationCode; this.processFloor = processFloor;
} }
} }

@ -51,10 +51,10 @@ public class SecurityConstants
/** /**
* ID * ID
*/ */
public static final String DETAILS_STATION_ID = "station_id"; public static final String DETAILS_PROCESS_ID = "process_id";
/** /**
* *
*/ */
public static final String DETAILS_STATION_CODE = "station_code"; public static final String DETAILS_PROCESS_FLOOR = "process_floor";
} }

@ -97,24 +97,24 @@ public class SecurityContextHolder
} }
public static Long getStationId() public static Long getProcessId()
{ {
return Convert.toLong(get(SecurityConstants.DETAILS_STATION_ID), 0L); return Convert.toLong(get(SecurityConstants.DETAILS_PROCESS_ID), 0L);
} }
public static void setStationId(String stationId) public static void setProcessId(String processId)
{ {
set(SecurityConstants.DETAILS_STATION_ID, stationId); set(SecurityConstants.DETAILS_PROCESS_ID, processId);
} }
public static String getStationCode() public static Integer getProcessFloor()
{ {
return get(SecurityConstants.DETAILS_STATION_CODE); return Convert.toInt(get(SecurityConstants.DETAILS_PROCESS_FLOOR),0);
} }
public static void setStationCode(String stationCode) public static void setProcessFloor(String processFloor)
{ {
set(SecurityConstants.DETAILS_STATION_CODE, stationCode); set(SecurityConstants.DETAILS_PROCESS_FLOOR, processFloor);
} }
} }

@ -123,24 +123,24 @@ public class JwtUtils
/** /**
* ID * ID
* *
* @param claims * @param claims
* @return ID * @return ID
*/ */
public static String getStationId(Claims claims) public static String getProcessId(Claims claims)
{ {
return getValue(claims, SecurityConstants.DETAILS_STATION_ID); return getValue(claims, SecurityConstants.DETAILS_PROCESS_ID);
} }
/** /**
* *
* *
* @param claims * @param claims
* @return * @return
*/ */
public static String getStationCode(Claims claims) public static String getProcessFloor(Claims claims)
{ {
return getValue(claims, SecurityConstants.DETAILS_STATION_CODE); return getValue(claims, SecurityConstants.DETAILS_PROCESS_FLOOR);
} }
} }

@ -31,8 +31,8 @@ public class HeaderInterceptor implements AsyncHandlerInterceptor
SecurityContextHolder.setUserId(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USER_ID)); SecurityContextHolder.setUserId(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USER_ID));
SecurityContextHolder.setUserName(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USERNAME)); SecurityContextHolder.setUserName(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USERNAME));
SecurityContextHolder.setUserKey(ServletUtils.getHeader(request, SecurityConstants.USER_KEY)); SecurityContextHolder.setUserKey(ServletUtils.getHeader(request, SecurityConstants.USER_KEY));
SecurityContextHolder.setStationId(ServletUtils.getHeader(request, SecurityConstants.DETAILS_STATION_ID)); SecurityContextHolder.setProcessId(ServletUtils.getHeader(request, SecurityConstants.DETAILS_PROCESS_ID));
SecurityContextHolder.setStationCode(ServletUtils.getHeader(request, SecurityConstants.DETAILS_STATION_CODE)); SecurityContextHolder.setProcessFloor(ServletUtils.getHeader(request, SecurityConstants.DETAILS_PROCESS_FLOOR));
String token = SecurityUtils.getToken(); String token = SecurityUtils.getToken();
if (StringUtils.isNotEmpty(token)) if (StringUtils.isNotEmpty(token))

@ -61,8 +61,8 @@ public class TokenService
claimsMap.put(SecurityConstants.USER_KEY, token); claimsMap.put(SecurityConstants.USER_KEY, token);
claimsMap.put(SecurityConstants.DETAILS_USER_ID, userId); claimsMap.put(SecurityConstants.DETAILS_USER_ID, userId);
claimsMap.put(SecurityConstants.DETAILS_USERNAME, userName); claimsMap.put(SecurityConstants.DETAILS_USERNAME, userName);
claimsMap.put(SecurityConstants.DETAILS_STATION_ID, loginUser.getStationId()); claimsMap.put(SecurityConstants.DETAILS_PROCESS_ID, loginUser.getProcessId());
claimsMap.put(SecurityConstants.DETAILS_STATION_CODE, loginUser.getStationCode()); claimsMap.put(SecurityConstants.DETAILS_PROCESS_FLOOR, loginUser.getProcessFloor());
// 接口返回信息 // 接口返回信息
Map<String, Object> rspMap = new HashMap<String, Object>(); Map<String, Object> rspMap = new HashMap<String, Object>();

@ -41,19 +41,19 @@ public class SecurityUtils
} }
/** /**
* ID * ID
*/ */
public static Long getStationId() public static Long getProcessId()
{ {
return SecurityContextHolder.getStationId(); return SecurityContextHolder.getProcessId();
} }
/** /**
* *
*/ */
public static String getStationCode() public static Integer getProcessFloor()
{ {
return SecurityContextHolder.getStationCode(); return SecurityContextHolder.getProcessFloor();
} }
/** /**

@ -69,8 +69,8 @@ public class AuthFilter implements GlobalFilter, Ordered
} }
String userid = JwtUtils.getUserId(claims); String userid = JwtUtils.getUserId(claims);
String username = JwtUtils.getUserName(claims); String username = JwtUtils.getUserName(claims);
String stationId = JwtUtils.getStationId(claims); String processId = JwtUtils.getProcessId(claims);
String stationCode = JwtUtils.getStationCode(claims); String processFloor = JwtUtils.getProcessFloor(claims);
if (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username)) if (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username))
{ {
return unauthorizedResponse(exchange, "令牌验证失败"); return unauthorizedResponse(exchange, "令牌验证失败");
@ -80,8 +80,8 @@ public class AuthFilter implements GlobalFilter, Ordered
addHeader(mutate, SecurityConstants.USER_KEY, userkey); addHeader(mutate, SecurityConstants.USER_KEY, userkey);
addHeader(mutate, SecurityConstants.DETAILS_USER_ID, userid); addHeader(mutate, SecurityConstants.DETAILS_USER_ID, userid);
addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username); addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username);
addHeader(mutate, SecurityConstants.DETAILS_STATION_ID, stationId); addHeader(mutate, SecurityConstants.DETAILS_PROCESS_ID, processId);
addHeader(mutate, SecurityConstants.DETAILS_STATION_CODE, stationCode); addHeader(mutate, SecurityConstants.DETAILS_PROCESS_FLOOR, processFloor);
// 内部请求来源参数清除 // 内部请求来源参数清除
removeHeader(mutate, SecurityConstants.FROM_SOURCE); removeHeader(mutate, SecurityConstants.FROM_SOURCE);
return chain.filter(exchange.mutate().request(mutate.build()).build()); return chain.filter(exchange.mutate().request(mutate.build()).build());

@ -4,7 +4,10 @@ import java.util.List;
import java.io.IOException; import java.io.IOException;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.hw.common.security.annotation.InnerAuth;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseProcessInfo;
import com.hw.mes.api.domain.MesBaseStationInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -17,7 +20,6 @@ import org.springframework.web.bind.annotation.RestController;
import com.hw.common.log.annotation.Log; import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType; import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions; import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.mes.domain.MesBaseProcessInfo;
import com.hw.mes.service.IMesBaseProcessInfoService; import com.hw.mes.service.IMesBaseProcessInfoService;
import com.hw.common.core.web.controller.BaseController; import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult; import com.hw.common.core.web.domain.AjaxResult;
@ -137,4 +139,17 @@ public class MesBaseProcessInfoController extends BaseController
{ {
return toAjax(mesBaseProcessInfoService.deleteMesBaseProcessInfoByProcessIds(processIds)); return toAjax(mesBaseProcessInfoService.deleteMesBaseProcessInfoByProcessIds(processIds));
} }
/**
*
*/
@InnerAuth
@GetMapping("/getProcesses")
public AjaxResult getProcesses(MesBaseProcessInfo mesBaseProcessInfo)
{
List<MesBaseProcessInfo> list = mesBaseProcessInfoService.selectMesBaseProcessInfoList(mesBaseProcessInfo);
return success(list);
}
} }

@ -5,6 +5,7 @@ import java.io.IOException;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseProdlineInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -17,7 +18,6 @@ import org.springframework.web.bind.annotation.RestController;
import com.hw.common.log.annotation.Log; import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType; import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions; import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.mes.domain.MesBaseProdlineInfo;
import com.hw.mes.service.IMesBaseProdlineInfoService; import com.hw.mes.service.IMesBaseProdlineInfoService;
import com.hw.common.core.web.controller.BaseController; import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult; import com.hw.common.core.web.domain.AjaxResult;

@ -1,153 +1,153 @@
package com.hw.mes.domain; //package com.hw.mes.domain;
//
import java.util.List; //import java.util.List;
//
import org.apache.commons.lang3.builder.ToStringBuilder; //import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; //import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel; //import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity; //import com.hw.common.core.web.domain.BaseEntity;
//
/** ///**
* mes_base_process_info // * 工序信息对象 mes_base_process_info
* // *
* @author Yinq // * @author Yinq
* @date 2024-01-24 // * @date 2024-01-24
*/ // */
public class MesBaseProcessInfo extends BaseEntity { //public class MesBaseProcessInfo extends BaseEntity {
private static final long serialVersionUID = 1L; // private static final long serialVersionUID = 1L;
//
/** // /**
* // * 主键标识
*/ // */
private Long processId; // private Long processId;
//
/** // /**
* // * 工序编号
*/ // */
@Excel(name = "工序编号") // @Excel(name = "工序编号")
private String processCode; // private String processCode;
//
/** // /**
* // * 工序名称
*/ // */
@Excel(name = "工序名称") // @Excel(name = "工序名称")
private String processName; // private String processName;
//
/** // /**
* 1-2- // * 工序类别1-生产工序2-质检工序)
*/ // */
@Excel(name = "工序类别" , readConverterExp = "1=生产工序,2=质检工序") // @Excel(name = "工序类别" , readConverterExp = "1=生产工序,2=质检工序")
private String processType; // private String processType;
//
/** // /**
* () // * 标准工时(分钟)
*/ // */
@Excel(name = "标准工时(分钟)") // @Excel(name = "标准工时(分钟)")
private Long productionTime; // private Long productionTime;
//
/** // /**
* // * 激活标识
*/ // */
@Excel(name = "激活标识") // @Excel(name = "激活标识")
private String activeFlag; // private String activeFlag;
//
private Long processOrder; // private Long processOrder;
//
/** // /**
* 线 // * 工序关联产线信息
*/ // */
private List<MesBaseProcessProdline> mesBaseProcessProdlineList; // private List<MesBaseProcessProdline> mesBaseProcessProdlineList;
//
/** 工序关联人员信息 */ // /** 工序关联人员信息 */
private List<MesBaseProcessUser> mesBaseProcessUserList; // private List<MesBaseProcessUser> mesBaseProcessUserList;
//
public List<MesBaseProcessUser> getMesBaseProcessUserList() { // public List<MesBaseProcessUser> getMesBaseProcessUserList() {
return mesBaseProcessUserList; // return mesBaseProcessUserList;
} // }
//
public void setMesBaseProcessUserList(List<MesBaseProcessUser> mesBaseProcessUserList) { // public void setMesBaseProcessUserList(List<MesBaseProcessUser> mesBaseProcessUserList) {
this.mesBaseProcessUserList = mesBaseProcessUserList; // this.mesBaseProcessUserList = mesBaseProcessUserList;
} // }
//
public void setProcessId(Long processId) { // public void setProcessId(Long processId) {
this.processId = processId; // this.processId = processId;
} // }
//
public Long getProcessId() { // public Long getProcessId() {
return processId; // return processId;
} // }
//
public void setProcessCode(String processCode) { // public void setProcessCode(String processCode) {
this.processCode = processCode; // this.processCode = processCode;
} // }
//
public String getProcessCode() { // public String getProcessCode() {
return processCode; // return processCode;
} // }
//
public void setProcessName(String processName) { // public void setProcessName(String processName) {
this.processName = processName; // this.processName = processName;
} // }
//
public String getProcessName() { // public String getProcessName() {
return processName; // return processName;
} // }
//
public void setProcessType(String processType) { // public void setProcessType(String processType) {
this.processType = processType; // this.processType = processType;
} // }
//
public String getProcessType() { // public String getProcessType() {
return processType; // return processType;
} // }
//
public void setProductionTime(Long productionTime) { // public void setProductionTime(Long productionTime) {
this.productionTime = productionTime; // this.productionTime = productionTime;
} // }
//
public Long getProductionTime() { // public Long getProductionTime() {
return productionTime; // return productionTime;
} // }
//
public void setActiveFlag(String activeFlag) { // public void setActiveFlag(String activeFlag) {
this.activeFlag = activeFlag; // this.activeFlag = activeFlag;
} // }
//
public String getActiveFlag() { // public String getActiveFlag() {
return activeFlag; // return activeFlag;
} // }
//
public List<MesBaseProcessProdline> getMesBaseProcessProdlineList() { // public List<MesBaseProcessProdline> getMesBaseProcessProdlineList() {
return mesBaseProcessProdlineList; // return mesBaseProcessProdlineList;
} // }
//
public void setMesBaseProcessProdlineList(List<MesBaseProcessProdline> mesBaseProcessProdlineList) { // public void setMesBaseProcessProdlineList(List<MesBaseProcessProdline> mesBaseProcessProdlineList) {
this.mesBaseProcessProdlineList = mesBaseProcessProdlineList; // this.mesBaseProcessProdlineList = mesBaseProcessProdlineList;
} // }
//
public Long getProcessOrder() { // public Long getProcessOrder() {
return processOrder; // return processOrder;
} // }
//
public void setProcessOrder(Long processOrder) { // public void setProcessOrder(Long processOrder) {
this.processOrder = processOrder; // this.processOrder = processOrder;
} // }
//
@Override // @Override
public String toString() { // public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) // return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("processId" , getProcessId()) // .append("processId" , getProcessId())
.append("processCode" , getProcessCode()) // .append("processCode" , getProcessCode())
.append("processName" , getProcessName()) // .append("processName" , getProcessName())
.append("processType" , getProcessType()) // .append("processType" , getProcessType())
.append("productionTime" , getProductionTime()) // .append("productionTime" , getProductionTime())
.append("activeFlag" , getActiveFlag()) // .append("activeFlag" , getActiveFlag())
.append("remark" , getRemark()) // .append("remark" , getRemark())
.append("createBy" , getCreateBy()) // .append("createBy" , getCreateBy())
.append("createTime" , getCreateTime()) // .append("createTime" , getCreateTime())
.append("updateBy" , getUpdateBy()) // .append("updateBy" , getUpdateBy())
.append("updateTime" , getUpdateTime()) // .append("updateTime" , getUpdateTime())
.append("mesBaseProcessProdlineList" , getMesBaseProcessProdlineList()) // .append("mesBaseProcessProdlineList" , getMesBaseProcessProdlineList())
.toString(); // .toString();
} // }
} //}

@ -1,52 +1,52 @@
package com.hw.mes.domain; //package com.hw.mes.domain;
//
import org.apache.commons.lang3.builder.ToStringBuilder; //import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; //import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel; //import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity; //import com.hw.common.core.web.domain.BaseEntity;
//
/** ///**
* 线 mes_base_process_prodline // * 工序关联产线对象 mes_base_process_prodline
* // *
* @author Yinq // * @author Yinq
* @date 2024-01-24 // * @date 2024-01-24
*/ // */
public class MesBaseProcessProdline extends BaseEntity //public class MesBaseProcessProdline extends BaseEntity
{ //{
private static final long serialVersionUID = 1L; // private static final long serialVersionUID = 1L;
//
/** 工序ID关联工序信息主键 */ // /** 工序ID关联工序信息主键 */
private Long processId; // private Long processId;
//
/** 所属产线ID关联产线主键 */ // /** 所属产线ID关联产线主键 */
private Long prodlineId; // private Long prodlineId;
//
public void setProcessId(Long processId) // public void setProcessId(Long processId)
{ // {
this.processId = processId; // this.processId = processId;
} // }
//
public Long getProcessId() // public Long getProcessId()
{ // {
return processId; // return processId;
} // }
public void setProdlineId(Long prodlineId) // public void setProdlineId(Long prodlineId)
{ // {
this.prodlineId = prodlineId; // this.prodlineId = prodlineId;
} // }
//
public Long getProdlineId() // public Long getProdlineId()
{ // {
return prodlineId; // return prodlineId;
} // }
//
@Override // @Override
public String toString() { // public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) // return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("processId", getProcessId()) // .append("processId", getProcessId())
.append("prodlineId", getProdlineId()) // .append("prodlineId", getProdlineId())
.append("createBy", getCreateBy()) // .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) // .append("createTime", getCreateTime())
.toString(); // .toString();
} // }
} //}

@ -1,77 +1,77 @@
package com.hw.mes.domain; //package com.hw.mes.domain;
//
import org.apache.commons.lang3.builder.ToStringBuilder; //import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; //import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel; //import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity; //import com.hw.common.core.web.domain.BaseEntity;
//
/** ///**
* mes_base_process_user // * 工序关联人员对象 mes_base_process_user
* // *
* @author Yinq // * @author Yinq
* @date 2024-01-29 // * @date 2024-01-29
*/ // */
public class MesBaseProcessUser extends BaseEntity //public class MesBaseProcessUser extends BaseEntity
{ //{
private static final long serialVersionUID = 1L; // private static final long serialVersionUID = 1L;
//
/** 工序ID关联工序主键 */ // /** 工序ID关联工序主键 */
private Long processId; // private Long processId;
//
/** 用户ID关联用户主键 */ // /** 用户ID关联用户主键 */
private Long userId; // private Long userId;
//
/** 用户名称关联sys_user的user_name */ // /** 用户名称关联sys_user的user_name */
@Excel(name = "用户名称") // @Excel(name = "用户名称")
private String userName; // private String userName;
//
private Long routeId; // private Long routeId;
//
//
public void setProcessId(Long processId) // public void setProcessId(Long processId)
{ // {
this.processId = processId; // this.processId = processId;
} // }
//
public Long getProcessId() // public Long getProcessId()
{ // {
return processId; // return processId;
} // }
public void setUserId(Long userId) // public void setUserId(Long userId)
{ // {
this.userId = userId; // this.userId = userId;
} // }
//
public Long getUserId() // public Long getUserId()
{ // {
return userId; // return userId;
} // }
public void setUserName(String userName) // public void setUserName(String userName)
{ // {
this.userName = userName; // this.userName = userName;
} // }
//
public String getUserName() // public String getUserName()
{ // {
return userName; // return userName;
} // }
//
public Long getRouteId() { // public Long getRouteId() {
return routeId; // return routeId;
} // }
//
public void setRouteId(Long routeId) { // public void setRouteId(Long routeId) {
this.routeId = routeId; // this.routeId = routeId;
} // }
//
@Override // @Override
public String toString() { // public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) // return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("processId", getProcessId()) // .append("processId", getProcessId())
.append("userId", getUserId()) // .append("userId", getUserId())
.append("userName", getUserName()) // .append("userName", getUserName())
.append("createBy", getCreateBy()) // .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) // .append("createTime", getCreateTime())
.toString(); // .toString();
} // }
} //}

@ -1,124 +1,124 @@
package com.hw.mes.domain; //package com.hw.mes.domain;
//
import org.apache.commons.lang3.builder.ToStringBuilder; //import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; //import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel; //import com.hw.common.core.annotation.Excel;
import com.hw.common.core.web.domain.BaseEntity; //import com.hw.common.core.web.domain.BaseEntity;
//
/** ///**
* 线 mes_base_prodline_info // * 产线信息对象 mes_base_prodline_info
* // *
* @author Yinq // * @author Yinq
* @date 2024-01-24 // * @date 2024-01-24
*/ // */
public class MesBaseProdlineInfo extends BaseEntity //public class MesBaseProdlineInfo extends BaseEntity
{ //{
private static final long serialVersionUID = 1L; // private static final long serialVersionUID = 1L;
//
/** 主键标识 */ // /** 主键标识 */
private Long prodlineId; // private Long prodlineId;
//
/** 产线编号 */ // /** 产线编号 */
@Excel(name = "产线编号") // @Excel(name = "产线编号")
private String prodlineCode; // private String prodlineCode;
//
/** 产线名称 */ // /** 产线名称 */
@Excel(name = "产线名称") // @Excel(name = "产线名称")
private String prodlineName; // private String prodlineName;
//
/** 产线类型 */ // /** 产线类型 */
@Excel(name = "产线类型") // @Excel(name = "产线类型")
private String prodlineType; // private String prodlineType;
//
/** 所属工厂ID */ // /** 所属工厂ID */
@Excel(name = "所属工厂ID") // @Excel(name = "所属工厂ID")
private Long factoryId; // private Long factoryId;
//
/** 所属工厂名称 */ // /** 所属工厂名称 */
@Excel(name = "所属工厂名称") // @Excel(name = "所属工厂名称")
private String factoryName; // private String factoryName;
//
/** 是否标识 */ // /** 是否标识 */
@Excel(name = "是否标识") // @Excel(name = "是否标识")
private String isFlag; // private String isFlag;
//
public String getFactoryName() { // public String getFactoryName() {
return factoryName; // return factoryName;
} // }
//
public void setFactoryName(String factoryName) { // public void setFactoryName(String factoryName) {
this.factoryName = factoryName; // this.factoryName = factoryName;
} // }
//
public void setProdlineId(Long prodlineId) // public void setProdlineId(Long prodlineId)
{ // {
this.prodlineId = prodlineId; // this.prodlineId = prodlineId;
} // }
//
public Long getProdlineId() // public Long getProdlineId()
{ // {
return prodlineId; // return prodlineId;
} // }
public void setProdlineCode(String prodlineCode) // public void setProdlineCode(String prodlineCode)
{ // {
this.prodlineCode = prodlineCode; // this.prodlineCode = prodlineCode;
} // }
//
public String getProdlineCode() // public String getProdlineCode()
{ // {
return prodlineCode; // return prodlineCode;
} // }
public void setProdlineName(String prodlineName) // public void setProdlineName(String prodlineName)
{ // {
this.prodlineName = prodlineName; // this.prodlineName = prodlineName;
} // }
//
public String getProdlineName() // public String getProdlineName()
{ // {
return prodlineName; // return prodlineName;
} // }
public void setProdlineType(String prodlineType) // public void setProdlineType(String prodlineType)
{ // {
this.prodlineType = prodlineType; // this.prodlineType = prodlineType;
} // }
//
public String getProdlineType() // public String getProdlineType()
{ // {
return prodlineType; // return prodlineType;
} // }
public void setFactoryId(Long factoryId) // public void setFactoryId(Long factoryId)
{ // {
this.factoryId = factoryId; // this.factoryId = factoryId;
} // }
//
public Long getFactoryId() // public Long getFactoryId()
{ // {
return factoryId; // return factoryId;
} // }
public void setIsFlag(String isFlag) // public void setIsFlag(String isFlag)
{ // {
this.isFlag = isFlag; // this.isFlag = isFlag;
} // }
//
public String getIsFlag() // public String getIsFlag()
{ // {
return isFlag; // return isFlag;
} // }
//
@Override // @Override
public String toString() { // public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) // return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("prodlineId", getProdlineId()) // .append("prodlineId", getProdlineId())
.append("prodlineCode", getProdlineCode()) // .append("prodlineCode", getProdlineCode())
.append("prodlineName", getProdlineName()) // .append("prodlineName", getProdlineName())
.append("prodlineType", getProdlineType()) // .append("prodlineType", getProdlineType())
.append("factoryId", getFactoryId()) // .append("factoryId", getFactoryId())
.append("isFlag", getIsFlag()) // .append("isFlag", getIsFlag())
.append("remark", getRemark()) // .append("remark", getRemark())
.append("createBy", getCreateBy()) // .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) // .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) // .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) // .append("updateTime", getUpdateTime())
.toString(); // .toString();
} // }
} //}

@ -1,9 +1,11 @@
package com.hw.mes.mapper; package com.hw.mes.mapper;
import com.hw.mes.api.domain.MesBaseProcessInfo;
import com.hw.mes.api.domain.MesBaseProcessProdline;
import com.hw.mes.api.domain.MesBaseProcessUser;
import java.util.List; import java.util.List;
import com.hw.mes.domain.MesBaseProcessInfo;
import com.hw.mes.domain.MesBaseProcessProdline;
import com.hw.mes.domain.MesBaseProcessUser;
/** /**
* Mapper * Mapper

@ -1,7 +1,8 @@
package com.hw.mes.mapper; package com.hw.mes.mapper;
import com.hw.mes.api.domain.MesBaseProcessUser;
import java.util.List; import java.util.List;
import com.hw.mes.domain.MesBaseProcessUser;
/** /**
* Mapper * Mapper

@ -1,7 +1,8 @@
package com.hw.mes.mapper; package com.hw.mes.mapper;
import com.hw.mes.api.domain.MesBaseProdlineInfo;
import java.util.List; import java.util.List;
import com.hw.mes.domain.MesBaseProdlineInfo;
/** /**
* 线Mapper * 线Mapper

@ -59,4 +59,15 @@ public interface MesBaseStationInfoMapper
* @return * @return
*/ */
public int deleteMesBaseStationInfoByStationIds(Long[] stationIds); public int deleteMesBaseStationInfoByStationIds(Long[] stationIds);
/**
*
*
* @param ipAddress IP
* @return
*/
public MesBaseStationInfo selectMesBaseStationInfoByStationIp(String ipAddress);
} }

@ -1,8 +1,9 @@
package com.hw.mes.service; package com.hw.mes.service;
import java.util.List; import java.util.List;
import com.hw.mes.domain.MesBaseProcessInfo;
import com.hw.mes.domain.MesBaseProcessUser; import com.hw.mes.api.domain.MesBaseProcessInfo;
import com.hw.mes.api.domain.MesBaseProcessUser;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
/** /**

@ -1,7 +1,8 @@
package com.hw.mes.service; package com.hw.mes.service;
import com.hw.mes.api.domain.MesBaseProdlineInfo;
import java.util.List; import java.util.List;
import com.hw.mes.domain.MesBaseProdlineInfo;
/** /**
* 线Service * 线Service

@ -5,7 +5,9 @@ import java.util.List;
import com.hw.common.core.exception.ServiceException; import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.domain.*; import com.hw.mes.api.domain.MesBaseProcessInfo;
import com.hw.mes.api.domain.MesBaseProcessProdline;
import com.hw.mes.api.domain.MesBaseProcessUser;
import com.hw.mes.mapper.MesBaseProcessUserMapper; import com.hw.mes.mapper.MesBaseProcessUserMapper;
import com.hw.mes.mapper.MesBaseRouteProcessMapper; import com.hw.mes.mapper.MesBaseRouteProcessMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

@ -2,10 +2,10 @@ package com.hw.mes.service.impl;
import java.util.List; import java.util.List;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
import com.hw.mes.api.domain.MesBaseProdlineInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBaseProdlineInfoMapper; import com.hw.mes.mapper.MesBaseProdlineInfoMapper;
import com.hw.mes.domain.MesBaseProdlineInfo;
import com.hw.mes.service.IMesBaseProdlineInfoService; import com.hw.mes.service.IMesBaseProdlineInfoService;
/** /**

@ -9,10 +9,12 @@ import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.exception.ServiceException; import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.SocketUtils; import com.hw.common.core.utils.SocketUtils;
import com.hw.common.core.utils.ip.IpUtils;
import com.hw.common.core.utils.uuid.Seq; import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.config.MesConfig; import com.hw.mes.config.MesConfig;
import com.hw.mes.domain.*; import com.hw.mes.domain.*;
import com.hw.mes.domain.vo.MesAssignTaskVo; import com.hw.mes.domain.vo.MesAssignTaskVo;
@ -337,11 +339,17 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
*/ */
@Override @Override
public List<MesProductPlan> selectMesProductPlanJoinList(MesProductPlan mesProductPlan) { public List<MesProductPlan> selectMesProductPlanJoinList(MesProductPlan mesProductPlan) {
Long stationId = SecurityUtils.getStationId(); Long processId = SecurityUtils.getProcessId();
mesProductPlan.setStationId(stationId); Long userId = SecurityUtils.getUserId();
if(!SecurityUtils.isAdmin(userId)) {
mesProductPlan.setUserId(userId);
}
mesProductPlan.setProcessId(processId);
// String ipAddress = IpUtils.getIpAddr();
// MesBaseStationInfo mesBaseStationInfo = mesBase
// queryBaseStation.set
List<MesProductPlan> mesProductPlans = mesProductPlanMapper.selectMesProductPlanJoinList(mesProductPlan); return mesProductPlanMapper.selectMesProductPlanJoinList(mesProductPlan);
return mesProductPlans;
// return mesProductPlans.stream(). // return mesProductPlans.stream().
// filter(e -> e.getPlanStatus().equals(MesConstants.MES_PRODUCT_PLAN_STATUS_DISPATCHED) || // filter(e -> e.getPlanStatus().equals(MesConstants.MES_PRODUCT_PLAN_STATUS_DISPATCHED) ||
// e.getPlanStatus().equals(MesConstants.MES_PRODUCT_PLAN_STATUS_STARTED)).collect(Collectors.toList()); // e.getPlanStatus().equals(MesConstants.MES_PRODUCT_PLAN_STATUS_STARTED)).collect(Collectors.toList());

@ -9,6 +9,7 @@
<result property="processCode" column="process_code"/> <result property="processCode" column="process_code"/>
<result property="processName" column="process_name"/> <result property="processName" column="process_name"/>
<result property="processType" column="process_type"/> <result property="processType" column="process_type"/>
<result property="processFloor" column="process_floor"/>
<result property="productionTime" column="production_time"/> <result property="productionTime" column="production_time"/>
<result property="activeFlag" column="active_flag"/> <result property="activeFlag" column="active_flag"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
@ -50,6 +51,7 @@
process_code, process_code,
process_name, process_name,
process_type, process_type,
process_floor,
production_time, production_time,
active_flag, active_flag,
remark, remark,
@ -80,6 +82,7 @@
a.process_code, a.process_code,
a.process_name, a.process_name,
a.process_type, a.process_type,
a.process_floor,
a.production_time, a.production_time,
a.active_flag, a.active_flag,
a.remark, a.remark,
@ -102,6 +105,7 @@
a.process_code, a.process_code,
a.process_name, a.process_name,
a.process_type, a.process_type,
a.process_floor,
a.production_time, a.production_time,
a.active_flag, a.active_flag,
a.remark, a.remark,
@ -126,6 +130,7 @@
<if test="processCode != null">process_code,</if> <if test="processCode != null">process_code,</if>
<if test="processName != null and processName != ''">process_name,</if> <if test="processName != null and processName != ''">process_name,</if>
<if test="processType != null and processType != ''">process_type,</if> <if test="processType != null and processType != ''">process_type,</if>
<if test="processFloor != null and processFloor != ''">process_floor,</if>
<if test="productionTime != null">production_time,</if> <if test="productionTime != null">production_time,</if>
<if test="activeFlag != null and activeFlag != ''">active_flag,</if> <if test="activeFlag != null and activeFlag != ''">active_flag,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
@ -138,6 +143,7 @@
<if test="processCode != null">#{processCode},</if> <if test="processCode != null">#{processCode},</if>
<if test="processName != null and processName != ''">#{processName},</if> <if test="processName != null and processName != ''">#{processName},</if>
<if test="processType != null and processType != ''">#{processType},</if> <if test="processType != null and processType != ''">#{processType},</if>
<if test="processFloor != null and processFloor != ''">#{processFloor},</if>
<if test="productionTime != null">#{productionTime},</if> <if test="productionTime != null">#{productionTime},</if>
<if test="activeFlag != null and activeFlag != ''">#{activeFlag},</if> <if test="activeFlag != null and activeFlag != ''">#{activeFlag},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
@ -154,6 +160,7 @@
<if test="processCode != null">process_code = #{processCode},</if> <if test="processCode != null">process_code = #{processCode},</if>
<if test="processName != null and processName != ''">process_name = #{processName},</if> <if test="processName != null and processName != ''">process_name = #{processName},</if>
<if test="processType != null and processType != ''">process_type = #{processType},</if> <if test="processType != null and processType != ''">process_type = #{processType},</if>
<if test="processFloor != null and processFloor != ''">process_floor = #{processFloor},</if>
<if test="productionTime != null">production_time = #{productionTime},</if> <if test="productionTime != null">production_time = #{productionTime},</if>
<if test="activeFlag != null and activeFlag != ''">active_flag = #{activeFlag},</if> <if test="activeFlag != null and activeFlag != ''">active_flag = #{activeFlag},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>

@ -13,6 +13,7 @@
<result property="floor" column="floor"/> <result property="floor" column="floor"/>
<result property="productionTime" column="production_time"/> <result property="productionTime" column="production_time"/>
<result property="activeFlag" column="active_flag"/> <result property="activeFlag" column="active_flag"/>
<result property="ipAddress" column="ip_address"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
@ -29,6 +30,7 @@
mbsi.floor, mbsi.floor,
mbsi.production_time, mbsi.production_time,
mbsi.active_flag, mbsi.active_flag,
mbsi.ip_address,
mbsi.remark, mbsi.remark,
mbsi.create_by, mbsi.create_by,
mbsi.create_time, mbsi.create_time,
@ -123,4 +125,10 @@
#{stationId} #{stationId}
</foreach> </foreach>
</delete> </delete>
<select id="selectMesBaseStationInfoByStationIp" parameterType="String" resultMap="MesBaseStationInfoResult">
<include refid="selectMesBaseStationInfoVo"/>
where ip_address = #{ipAddress}
</select>
</mapper> </mapper>

@ -333,14 +333,15 @@
<select id="selectMesProductPlanJoinList" parameterType="MesProductPlan" resultMap="MesProductPlanResult"> <select id="selectMesProductPlanJoinList" parameterType="MesProductPlan" resultMap="MesProductPlanResult">
select mpp.plan_id, mpp.product_order_id, mpp.sale_order_id,mpp.saleorder_code,mpp.plan_code, mpp.dispatch_code, mpp.material_id, select mpp.plan_id, mpp.product_order_id, mpp.sale_order_id,mpp.saleorder_code,mpp.plan_code, mpp.dispatch_code, mpp.material_id,
mpp.material_bom_id, mpp.process_id, mpp.process_order, mpp.last_process_id, mpp.material_bom_id, mpp.process_id, mpp.process_order, mpp.last_process_id,mpp.user_id,
mpp.station_id, mpp.dispatch_amount, mpp.plan_amount, mpp.complete_amount, mpp.plan_begin_time, mpp.plan_end_time, mpp.station_id, mpp.dispatch_amount, mpp.plan_amount, mpp.complete_amount, mpp.plan_begin_time, mpp.plan_end_time,
mpp.real_begin_time, mpp.real_end_time, mpp.real_begin_time, mpp.real_end_time,
mpp.attach_id, mpp.plan_status, mpo.plan_delivery_date,mbmi.material_code,mbmi.material_name mpp.attach_id, mpp.plan_status, mpo.plan_delivery_date,mbmi.material_code,mbmi.material_name
from mes_product_plan mpp left join mes_product_order mpo on mpp.product_order_id = mpo.product_order_id from mes_product_plan mpp left join mes_product_order mpo on mpp.product_order_id = mpo.product_order_id
left join mes_base_material_info mbmi on mpp.material_id=mbmi.material_id left join mes_base_material_info mbmi on mpp.material_id=mbmi.material_id
<where> <where>
<if test="stationId != null ">and mpp.station_id = #{stationId}</if> <if test="processId != null ">and mpp.process_id = #{processId}</if>
<if test="userId != null ">and mpp.user_id = #{userId}</if>
<if test="planStatus != null and planStatus != ''">and mpp.plan_status = #{planStatus}</if> <if test="planStatus != null and planStatus != ''">and mpp.plan_status = #{planStatus}</if>
</where> </where>
order by mpo.plan_delivery_date order by mpo.plan_delivery_date

@ -1,7 +1,7 @@
import request from '@/utils/request' import request from '@/utils/request'
// 登录方法 // 登录方法
export function login(username, password, code, uuid, stationId,stationCode) { export function login(username, password, code, uuid, processId,processFloor) {
return request({ return request({
url: '/auth/login', url: '/auth/login',
headers: { headers: {
@ -9,7 +9,7 @@ export function login(username, password, code, uuid, stationId,stationCode) {
repeatSubmit: false repeatSubmit: false
}, },
method: 'post', method: 'post',
data: {username, password, code, uuid, stationId,stationCode} data: {username, password, code, uuid, processId,processFloor}
}) })
} }
@ -61,7 +61,7 @@ export function getCodeImg() {
}) })
} }
// 获取验证码 // 获取工位
export function getStations() { export function getStations() {
return request({ return request({
headers: { headers: {
@ -71,3 +71,15 @@ export function getStations() {
method: 'get', method: 'get',
}) })
} }
// 获取工序列表
export function getProcesses() {
return request({
headers: {
isToken: false
},
url: '/auth/getProcesses',
method: 'get',
})
}

@ -42,10 +42,10 @@ const user = {
const password = userInfo.password const password = userInfo.password
const code = userInfo.code const code = userInfo.code
const uuid = userInfo.uuid const uuid = userInfo.uuid
const stationId = userInfo.stationId || '' const processId = userInfo.processId || ''
const stationCode = userInfo.stationCode || '' const processFloor = userInfo.processFloor || ''
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
login(username, password, code, uuid,stationId,stationCode).then(res => { login(username, password, code, uuid,processId,processFloor).then(res => {
let data = res.data let data = res.data
setToken(data.access_token) setToken(data.access_token)
commit('SET_TOKEN', data.access_token) commit('SET_TOKEN', data.access_token)

@ -22,6 +22,8 @@ export const monitorSerialData = {
async connectSerial(callback) { async connectSerial(callback) {
if ('serial' in navigator) {
console.log("serial support")
try { try {
// 请求串口访问权限 // 请求串口访问权限
this.serialPort = await navigator.serial.requestPort(); this.serialPort = await navigator.serial.requestPort();
@ -42,17 +44,18 @@ export const monitorSerialData = {
// console.log("---"+value); // console.log("---"+value);
// const data = this.decoder.decode(value); // const data = this.decoder.decode(value);
this.processReceivedData(value,callback); this.processReceivedData(value, callback);
} }
} catch (error) { } catch (error) {
console.error('连接或读取串口时发生错误:', error); console.error('连接或读取串口时发生错误:', error);
} finally{ } finally {
this.reader.releaseLock(); this.reader.releaseLock();
await this.serialPort.close(); await this.serialPort.close();
} }
}
}, },
processReceivedData(data,callback) { processReceivedData(data, callback) {
// 假设条码数据以回车符或换行符结束 // 假设条码数据以回车符或换行符结束
const barcodeEnd = /\r|\n/; const barcodeEnd = /\r|\n/;
// console.log("---:" + data) // console.log("---:" + data)

@ -23,14 +23,14 @@
<svg-icon slot="prefix" class="el-input__icon input-icon" icon-class="password"/> <svg-icon slot="prefix" class="el-input__icon input-icon" icon-class="password"/>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item v-if="isStationId" prop="stationId"> <el-form-item v-if="isStationId" prop="processId">
<el-select v-model="loginForm.stationId" placeholder="请选择工位" style="width: 100%" @change="changeStation"> <el-select v-model="loginForm.processId" placeholder="请选择工序" style="width: 100%" @change="changeProcess">
<el-option v-for="item in options" :key="item.stationId" :label="item.stationName" <el-option v-for="item in options" :key="item.processId" :label="item.processName"
:value="item.stationId"></el-option> :value="item.processId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="工位编号" prop="stationCode" v-if="false"> <el-form-item label="工位编号" prop="processFloor" v-if="false">
<el-input v-model="loginForm.stationCode"/> <el-input v-model="loginForm.processFloor"/>
</el-form-item> </el-form-item>
<el-form-item v-if="captchaEnabled" prop="code"> <el-form-item v-if="captchaEnabled" prop="code">
<el-input <el-input
@ -71,7 +71,7 @@
</template> </template>
<script> <script>
import {getCodeImg, getStations} from "@/api/login"; import {getCodeImg, getProcesses} from "@/api/login";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import {encrypt, decrypt} from '@/utils/jsencrypt' import {encrypt, decrypt} from '@/utils/jsencrypt'
@ -84,8 +84,8 @@ export default {
username: "admin", username: "admin",
password: "admin123", password: "admin123",
rememberMe: false, rememberMe: false,
stationId: '', processId: '',
stationCode:'', processFloor:'',
code: "", code: "",
uuid: "" uuid: ""
}, },
@ -96,6 +96,9 @@ export default {
password: [ password: [
{required: true, trigger: "blur", message: "请输入您的密码"} {required: true, trigger: "blur", message: "请输入您的密码"}
], ],
processId: [
{required: true, trigger: "blur", message: "请选择工序"}
],
code: [{required: true, trigger: "change", message: "请输入验证码"}] code: [{required: true, trigger: "change", message: "请输入验证码"}]
}, },
loading: false, loading: false,
@ -112,6 +115,11 @@ export default {
processId: 11, processId: 11,
route: '/board/firstFloor' route: '/board/firstFloor'
}, },
{
floor: 1,
processId: 12,
route: '/board/firstFloor'
},
{ {
floor: 4, floor: 4,
processId: 41, processId: 41,
@ -157,10 +165,9 @@ export default {
created() { created() {
this.getCode(); this.getCode();
this.getCookie(); this.getCookie();
// this.loginForm.stationId = this.$route?.query?.station || '';
if (this.$route?.query?.isStationId === 'true') { if (this.$route?.query?.isStationId === 'true') {
this.isStationId = true this.isStationId = true
getStations().then(e => { getProcesses().then(e => {
this.options = e.data this.options = e.data
}) })
} }
@ -199,8 +206,8 @@ export default {
Cookies.remove('rememberMe'); Cookies.remove('rememberMe');
} }
this.$store.dispatch("Login", this.loginForm).then(() => { this.$store.dispatch("Login", this.loginForm).then(() => {
let data = this.options.find(v=>v.stationId === this.loginForm.stationId) || {} let data = this.options.find(v=>v.processId === this.loginForm.processId) || {}
let routeData = this.floorData.find(v=>v.floor === data.floor && v.processId === data.processId) || {} let routeData = this.floorData.find(v=>v.floor === data.processFloor && v.processId === data.processId) || {}
if(routeData.route){ if(routeData.route){
sessionStorage.setItem("FLOORDATA", JSON.stringify(routeData)) sessionStorage.setItem("FLOORDATA", JSON.stringify(routeData))
} }
@ -219,9 +226,9 @@ export default {
}, },
changeStation(stationId){ changeProcess(processId){
let station = this.options.find(v=>v.stationId === stationId) let process = this.options.find(v=>v.processId === processId)
this.loginForm.stationCode = station.stationCode; this.loginForm.processFloor = process.processFloor;
} }
} }
}; };

Loading…
Cancel
Save