| | |
| | | import com.zy.core.thread.BarcodeThread; |
| | | import com.zy.core.thread.ScaleThread; |
| | | import com.zy.core.thread.SiemensCrnThread; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private DeviceErrorService deviceErrorService; |
| | | @Autowired |
| | | private BasCrnpService basCrnpService; |
| | | @Autowired |
| | | private ConfigService configService; |
| | | |
| | | @PostMapping("/system/running/status") |
| | | @ManagerAuth(memo = "系统运行状态") |
| | |
| | | return R.ok().add(Cools.add("status", SystemProperties.WCS_RUNNING_STATUS.get())); |
| | | } |
| | | |
| | | @GetMapping("/switchDemo") |
| | | public R switchDemo() { |
| | | //切换演示模式 |
| | | Config demoEnableConfig = configService.selectByCode("demoEnable"); |
| | | if(demoEnableConfig == null){ |
| | | return R.error("演示模式参数不存在"); |
| | | } |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | if (demoEnableConfig.getValue().equals("true")) { |
| | | //开启状态,变更关闭 |
| | | demoEnableConfig.setValue("false"); |
| | | configService.updateById(demoEnableConfig); |
| | | |
| | | map.put("status", false); |
| | | }else { |
| | | //关闭状态,变更开启 |
| | | demoEnableConfig.setValue("true"); |
| | | configService.updateById(demoEnableConfig); |
| | | |
| | | map.put("status", true); |
| | | } |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | | @GetMapping("/getDemoStatus") |
| | | public R getDemoStatus() { |
| | | //切换演示模式 |
| | | Config demoEnableConfig = configService.selectByCode("demoEnable"); |
| | | if(demoEnableConfig == null){ |
| | | return R.error("演示模式参数不存在"); |
| | | } |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | boolean status = false; |
| | | if(demoEnableConfig.getValue().equals("true")){ |
| | | status = true; |
| | | } |
| | | map.put("status", status); |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | | /****************************************************************/ |
| | | /************************** 实时数据 ******************************/ |
| | | /****************************************************************/ |