登录:在登录时增加获取工位列表信息的接口
master
xins 9 months ago
parent b7f4e0a1c9
commit 2d52984ba3

@ -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.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;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
@ -36,4 +37,15 @@ public interface RemoteMesService {
@PostMapping("/materialinfo/getMaterialsByMaterialIds") @PostMapping("/materialinfo/getMaterialsByMaterialIds")
public R<List<MesBaseMaterialInfo>> getMaterialsByMaterialIds(@RequestBody MesBaseMaterialInfoVo mesBaseMaterialInfo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); public R<List<MesBaseMaterialInfo>> getMaterialsByMaterialIds(@RequestBody MesBaseMaterialInfoVo mesBaseMaterialInfo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*
*
* @param source
* @return
*/
@GetMapping("/baseStationInfo/getStations")
public R<List<MesBaseStationInfo>> getStations(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
} }

@ -0,0 +1,145 @@
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_station_info
*
* @author Yinq
* @date 2024-01-26
*/
public class MesBaseStationInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long stationId;
/**
*
*/
@Excel(name = "工位编号")
private String stationCode;
/**
*
*/
@Excel(name = "工位名称")
private String stationName;
/**
*
*/
@Excel(name = "所属工序编号")
private Long processId;
/**
*
*/
@Excel(name = "所属工序名称")
private String processName;
/**
*
*/
@Excel(name = "楼层")
private Long floor;
/**
*
*/
@Excel(name = "单位生产时间")
private Long productionTime;
/**
*
*/
@Excel(name = "激活标识")
private String activeFlag;
public String getProcessName() {
return processName;
}
public void setProcessName(String processName) {
this.processName = processName;
}
public void setStationId(Long stationId) {
this.stationId = stationId;
}
public Long getStationId() {
return stationId;
}
public void setStationCode(String stationCode) {
this.stationCode = stationCode;
}
public String getStationCode() {
return stationCode;
}
public void setStationName(String stationName) {
this.stationName = stationName;
}
public String getStationName() {
return stationName;
}
public void setProcessId(Long processId) {
this.processId = processId;
}
public Long getProcessId() {
return processId;
}
public void setFloor(Long floor) {
this.floor = floor;
}
public Long getFloor() {
return floor;
}
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;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("stationId", getStationId())
.append("stationCode", getStationCode())
.append("stationName", getStationName())
.append("processId", getProcessId())
.append("floor", getFloor())
.append("productionTime", getProductionTime())
.append("activeFlag", getActiveFlag())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -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.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;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -34,6 +35,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
public R<List<MesBaseMaterialInfo>> getMaterialsByMaterialIds(MesBaseMaterialInfoVo mesBaseMaterialInfo, String source) { public R<List<MesBaseMaterialInfo>> getMaterialsByMaterialIds(MesBaseMaterialInfoVo mesBaseMaterialInfo, String source) {
return R.fail("获取物料信息失败:" + throwable.getMessage()); return R.fail("获取物料信息失败:" + throwable.getMessage());
} }
@Override
public R<List<MesBaseStationInfo>> getStations(String source) {
return R.fail("获取工位列表信息失败:" + throwable.getMessage());
}
}; };
} }
} }

@ -1,11 +1,12 @@
package com.hw.auth.controller; package com.hw.auth.controller;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.mes.api.RemoteMesService;
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.DeleteMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.hw.auth.form.LoginBody; import com.hw.auth.form.LoginBody;
import com.hw.auth.form.RegisterBody; import com.hw.auth.form.RegisterBody;
import com.hw.auth.service.SysLoginService; import com.hw.auth.service.SysLoginService;
@ -17,6 +18,8 @@ import com.hw.common.security.service.TokenService;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.system.api.model.LoginUser; import com.hw.system.api.model.LoginUser;
import java.util.List;
/** /**
* token * token
* *
@ -31,6 +34,9 @@ public class TokenController
@Autowired @Autowired
private SysLoginService sysLoginService; private SysLoginService sysLoginService;
@Autowired
private RemoteMesService remoteMesService;
@PostMapping("login") @PostMapping("login")
public R<?> login(@RequestBody LoginBody form) public R<?> login(@RequestBody LoginBody form)
{ {
@ -85,4 +91,17 @@ public class TokenController
// 获取登录token // 获取登录token
return R.ok(tokenService.createToken(userInfo)); return R.ok(tokenService.createToken(userInfo));
} }
/**
*
* @return
*/
@GetMapping("getStations")
public R<?> getStations()
{
R<List<MesBaseStationInfo>> resultR = remoteMesService.getStations(SecurityConstants.INNER);
return R.ok(resultR.getData());
}
} }

@ -146,7 +146,7 @@ public class TdEngineConstants {
* @param monitorId * @param monitorId
* @return String * @return String
*/ */
public static String getEmsTableName(Long monitorId){ public static String getEmsTableName(String monitorId){
return EMS_TABLE_NAME_PREFIX + monitorId; return EMS_TABLE_NAME_PREFIX + monitorId;
} }

@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
/** /**
* BOMController * MESController
* *
* @author Yinq * @author Yinq
* @date 2024-01-30 * @date 2024-01-30

@ -3,7 +3,9 @@ package com.hw.mes.controller;
import java.util.List; import java.util.List;
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.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;
@ -16,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.MesBaseStationInfo;
import com.hw.mes.service.IMesBaseStationInfoService; import com.hw.mes.service.IMesBaseStationInfoService;
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;
@ -105,4 +106,19 @@ public class MesBaseStationInfoController extends BaseController
{ {
return toAjax(mesBaseStationInfoService.deleteMesBaseStationInfoByStationIds(stationIds)); return toAjax(mesBaseStationInfoService.deleteMesBaseStationInfoByStationIds(stationIds));
} }
/**
*
*/
@InnerAuth
@GetMapping("/getStations")
public AjaxResult getStations(MesBaseStationInfo mesBaseStationInfo)
{
List<MesBaseStationInfo> list = mesBaseStationInfoService.selectMesBaseStationInfoList(mesBaseStationInfo);
return success(list);
}
} }

@ -0,0 +1,23 @@
package com.hw.mes.controller;
import com.hw.common.core.web.controller.BaseController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* MES线Controller
*
* @author Yinq
* @date 2024-01-30
*/
@RestController
@RequestMapping("/pl")
public class MesProductionLineController extends BaseController
{
}

@ -1,145 +1,145 @@
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_station_info // * 工位信息对象 mes_base_station_info
* // *
* @author Yinq // * @author Yinq
* @date 2024-01-26 // * @date 2024-01-26
*/ // */
public class MesBaseStationInfo extends BaseEntity { //public class MesBaseStationInfo extends BaseEntity {
private static final long serialVersionUID = 1L; // private static final long serialVersionUID = 1L;
//
/** // /**
* // * 主键标识
*/ // */
private Long stationId; // private Long stationId;
//
/** // /**
* // * 工位编号
*/ // */
@Excel(name = "工位编号") // @Excel(name = "工位编号")
private String stationCode; // private String stationCode;
//
/** // /**
* // * 工位名称
*/ // */
@Excel(name = "工位名称") // @Excel(name = "工位名称")
private String stationName; // private String stationName;
//
/** // /**
* // * 所属工序编号
*/ // */
@Excel(name = "所属工序编号") // @Excel(name = "所属工序编号")
private Long processId; // private Long processId;
//
/** // /**
* // * 所属工序名称
*/ // */
@Excel(name = "所属工序名称") // @Excel(name = "所属工序名称")
private String processName; // private String processName;
//
/** // /**
* // * 楼层
*/ // */
@Excel(name = "楼层") // @Excel(name = "楼层")
private Long floor; // private Long floor;
//
/** // /**
* // * 单位生产时间
*/ // */
@Excel(name = "单位生产时间") // @Excel(name = "单位生产时间")
private Long productionTime; // private Long productionTime;
//
/** // /**
* // * 激活标识
*/ // */
@Excel(name = "激活标识") // @Excel(name = "激活标识")
private String activeFlag; // private String activeFlag;
//
public String getProcessName() { // public String getProcessName() {
return processName; // return processName;
} // }
//
public void setProcessName(String processName) { // public void setProcessName(String processName) {
this.processName = processName; // this.processName = processName;
} // }
//
public void setStationId(Long stationId) { // public void setStationId(Long stationId) {
this.stationId = stationId; // this.stationId = stationId;
} // }
//
public Long getStationId() { // public Long getStationId() {
return stationId; // return stationId;
} // }
//
public void setStationCode(String stationCode) { // public void setStationCode(String stationCode) {
this.stationCode = stationCode; // this.stationCode = stationCode;
} // }
//
public String getStationCode() { // public String getStationCode() {
return stationCode; // return stationCode;
} // }
//
public void setStationName(String stationName) { // public void setStationName(String stationName) {
this.stationName = stationName; // this.stationName = stationName;
} // }
//
public String getStationName() { // public String getStationName() {
return stationName; // return stationName;
} // }
//
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 setFloor(Long floor) { // public void setFloor(Long floor) {
this.floor = floor; // this.floor = floor;
} // }
//
public Long getFloor() { // public Long getFloor() {
return floor; // return floor;
} // }
//
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;
} // }
//
@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("stationId", getStationId()) // .append("stationId", getStationId())
.append("stationCode", getStationCode()) // .append("stationCode", getStationCode())
.append("stationName", getStationName()) // .append("stationName", getStationName())
.append("processId", getProcessId()) // .append("processId", getProcessId())
.append("floor", getFloor()) // .append("floor", getFloor())
.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())
.toString(); // .toString();
} // }
} //}

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

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

@ -3,10 +3,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.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseStationInfo;
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.MesBaseStationInfoMapper; import com.hw.mes.mapper.MesBaseStationInfoMapper;
import com.hw.mes.domain.MesBaseStationInfo;
import com.hw.mes.service.IMesBaseStationInfoService; import com.hw.mes.service.IMesBaseStationInfoService;
/** /**

Loading…
Cancel
Save