登录:在登录时增加获取工位列表信息的接口
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.mes.api.domain.MesBaseBarcodeInfo;
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.factory.RemoteMesFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
@ -36,4 +37,15 @@ public interface RemoteMesService {
@PostMapping("/materialinfo/getMaterialsByMaterialIds")
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.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -34,6 +35,11 @@ public class RemoteMesFallbackFactory implements FallbackFactory<RemoteMesServic
public R<List<MesBaseMaterialInfo>> getMaterialsByMaterialIds(MesBaseMaterialInfoVo mesBaseMaterialInfo, String source) {
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;
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.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.hw.auth.form.LoginBody;
import com.hw.auth.form.RegisterBody;
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.system.api.model.LoginUser;
import java.util.List;
/**
* token
*
@ -31,6 +34,9 @@ public class TokenController
@Autowired
private SysLoginService sysLoginService;
@Autowired
private RemoteMesService remoteMesService;
@PostMapping("login")
public R<?> login(@RequestBody LoginBody form)
{
@ -85,4 +91,17 @@ public class TokenController
// 获取登录token
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
* @return String
*/
public static String getEmsTableName(Long monitorId){
public static String getEmsTableName(String monitorId){
return EMS_TABLE_NAME_PREFIX + monitorId;
}

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

@ -3,7 +3,9 @@ package com.hw.mes.controller;
import java.util.List;
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.MesBaseStationInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.mes.domain.MesBaseStationInfo;
import com.hw.mes.service.IMesBaseStationInfoService;
import com.hw.common.core.web.controller.BaseController;
import com.hw.common.core.web.domain.AjaxResult;
@ -25,7 +26,7 @@ import com.hw.common.core.web.page.TableDataInfo;
/**
* Controller
*
*
* @author Yinq
* @date 2024-01-26
*/
@ -105,4 +106,19 @@ public class MesBaseStationInfoController extends BaseController
{
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;
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_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();
}
}
//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_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();
// }
//}

@ -1,19 +1,20 @@
package com.hw.mes.mapper;
import com.hw.mes.api.domain.MesBaseStationInfo;
import java.util.List;
import com.hw.mes.domain.MesBaseStationInfo;
/**
* Mapper
*
*
* @author Yinq
* @date 2024-01-26
*/
public interface MesBaseStationInfoMapper
public interface MesBaseStationInfoMapper
{
/**
*
*
*
* @param stationId
* @return
*/
@ -21,7 +22,7 @@ public interface MesBaseStationInfoMapper
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -29,7 +30,7 @@ public interface MesBaseStationInfoMapper
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -37,7 +38,7 @@ public interface MesBaseStationInfoMapper
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -45,7 +46,7 @@ public interface MesBaseStationInfoMapper
/**
*
*
*
* @param stationId
* @return
*/
@ -53,7 +54,7 @@ public interface MesBaseStationInfoMapper
/**
*
*
*
* @param stationIds
* @return
*/

@ -1,19 +1,20 @@
package com.hw.mes.service;
import com.hw.mes.api.domain.MesBaseStationInfo;
import java.util.List;
import com.hw.mes.domain.MesBaseStationInfo;
/**
* Service
*
*
* @author Yinq
* @date 2024-01-26
*/
public interface IMesBaseStationInfoService
public interface IMesBaseStationInfoService
{
/**
*
*
*
* @param stationId
* @return
*/
@ -21,7 +22,7 @@ public interface IMesBaseStationInfoService
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -29,7 +30,7 @@ public interface IMesBaseStationInfoService
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -37,7 +38,7 @@ public interface IMesBaseStationInfoService
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -45,7 +46,7 @@ public interface IMesBaseStationInfoService
/**
*
*
*
* @param stationIds
* @return
*/
@ -53,7 +54,7 @@ public interface IMesBaseStationInfoService
/**
*
*
*
* @param stationId
* @return
*/

@ -3,27 +3,27 @@ package com.hw.mes.service.impl;
import java.util.List;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseStationInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesBaseStationInfoMapper;
import com.hw.mes.domain.MesBaseStationInfo;
import com.hw.mes.service.IMesBaseStationInfoService;
/**
* Service
*
*
* @author Yinq
* @date 2024-01-26
*/
@Service
public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
{
@Autowired
private MesBaseStationInfoMapper mesBaseStationInfoMapper;
/**
*
*
*
* @param stationId
* @return
*/
@ -35,7 +35,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -47,7 +47,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -61,7 +61,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
/**
*
*
*
* @param mesBaseStationInfo
* @return
*/
@ -75,7 +75,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
/**
*
*
*
* @param stationIds
* @return
*/
@ -87,7 +87,7 @@ public class MesBaseStationInfoServiceImpl implements IMesBaseStationInfoService
/**
*
*
*
* @param stationId
* @return
*/

Loading…
Cancel
Save