| | |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.properties.SystemProperties; |
| | | import com.zy.core.thread.*; |
| | | import com.zy.system.entity.license.LicenseVerify; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private BasDevpService basDevpService; |
| | | |
| | | @PostMapping("/system/running/status") |
| | | @ManagerAuth(memo = "系统运行状态") |
| | | // @ManagerAuth(memo = "系统运行状态") |
| | | public R systemRunningStatus(){ |
| | | return R.ok().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get())); |
| | | } |
| | | |
| | | @PostMapping("/system/switch") |
| | | @ManagerAuth(memo = "系统运行开关操作") |
| | | // @ManagerAuth(memo = "系统运行开关操作") |
| | | public R systemSwitch(SystemSwitchParam param) throws InterruptedException { |
| | | if (Cools.isEmpty(param.getOperatorType())){ |
| | | // if (Cools.isEmpty(param.getOperatorType())){ |
| | | // return R.error(); |
| | | // } |
| | | // if (param.getOperatorType() == 0) { |
| | | // if (Cools.isEmpty(param.getPassword())){ |
| | | // return R.error("请输入口令"); |
| | | // } |
| | | // if (!param.getPassword().equals(SystemProperties.WCS_PASSWORD)){ |
| | | // return R.error("口令错误"); |
| | | // } |
| | | // } |
| | | // Thread.sleep(200L); |
| | | //验证许可证是否有效 |
| | | try{ |
| | | boolean systemSign = SystemProperties.WCS_RUNNING_STATUS.get(); |
| | | if (!systemSign){ |
| | | if (new LicenseVerify().verify()){ |
| | | SystemProperties.WCS_RUNNING_STATUS.set(Boolean.TRUE); |
| | | return R.ok(); |
| | | } |
| | | } |
| | | } catch (Exception e){ |
| | | log.error("许可证验证失败!!异常:{}",e.getMessage()); |
| | | return R.error(); |
| | | } |
| | | if (param.getOperatorType() == 0) { |
| | | if (Cools.isEmpty(param.getPassword())){ |
| | | return R.error("请输入口令"); |
| | | } |
| | | if (!param.getPassword().equals(SystemProperties.WCS_PASSWORD)){ |
| | | return R.error("口令错误"); |
| | | } |
| | | } |
| | | Thread.sleep(200L); |
| | | SystemProperties.WCS_RUNNING_STATUS.set(param.getOperatorType()==1?Boolean.TRUE:Boolean.FALSE); |
| | | return R.ok().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get())); |
| | | SystemProperties.WCS_RUNNING_STATUS.set(Boolean.FALSE); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /****************************************************************/ |
| | |
| | | if (null != devpThread) { |
| | | StaProtocol staProtocol = devpThread.getStation().get(siteId); |
| | | if (staProtocol != null) { |
| | | BasDevp basDevp = basDevpService.selectById(siteId); |
| | | BasDevp basDevp = basDevpService.getById(siteId); |
| | | if (basDevp == null) { |
| | | return R.error("数据库维护异常"); |
| | | } |
| | |
| | | vo.setWorkNo(staProtocol.getWorkNo()); // 工作号 |
| | | |
| | | if (staProtocol.getWorkNo() > 0) { |
| | | WrkMast wrkMast = wrkMastService.selectById(staProtocol.getWorkNo()); |
| | | WrkMast wrkMast = wrkMastService.getById(staProtocol.getWorkNo()); |
| | | if (wrkMast != null) { |
| | | vo.setWrkSts(wrkMast.getWrkSts$()); // 工作状态 |
| | | vo.setIoType(wrkMast.getIoType$()); // 入出库类型 |