Fancy
2024-07-24 ee7f2c1ff8b8bdc2352db35dc26253ac8e4d832d
check station API add check line disabled
1个文件已修改
14 ■■■■■ 已修改文件
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/workOrder/WorkOrderSv.java
@@ -3,6 +3,7 @@
import com.alibaba.excel.util.StringUtils;
import com.dy.pmsGlobal.daoBa.BaUserMapper;
import com.dy.pmsGlobal.daoPlt.PltProductMapper;
import com.dy.pmsGlobal.daoPlt.PltProductionLineMapper;
import com.dy.pmsGlobal.daoPlt.PltStationMapper;
import com.dy.pmsGlobal.daoPr.PrAssemblyPlanMapper;
import com.dy.pmsGlobal.daoPr.PrProductionNodeMapper;
@@ -10,6 +11,7 @@
import com.dy.pmsGlobal.daoSta.StaAssemblyWorkLastMapper;
import com.dy.pmsGlobal.pojoBa.BaUser;
import com.dy.pmsGlobal.pojoPlt.PltProduct;
import com.dy.pmsGlobal.pojoPlt.PltProductionLine;
import com.dy.pmsGlobal.pojoPlt.PltStation;
import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan;
import com.dy.pmsGlobal.pojoPr.PrProductionNode;
@@ -49,6 +51,7 @@
    private StaAssemblyWorkHistoryMapper assemblyWorkHistoryDao;
    private PrProductionNodeMapper nodeDao;
    private PltProductMapper productDao;
    private PltProductionLineMapper lineDao;
    @Autowired
    public void setAssemblyDao(PrAssemblyPlanMapper assemblyDao) {
@@ -85,6 +88,10 @@
        this.productDao = productDao;
    }
    @Autowired
    public void setLineDao(PltProductionLineMapper lineDao) {
        this.lineDao = lineDao;
    }
    public BaUser getUserInfo(String id) {
        Long userId = null;
@@ -124,6 +131,13 @@
        } else if (stationInfo.getDisabled()) {
            throw new RuntimeException("工站(" + stationInfo.getName() + ")编码:" + stationId + "在系统已禁用,请先启用工站");
        }
        //检查线体是否被禁用
        PltProductionLine lineInfo = lineDao.selectByPrimaryKey(stationInfo.getLineId());
        if (lineInfo == null ) {
            throw new RuntimeException("工站(" + stationInfo.getName() + ")编码:" + stationId + "所在线体编码:" + lineInfo.getId() + "在系统不存在,请先找管理人员检查");
        }else if(lineInfo.getDisabled()){
            throw new RuntimeException("工站(" + stationInfo.getName() + ")编码:" + stationId + "所在线体编码:" + lineInfo.getName() + "在系统已禁用,请先启用线体");
        }
        return stationInfo;
    }