| | |
| | | import com.zy.common.annotations.OpenApiLog; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.core.enums.WrkIoType; |
| | | 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.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | @RequestMapping("/openapi") |
| | | public class OpenController { |
| | | |
| | | @Value("${mainProcessPlugin}") |
| | | private String mainProcessPlugin; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | @Autowired |
| | |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private ConfigService configService; |
| | | |
| | | //移库任务 |
| | | @PostMapping("/createLocMoveTask") |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/getFakeSystemRunStatus") |
| | | public R getFakeSystemRunStatus() { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | if(mainProcessPlugin.equals("FakeProcess")) { |
| | | map.put("running", false); |
| | | map.put("isFake", true); |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | if(config != null) { |
| | | if(config.getValue().equals("Y")) { |
| | | map.put("running", true); |
| | | } |
| | | } |
| | | } else { |
| | | map.put("isFake", false); |
| | | } |
| | | return R.ok().add(map); |
| | | } |
| | | |
| | | @PostMapping("/startFakeSystem") |
| | | @OpenApiLog(memo = "启动仿真模拟") |
| | | public R startFakeSystem() { |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | if(config != null) { |
| | | config.setValue("Y"); |
| | | configService.updateById(config); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/stopFakeSystem") |
| | | @OpenApiLog(memo = "停止仿真模拟") |
| | | public R stopFakeSystem() { |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | if(config != null) { |
| | | config.setValue("N"); |
| | | configService.updateById(config); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |