| | |
| | | |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pmsGlobal.daoPlt.PltProductionLineMapper; |
| | | import com.dy.pmsGlobal.daoPlt.PltStationMapper; |
| | | import com.dy.pmsGlobal.pojoPlt.PltProductionLine; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | |
| | | public class ProLineSv { |
| | | |
| | | private PltProductionLineMapper dao; |
| | | private PltStationMapper stationDao; |
| | | |
| | | @Autowired |
| | | public void setDao(PltProductionLineMapper dao) { |
| | | this.dao = dao; |
| | | } |
| | | @Autowired |
| | | public void setStationDao(PltStationMapper stationDao) { |
| | | this.stationDao = stationDao; |
| | | } |
| | | |
| | | @Transactional |
| | |
| | | public List<PltProductionLine> selectAll() { |
| | | return dao.selectAll(); |
| | | } |
| | | |
| | | @Transactional |
| | | public int updateStatus(PltProductionLine line) { |
| | | if(line.disabled){ |
| | | long count = stationDao.selectByLineAndStatus(line.id,false); |
| | | if(count>0){ |
| | | throw new RuntimeException("该生产线还有启用状态的工站"); |
| | | } |
| | | } |
| | | PltProductionLine lineParam = new PltProductionLine(); |
| | | lineParam.id = line.id; |
| | | lineParam.disabled = line.disabled; |
| | | return dao.updateByPrimaryKeySelective(lineParam); |
| | | } |
| | | } |
| | | |