| | |
| | | } |
| | | return userInfo; |
| | | } |
| | | |
| | | public PltStation getStationInfo(String id){ |
| | | //仅检查工站信息以及工站占用情况 |
| | | Long stationId = null; |
| | | if(StringUtils.isBlank(id)){ |
| | | throw new RuntimeException("工站编码不能为空"); |
| | |
| | | } |
| | | return stationInfo; |
| | | } |
| | | public StaAssemblyWorkLast checkStationUsed(QueryVo last){ |
| | | public StaAssemblyWorkLast checkStationUsed(String id){ |
| | | StaAssemblyWorkLast result = new StaAssemblyWorkLast(); |
| | | PltStation stationInfo = null; |
| | | if(StringUtils.isBlank(id)){ |
| | | throw new RuntimeException("工站编码不能为空,请检查"); |
| | | } |
| | | stationInfo = getStationInfo(id); |
| | | //检查表中stationId是否已经存在 |
| | | StaAssemblyWorkLast param = new StaAssemblyWorkLast(); |
| | | param.setStationId(stationInfo.getId()); |
| | | param.setStatus(1); |
| | | List<StaAssemblyWorkLast> workLasts = assemblyWorkLastDao.selectList(param); |
| | | if(workLasts.size() > 0){ |
| | | BeanUtils.copyProperties(workLasts.get(0),result); |
| | | }else{ |
| | | result.setStationId(stationInfo.getId()); |
| | | result.setStationName(stationInfo.getName()); |
| | | result.setLineId(stationInfo.getLineId()); |
| | | result.setLineName(stationInfo.getLineName()); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | public StaAssemblyWorkLast checkUserAndStationUsed(QueryVo last){ |
| | | StaAssemblyWorkLast result = new StaAssemblyWorkLast(); |
| | | PltStation stationInfo = null; |
| | | BaUser userInfo = null; |
| | |
| | | @Transactional |
| | | public StaAssemblyWorkLast save(QueryVo last) { |
| | | //先check |
| | | StaAssemblyWorkLast checkResult = checkStationUsed(last); |
| | | StaAssemblyWorkLast checkResult = checkUserAndStationUsed(last); |
| | | //校验planId processId nodeId |
| | | PrAssemblyPlan params = new PrAssemblyPlan(); |
| | | params.setStatus(1); |
| | |
| | | if (count <= 0) { |
| | | throw new RuntimeException("数据库存储失败"); |
| | | } |
| | | StaAssemblyWorkLast result = assemblyWorkLastDao.selectList(staLast).get(0); |
| | | StaAssemblyWorkLast result = assemblyWorkLastDao.selectByPrimaryKey(staLast.getId()); |
| | | return result; |
| | | } |
| | | @Transactional |