forked from I3-YF/i3plus-mes-yfai
基础主数据开
parent
b5f42242b1
commit
327e7f4f45
@ -1,13 +1,13 @@
|
|||||||
package cn.estsh.i3plus.ext.mes.api.base;
|
package cn.estsh.i3plus.ext.mes.api.base;
|
||||||
|
|
||||||
import cn.estsh.i3plus.pojo.mes.bean.MesEquitment;
|
import cn.estsh.i3plus.pojo.mes.bean.MesEquipment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description:
|
* @Description:
|
||||||
* @CreateDate 2024/04/16
|
* @CreateDate 2024/04/16
|
||||||
* @Author mingliang.li
|
* @Author mingliang.li
|
||||||
*/
|
*/
|
||||||
public interface IMesEquitmentService extends IBaseMesService<MesEquitment> {
|
public interface IMesEquitmentService extends IBaseMesService<MesEquipment> {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.api.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartPull;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @CreateDate 2024/04/16
|
||||||
|
* @Author mingliang.li
|
||||||
|
*/
|
||||||
|
public interface IMesPartPtrService {
|
||||||
|
|
||||||
|
ResultBean getDetailById(int id);
|
||||||
|
}
|
@ -0,0 +1,383 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.mes.api.iservice.base.IProdOrgService;
|
||||||
|
import cn.estsh.i3plus.mes.api.iservice.busi.IEquipmentService;
|
||||||
|
import cn.estsh.i3plus.mes.apiservice.util.MesCommConstWords;
|
||||||
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
||||||
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
||||||
|
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
|
||||||
|
import cn.estsh.i3plus.platform.common.util.MesConstWords;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.MesEnumUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesArea;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesEquipment;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.model.ProdOrgModel;
|
||||||
|
import cn.estsh.impp.framework.base.controller.MesBaseController;
|
||||||
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Reference:
|
||||||
|
* @Author: yiming.gu
|
||||||
|
* @CreateDate:2019-05-06-9:51
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@RestController
|
||||||
|
@Api("MES组织模型")
|
||||||
|
@RequestMapping(CommonConstWords.BASE_URL_MES + "/prod-org-new")
|
||||||
|
public class ExtProdOrgController extends MesBaseController {
|
||||||
|
|
||||||
|
public static final Logger LOGGER = LoggerFactory.getLogger(ExtProdOrgController.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IProdOrgService prodOrgService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEquipmentService mesEquipmentService;
|
||||||
|
|
||||||
|
@GetMapping(value = "/mes-data-tree/query")
|
||||||
|
@ApiOperation(value = "查询MES组织模型数据返回树结构")
|
||||||
|
public ResultBean queryMesDataTree() {
|
||||||
|
try {
|
||||||
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode())
|
||||||
|
.setResultList(prodOrgService.queryMesDataTree(AuthUtil.getOrganize().getOrganizeCode()));
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/mes-prod/query")
|
||||||
|
@ApiOperation(value = "按条件分页查询MES组织模型数据")
|
||||||
|
public ResultBean queryMesProdOrgByPager(ProdOrgModel prodOrgModel, Pager pager) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
ListPager listPager = null;
|
||||||
|
|
||||||
|
prodOrgModel.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
//工厂
|
||||||
|
if (MesEnumUtil.PROD_ORG_LEVEL.LEVEL_ONE.getValue() == prodOrgModel.getLevel()) {
|
||||||
|
|
||||||
|
MesArea mesArea = new MesArea();
|
||||||
|
BeanUtils.copyProperties(prodOrgModel, mesArea);
|
||||||
|
|
||||||
|
listPager = prodOrgService.queryMesAreaByPager(mesArea, pager);
|
||||||
|
}
|
||||||
|
//生产线
|
||||||
|
if (MesEnumUtil.PROD_ORG_LEVEL.LEVEL_TWO.getValue() == prodOrgModel.getLevel()) {
|
||||||
|
|
||||||
|
MesWorkCenter workCenter = new MesWorkCenter();
|
||||||
|
BeanUtils.copyProperties(prodOrgModel, workCenter);
|
||||||
|
|
||||||
|
listPager = prodOrgService.queryWorkCenterByPager(workCenter, pager);
|
||||||
|
}
|
||||||
|
//工位
|
||||||
|
if (MesEnumUtil.PROD_ORG_LEVEL.LEVEL_THREE.getValue() == prodOrgModel.getLevel()) {
|
||||||
|
|
||||||
|
MesWorkCell workCell = new MesWorkCell();
|
||||||
|
BeanUtils.copyProperties(prodOrgModel, workCell);
|
||||||
|
|
||||||
|
listPager = prodOrgService.queryWorkCellByPager(workCell, pager);
|
||||||
|
}
|
||||||
|
//工位下的设备
|
||||||
|
if (MesEnumUtil.PROD_ORG_LEVEL.LEVEL_FOUR.getValue() <= prodOrgModel.getLevel()) {
|
||||||
|
|
||||||
|
MesEquipment equipment = new MesEquipment();
|
||||||
|
//这是用到的参数有id 必须使用org.springframework.beans.BeanUtils
|
||||||
|
//如果使用org.apache.commons.beanutils.BeanUtils当id为null会默认转化为0
|
||||||
|
BeanUtils.copyProperties(prodOrgModel, equipment);
|
||||||
|
|
||||||
|
listPager = mesEquipmentService.queryMesEquipmentByPagerOrg(equipment, pager);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null == listPager) {
|
||||||
|
return ResultBean.success("操作成功").setMsg("暂无数据")
|
||||||
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} else {
|
||||||
|
return ResultBean.success("操作成功").setListPager(listPager)
|
||||||
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
}
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "/mes-prod/insert")
|
||||||
|
@ApiOperation(value = "新增mes组织模型信息(区域,生产线,工位)")
|
||||||
|
public ResultBean insertMesProdOrg(ProdOrgModel prodOrgModel) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
prodOrgModel.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
ConvertBean.serviceModelInitialize(prodOrgModel, AuthUtil.getSessionUser().getUserName());
|
||||||
|
|
||||||
|
prodOrgService.insertMesProdOrg(prodOrgModel);
|
||||||
|
|
||||||
|
return ResultBean.success("添加成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/mes-area/query")
|
||||||
|
@ApiOperation(value = "分页查询区域")
|
||||||
|
public ResultBean queryMesAreaByPager(MesArea mesArea, Pager pager) {
|
||||||
|
try {
|
||||||
|
mesArea.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
ListPager areaList = prodOrgService.queryMesAreaByPager(mesArea, pager);
|
||||||
|
|
||||||
|
return ResultBean.success("操作成功").setListPager(areaList)
|
||||||
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/mes-area/query-all")
|
||||||
|
@ApiOperation(value = "按条件查询区域所有数据")
|
||||||
|
public ResultBean queryMesAreaByProperties(MesArea mesArea) {
|
||||||
|
try {
|
||||||
|
mesArea.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
List<MesArea> areaList = prodOrgService.queryMesAreaByProperties(mesArea);
|
||||||
|
|
||||||
|
return ResultBean.success("操作成功").setResultList(areaList)
|
||||||
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping(value = "/mes-area/status-update")
|
||||||
|
@ApiOperation(value = "根据id启用或禁用区域信息")
|
||||||
|
public ResultBean updateMesAreaStatusById(Long id, int status) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (null == id) {
|
||||||
|
throw ImppExceptionBuilder.newInstance()
|
||||||
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
||||||
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
||||||
|
.setErrorDetail("请选择需要操作的资源。")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
prodOrgService.updateMesAreaStatusById(id, status, AuthUtil.getSessionUser().getUserName(), AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
|
||||||
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping(value = "/mes-area/update")
|
||||||
|
@ApiOperation(value = "更新mes区域信息")
|
||||||
|
public ResultBean updateMesArea(MesArea mesArea) {
|
||||||
|
try {
|
||||||
|
//条件验证
|
||||||
|
ValidatorBean.beginValid(mesArea)
|
||||||
|
.notNull(MesConstWords.ID, mesArea.getId())
|
||||||
|
.notNull(MesCommConstWords.AREA_CODE, mesArea.getAreaCode())
|
||||||
|
.notNull(MesCommConstWords.AREA_NAME, mesArea.getAreaName());
|
||||||
|
|
||||||
|
prodOrgService.updateMesArea(mesArea, AuthUtil.getSessionUser().getUserName(), AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
return ResultBean.success("修改成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping(value = "/work-center/update")
|
||||||
|
@ApiOperation(value = "更新生产线信息")
|
||||||
|
public ResultBean updateMesWorkCenter(MesWorkCenter workCenter) {
|
||||||
|
try {
|
||||||
|
//条件验证
|
||||||
|
ValidatorBean.beginValid(workCenter)
|
||||||
|
.notNull(MesConstWords.ID, workCenter.getId())
|
||||||
|
.notNull(MesConstWords.WORK_CENTER_CODE, workCenter.getWorkCenterCode())
|
||||||
|
.notNull(MesCommConstWords.WORK_CENTER_NAME, workCenter.getWorkCenterName())
|
||||||
|
.notNull(MesCommConstWords.AREA_CODE, workCenter.getAreaCode());
|
||||||
|
|
||||||
|
prodOrgService.updateMesWorkCenter(workCenter, AuthUtil.getSessionUser().getUserName(), AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
return ResultBean.success("修改成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/mes-center/query")
|
||||||
|
@ApiOperation(value = "分页查询生产线")
|
||||||
|
public ResultBean queryMesWorkCenterByPager(MesWorkCenter workCenter, Pager pager) {
|
||||||
|
try {
|
||||||
|
workCenter.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
ListPager<MesWorkCenter> workCenterList = prodOrgService.queryWorkCenterByPager(workCenter, pager);
|
||||||
|
|
||||||
|
return ResultBean.success("操作成功").setListPager(workCenterList)
|
||||||
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/mes-center/query-all")
|
||||||
|
@ApiOperation(value = "按条件查询生产线所有数据")
|
||||||
|
public ResultBean queryMesWorkCenterByProperties(MesWorkCenter workCenter) {
|
||||||
|
try {
|
||||||
|
workCenter.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
List<MesWorkCenter> workCenterList = prodOrgService.queryMesWorkCenterByProperties(workCenter);
|
||||||
|
|
||||||
|
return ResultBean.success("操作成功").setResultList(workCenterList)
|
||||||
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/mes-center-all/query")
|
||||||
|
@ApiOperation(value = "按条件查询生产线所有数据")
|
||||||
|
public ResultBean queryMesWorkCenterByOrg() {
|
||||||
|
try {
|
||||||
|
|
||||||
|
List<MesWorkCenter> workCenterList = prodOrgService.queryMesWorkCenterByOrg(AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
|
||||||
|
return ResultBean.success("操作成功").setResultList(workCenterList)
|
||||||
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping(value = "/mes-center/status-update")
|
||||||
|
@ApiOperation(value = "根据id启用或禁用生产线信息")
|
||||||
|
public ResultBean updateMesCenterStatusById(Long id, int status) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (null == id) {
|
||||||
|
throw ImppExceptionBuilder.newInstance()
|
||||||
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
||||||
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
||||||
|
.setErrorDetail("请选择需要操作的资源。")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
prodOrgService.updateMesCenterStatusById(id, status, AuthUtil.getSessionUser().getUserName(), AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
|
||||||
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping(value = "/work-cell/update")
|
||||||
|
@ApiOperation(value = "更新工位信息")
|
||||||
|
public ResultBean updateMesWorkCell(MesWorkCell workCell) {
|
||||||
|
try {
|
||||||
|
ValidatorBean.beginValid(workCell)
|
||||||
|
.notNull(MesConstWords.ID, workCell.getId())
|
||||||
|
.notNull(MesConstWords.WORK_CELL_CODE, workCell.getWorkCellCode())
|
||||||
|
.notNull(MesCommConstWords.WORK_CELL_NAME, workCell.getWorkCellName())
|
||||||
|
.notNull(MesConstWords.WORK_CENTER_CODE, workCell.getWorkCenterCode())
|
||||||
|
.notNull("workCellType", workCell.getWorkCellType())
|
||||||
|
.notNull(MesCommConstWords.AREA_CODE, workCell.getAreaCode());
|
||||||
|
|
||||||
|
prodOrgService.updateMesWorkCell(workCell, AuthUtil.getSessionUser().getUserName(), AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
return ResultBean.success("修改成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/mes-cell/query")
|
||||||
|
@ApiOperation(value = "分页查询工位")
|
||||||
|
public ResultBean queryMesWorkCellByPager(MesWorkCell workCell, Pager pager) {
|
||||||
|
try {
|
||||||
|
workCell.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
ListPager<MesWorkCell> workCellList = prodOrgService.queryWorkCellByPager(workCell, pager);
|
||||||
|
return ResultBean.success("操作成功").setListPager(workCellList)
|
||||||
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/mes-cell/query-all")
|
||||||
|
@ApiOperation(value = "按条件查询工位所有数据")
|
||||||
|
public ResultBean queryMesWorkCellByProperties(MesWorkCell workCell) {
|
||||||
|
try {
|
||||||
|
workCell.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
List<MesWorkCell> workCellList = prodOrgService.queryMesWorkCellByProperties(workCell);
|
||||||
|
return ResultBean.success("操作成功").setResultList(workCellList)
|
||||||
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping(value = "/mes-cell/status-update")
|
||||||
|
@ApiOperation(value = "根据id启用或禁用工位信息")
|
||||||
|
public ResultBean updateMesCellStatusById(Long id, int status) {
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (null == id) {
|
||||||
|
throw ImppExceptionBuilder.newInstance()
|
||||||
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
||||||
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
||||||
|
.setErrorDetail("请选择需要操作的资源。")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
prodOrgService.updateMesCellStatusById(id, status, AuthUtil.getSessionUser().getUserName(), AuthUtil.getOrganize().getOrganizeCode());
|
||||||
|
|
||||||
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,12 +1,12 @@
|
|||||||
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
||||||
|
|
||||||
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
||||||
import cn.estsh.i3plus.pojo.mes.bean.MesEquitment;
|
import cn.estsh.i3plus.pojo.mes.bean.MesEquipment;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesEquitment")
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesEquipment")
|
||||||
|
|
||||||
public class MesEquitmentController extends BaseMesController<MesEquitment> {
|
public class MesEquitmentController extends BaseMesController<MesEquipment> {
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,29 @@
|
|||||||
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.api.base.IMesPartPtrService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base.MesPartPtrDetailService;
|
||||||
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
||||||
import cn.estsh.i3plus.pojo.mes.bean.MesArea;
|
import cn.estsh.i3plus.pojo.mes.bean.MesArea;
|
||||||
import cn.estsh.i3plus.pojo.mes.bean.MesPartPtr;
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartPtr;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartPtrDetail;
|
||||||
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ptr零件
|
||||||
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesPartPtr")
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesPartPtr")
|
||||||
public class MesPartPtrController extends BaseMesController<MesPartPtr> {
|
public class MesPartPtrController extends BaseMesController<MesPartPtr> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base.MesPartPtrDetailService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||||
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartPtr;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartPtrDetail;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ptr零件
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesPartPtrDetail")
|
||||||
|
public class MesPartPtrDetailController extends BaseMesController<MesPartPtrDetail> {
|
||||||
|
|
||||||
|
@PostMapping(value = "/queryPtrDetail")
|
||||||
|
@ApiOperation(value = "查询节拍列表")
|
||||||
|
public ResultBean getPtrDetail(MesPartPtrDetail mesPartPtrDetail, Pager pager) {
|
||||||
|
try {
|
||||||
|
mesPartPtrDetail.setIsValid(1);
|
||||||
|
mesPartPtrDetail.setOrganizeCode("1154");
|
||||||
|
|
||||||
|
ListPager<MesPartPtrDetail> mesList = baseService.queryPager(mesPartPtrDetail, pager);
|
||||||
|
return ResultBean.success("查询成功").setListPager(mesList)
|
||||||
|
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||||
|
} catch (ImppBusiException busExcep) {
|
||||||
|
return ResultBean.fail(busExcep);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartPtr;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesPartPtrDetail;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class MesPartPtrDetailService extends BaseMesService<MesPartPtrDetail> {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue