117 lines
4.4 KiB
Java
117 lines
4.4 KiB
Java
package org.nl;
|
|
|
|
import cn.dev33.satoken.annotation.SaIgnore;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation;
|
|
import com.alicp.jetcache.anno.config.EnableMethodCache;
|
|
import io.swagger.annotations.Api;
|
|
import org.nl.modules.wql.core.bean.WQLObject;
|
|
import org.nl.modules.wql.util.SpringContextHolder;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
|
|
import org.springframework.boot.web.servlet.ServletComponentScan;
|
|
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
/**
|
|
* 开启审计功能 -> @EnableJpaAuditing
|
|
* https://www.cnblogs.com/niceyoo/p/10908647.html
|
|
*
|
|
* @author ldjun
|
|
* @date 2021/2/22 9:20:19
|
|
*/
|
|
@EnableAsync
|
|
@RestController
|
|
@Api(hidden = true)
|
|
@SpringBootApplication(exclude = {
|
|
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
|
})
|
|
@ServletComponentScan //https://blog.csdn.net/qq_36850813/article/details/101194250
|
|
@EnableTransactionManagement
|
|
@EnableJpaAuditing(auditorAwareRef = "auditorAware")
|
|
@EnableMethodCache(basePackages = "org.nl")
|
|
@EnableCreateCacheAnnotation
|
|
public class AppRun {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
SpringApplication.run(AppRun.class, args);
|
|
}
|
|
|
|
@Bean
|
|
public SpringContextHolder springContextHolder() {
|
|
return new SpringContextHolder();
|
|
}
|
|
|
|
@Bean
|
|
public ServletWebServerFactory webServerFactory() {
|
|
TomcatServletWebServerFactory fa = new TomcatServletWebServerFactory();
|
|
fa.addConnectorCustomizers(connector -> connector.setProperty("relaxedQueryChars", "[]{}"));
|
|
return fa;
|
|
}
|
|
|
|
/**
|
|
* 访问首页提示
|
|
*
|
|
* @return /
|
|
*/
|
|
@GetMapping("/")
|
|
@SaIgnore
|
|
public String index() {
|
|
// WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point");
|
|
// int block = 6;
|
|
// int row = 4; // 排
|
|
// int col = 8;
|
|
// String regionCode = "YSQB01";
|
|
// String regionId = "1663803432005406720";
|
|
// String regionName = "养生区B";
|
|
// for (int i = 5; i <= block; i++) {
|
|
// for (int j = 1; j <= row; j++) {
|
|
// for (int k = 1; k <= col; k++) {
|
|
// String pointCode = "1";
|
|
// // 块
|
|
// pointCode = pointCode + i;
|
|
// // 排
|
|
// if (j < 10) pointCode = pointCode + "0" + j + "-";
|
|
// else pointCode = pointCode + j + "-";
|
|
// // 列
|
|
// if (k < 10) pointCode = pointCode + "0" + k + "-" + "01";
|
|
// else pointCode = pointCode + k + "-" + "01";
|
|
// String name = j + "排" + k + "列" + "1层";
|
|
// String pointStatus = "1";
|
|
// String can_vehicle_type = "3";
|
|
// JSONObject po = new JSONObject();
|
|
// po.put("point_id", IdUtil.getSnowflake(1,1).nextIdStr());
|
|
// po.put("point_code", pointCode);
|
|
// po.put("point_name", name);
|
|
// po.put("point_status", pointStatus);
|
|
// po.put("can_vehicle_type", can_vehicle_type);
|
|
// po.put("region_id", regionId);
|
|
// po.put("region_code", regionCode);
|
|
// po.put("region_name", regionName);
|
|
// po.put("block_num", i);
|
|
// po.put("row_num", j);
|
|
// po.put("col_num", k);
|
|
// po.put("layer_num", 1);
|
|
// po.put("in_order_seq", col - k + 1);
|
|
// po.put("out_order_seq", k);
|
|
// po.put("in_empty_seq", col - k + 1);
|
|
// po.put("out_empty_seq", k);
|
|
// pointTab.insert(po);
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
return "Backend service started successfully";
|
|
}
|
|
}
|
|
|