| | |
| | | |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.pmsGlobal.pojoBa.BaUser; |
| | | import com.dy.pmsGlobal.pojoPlt.PltStation; |
| | | import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan; |
| | | import com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast; |
| | | import jakarta.validation.Valid; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | this.sv = workOrderSv; |
| | | } |
| | | /** |
| | | * 查询用户信息 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping(path="getUserInfo") |
| | | public BaseResponse<BaUser> getUserInfo(String userId){ |
| | | log.info("getUserInfo:{}",userId); |
| | | BaUser userInfo = sv.getUserInfo(userId); |
| | | return BaseResponseUtils.buildSuccess(userInfo); |
| | | } |
| | | /** |
| | | * 查询工站是否已经被占用 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping(path="isStationUsed") |
| | | public BaseResponse<Boolean> isStationUsed(StaAssemblyWorkLast last){ |
| | | String message = sv.isStationUsed(last); |
| | | if ("".equals(message)) { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } else { |
| | | return BaseResponseUtils.buildFail(message); |
| | | } |
| | | @GetMapping(path="getStationInfo") |
| | | public BaseResponse<PltStation> getStationInfo(String stationId){ |
| | | log.info("getStationInfo:{}",stationId); |
| | | PltStation stationInfo = sv.getStationInfo(stationId); |
| | | return BaseResponseUtils.buildSuccess(stationInfo); |
| | | } |
| | | /** |
| | | * 查询工站是否已经被占用 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping(path="checkStationUsed") |
| | | public BaseResponse<StaAssemblyWorkLast> checkStationUsed(String stationId){ |
| | | log.info("checkStationUsed:{}",stationId); |
| | | StaAssemblyWorkLast stationInfo = sv.checkStationUsed(stationId); |
| | | return BaseResponseUtils.buildSuccess(stationInfo); |
| | | } |
| | | /** |
| | | * 根据workId查询workLast |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping(path="getWorkLast") |
| | | public BaseResponse<StaAssemblyWorkLast> getWorkLast(String workId){ |
| | | log.info("getWorkLast:{}",workId); |
| | | StaAssemblyWorkLast workLast = sv.getWorkLast(workId); |
| | | return BaseResponseUtils.buildSuccess(workLast); |
| | | } |
| | | |
| | | /** |
| | | * 查询全部执行中的组装任务清单 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping(path="planList") |
| | | public BaseResponse<List<PrAssemblyPlan>> selectOnLineList(){ |
| | | public BaseResponse<List<PrAssemblyPlan>> selectAssyPlanList(){ |
| | | log.info("selectAssyPlanList"); |
| | | PrAssemblyPlan params = new PrAssemblyPlan(); |
| | | params.setStatus(1); |
| | | List<PrAssemblyPlan> list = sv.selectAssyPlanList(params); |
| | | return BaseResponseUtils.buildSuccess(list); |
| | | } |
| | | /** |
| | | * 根据组装任务查询节点信息 |
| | | * @param |
| | | * @return |
| | | */ |
| | | /* @GetMapping(path="nodeList") |
| | | public BaseResponse<List<PrAssemblyPlan>> selectOnLineList(String processId){ |
| | | PrAssemblyPlan params = new PrAssemblyPlan(); |
| | | params.setStatus(1); |
| | | List<PrAssemblyPlan> list = sv.selectList(params); |
| | | return BaseResponseUtils.buildSuccess(list); |
| | | }*/ |
| | | /** |
| | | * 保存登录信息 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping(path="save") |
| | | public BaseResponse<StaAssemblyWorkLast> save(@RequestBody @Valid QueryVo last){ |
| | | log.info("WorkOrderCtrl.save():{}",last.toString()); |
| | | StaAssemblyWorkLast result = sv.save(last); |
| | | return BaseResponseUtils.buildSuccess(result); |
| | | } |
| | | |
| | | /** |
| | | * 保存登出信息 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping(path="logout") |
| | | public BaseResponse<Boolean> logout(String workId){ |
| | | log.info("WorkOrderCtrl.logout():{}",workId); |
| | | int count = sv.logout(workId); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | /** |
| | | * 添加单个辅助人员 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping(path="addAssistant") |
| | | public BaseResponse<Boolean> addAssistant(String workId ,String assistant){ |
| | | log.info("WorkOrderCtrl.addAssistant():{},{}",workId,assistant); |
| | | int count = sv.addAssistant(workId,assistant); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | /** |
| | | * 删除单个辅助人员 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping(path="removeAssistant") |
| | | public BaseResponse<Boolean> removeAssistant(String workId ,String assistant){ |
| | | log.info("WorkOrderCtrl.removeAssistant():{},{}",workId,assistant); |
| | | log.info("WorkOrderCtrl.removeAssistant()"); |
| | | int count = sv.removeAssistant(workId,assistant); |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | /** |
| | | * 查询辅助人员信息表 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping(path="getAssistantList") |
| | | public BaseResponse<List<BaUser>> getAssistantList(String workId){ |
| | | log.info("WorkOrderCtrl.getAssistantList():{}",workId); |
| | | List<BaUser> result = sv.getAssistantList(workId); |
| | | return BaseResponseUtils.buildSuccess(result); |
| | | } |
| | | |
| | | @GetMapping(path = "test") |
| | | public BaseResponse test() { |