forked from I3-YF/i3plus-mes-pcn-yfai
pcn ext
parent
8bca19c47e
commit
3a48a5e68e
@ -0,0 +1,24 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.api.base;
|
||||
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yumingxing
|
||||
* @version 1.0
|
||||
* @date 2021/1/29 13:24
|
||||
**/
|
||||
public interface ISxOrganizeExtService {
|
||||
|
||||
/**
|
||||
* 根据生产线代码查询工位集合
|
||||
* @param organizeCode 组织代码
|
||||
* @param workCenterCode 生产线代码
|
||||
* @return 工位集合
|
||||
*/
|
||||
@ApiOperation(value = "根据生产线代码查询工位集合", notes = "根据生产线代码查询工位集合")
|
||||
List<MesWorkCell> findWorkCell(String organizeCode, String workCenterCode);
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.base;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.base.ISxOrganizeExtService;
|
||||
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
||||
import cn.estsh.impp.framework.base.controller.MesPcnBaseController;
|
||||
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.Api;
|
||||
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.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: wangjie
|
||||
* @CreateDate: 2021/01/19 15:37
|
||||
* @Description:
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping(CommonConstWords.BASE_URL_MES_PCN + "/ext")
|
||||
@Api(tags = "SX_组织")
|
||||
public class SxOrganizeExtController extends MesPcnBaseController {
|
||||
|
||||
@Autowired
|
||||
private ISxOrganizeExtService organizeService;
|
||||
|
||||
@GetMapping({"/query-work-cell-by-center"})
|
||||
@ApiOperation(
|
||||
value = "查询工作单元",
|
||||
notes = "查询工作单元"
|
||||
)
|
||||
public ResultBean queryWorkCell(String workCenterCode) {
|
||||
try {
|
||||
List<MesWorkCell> areaList = this.organizeService.findWorkCell(AuthUtil.getOrganize().getOrganizeCode(), workCenterCode);
|
||||
return ResultBean.success("操作成功").setResultList(areaList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||
} catch (ImppBusiException var3) {
|
||||
return ResultBean.fail(var3);
|
||||
} catch (Exception var4) {
|
||||
return ImppExceptionBuilder.newInstance().buildExceptionResult(var4);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
||||
|
||||
public class TestBusiController {
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.base;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.base.ISxOrganizeExtService;
|
||||
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
||||
import cn.estsh.i3plus.pojo.mes.repository.MesWorkCellRepository;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wangjie
|
||||
* @version 1.0
|
||||
* @date 2021/1/13 9:28
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SxOrganizeExtService implements ISxOrganizeExtService {
|
||||
|
||||
@Autowired
|
||||
private MesWorkCellRepository workCellRepository;
|
||||
|
||||
@Override
|
||||
public List<MesWorkCell> findWorkCell(String organizeCode, String workCenterCode) {
|
||||
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
|
||||
DdlPreparedPack.getStringEqualPack(workCenterCode, "workCenterCode", packBean);
|
||||
DdlPreparedPack.getNumNOEqualPack(MesPcnEnumUtil.MES_WORK_CELL_TYPE.REWORK.getValue(), "workCellType", packBean);
|
||||
DdlPreparedPack.getOrderByPack(new Object[]{1}, new String[]{"seq"}, packBean);
|
||||
return this.workCellRepository.findByHqlWhere(packBean);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
|
||||
|
||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* @Description : 读取加工结果工步
|
||||
* @Author : wangjie
|
||||
**/
|
||||
@Slf4j
|
||||
@Service("mesWorkResultReadStepService")
|
||||
public class MesWorkResultReadStepService extends BaseStepService {
|
||||
|
||||
@Override
|
||||
public StepResult init(StationRequestBean reqBean) {
|
||||
|
||||
|
||||
|
||||
StationResultBean resultBean = new StationResultBean();
|
||||
|
||||
if (StringUtils.isEmpty(reqBean.getScanInfo())) execSendGuideAndThrowEx(reqBean, resultBean, "请扫描产品条码!");
|
||||
|
||||
|
||||
StepResult stepResult = StepResult.getSuccessComplete();
|
||||
|
||||
|
||||
return stepResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StepResult execute(StationRequestBean reqBean) {
|
||||
|
||||
StationResultBean resultBean = new StationResultBean();
|
||||
|
||||
if (StringUtils.isEmpty(reqBean.getScanInfo())) execSendGuideAndThrowEx(reqBean, resultBean, "请扫描产品条码!");
|
||||
|
||||
|
||||
StepResult stepResult = StepResult.getSuccessComplete();
|
||||
|
||||
|
||||
return stepResult;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue