车间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.mes.api.domain.MesBaseBarcodeInfo;
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.vo.MesBaseMaterialInfoVo;
import com.hw.mes.api.factory.RemoteMesFallbackFactory;
@ -59,4 +60,13 @@ public interface RemoteMesService {
@GetMapping("/barcode/getBarcodeByBindBarcode/{bindBarcode}")
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 = "激活标识")
private String activeFlag;
private String ipAddress;
public String getProcessName() {
return processName;
}
@ -125,6 +127,14 @@ public class MesBaseStationInfo extends BaseEntity {
return activeFlag;
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
@Override
public String toString() {
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.domain.MesBaseBarcodeInfo;
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.vo.MesBaseMaterialInfoVo;
import org.slf4j.Logger;
@ -45,6 +46,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
public R<MesBaseBarcodeInfo> getBarcodeByBindBarcode(String bindBarcode, String source) {
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;
/**
* ID
* ID
*/
private Long stationId;
private Long processId;
/**
*
*
*/
private String stationCode;
private Integer processFloor;
public String getToken()
{
@ -158,19 +158,19 @@ public class LoginUser implements Serializable
this.sysUser = sysUser;
}
public Long getStationId() {
return stationId;
public Long getProcessId() {
return processId;
}
public void setStationId(Long stationId) {
this.stationId = stationId;
public void setProcessId(Long processId) {
this.processId = processId;
}
public String getStationCode() {
return stationCode;
public Integer getProcessFloor() {
return processFloor;
}
public void setStationCode(String stationCode) {
this.stationCode = stationCode;
public void setProcessFloor(Integer processFloor) {
this.processFloor = processFloor;
}
}

@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletRequest;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseProcessInfo;
import com.hw.mes.api.domain.MesBaseStationInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -43,8 +44,8 @@ public class TokenController
{
// 用户登录
LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword());
userInfo.setStationId(form.getStationId());
userInfo.setStationCode(form.getStationCode());
userInfo.setProcessId(form.getProcessId());
userInfo.setProcessFloor(form.getProcessFloor());
// 获取登录token
return R.ok(tokenService.createToken(userInfo));
}
@ -107,4 +108,16 @@ public class TokenController
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()
{
@ -48,19 +48,20 @@ public class LoginBody
this.password = password;
}
public Long getStationId() {
return stationId;
public Long getProcessId() {
return processId;
}
public void setStationId(Long stationId) {
this.stationId = stationId;
public void setProcessId(Long processId) {
this.processId = processId;
}
public String getStationCode() {
return stationCode;
public Integer getProcessFloor() {
return processFloor;
}
public void setStationCode(String stationCode) {
this.stationCode = stationCode;
public void setProcessFloor(Integer processFloor) {
this.processFloor = processFloor;
}
}

@ -51,10 +51,10 @@ public class SecurityConstants
/**
* 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
* @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
* @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.setUserName(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USERNAME));
SecurityContextHolder.setUserKey(ServletUtils.getHeader(request, SecurityConstants.USER_KEY));
SecurityContextHolder.setStationId(ServletUtils.getHeader(request, SecurityConstants.DETAILS_STATION_ID));
SecurityContextHolder.setStationCode(ServletUtils.getHeader(request, SecurityConstants.DETAILS_STATION_CODE));
SecurityContextHolder.setProcessId(ServletUtils.getHeader(request, SecurityConstants.DETAILS_PROCESS_ID));
SecurityContextHolder.setProcessFloor(ServletUtils.getHeader(request, SecurityConstants.DETAILS_PROCESS_FLOOR));
String token = SecurityUtils.getToken();
if (StringUtils.isNotEmpty(token))

@ -61,8 +61,8 @@ public class TokenService
claimsMap.put(SecurityConstants.USER_KEY, token);
claimsMap.put(SecurityConstants.DETAILS_USER_ID, userId);
claimsMap.put(SecurityConstants.DETAILS_USERNAME, userName);
claimsMap.put(SecurityConstants.DETAILS_STATION_ID, loginUser.getStationId());
claimsMap.put(SecurityConstants.DETAILS_STATION_CODE, loginUser.getStationCode());
claimsMap.put(SecurityConstants.DETAILS_PROCESS_ID, loginUser.getProcessId());
claimsMap.put(SecurityConstants.DETAILS_PROCESS_FLOOR, loginUser.getProcessFloor());
// 接口返回信息
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 username = JwtUtils.getUserName(claims);
String stationId = JwtUtils.getStationId(claims);
String stationCode = JwtUtils.getStationCode(claims);
String processId = JwtUtils.getProcessId(claims);
String processFloor = JwtUtils.getProcessFloor(claims);
if (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username))
{
return unauthorizedResponse(exchange, "令牌验证失败");
@ -80,8 +80,8 @@ public class AuthFilter implements GlobalFilter, Ordered
addHeader(mutate, SecurityConstants.USER_KEY, userkey);
addHeader(mutate, SecurityConstants.DETAILS_USER_ID, userid);
addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username);
addHeader(mutate, SecurityConstants.DETAILS_STATION_ID, stationId);
addHeader(mutate, SecurityConstants.DETAILS_STATION_CODE, stationCode);
addHeader(mutate, SecurityConstants.DETAILS_PROCESS_ID, processId);
addHeader(mutate, SecurityConstants.DETAILS_PROCESS_FLOOR, processFloor);
// 内部请求来源参数清除
removeHeader(mutate, SecurityConstants.FROM_SOURCE);
return chain.filter(exchange.mutate().request(mutate.build()).build());

@ -4,7 +4,10 @@ import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.hw.common.security.annotation.InnerAuth;
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.web.bind.annotation.GetMapping;
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.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.mes.domain.MesBaseProcessInfo;
import com.hw.mes.service.IMesBaseProcessInfoService;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
@ -137,4 +139,17 @@ public class MesBaseProcessInfoController extends BaseController
{
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 com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseProdlineInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.mes.domain.MesBaseProdlineInfo;
import com.hw.mes.service.IMesBaseProdlineInfoService;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;

@ -1,153 +1,153 @@
package com.hw.mes.domain;
import java.util.List;
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;
/**
* 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 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 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();
}
}
//package com.hw.mes.domain;
//
//import java.util.List;
//
//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;
//
///**
// * 工序信息对象 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 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 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();
// }
//}

@ -1,52 +1,52 @@
package com.hw.mes.domain;
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;
/**
* 线 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();
}
}
//package com.hw.mes.domain;
//
//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;
//
///**
// * 工序关联产线对象 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();
// }
//}

@ -1,77 +1,77 @@
package com.hw.mes.domain;
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;
/**
* 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();
}
}
//package com.hw.mes.domain;
//
//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;
//
///**
// * 工序关联人员对象 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();
// }
//}

@ -1,124 +1,124 @@
package com.hw.mes.domain;
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;
/**
* 线 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();
}
}
//package com.hw.mes.domain;
//
//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;
//
///**
// * 产线信息对象 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();
// }
//}

@ -1,9 +1,11 @@
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 com.hw.mes.domain.MesBaseProcessInfo;
import com.hw.mes.domain.MesBaseProcessProdline;
import com.hw.mes.domain.MesBaseProcessUser;
/**
* Mapper

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

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

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

@ -1,8 +1,9 @@
package com.hw.mes.service;
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;
/**

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

@ -5,7 +5,9 @@ import java.util.List;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
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.MesBaseRouteProcessMapper;
import org.springframework.beans.factory.annotation.Autowired;

@ -2,10 +2,10 @@ package com.hw.mes.service.impl;
import java.util.List;
import com.hw.common.core.utils.DateUtils;
import com.hw.mes.api.domain.MesBaseProdlineInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBaseProdlineInfoMapper;
import com.hw.mes.domain.MesBaseProdlineInfo;
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.utils.DateUtils;
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.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.config.MesConfig;
import com.hw.mes.domain.*;
import com.hw.mes.domain.vo.MesAssignTaskVo;
@ -337,11 +339,17 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
*/
@Override
public List<MesProductPlan> selectMesProductPlanJoinList(MesProductPlan mesProductPlan) {
Long stationId = SecurityUtils.getStationId();
mesProductPlan.setStationId(stationId);
Long processId = SecurityUtils.getProcessId();
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 mesProductPlans;
return mesProductPlanMapper.selectMesProductPlanJoinList(mesProductPlan);
// return mesProductPlans.stream().
// filter(e -> e.getPlanStatus().equals(MesConstants.MES_PRODUCT_PLAN_STATUS_DISPATCHED) ||
// e.getPlanStatus().equals(MesConstants.MES_PRODUCT_PLAN_STATUS_STARTED)).collect(Collectors.toList());

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

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

@ -333,14 +333,15 @@
<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,
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.real_begin_time, mpp.real_end_time,
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
left join mes_base_material_info mbmi on mpp.material_id=mbmi.material_id
<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>
</where>
order by mpo.plan_delivery_date

@ -1,7 +1,7 @@
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({
url: '/auth/login',
headers: {
@ -9,7 +9,7 @@ export function login(username, password, code, uuid, stationId,stationCode) {
repeatSubmit: false
},
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() {
return request({
headers: {
@ -71,3 +71,15 @@ export function getStations() {
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 code = userInfo.code
const uuid = userInfo.uuid
const stationId = userInfo.stationId || ''
const stationCode = userInfo.stationCode || ''
const processId = userInfo.processId || ''
const processFloor = userInfo.processFloor || ''
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
setToken(data.access_token)
commit('SET_TOKEN', data.access_token)

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

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

Loading…
Cancel
Save