diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4449f92 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +### IDEA ### +*.iml +*/target/* +*/*.iml +/.gradle/ +*.pid +logs +/.idea/ \ No newline at end of file diff --git a/kqapi/pom.xml b/kqapi/pom.xml new file mode 100644 index 0000000..828bdf0 --- /dev/null +++ b/kqapi/pom.xml @@ -0,0 +1,240 @@ + + + 4.0.0 + + com.ningdatech + kq-value-added-project + 1.0.0 + + kqapi + 1.0.0 + + + + + + com.google.guava + guava + + + cn.hutool + hutool-all + 5.8.5 + + + + org.projectlombok + lombok + + + + com.baomidou + mybatis-plus-boot-starter + + + com.baomidou + mybatis-plus-extension + + + org.springframework.boot + spring-boot-starter-freemarker + + + + org.apache.commons + commons-pool2 + ${commons-pool2.version} + + + org.apache.commons + commons-lang3 + + + com.alibaba + fastjson + + + org.apache.tomcat.embed + tomcat-embed-core + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-jdbc + + + + org.springframework.boot + spring-boot-devtools + true + true + + + org.springframework.boot + spring-boot-starter-aop + + + + com.github.ben-manes.caffeine + caffeine + + + org.apache.httpcomponents + httpclient + + + org.apache.poi + poi + + + org.apache.poi + poi-ooxml + + + + com.aliyun.oss + aliyun-sdk-oss + 3.15.0 + + + junit + junit + test + + + org.aspectj + aspectjweaver + + + + org.springframework.boot + spring-boot-starter-test + + + org.springframework.boot + spring-boot-configuration-processor + + + com.ningdatech + nd-basic + + + org.slf4j + slf4j-log4j12 + + + spring-boot-starter-security + org.springframework.boot + + + + + com.ningdatech + nd-swagger2-starter + + + org.slf4j + slf4j-log4j12 + + + + + + + mysql + mysql-connector-java + + + + + + + dev + + + dev + + + + test + + test + + + + pre + + pre + + + + prod + + prod + + + + + + + + src/main/resources + + **/* + + + + src/main/java + + **/*.xml + + + + src/main/lib + BOOT-INF/lib/ + + **/*.jar + + + + src/main/resources + BOOT-INF/classes/ + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + 2.6.8 + + true + + + + + repackage + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + + diff --git a/kqapi/src/lib/kingbase8-8.2.0.jar b/kqapi/src/lib/kingbase8-8.2.0.jar new file mode 100644 index 0000000..390ae26 Binary files /dev/null and b/kqapi/src/lib/kingbase8-8.2.0.jar differ diff --git a/kqapi/src/lib/kingbase8-8.6.0.jar b/kqapi/src/lib/kingbase8-8.6.0.jar new file mode 100644 index 0000000..965ca8f Binary files /dev/null and b/kqapi/src/lib/kingbase8-8.6.0.jar differ diff --git a/kqapi/src/lib/zwdd-sdk-java-1.2.0.jar b/kqapi/src/lib/zwdd-sdk-java-1.2.0.jar new file mode 100644 index 0000000..44405ec Binary files /dev/null and b/kqapi/src/lib/zwdd-sdk-java-1.2.0.jar differ diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/App.java b/kqapi/src/main/java/com/ningdatech/kqapi/App.java new file mode 100644 index 0000000..85ee652 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/App.java @@ -0,0 +1,41 @@ +package com.ningdatech.kqapi; + +import com.ningdatech.basic.util.SpringUtils; +import com.ningdatech.kqapi.common.util.SpringContextHolder; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.EnableAspectJAutoProxy; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +/** + * @author zpf + */ +@SpringBootApplication +@EnableAsync +@MapperScan(App.MAPPER_PACKAGES) +@EnableScheduling +@EnableTransactionManagement +@EnableAspectJAutoProxy(exposeProxy = true) +@ComponentScan(basePackages = {"com.ningdatech.kqapi","com.ningdatech.kqapi.common"}) +public class App { + + protected static final String MAPPER_PACKAGES = "com.ningdatech.kqapi.**.mapper"; + + public static void main(String[] args) { + ApplicationContext context = SpringApplication.run(App.class, args); + // 设置applicationContext + SpringUtils.setApplicationContext(context); + } + + @Bean + public SpringContextHolder springContextHolder() { + return new SpringContextHolder(); + } + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/compare/Compare.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/compare/Compare.java new file mode 100644 index 0000000..d42f28c --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/compare/Compare.java @@ -0,0 +1,22 @@ +package com.ningdatech.kqapi.common.compare; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * 字段标记注解 + * + * @author zpf + * @since 2023/07/21 + */ +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +public @interface Compare { + + /** + * 字段名称 + */ + String value(); +} \ No newline at end of file diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/compare/CompareNode.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/compare/CompareNode.java new file mode 100644 index 0000000..f763601 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/compare/CompareNode.java @@ -0,0 +1,47 @@ +package com.ningdatech.kqapi.common.compare; + +/** + * @author zpf + * @since 2023/07/21 + */ +public class CompareNode { + + /** + * 字段 + */ + private String fieldKey; + + /** + * 字段值 + */ + private Object fieldValue; + + /** + * 字段名称 + */ + private String fieldName; + + public String getFieldKey() { + return fieldKey; + } + + public void setFieldKey(String fieldKey) { + this.fieldKey = fieldKey; + } + + public Object getFieldValue() { + return fieldValue; + } + + public void setFieldValue(Object fieldValue) { + this.fieldValue = fieldValue; + } + + public String getFieldName() { + return fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } +} \ No newline at end of file diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/compare/CompareUtils.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/compare/CompareUtils.java new file mode 100644 index 0000000..344e118 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/compare/CompareUtils.java @@ -0,0 +1,182 @@ +package com.ningdatech.kqapi.common.compare; + +import com.alibaba.fastjson.JSONObject; + +import java.lang.reflect.Field; +import java.util.*; + +/** + * 使用须知:
+ * (1)该工具类主要用于两个同类对象的属性值比较;
+ * (2)使用本工具类前,请将对应的类属性上打上 @Compare("xxx") 注解,其中xxx为字段的表达名称;
+ * (3)为了比较灵活,只有打了该注解才会进行比较,不打的字段则不会进行比较
+ * (4)比较后,只会返回有变化的字段,无变化的字符则不返回
+ * + * @author zpf + * @since 2023/07/21 + */ +public class CompareUtils { + + private static final String COMMA = ","; + + /** + * 属性比较 + * + * @param source 源数据对象 + * @param target 目标数据对象 + * @return 对应属性值的比较变化 + */ + public String compare(T source, T target) { + return compare(source, target, null); + } + + + /** + * 属性比较 + * + * @param source 源数据对象 + * @param target 目标数据对象 + * @param ignoreCompareFields 忽略比较的字段 + * @return 对应属性值的比较变化 + */ + public String compare(T source, T target, List ignoreCompareFields) { + if (Objects.isNull(source) && Objects.isNull(target)) { + return ""; + } + Map sourceMap = this.getFiledValueMap(source); + Map targetMap = this.getFiledValueMap(target); + if (sourceMap.isEmpty() && targetMap.isEmpty()) { + return ""; + } + // 如果源数据为空,则只显示目标数据,不显示属性变化情况 + if (sourceMap.isEmpty()) { + return doEmpty(targetMap, ignoreCompareFields); + } + // 如果源数据为空,则显示属性变化情况 + String s = doCompare(sourceMap, targetMap, ignoreCompareFields); + if (!s.endsWith(COMMA)) { + return s; + } + return s.substring(0, s.length() - 1); + } + + public JSONObject compareToJson(T source, T target, List ignoreCompareFields) { + JSONObject res = new JSONObject(); + if (Objects.isNull(source) && Objects.isNull(target)) { + return res; + } + Map sourceMap = this.getFiledValueMap(source); + Map targetMap = this.getFiledValueMap(target); + if (sourceMap.isEmpty() && targetMap.isEmpty()) { + return res; + } + // 如果源数据为空,则只显示目标数据,不显示属性变化情况 + if (sourceMap.isEmpty()) { + return res; + } + + return doCompareJson(sourceMap, targetMap, ignoreCompareFields); + } + + private String doEmpty(Map targetMap, List ignoreCompareFields) { + StringBuilder sb = new StringBuilder(); + Collection values = targetMap.values(); + int size = values.size(); + int current = 0; + for (CompareNode node : values) { + current++; + Object o = Optional.ofNullable(node.getFieldValue()).orElse(""); + if (Objects.nonNull(ignoreCompareFields) && ignoreCompareFields.contains(node.getFieldKey())) { + continue; + } + if (o.toString().length() > 0) { + sb.append("[" + node.getFieldName() + ":" + o + "]"); + if (current < size) { + sb.append(COMMA); + } + } + } + return sb.toString(); + } + + private String doCompare(Map sourceMap, Map targetMap, List ignoreCompareFields) { + StringBuilder sb = new StringBuilder(); + Set keys = sourceMap.keySet(); + int size = keys.size(); + int current = 0; + for (String key : keys) { + current++; + CompareNode sn = sourceMap.get(key); + CompareNode tn = targetMap.get(key); + if (Objects.nonNull(ignoreCompareFields) && ignoreCompareFields.contains(sn.getFieldKey())) { + continue; + } + String sv = Optional.ofNullable(sn.getFieldValue()).orElse("").toString(); + String tv = Optional.ofNullable(tn.getFieldValue()).orElse("").toString(); + // 只有两者属性值不一致时, 才显示变化情况 + if (!sv.equals(tv)) { + sb.append(String.format("[%s:%s -> %s]", sn.getFieldName(), sv, tv)); + if (current < size) { + sb.append(COMMA); + } + } + } + return sb.toString(); + } + + private JSONObject doCompareJson(Map sourceMap, Map targetMap, List ignoreCompareFields) { + JSONObject res = new JSONObject(); + Set keys = sourceMap.keySet(); + int size = keys.size(); + int current = 0; + for (String key : keys) { + current++; + CompareNode sn = sourceMap.get(key); + CompareNode tn = targetMap.get(key); + if (Objects.nonNull(ignoreCompareFields) && ignoreCompareFields.contains(sn.getFieldKey())) { + continue; + } + String sv = Optional.ofNullable(sn.getFieldValue()).orElse("").toString(); + String tv = Optional.ofNullable(tn.getFieldValue()).orElse("").toString(); + // 只有两者属性值不一致时, 才显示变化情况 + if (!sv.equals(tv)) { + JSONObject valueChange = new JSONObject(); + valueChange.put("fieldKey",sn.getFieldKey()); + valueChange.put("old",tv); + valueChange.put("new",sv); + res.put(sn.getFieldName(),valueChange); + } + } + return res; + } + + private Map getFiledValueMap(T t) { + if (Objects.isNull(t)) { + return Collections.emptyMap(); + } + Field[] fields = t.getClass().getDeclaredFields(); + if (Objects.isNull(fields) || fields.length == 0) { + return Collections.emptyMap(); + } + Map map = new LinkedHashMap(); + for (Field field : fields) { + Compare compareAnnotation = field.getAnnotation(Compare.class); + if (Objects.isNull(compareAnnotation)) { + continue; + } + field.setAccessible(true); + try { + String fieldKey = field.getName(); + CompareNode node = new CompareNode(); + node.setFieldKey(fieldKey); + node.setFieldValue(field.get(t)); + node.setFieldName(compareAnnotation.value()); + map.put(field.getName(), node); + } catch (IllegalArgumentException | IllegalAccessException e) { + e.printStackTrace(); + } + } + return map; + } + +} \ No newline at end of file diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/config/BeanConfig.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/config/BeanConfig.java new file mode 100644 index 0000000..0bf84b1 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/config/BeanConfig.java @@ -0,0 +1,109 @@ +package com.ningdatech.kqapi.common.config; + +import lombok.extern.slf4j.Slf4j; +import org.apache.http.Header; +import org.apache.http.client.HttpClient; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.impl.client.DefaultConnectionKeepAliveStrategy; +import org.apache.http.impl.client.DefaultHttpRequestRetryHandler; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.apache.http.message.BasicHeader; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.http.client.ClientHttpRequestFactory; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.StringHttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.web.client.RestTemplate; + +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @Classname BeanConfig + * @Description + * @Date 2023/3/2 9:42 + * @Created by PoffyZhang + */ +@Configuration +@Slf4j +public class BeanConfig { + + + @Bean + public RestTemplate restTemplate() { + // 添加内容转换器,使用默认的内容转换器 + RestTemplate restTemplate = new RestTemplate(httpRequestFactory()); + // 设置编码格式为UTF-8,解决中文乱码问题 + List> converterList = restTemplate.getMessageConverters(); + HttpMessageConverter converterTarget = null; + for (HttpMessageConverter item : converterList) { + if (item.getClass() == StringHttpMessageConverter.class) { + converterTarget = item; + break; + } + } + if (converterTarget != null) { + converterList.remove(converterTarget); + } + HttpMessageConverter converter = new StringHttpMessageConverter(StandardCharsets.UTF_8); + converterList.add(1,converter); + + MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter(); + mappingJackson2HttpMessageConverter.setSupportedMediaTypes(Arrays.asList( + MediaType.TEXT_HTML, + MediaType.TEXT_PLAIN)); + restTemplate.getMessageConverters().add(mappingJackson2HttpMessageConverter); + + log.info("-----restTemplate-----初始化完成"); + return restTemplate; + } + + @Bean + public ClientHttpRequestFactory httpRequestFactory() { + return new HttpComponentsClientHttpRequestFactory(httpClient()); + } + + @Bean + public HttpClient httpClient() { + // 长连接保持30秒 + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(30, TimeUnit.SECONDS); + //设置整个连接池最大连接数 根据自己的场景决定 + connectionManager.setMaxTotal(500); + //同路由的并发数,路由是对maxTotal的细分 + connectionManager.setDefaultMaxPerRoute(500); + + //requestConfig + RequestConfig requestConfig = RequestConfig.custom() + //服务器返回数据(response)的时间,超过该时间抛出read timeout + .setSocketTimeout(10000) + //连接上服务器(握手成功)的时间,超出该时间抛出connect timeout + .setConnectTimeout(5000) + //从连接池中获取连接的超时时间,超过该时间未拿到可用连接,会抛出org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool + .setConnectionRequestTimeout(500) + .build(); + //headers + List
headers = new ArrayList<>(); + headers.add(new BasicHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.16 Safari/537.36")); + headers.add(new BasicHeader("Accept-Encoding", "gzip,deflate")); + headers.add(new BasicHeader("Accept-Language", "zh-CN")); + headers.add(new BasicHeader("Connection", "Keep-Alive")); + headers.add(new BasicHeader("Content-type", "application/json;charset=UTF-8")); + + return HttpClientBuilder.create() + .setDefaultRequestConfig(requestConfig) + .setConnectionManager(connectionManager) + .setDefaultHeaders(headers) + // 保持长连接配置,需要在头添加Keep-Alive + .setKeepAliveStrategy(new DefaultConnectionKeepAliveStrategy()) + //重试次数,默认是3次,没有开启 + .setRetryHandler(new DefaultHttpRequestRetryHandler(2, true)) + .build(); + } +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/config/ConfigurerAdapter.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/config/ConfigurerAdapter.java new file mode 100644 index 0000000..f0b1f32 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/config/ConfigurerAdapter.java @@ -0,0 +1,37 @@ +package com.ningdatech.kqapi.common.config; + +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.alibaba.fastjson.support.config.FastJsonConfig; +import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; + +/** + * @author qinxianyun + */ +@EnableWebMvc +@Configuration +public class ConfigurerAdapter implements WebMvcConfigurer { + + @Override + public void configureMessageConverters(List> converters) { + // 使用 fastjson 序列化,会导致 @JsonIgnore 失效,可以使用 @JSONField(serialize = false) 替换 + FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter(); + List supportMediaTypeList = new ArrayList<>(); + supportMediaTypeList.add(MediaType.APPLICATION_JSON); + FastJsonConfig config = new FastJsonConfig(); + config.setDateFormat("yyyy-MM-dd HH:mm:ss"); + config.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect); + converter.setFastJsonConfig(config); + converter.setSupportedMediaTypes(supportMediaTypeList); + converter.setDefaultCharset(StandardCharsets.UTF_8); + converters.add(converter); + } +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/config/DingOrganizationProperties.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/config/DingOrganizationProperties.java new file mode 100644 index 0000000..5fcf9db --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/config/DingOrganizationProperties.java @@ -0,0 +1,19 @@ +package com.ningdatech.kqapi.common.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/9/9 下午5:37 + */ +@Data +@Configuration +@ConfigurationProperties(prefix = "organization") +public class DingOrganizationProperties { + private List deptVisibleScopes = new ArrayList<>(); +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/config/ProvincialProperties.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/config/ProvincialProperties.java new file mode 100644 index 0000000..cdbf17c --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/config/ProvincialProperties.java @@ -0,0 +1,26 @@ +package com.ningdatech.kqapi.common.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +/** + * @author zpf + * @date 2023/3/2 下午5:37 + */ +@Data +@Configuration +@ConfigurationProperties(prefix = "provincial") +public class ProvincialProperties { + private String host; + + private String pushUrl; + + private String detailUrl; + + private String domainUrl; + + private String key; + + private String secret; +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/BaseFieldConst.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/BaseFieldConst.java new file mode 100644 index 0000000..af3f58a --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/BaseFieldConst.java @@ -0,0 +1,18 @@ +package com.ningdatech.kqapi.common.constant; + +/** + *

+ * 创建人修改人基础字段 + *

+ * + * @author WendyYang + * @since 17:17 2023/01/29 + */ +public interface BaseFieldConst { + + String CREATE_BY = "createBy"; + String UPDATE_BY = "updateBy"; + String CREATE_ON = "createOn"; + String UPDATE_ON = "updateOn"; + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/BizConst.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/BizConst.java new file mode 100644 index 0000000..0784b6f --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/BizConst.java @@ -0,0 +1,108 @@ +package com.ningdatech.kqapi.common.constant; + +import com.ningdatech.basic.model.ApiResponse; + +import java.math.BigDecimal; + +/** + *

+ * 业务常量 + *

+ * + * @author WendyYang + * @since 13:42 2022/12/1 + */ +public interface BizConst { + + /** + * SQL查询一条 + */ + String LIMIT_1 = "limit 1"; + + String COOKIE_KEY = "ND_PROJECT_MANAGEMENT_JSESSION"; + + /** + * 一小时秒数 + **/ + BigDecimal SECONDS_BY_HOUR = new BigDecimal(60 * 60); + + /** + * 十分钟的毫秒数 + */ + long MILLS_10_MIN = 1000L * 60 * 10; + + /** + * 中国行政区划编码 + */ + long ROOT_REGION_CODE = 100000L; + + /** + * 一级行政区划数量 + */ + int NUM_PROVINCE = 34; + + /** + * 默认的父id + */ + long PARENT_ID = 0L; + + /** + * 默认树层级 + */ + int TREE_GRADE = 0; + + /** + * 默认的排序 + */ + int SORT_VALUE = 0; + + /** + * 浙江省的region_id + */ + long ZJ_REGION_CODE = 330000L; + String NINE_AREA_CODE_LAST = "000"; + + /** + * 省/直辖市 level + */ + int GOV_L1 = 1; + + /** + * 市 level + */ + int GOV_L2 = 2; + + /** + * 区/县 level + */ + int GOV_L3 = 3; + + /** + * 密码正则:长度8-20位且至少包含大写字母、小写字母、数字或特殊符号中的任意三种 + */ + String REGEX_PASS = "^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\\W_]+$)(?![a-z0-9]+$)(?![a-z\\W_]+$)(?![0-9\\W_]+$)[a-zA-Z0-9\\W_]{8,20}$"; + + ApiResponse UNAUTHENTICATED = ApiResponse.of(401, "用户未登录", null); + + int MAX_EXPORT_COUNT = 5000; + + String RESPONSE_KEY_DATA = "data"; + String RESPONSE_KEY_ID = "id"; + String RESPONSE_KEY_DING_CODE = "dingCode"; + String RESPONSE_KEY_MATTER_NAME = "matterName"; + String RESPONSE_KEY_ORG_NAME = "orgName"; + String RESPONSE_KEY_USER_STATE = "userState"; + + String RESPONSE_KEY_AREA_NAME = "areaName"; + String ORG_NAME = "organizationName"; + String ORG_CODE = "organizationCode"; + + String DEV = "dev"; + String PRE = "pre"; + String PROD = "prod"; + + String SAVE_SUCCESS = "保存成功"; + String OP_SUCCESS = "操作成功"; + String OP_FAIL = "操作失败"; + String SAVE_FAIL = "保存失败"; +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/CommonConst.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/CommonConst.java new file mode 100644 index 0000000..abab570 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/CommonConst.java @@ -0,0 +1,69 @@ +package com.ningdatech.kqapi.common.constant; + +/** + * @description: 常量 + * @author: LiuXinXin + * @date: 2022/5/5 17:31 + */ +public interface CommonConst { + + String COOKIE_KEY = "ND_JSESSION"; + + Integer EXPORT_PAGE_NUMBER = 1; + Integer EXPORT_PAGE_SIZE = 100000; + String CALL_STATUS = "status"; + String CALL_STATUS_OK_VALUE = "ok"; + + Integer COMMENT_MAX_SIZE = 163; + Integer SUB_COMMENT_SIZE_MIN = 0; + Integer SUB_COMMENT_SIZE_MAX = 160; + + String PROJECT_DECLARE = "项目申报"; + String UNIT_INNER_AUDIT = "单位内部审核"; + String PRELIMINARY_PREVIEW = "项目预审"; + + String DEPT_UNITED_REVIEW = "部门联审"; + String PROVINCE_UNITED_REVIEW = "省级部门联审"; + String ANNUAL_PLAN = "年度计划"; + String CONSTRUCTION_PLAN_REVIEW = "建设方案评审"; + String PROJECT_APPROVAL = "立项批复"; + String TENDER_PURCHASE = "招标采购"; + String PROJECT_PRELIMINARY_INSPECTION = "项目初验"; + String PROJECT_FINAL_INSPECTION = "项目终验"; + + String ARCHIVED = "归档"; + + String FILE_NAME = "name"; + String BASIS_FILE_NAME = "fileName"; + + String NULL = "null"; + + String TITLE = "title"; + + String FILE_NAME_STR = "fileName"; + String FILE_ID_STR = "fileId"; + String ID_STR = "id"; + String FILE_LIST = "fileList"; + String ITEM_BASED = "依据项:"; + String ITEM_BASED_FILE_NAME = "依据文件名:"; + String APPENDIX = "文件:"; + String NEW_CONSTRUCTION = "新建"; + String CONTINUED_CONSTRUCTION = "续建"; + String MONTH = "月"; + String ZHI = "至"; + String YEAR = "年"; + + Integer VERSION_ONE = 1; + Integer VERSION_SIZE = 2; + Integer VERSION_JUDGE = -1; + + String COPY = "副本"; + String PROJECT_REPEAT = " 项目已在其他评价计划中,请勿重复添加!"; + String APP_REPEAT = " 应用已在其他评价计划中,请勿重复添加!"; + Integer REAPPRAISAL_TYPE = 1; + Integer VERIFY_TYPE = 2; + String REPEAT = " 已在其他当前评价计划其他分组中,请勿重复添加!"; + + String NORMAL_TIME_PATTERN = "yyyy-MM-dd"; + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/DefValConst.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/DefValConst.java new file mode 100644 index 0000000..98cecd5 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/DefValConst.java @@ -0,0 +1,34 @@ +package com.ningdatech.kqapi.common.constant; + + +import com.ningdatech.basic.util.StrPool; + +/** + * 默认值 + * + * @author PoffyZhang + */ +public interface DefValConst { + + /** + * 默认的根节点path + */ + String ROOT_PATH = StrPool.COMMA; + /** + * 默认树层级 + */ + Integer TREE_GRADE = 0; + /** + * 默认的父id + */ + Long PARENT_ID = 0L; + /** + * 默认的排序 + */ + Integer SORT_VALUE = 0; + /** + * 字典占位符 + */ + String DICT_PLACEHOLDER = "###"; + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/DingConst.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/DingConst.java new file mode 100644 index 0000000..e30577d --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/DingConst.java @@ -0,0 +1,14 @@ +package com.ningdatech.kqapi.common.constant; + +/** + * 浙政钉常量 + * + * @author CMM + * @since 2023/02/01 14:49 + */ +public interface DingConst { + /** + * 工作通知 + */ + String WORKING_NOTICE = "/message/workNotification"; +} \ No newline at end of file diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/ProjectDeclareConst.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/ProjectDeclareConst.java new file mode 100644 index 0000000..d9132a6 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/ProjectDeclareConst.java @@ -0,0 +1,172 @@ +package com.ningdatech.kqapi.common.constant; + +import java.math.BigDecimal; + +/** + * 项目申报表单数据常量key + * @return + * @author CMM + * @since 2023/01/19 10:31 + */ +public interface ProjectDeclareConst { + + /** + * 基本信息 + */ + class BasicInformation { + // 项目名称 + public static final String PROJECT_NAME = "projectName"; + // 是否一地创新全省共享项目 + public static final String INNOVATION_SHARING_PROJECT = "innovationSharingProject"; + // 是否临时增补 + public static final String TEMPORARY_SUPPLEMENT = "temporarySupplement"; + // 项目负责人 + public static final String PROJECT_LEADER = "projectLeader"; + // 项目负责人手机号 + public static final String PROJECT_LEADER_PHONE_NUMBER = "projectLeaderPhoneNumber"; + // 项目联系人 + public static final String PROJECT_CONTACT = "projectContact"; + // 项目联系人手机号 + public static final String PROJECT_CONTACT_PHONE_NUMBER = "projectContactPhoneNumber"; + // 建设单位 + public static final String CONSTRUCTION_UNIT = "constructionUnit"; + // 建设单位统一信用代码 + public static final String CONSTRUCTION_UNIT_UNIFIED_CREDIT_CODE = "constructionUnitUnifiedCreditCode"; + // 项目类型 + public static final String PROJECT_TYPE = "projectType"; + // 是否首次新建 + public static final String FIRST_NEW_CONSTRUCTION = "firstNewConstruction"; + // 预算年度 + public static final String BUDGET_YEAR = "projectYear"; + // 建设开始时间 + public static final String CONSTRUCTION_START_TIME = "constructionStartTime"; + // 建设结束时间 + public static final String CONSTRUCTION_END_TIME = "constructionEndTime"; + // 四大体系 + public static final String FOUR_SYSTEM = "fourSystem"; + // 是否数字化改革项目 + public static final String DIGITAL_REFORM_PROJECT = "digitalReformProject"; + // 建设层级 + public static final String CONSTRUCTION_HIERARCHY = "constructionHierarchy"; + // 立项依据材料 + public static final String PROJECT_BASIS_MATERIAL = "projectBasisMaterial"; + // 发改编码 + public static final String CHANGE_CODE = "changeCode"; + // 财政编码 + public static final String FISCAL_CODE = "fiscalCode"; + // 是否上云 + public static final String ON_CLOUD = "onCloud"; + // 项目简介 + public static final String PROJECT_INTRODUCTION = "projectIntroduction"; + } + + /** + * 资金申报情况 + */ + class FundDeclareInfo { + // 申报金额 + public static final String DECLARE_AMOUNT = "declareAmount"; + // 自有资金 + public static final String OWN_FUND = "ownFund"; + // 政府投资-本级财政资金 + public static final String GOVERNMENT_INVESTMENT_SAME_LEVEL_FUND = "governmentInvestmentSameLevelFund"; + // 政府投资-上级补助资金 + public static final String GOVERNMENT_INVESTMENT_SUPERIOR_FUND = "governmentInvestmentSuperiorFund"; + // 银行贷款 + public static final String BANK_LOAN = "bankLoan"; + // 其他资金 + public static final String OTHER_FUND = "otherFund"; + } + + /** + * 总投资分配情况 + */ + class TotalInvestmentAllocations { + // 软件开发 + public static final String SOFTWARE_DEVELOPMENT = "softwareDevelopment"; + // 云资源、硬件配置 + public static final String CLOUD_RESOURCE_HARDWARE_CONFIGURATION = "cloudResourceHardwareConfiguration"; + // 第三方服务 + public static final String THIRD_PARTY_SERVICE = "thirdPartyService"; + } + /** + * 年度支付计划 + */ + class AnnualPaymentPlan { + // 年度支付金额 + public static final String ANNUAL_PAYMENT_AMOUNT = "annualPaymentAmount"; + // 自有资金 + public static final String OWN_FUND = "ownFund"; + // 政府投资-本级财政资金 + public static final String GOVERNMENT_INVESTMENT_SAME_LEVEL_FUND = "governmentInvestmentSameLevelFund"; + // 政府投资-上级补助资金 + public static final String GOVERNMENT_INVESTMENT_SUPERIOR_FUND = "governmentInvestmentSuperiorFund"; + // 银行贷款 + public static final String BANK_LOAN = "bankLoan"; + // 其他 + public static final String OTHER = "other"; + } + /** + * 核心业务 + */ + class CoreBusiness { + + } + /** + * 安全投入 + */ + class SafetyInput { + // 投入项 + public static final String INPUT_ITEM = "inputItem"; + // 内容描述 + public static final String CONTENT_DESCRIPTION = "contentDescription"; + // 金额 + public static final String AMOUNT = "amount"; + } + /** + * 工程形象进度 + */ + class ProjectImageProgress { + // 第一季度 + public static final String FIRST_QUARTER = "firstQuarter"; + // 第二季度 + public static final String SECOND_QUARTER = "secondQuarter"; + // 第三季度 + public static final String THIRD_QUARTER = "thirdQuarter"; + // 第四季度 + public static final String FOURTH_QUARTER = "fourthQuarter"; + } + /** + * 附件 + */ + class Appendix { + + } + /** + * 备注 + */ + class Remark { + + } + /** + * 应用信息 + */ + class ApplicationInformation { + + } + + class Number { + public static final BigDecimal DECLARE_AMOUNT_JUDGEMENT = BigDecimal.valueOf(1000); + + //区县是500万 + public static final BigDecimal DECLARE_COUNTY_AMOUNT_JUDGEMENT = BigDecimal.valueOf(500); + + public static final Integer COUNTRY_BUILD_LEVEL = 1; + public static final Integer PROVINCE_BUILD_LEVEL = 2; + public static final Integer PROVINCE_SELF_BUILD_LEVEL = 3; + public static final Integer CITY_BUILD_LEVEL = 4; + public static final Integer CITY_SELF_BUILD_LEVEL = 5; + public static final Integer DISTRICTS_COUNTRIES_BUILD_LEVEL = 6; + public static final Integer VILLAGES_TOWNS_BUILD_LEVEL = 7; + } +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/RegionConst.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/RegionConst.java new file mode 100644 index 0000000..66c5eac --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/RegionConst.java @@ -0,0 +1,50 @@ +package com.ningdatech.kqapi.common.constant; + +/** + *

+ * RegionConst + *

+ * + * @author WendyYang + * @since 13:57 2023/3/1 + */ +public interface RegionConst { + + //---------------------------------------地区层级(缩写RL)------------------------------------------------------------- + + int RL_PROVINCE = 1; + + int RL_CITY = 2; + + int RL_COUNTY = 3; + + //---------------------------------------地区编码(缩写RC)------------------------------------------------------------- + + /** + * 丽水行政区划编码 + */ + String RC_LS = "331100"; + //丽水开发区 + String LS_KF = "331118"; + String LS_KF_IRS = "331151"; + String RC_LS_SBJ_IRS = "331101"; + //遂昌县 + String RC_SC = "331123"; + String LS_KF_NAME = "开发区"; + + /** + * 中国行政区划编码 + */ + String RC_CHINA = "100000"; + + + /** + * 浙江行政区划编码 + */ + String RC_ZJ = "330000"; + + //----------------------------------------地区父级ID(缩写PID)--------------------------------------------------------- + + long PID_CHINA = 0; + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/StateMachineConst.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/StateMachineConst.java new file mode 100644 index 0000000..9cd0f1f --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/constant/StateMachineConst.java @@ -0,0 +1,14 @@ +package com.ningdatech.kqapi.common.constant; + +/** + * @author CMM + * @since 2023/02/07 16:24 + */ + +public class StateMachineConst { + + public static final String PROJECT_DECLARE = "projectDeclare"; + public static final String APPLICATION_DECLARE = "applicationDeclare"; + public static final String LI_SHUI_CITY_AREA_CODE = "331100"; + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/enumeration/BoolDisplayEnum.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/enumeration/BoolDisplayEnum.java new file mode 100644 index 0000000..9c45703 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/enumeration/BoolDisplayEnum.java @@ -0,0 +1,32 @@ +package com.ningdatech.kqapi.common.enumeration; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author liuxinxin + * @date 2022/7/26 上午9:21 + */ +@AllArgsConstructor +@Getter +public enum BoolDisplayEnum { + + /** + * true + */ + Y, + + /** + * false + */ + N; + + public static boolean judgeBoolean(String key) { + return Y.name().equals(key); + } + + public static BoolDisplayEnum judgeBoolean(boolean key) { + return key ? Y : N; + } + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/enumeration/CommonEnum.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/enumeration/CommonEnum.java new file mode 100644 index 0000000..753c33b --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/enumeration/CommonEnum.java @@ -0,0 +1,39 @@ +package com.ningdatech.kqapi.common.enumeration; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author zpf + * @date 2023/3/12 上午9:21 + */ +@AllArgsConstructor +@Getter +public enum CommonEnum { + /** + * 公共的一些枚举 + */ + YES(1,"是",1), + NO(0,"否",1), + + LS_SBJ(331100,"市本级",2), + LS_LD(331102,"莲都区",2), + LS_QT(331121,"青田县",2), + LS_JY(331122,"缙云县",2), + LS_SC(331123,"遂昌县",2), + LS_SY(331124,"松阳县",2), + LS_YH(331125,"云和县",2), + LS_QY(331126,"庆元县",2), + LS_JN(331127,"景宁畲族自治县",2), + LS_LQ(331181,"龙泉市",2), + LS_KFQ(331199,"开发区",2), + ZWDD(0,"浙政钉",3), + MOBILE(1,"短信",3); + + private Integer code; + private String desc; + private Integer groupId; + + + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/enumeration/ExportOptionEnum.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/enumeration/ExportOptionEnum.java new file mode 100644 index 0000000..9185c77 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/enumeration/ExportOptionEnum.java @@ -0,0 +1,157 @@ +package com.ningdatech.kqapi.common.enumeration; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + + +/** + * 导出选项枚举 + * + * @author CMM + * @since 2023/02/10 16:38 + */ +@Getter +@AllArgsConstructor +@NoArgsConstructor +public enum ExportOptionEnum { + /** + * 导出选项 + */ + id(1, "项目ID"), + + projectName(2, "项目名称"), + + areaCode(3, "行政区划编码"), + + area(4, "行政区划名称"), + + responsibleMan(5, "项目负责人"), + + responsibleManMobile(6, "项目负责人手机号"), + + contactName(7, "项目联系人"), + + contactPhone(8, "项目联系人手机号"), + + higherSuperOrg(9, "上级业务主管单位"), + + higherSuperOrgCode(10, "上级主管单位浙政钉ID"), + + superOrg(11, "本级主管部门"), + + superOrgCode(12, "本级主管部门浙政钉ID"), + + buildOrgName(13, "建设单位名称"), + + buildOrgZheJiangGovDingId(14, "建设单位浙政钉ID"), + + orgCreditCode(15, "建设单位统一信用代码"), + + projectType(16, "项目类型"), + + isFirst(17, "是否首次新建"), + + relatedExistsApplication(18, "关联应用"), + + relatedExistsApplicationCode(19, "关联应用IRS编码"), + + declareAmount(20, "申报金额"), + + approvedTotalInvestmentIncrease(21, "批复金额"), + + /** + * 表里没有 + */ + budgetSource(22, "预算来源"), + + projectYear(23, "预算年度"), + + projectIntroduction(24, "项目简介"), + + buildBasis(25, "立项依据"), + + buildLevel(26, "建设层级"), + + developCode(27, "发改编码"), + + financialCode(28, "财政编码"), + + /** + * 表里没有 + */ + informationValidity(29, "信息是否有效"), + + + isDigitalReform(30, "是否数字化改革项目"), + + bizDomain(31, "综合应用领域"), + + isCloud(32, "是否上云"), + + cloudType(33, "云类型"), + + fourSystems(34, "四大体系"), + isTemporaryAugment(35, "是否临时增补"), + + protectionLevel(36, "等保级别"), + + isSecretComments(37, "是否密评"), + + businessNumber(38, "业务编号"), + + businessName(39, "业务名称"), + + orgName(40, "单位名称"), + + softwareDevelopmentAmount(41, "软件开发"), + + cloudHardwarePurchaseAmount(42, "云资源、硬件购置"), + + thirdPartyAmount(43, "第三方服务"), + + safetyInputTitle(44, "投入项"), + + safetyInputDescribe(45, "内容描述"), + + safetyInputAmount(46, "金额"), + + annualPlanAmount(47, "年度支付金额"), + + annualPlanHaveAmount(48, "自有资金"), + + declareGovOwnFinanceAmount(49, "政府投资-本级财政资金"), + + declareGovSuperiorFinanceAmount(50, "政府投资-上级补助资金"), + + declareBankLendingAmount(51, "银行贷款"), + + declareOtherAmount(52, "其它资金"), + + engineeringSpeedOne(53, "第一季度"), + + engineeringSpeedTwo(54, "第二季度"), + + engineeringSpeedThree(55, "第三季度"), + + engineeringSpeedFour(56, "第四季度"), + + preliminaryPlanFile(57, "初步方案"), + + supportingMaterialsFile(58, "附件-佐证材料"), + + projectRemarks(59, "备注"), + processStatusName(60, "流程状态名称"), + processLaunchTime(61,"流程发起时间"), + processHandleTime(62,"流程处理时间"), + + projectStatusName(63,"项目状态名称"), + + createOn(64,"创建时间"), + + updateOn(65,"更新时间"); + + + private Integer code; + private String desc; +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/enumeration/ProjectProcessStageEnum.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/enumeration/ProjectProcessStageEnum.java new file mode 100644 index 0000000..8c2d16e --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/enumeration/ProjectProcessStageEnum.java @@ -0,0 +1,39 @@ +package com.ningdatech.kqapi.common.enumeration; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; + +import java.util.Objects; + +@Getter +@AllArgsConstructor +@NoArgsConstructor +public enum ProjectProcessStageEnum { + /** + * 项目流程配置 阶段枚举 + */ + ORG_INTERNAL_APPROVAL_PROCESS(1,"单位内部审批流程"), + PROJECT_PREQUALIFICATION_APPROVAL_PROCESS(2,"项目预审审批流程"), + DEPARTMENT_JOINT_APPROVAL_PROCESS(3,"部门联合审批流程"), + CONSTRUCTION_PROJECT_APPROVAL_PROCESS(4,"建设方案审批流程"), + ACCEPTANCE_DECLARATION_APPROVAL_PROCESS(5,"验收申报审批流程"), + APPLY_DELAY(6,"申请延期审批流程"), + APPLY_BORROW(7,"申请借阅审批流程"); + + private Integer code; + private String desc; + + public static String getDesc(Integer code) { + if (Objects.isNull(code)) { + return StringUtils.EMPTY; + } + for (ProjectProcessStageEnum t : ProjectProcessStageEnum.values()) { + if (code.equals(t.getCode())) { + return t.desc; + } + } + return StringUtils.EMPTY; + } +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/errorcode/AppErrorCode.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/errorcode/AppErrorCode.java new file mode 100644 index 0000000..76df261 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/errorcode/AppErrorCode.java @@ -0,0 +1,24 @@ +package com.ningdatech.kqapi.common.errorcode; + +import lombok.Getter; + +/** + * @author LiuXinXin + */ +@Getter +public enum AppErrorCode { + USER(100), + + AUTH(101); + + private final Integer code; + + AppErrorCode(Integer code) { + this.code = code; + } + + public Integer getCode() { + return code; + } + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/handler/GlobalExceptionHandler.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/handler/GlobalExceptionHandler.java new file mode 100644 index 0000000..82a981e --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/handler/GlobalExceptionHandler.java @@ -0,0 +1,62 @@ +package com.ningdatech.kqapi.common.handler; + +import com.ningdatech.basic.enumeration.Status; +import com.ningdatech.basic.model.ApiResponse; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.support.DefaultMessageSourceResolvable; +import org.springframework.http.HttpStatus; +import org.springframework.validation.BindException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.servlet.NoHandlerFoundException; + +import javax.validation.ConstraintViolation; +import javax.validation.ConstraintViolationException; +import java.util.stream.Collectors; + +/** + * @description: 统一错误处理 + * @author: liuxinxin + * @date: 2023/01/03 11:39 + */ +@Slf4j +@ControllerAdvice +@ResponseStatus(HttpStatus.BAD_REQUEST) +public class GlobalExceptionHandler { + + @ResponseBody + @ExceptionHandler(value = NoHandlerFoundException.class) + public ApiResponse noHandlerFoundException(NoHandlerFoundException e) { + log.error("【全局异常拦截】NoHandlerFoundException: 请求方法 {}, 请求路径 {}", e.getRequestURL(), e.getHttpMethod()); + return ApiResponse.ofStatus(Status.REQUEST_NOT_FOUND); + } + + @ResponseBody + @ExceptionHandler(value = {MethodArgumentNotValidException.class, BindException.class}) + public ApiResponse bindException(BindException e) { + String msg = e.getAllErrors().stream() + .map(DefaultMessageSourceResolvable::getDefaultMessage) + .collect(Collectors.joining(",")); + return ApiResponse.of(Status.BAD_REQUEST.getCode(), msg, null); + } + + @ResponseBody + @ExceptionHandler(value = ConstraintViolationException.class) + public ApiResponse constraintViolationException(ConstraintViolationException e) { + String msg = e.getConstraintViolations().stream() + .map(ConstraintViolation::getMessage) + .collect(Collectors.joining(",")); + return ApiResponse.of(Status.BAD_REQUEST.getCode(), msg, null); + } + + @ResponseBody + @ExceptionHandler(value = Exception.class) + public ApiResponse handlerException(Exception e) { + log.error("【全局异常拦截】: 异常信息 {}: {} ", e.getClass().getSimpleName(), e); + return ApiResponse.of(Status.BAD_REQUEST.getCode(), e.getMessage(), null); + } + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/handler/GlobalResponseHandler.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/handler/GlobalResponseHandler.java new file mode 100644 index 0000000..9adeba0 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/handler/GlobalResponseHandler.java @@ -0,0 +1,58 @@ +package com.ningdatech.kqapi.common.handler; + +import com.ningdatech.basic.model.ApiResponse; +import org.springframework.core.MethodParameter; +import org.springframework.http.MediaType; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.server.ServerHttpRequest; +import org.springframework.http.server.ServerHttpResponse; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; +import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; + +/** + * @Author liuxinxin + * @Date 2021/7/21 11:26 + * @Version 1.0 + **/ +@RestControllerAdvice(basePackages = { + "com.ningdatech.kqapi.zzsfw.controller" +}) +public class GlobalResponseHandler implements ResponseBodyAdvice { + + private static final String SWAGGER_CLASS_PREFIX = "springfox.documentation"; + + @Override + public boolean supports(MethodParameter methodParameter, Class> aClass) { + return filter(methodParameter); + } + + @Override + public Object beforeBodyWrite(Object o, MethodParameter methodParameter, MediaType mediaType, + Class> aClass, ServerHttpRequest serverHttpRequest, + ServerHttpResponse serverHttpResponse) { + ApiResponse apiResponse = ApiResponse.ofSuccess(o); + // 处理字符串时,遇到了类型转换的问题,debug一步一步跟踪,原来是对于字符串的ContentType是“text-plain”, + // ConverterType是StringHttpMessageConverter这个类型转换, + // 由于将结果封装成了自定义的ApiResponse类型,所以有ApiResponse转换成String报错 + // 所以需要对String类型的返回值单独进行处理 +// if (o instanceof String) { +// return JSONUtil.toJsonStr(apiResponse); +// } + return ApiResponse.ofSuccess(o); +// return o; + } + + private Boolean filter(MethodParameter methodParameter) { + Class declaringClass = methodParameter.getDeclaringClass(); + // swagger中的所有返回不进行统一封装 + if (declaringClass.getName().contains(SWAGGER_CLASS_PREFIX)) { + return false; + } + if (methodParameter.hasMethodAnnotation(ExceptionHandler.class)) { + return false; + } + // 如果本身就是使用ApiResponse返回,则不需要进行格式化 + return !methodParameter.getParameterType().equals(ApiResponse.class); + } +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/util/BizUtils.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/BizUtils.java new file mode 100644 index 0000000..80b6442 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/BizUtils.java @@ -0,0 +1,137 @@ +package com.ningdatech.kqapi.common.util; + +import cn.hutool.core.util.StrUtil; +import com.ningdatech.basic.util.StrPool; +import org.apache.commons.lang3.StringUtils; +import org.springframework.util.NumberUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.stream.Collectors; + +import static java.util.stream.Collectors.toList; + +/** + *

+ * BizUtils + *

+ * + * @author WendyYang + * @since 17:32 2023/1/29 + */ +public class BizUtils { + + private BizUtils() { + + } + + public static > void notEmpty(T objs, Consumer consumer) { + if (objs != null && !objs.isEmpty()) { + consumer.accept(objs); + } + } + + public static List splitToNum(String str, Class aClass) { + if (StrUtil.isEmpty(str)) { + return Collections.emptyList(); + } + return Arrays.stream(str.split(StrPool.COMMA)) + .map(w -> NumberUtils.parseNumber(w, aClass)) + .collect(Collectors.toList()); + } + + public static List splitToLong(String str) { + return splitToNum(str, Long.class); + } + + + public static void notNull(T obj, Consumer consumer) { + if (obj != null) { + consumer.accept(obj); + } + } + + public static void notBlank(String str, Consumer consumer) { + if (StrUtil.isNotBlank(str)) { + consumer.accept(str); + } + } + + public static boolean getJSONType(String str) { + boolean result = false; + if (StringUtils.isNotBlank(str)) { + str = str.trim(); + if (str.startsWith("{") && str.endsWith("}")) { + result = true; + } else if (str.startsWith("[") && str.endsWith("]")) { + result = true; + } + } + return result; + } + + public static String uuid32() { + return UUID.randomUUID().toString().replace("-", ""); + } + + /** + * 对象分组取第一条 + * + * @param objs 对象集合 + * @param group 分组函数 + * @param comparator 比较器 + * @return java.util.Collection + * @author WendyYang + **/ + public static Collection groupFirst(Collection objs, Function group, Comparator comparator) { + return groupFirstMap(objs, group, comparator).values(); + } + + /** + * 对象分组取第一条 + * + * @param objs 对象集合 + * @param group 分组函数 + * @param comparator 比较器 + * @return java.util.Collection + * @author WendyYang + **/ + public static Map groupFirstMap(Collection objs, Function group, Comparator comparator) { + return objs.stream().collect(Collectors.groupingBy(group, + Collectors.collectingAndThen(toList(), w -> { + w.sort(comparator); + return w.get(0); + }))); + } + + public static String inSqlJoin(List strings) { + return strings.stream().map(w -> "'" + w + "'").collect(Collectors.joining(StrPool.COMMA, StrPool.LEFT_BRACKET, StrPool.RIGHT_BRACKET)); + } + + public static LocalDateTime convertDate(Date date) { + if (Objects.nonNull(date)) { + return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); + } + return null; + } + + public static String computeRise(Integer numa, Integer numb) { + if((Objects.isNull(numb)|| numb.equals(0)) && + (Objects.isNull(numa)|| numa.equals(0))){ + return "0"; + } + if(Objects.isNull(numa) || numa.equals(0)){ + return "-100"; + } + if(Objects.isNull(numb)|| numb.equals(0)){ + return "100"; + } + return BigDecimal.valueOf((numa - numb) * 100.0).divide(BigDecimal.valueOf(numb),2, RoundingMode.CEILING) + .stripTrailingZeros().toPlainString(); + } +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/util/CallBack.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/CallBack.java new file mode 100644 index 0000000..49f2bcd --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/CallBack.java @@ -0,0 +1,25 @@ +package com.ningdatech.kqapi.common.util; + +/** + * @author qinxianyun + * @see {@link SpringContextHolder} + * 针对某些初始化方法,在SpringContextHolder 初始化前时,
+ * 可提交一个 提交回调任务。
+ * 在SpringContextHolder 初始化后,进行回调使用 + */ + +public interface CallBack { + /** + * 回调执行方法 + */ + void executor(); + + /** + * 本回调任务名称 + * @return / + */ + default String getCallBackName() { + return Thread.currentThread().getId() + ":" + this.getClass().getName(); + } +} + diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/util/CodeUtil.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/CodeUtil.java new file mode 100644 index 0000000..03faee7 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/CodeUtil.java @@ -0,0 +1,27 @@ +package com.ningdatech.kqapi.common.util; + +import com.ningdatech.basic.util.StrPool; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.stream.Collectors; + +/** + * @Classname CodeUtil + * @Description + * @Date 2023/6/20 16:06 + * @Author PoffyZhang + */ +@Slf4j +public class CodeUtil { + + public static Collection convertStrToList(String str) { + if(StringUtils.isBlank(str)){ + return Collections.emptyList(); + } + return Arrays.stream(str.split(StrPool.COMMA)).collect(Collectors.toList()); + } +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/util/CommonInputStreamResource.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/CommonInputStreamResource.java new file mode 100644 index 0000000..8e38ea9 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/CommonInputStreamResource.java @@ -0,0 +1,53 @@ +package com.ningdatech.kqapi.common.util; + +import org.springframework.core.io.InputStreamResource; + +import java.io.InputStream; + +public class CommonInputStreamResource extends InputStreamResource { + /*** + * 文件長度 + */ + private int length; + /*** + * 文件名稱 + */ + private String fileName; + public CommonInputStreamResource(InputStream inputStream) { + super(inputStream); + } + public CommonInputStreamResource(InputStream inputStream, int length,String fileName) { + super(inputStream); + this.length = length; + this.fileName = fileName; + } + /** + * 覆写父类方法 + * 如果不重写这个方法,并且文件有一定大小,那么服务端会出现异常 + * {@code The multi-part request contained parameter data (excluding uploaded files) that exceeded} + * + * @return + */ + @Override + public String getFilename() { + return this.fileName; + } + /** + * 覆写父类 contentLength 方法 + * 因为 {@link org.springframework.core.io.AbstractResource#contentLength()}方法会重新读取一遍文件, + * 而上传文件时,restTemplate 会通过这个方法获取大小。然后当真正需要读取内容的时候,发现已经读完,会报如下错误。 + * + * java.lang.IllegalStateException: InputStream has already been read - do not use InputStreamResource if a stream needs to be read multiple times + * at org.springframework.core.io.InputStreamResource.getInputStream(InputStreamResource.java:96) + * + *

+ * ref:com.amazonaws.services.s3.model.S3ObjectInputStream#available() + * + * @return + */ + @Override + public long contentLength() { + int estimate = length; + return estimate == 0 ? 1 : estimate; + } +} \ No newline at end of file diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/util/CryptUtils.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/CryptUtils.java new file mode 100644 index 0000000..732ea34 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/CryptUtils.java @@ -0,0 +1,85 @@ +package com.ningdatech.kqapi.common.util; + +import org.apache.commons.codec.binary.Hex; + +import javax.crypto.Mac; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.security.InvalidKeyException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +/** + * 加密工具 + * @author hank + */ +public class CryptUtils { + + /** + * 默认的算法 + */ + private static final String DE_KEY_MAC = "HmacMD5"; + + /** + * 默认的字符集 + */ + private static final Charset DE_CHARSET = StandardCharsets.UTF_8; + + + /** + * 使用默认的算法(HmacMD5) 得到hmac 16进制字符串 + * @param inputStr 需要加密的串 + * @param key key + * @return 16进制字符串 + * @throws Exception + */ + public static String encryptHMAC(String inputStr, String key) throws Exception { + return encryptHMAC(inputStr, key, DE_KEY_MAC); + } + /** + * 使用指定的算法得到hmac 16进制字符串 + * @param inputStr 需要加密的串 + * @param key key + * @param keyMac hmac算法 + * @return 16进制字符串 + * @throws Exception + */ + public static String encryptHMAC(String inputStr, String key, String keyMac) throws Exception { + return Hex.encodeHexString(encryptHMAC(inputStr.getBytes(DE_CHARSET), key, keyMac)); + } + + public static String MD5Encode(String origin) throws NoSuchAlgorithmException { + MessageDigest md = MessageDigest.getInstance("MD5"); + return Hex.encodeHexString(md.digest(origin.getBytes(DE_CHARSET))); + } + + private static byte[] encryptHMAC(byte[] data, String key, String keyMac) throws Exception { + + SecretKey secretKey = new SecretKeySpec(key.getBytes(DE_CHARSET), keyMac); + Mac mac = Mac.getInstance(secretKey.getAlgorithm()); + mac.init(secretKey); + return mac.doFinal(data); + } + + /** + * 生成HMAC-MD5值 + * @param data 消息数据 + * @param key 密钥 + * @return HMAC-MD5值 + * @throws NoSuchAlgorithmException + * @throws InvalidKeyException + */ + public static byte[] hmacMd5(byte[] data, byte[] key) + throws NoSuchAlgorithmException, InvalidKeyException { + SecretKeySpec signingKey = new SecretKeySpec(key, "HmacMD5"); + Mac mac = Mac.getInstance("HmacMD5"); + mac.init(signingKey); + return mac.doFinal(data); + } + + public static void main(String[] args) throws Exception{ + System.out.println("HMACStr:\n" + encryptHMAC("a", "hank")); + } +} \ No newline at end of file diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/util/FreemarkerWordUtil.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/FreemarkerWordUtil.java new file mode 100644 index 0000000..02b69d6 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/FreemarkerWordUtil.java @@ -0,0 +1,104 @@ +package com.ningdatech.kqapi.common.util; + +import cn.hutool.core.io.IoUtil; +import com.ningdatech.basic.exception.BizException; +import freemarker.template.Configuration; +import freemarker.template.Template; +import freemarker.template.TemplateException; +import lombok.extern.slf4j.Slf4j; +import org.apache.http.entity.ContentType; +import org.springframework.core.io.ByteArrayResource; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +/** + *

+ * FreemarkerWordUtil + *

+ * + * @author WendyYang + * @since 2023/7/24 + **/ +@Slf4j +public class FreemarkerWordUtil { + + private static void setDownFileName(HttpServletResponse response, String fileName) { + String fileNameEncoded; + try { + fileNameEncoded = URLEncoder.encode(fileName, "UTF-8"); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("文件名编码异常"); + } + response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileNameEncoded); + } + + private static final Configuration CONFIGURATION = new Configuration(Configuration.VERSION_2_3_31); + + static { + CONFIGURATION.setDefaultEncoding("UTF-8"); + CONFIGURATION.setClassForTemplateLoading(FreemarkerWordUtil.class, "/template"); + } + + /** + * 生成word文件 + * + * @param dataMap word中需要展示的动态数据,用map集合来保存 + * @param templateName word模板名称,例如:test.ftl + * @param filePath 文件生成的目标路径,例如:D:/wordFile/ + * @param fileName 生成的文件名称,例如:test.doc + */ + public static void create(Object dataMap, String templateName, String filePath, String fileName) { + try { + Template template = CONFIGURATION.getTemplate(templateName); + //输出文件 + File outFile = new File(filePath + File.separator + fileName); + //如果输出目标文件夹不存在,则创建 + if (!outFile.getParentFile().exists()) { + boolean ignore = outFile.getParentFile().mkdirs(); + } + //将模板和数据模型合并生成文件 + Writer out = new BufferedWriter(new OutputStreamWriter(Files.newOutputStream(outFile.toPath()), StandardCharsets.UTF_8)); + //生成文件 + template.process(dataMap, out); + IoUtil.flush(out); + IoUtil.close(out); + } catch (Exception e) { + log.error("根据模版生成Word文件失败:", e); + throw BizException.wrap("根据模版生成Word文件失败"); + } + } + + public static void export(String fileName, Object data, HttpServletResponse response, String templateName) throws TemplateException, IOException { + Template template = CONFIGURATION.getTemplate(templateName); + response.setCharacterEncoding(StandardCharsets.UTF_8.displayName()); + response.setContentType(ContentType.APPLICATION_JSON.getMimeType()); + setDownFileName(response, fileName); + try (StringWriter out = new StringWriter(); + Writer writer = new BufferedWriter(out, 4096)) { + template.process(data, writer); + try (InputStream is = new ByteArrayResource(out.toString().getBytes(StandardCharsets.UTF_8)).getInputStream(); + ServletOutputStream outputStream = response.getOutputStream()) { + // 缓冲区 + byte[] buffer = new byte[1024]; + int bytesToRead; + // 通过循环将读入的Word文件的内容输出到浏览器中 + while ((bytesToRead = is.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesToRead); + } + } + } + + + } + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/util/GzipUtils.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/GzipUtils.java new file mode 100644 index 0000000..46d393f --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/GzipUtils.java @@ -0,0 +1,89 @@ +package com.ningdatech.kqapi.common.util; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; + +/** + *

+ * 压缩为Gzip + *

+ * + * @author WendyYang + */ +public class GzipUtils { + /** + * 使用gzip进行压缩 + */ + public static String compress(String primStr) { + if (primStr == null || primStr.length() == 0) { + return primStr; + } + ByteArrayOutputStream out = new ByteArrayOutputStream(); + GZIPOutputStream gzip = null; + try { + gzip = new GZIPOutputStream(out); + gzip.write(primStr.getBytes()); + } catch (IOException e) { + throw new RuntimeException(e); + } finally { + if (gzip != null) { + try { + gzip.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + return new sun.misc.BASE64Encoder().encode(out.toByteArray()); + } + + /** + * 使用gzip进行解压缩 + */ + public static String uncompress(String compressedStr) { + if (compressedStr == null) { + return null; + } + ByteArrayOutputStream out = new ByteArrayOutputStream(); + ByteArrayInputStream in = null; + GZIPInputStream ginzip = null; + byte[] compressed = null; + String decompressed = null; + try { + compressed = new sun.misc.BASE64Decoder().decodeBuffer(compressedStr); + in = new ByteArrayInputStream(compressed); + ginzip = new GZIPInputStream(in); + + byte[] buffer = new byte[1024]; + int offset = -1; + while ((offset = ginzip.read(buffer)) != -1) { + out.write(buffer, 0, offset); + } + decompressed = out.toString(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (ginzip != null) { + try { + ginzip.close(); + } catch (IOException e) { + } + } + if (in != null) { + try { + in.close(); + } catch (IOException e) { + } + } + try { + out.close(); + } catch (IOException e) { + } + } + return decompressed; + } + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/util/HmacAuthUtil.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/HmacAuthUtil.java new file mode 100644 index 0000000..c5bc135 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/HmacAuthUtil.java @@ -0,0 +1,82 @@ +package com.ningdatech.kqapi.common.util; + +import org.apache.commons.math3.util.Pair; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import javax.xml.bind.DatatypeConverter; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URLEncoder; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +public class HmacAuthUtil { + /** + * 构造http请求 header + * + * @param url 请求url,全路径格式,比如:https://bcdsg.zj.gov.cn/api/p/v1/user.get + * @param requestMethod 请求方法,大写格式,如:GET, POST + * @param accessKey 应用的 AK + * @param secretKey 应用的 SK + * @return + */ + public static Map generateHeader(String url, String requestMethod, String accessKey, String secretKey) { + Map header = new HashMap<>(); + try { + DateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US); + dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); + String date = dateFormat.format(new Date()); + URI uri = URI.create(url); + String canonicalQueryString = getCanonicalQueryString(uri.getQuery()); + String message = requestMethod.toUpperCase() + "\n" + uri.getPath() + "\n" + canonicalQueryString + "\n" + accessKey + "\n" + date + "\n"; + Mac mac = Mac.getInstance("HmacSHA256"); + mac.init(new SecretKeySpec(secretKey.getBytes(), "HmacSHA256")); + byte[] hash = mac.doFinal(message.getBytes()); + // to lowercase hexits + DatatypeConverter.printHexBinary(hash); + // to base64 + String sign = DatatypeConverter.printBase64Binary(hash); + header.put("X-BG-HMAC-SIGNATURE", sign); + header.put("X-BG-HMAC-ALGORITHM", "hmac-sha256"); + header.put("X-BG-HMAC-ACCESS-KEY", accessKey); + header.put("X-BG-DATE-TIME", date); + System.out.println(date); + } catch (Exception e) { + throw new RuntimeException("generate jc brain header error", e); + } + return header; + } + + private static String getCanonicalQueryString(String query) { + if (query == null || query.trim().length() == 0) { + return ""; + } + List> queryParamList = new ArrayList<>(); + String[] params = query.split("&"); + for (String param : params) { + String[] keyValue = param.split("="); + Pair pair = new Pair(keyValue[0], keyValue.length > 1 ? keyValue[1] : ""); + queryParamList.add(pair); + } + List> sortedParamList = queryParamList.stream().sorted(Comparator.comparing(param -> param.getKey() + "=" + Optional.ofNullable(param.getValue()).orElse(""))).collect(Collectors.toList()); + List> encodeParamList = new ArrayList<>(); + sortedParamList.stream().forEach(param -> { + try { + String key = URLEncoder.encode(param.getKey(), "utf-8"); + String value = URLEncoder.encode(Optional.ofNullable(param.getValue()).orElse(""), "utf-8"); + encodeParamList.add(new Pair<>(key, value)); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("encoding error"); + } + }); + StringBuilder queryParamString = new StringBuilder(64); + for (Pair encodeParam : encodeParamList) { + queryParamString.append(encodeParam.getKey()).append("=").append(Optional.ofNullable(encodeParam.getValue()).orElse("")); + queryParamString.append("&"); + } + return queryParamString.substring(0, queryParamString.length() - 1); + } +} \ No newline at end of file diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/util/HttpUtil.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/HttpUtil.java new file mode 100644 index 0000000..17f355f --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/HttpUtil.java @@ -0,0 +1,246 @@ +package com.ningdatech.kqapi.common.util; + +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.conn.ssl.DefaultHostnameVerifier; +import org.apache.http.conn.ssl.NoopHostnameVerifier; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.conn.ssl.TrustStrategy; +import org.apache.http.conn.util.PublicSuffixMatcher; +import org.apache.http.conn.util.PublicSuffixMatcherLoader; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.ssl.SSLContexts; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; + +import javax.net.ssl.SSLContext; +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +public class HttpUtil { + private Logger logger = LoggerFactory.getLogger(getClass()); + private RequestConfig requestConfig = RequestConfig.custom() + .setSocketTimeout(15000) + .setConnectTimeout(15000) + .setConnectionRequestTimeout(15000) + .build(); + private static HttpUtil instance = null; + private HttpUtil(){} + + public static HttpUtil getInstance(){ + if (instance == null) { + instance = new HttpUtil(); + } + return instance; + } + + /** + * 发送 post 请求 + * @param httpUrl 地址 + */ + public String sendHttpPost(String httpUrl) { + HttpPost httpPost= new HttpPost(httpUrl);// 创建 httpPost + return sendHttpPost(httpPost); + } + + /** + * 发送 post 请求 + * @param httpUrl 地址 + * @param params 参数(格式:key1=value1&key2=value2) + */ + public String sendHttpPost(String httpUrl, String params) { + HttpPost httpPost= new HttpPost(httpUrl);// 创建 httpPost + try { + //设置参数 + StringEntity stringEntity = new StringEntity(params, "UTF-8"); + stringEntity.setContentType("application/x-www-form-urlencoded"); + httpPost.setEntity(stringEntity); + } catch (Exception e) { + logger.error(e.getMessage(),e); + } + return sendHttpPost(httpPost); + } + + /** + * 发送 post 请求 + * @param httpUrl 地址 + * @param maps 参数 + */ + public String sendHttpPost(String httpUrl, Map maps) { + HttpPost httpPost= new HttpPost(httpUrl);// 创建 httpPost + // 创建参数队列 + List nameValuePairs = new ArrayList(); + for (String key : maps.keySet()) { + nameValuePairs.add(new BasicNameValuePair(key, maps.get(key))); + } + try { + httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs, "UTF-8")); + } catch (Exception e) { + logger.error(e.getMessage(),e); + } + return sendHttpPost(httpPost); + } + + /** + * 发送 Post请求 + * @param httpPost + *@return + */ + private String sendHttpPost(HttpPost httpPost) { + CloseableHttpClient httpClient = null; + CloseableHttpResponse response = null; + HttpEntity entity = null; + String responseContent = null; + try { + // 创建默认的 httpClient 实例. + httpClient = HttpClients.createDefault(); + httpPost.setConfig(requestConfig); + // 执行请求 + response = httpClient.execute(httpPost); + entity = response.getEntity(); + responseContent = EntityUtils.toString(entity, "UTF-8"); + } catch (Exception e) { + logger.error(e.getMessage(),e); + } finally { + try { + // 关闭连接,释放资源 + if (response != null) { + response.close(); + } + if (httpClient != null) { + httpClient.close(); + } + } catch (IOException e) { + logger.error(e.getMessage(),e); + } + } + return responseContent; + } + + /** + * 发送 get 请求 + * @param httpUrl + */ + public String sendHttpGet(String httpUrl) { + HttpGet httpGet = new HttpGet(httpUrl);// 创建 get 请求 + return sendHttpGet(httpGet); + } + + /** + * 发送 get请求 Https + * @param httpUrl + */ + public String sendHttpsGet(String httpUrl) { + HttpGet httpGet = new HttpGet(httpUrl);// 创建 get 请求 + return sendHttpsGet(httpGet); + } + + /** + * 发送 Get请求 + * @param httpGet + *@return + */ + private String sendHttpGet(HttpGet httpGet) { + CloseableHttpClient httpClient = null; + CloseableHttpResponse response = null; + HttpEntity entity = null; + String responseContent = null; + try { + // 创建默认的 httpClient 实例. + httpClient = HttpClients.createDefault(); + httpGet.setConfig(requestConfig); + // 执行请求 + response = httpClient.execute(httpGet); + entity = response.getEntity(); + responseContent = EntityUtils.toString(entity, "UTF-8"); + } catch (Exception e) { + logger.error(e.getMessage(),e); + } finally { + try { + // 关闭连接,释放资源 + if (response != null) { + response.close(); + } + if (httpClient != null) { + httpClient.close(); + } + } catch (IOException e) { + logger.error(e.getMessage(),e); + } + } + return responseContent; + } + + /** + * 发送 Get请求 Https + *@return + */ + private String sendHttpsGet(HttpGet httpGet) { + CloseableHttpClient httpClient = null; + CloseableHttpResponse response = null; + HttpEntity entity = null; + String responseContent = null; + try { + // 创建默认的 httpClient 实例. + PublicSuffixMatcher publicSuffixMatcher = PublicSuffixMatcherLoader.load(new + URL(httpGet.getURI().toString())); + DefaultHostnameVerifier hostnameVerifier = new DefaultHostnameVerifier(publicSuffixMatcher); + httpClient = HttpClients.custom().setSSLHostnameVerifier(hostnameVerifier).build(); + httpGet.setConfig(requestConfig); + // 执行请求 + response = httpClient.execute(httpGet); + entity = response.getEntity(); + responseContent = EntityUtils.toString(entity, "UTF-8"); + } catch (Exception e) { + logger.error(e.getMessage(),e); + } finally { + try { + // 关闭连接,释放资源 + if (response != null) { + response.close(); + } + if (httpClient != null) { + httpClient.close(); + } + } catch (IOException e) { + logger.error(e.getMessage(),e); + } + } + return responseContent; + } + + /** + * 通过该工厂类创建的RestTemplate发送请求时,可忽略https证书认证 + * @return 工厂 + */ + public static HttpComponentsClientHttpRequestFactory generateHttpRequestFactory(){ + try{ + TrustStrategy acceptingTrustStrategy = ((x509Certificates, authType) -> true); + SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(null, acceptingTrustStrategy).build(); + SSLConnectionSocketFactory connectionSocketFactory = new SSLConnectionSocketFactory(sslContext, new NoopHostnameVerifier()); + + HttpClientBuilder httpClientBuilder = HttpClients.custom(); + httpClientBuilder.setSSLSocketFactory(connectionSocketFactory); + CloseableHttpClient httpClient = httpClientBuilder.build(); + HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(); + factory.setHttpClient(httpClient); + return factory; + }catch (Exception e){ + e.printStackTrace(); + } + return null; + } +} \ No newline at end of file diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/util/Md5Utils.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/Md5Utils.java new file mode 100644 index 0000000..80f083a --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/Md5Utils.java @@ -0,0 +1,52 @@ +package com.ningdatech.kqapi.common.util; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; + +public class Md5Utils { + private static final Logger LOGGER = LoggerFactory.getLogger(Md5Utils.class); + + public static byte[] md5(String s) { + MessageDigest algorithm; + try { + algorithm = MessageDigest.getInstance("MD5"); + algorithm.reset(); + algorithm.update(s.getBytes(StandardCharsets.UTF_8)); + return algorithm.digest(); + } catch (Exception e) { + LOGGER.error("MD5 Error...", e); + } + return null; + } + + private static String toHex(byte[] hash) { + if (hash == null) { + return null; + } + StringBuilder buf = new StringBuilder(hash.length * 2); + int i; + for (i = 0; i < hash.length; i++) { + if ((hash[i] & 0xff) < 0x10) { + buf.append("0"); + } + buf.append(Long.toString(hash[i] & 0xff, 16)); + } + return buf.toString(); + } + + public static String hash(String s) { + try { + String hex = toHex(md5(s)); + if (hex == null) { + return s; + } + return new String(hex.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8); + } catch (Exception e) { + LOGGER.error("not supported charset:", e); + return s; + } + } +} \ No newline at end of file diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/util/RefreshKeyUtil.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/RefreshKeyUtil.java new file mode 100644 index 0000000..28ffb67 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/RefreshKeyUtil.java @@ -0,0 +1,58 @@ +package com.ningdatech.kqapi.common.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * @Classname RefreshKeyUtil + * @Description + * @Date 2023/6/27 10:03 + * @Author PoffyZhang + */ +@Slf4j +public class RefreshKeyUtil { + public static String getRequestSecret(String appKey, String appSecret,Long requestTime) { + // 刷新秘钥 + HttpUtil httpUtil = HttpUtil.getInstance(); + log.info("请求密钥" + appSecret); + String sign = Md5Utils.hash (appKey + appSecret + requestTime); + String refreshUrl = "http://interface.zjzwfw.gov.cn/gateway/app/refreshTokenByKey.htm"; + log.info(refreshUrl); + Map map = new HashMap<>(); + map.put("appKey",appKey); + map.put("sign",sign); + map.put("requestTime",requestTime + ""); + String result = httpUtil.sendHttpPost(refreshUrl,map); + log.info(result); + JSONObject dataJson = JSON.parseObject(result).getJSONObject("datas"); + if(Objects.nonNull(dataJson)){ + return dataJson.getString("requestSecret"); + } + return result; + } + + public static String refreshSecret(String appKey, String refreshSecret,Long requestTime) { + // 刷新秘钥 + HttpUtil httpUtil = HttpUtil.getInstance(); + log.info("刷新密钥" + refreshSecret); + String refreshSign = Md5Utils.hash (appKey + refreshSecret + requestTime); + String refreshUrl = "http://interface.zjzwfw.gov.cn/gateway/app/refreshTokenBySec.htm"; + log.info(refreshUrl); + Map map = new HashMap<>(); + map.put("appKey",appKey); + map.put("sign",refreshSign); + map.put("requestTime",requestTime + ""); + String result = httpUtil.sendHttpPost(refreshUrl,map); + log.info(result); + JSONObject dataJson = JSON.parseObject(result).getJSONObject("datas"); + if(Objects.nonNull(dataJson)){ + return dataJson.getString("requestSecret"); + } + return result; + } +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/common/util/SpringContextHolder.java b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/SpringContextHolder.java new file mode 100644 index 0000000..1104523 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/common/util/SpringContextHolder.java @@ -0,0 +1,150 @@ +package com.ningdatech.kqapi.common.util; + +import java.util.ArrayList; +import java.util.List; + + +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.DisposableBean; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.core.env.Environment; +import org.springframework.lang.NonNull; + +import lombok.extern.slf4j.Slf4j; + +/** + * @author qinxianyun + */ +@Slf4j +public class SpringContextHolder implements ApplicationContextAware, DisposableBean { + + private static ApplicationContext applicationContext = null; + private static final List CALL_BACKS = new ArrayList<>(); + private static boolean addCallback = true; + + /** + * 针对 某些初始化方法,在SpringContextHolder 未初始化时 提交回调方法。 + * 在SpringContextHolder 初始化后,进行回调使用 + * + * @param callBack 回调函数 + */ + public synchronized static void addCallBacks(CallBack callBack) { + if (addCallback) { + SpringContextHolder.CALL_BACKS.add(callBack); + } else { + log.warn("CallBack:{} 已无法添加!立即执行", callBack.getCallBackName()); + callBack.executor(); + } + } + + /** + * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. + */ + @SuppressWarnings("unchecked") + public static T getBean(String name) { + assertContextInjected(); + return (T) applicationContext.getBean(name); + } + + /** + * 从静态变量applicationContext中取得Bean, 自动转型为所赋值对象的类型. + */ + public static T getBean(Class requiredType) { + assertContextInjected(); + return applicationContext.getBean(requiredType); + } + + /** + * 获取SpringBoot 配置信息 + * + * @param property 属性key + * @param defaultValue 默认值 + * @param requiredType 返回类型 + * @return / + */ + public static T getProperties(String property, T defaultValue, Class requiredType) { + T result = defaultValue; + try { + result = getBean(Environment.class).getProperty(property, requiredType); + } catch (Exception ignored) { + } + return result; + } + + /** + * 获取SpringBoot 配置信息 + * + * @param property 属性key + * @return / + */ + public static String getProperties(String property) { + return getProperties(property, null, String.class); + } + + /** + * 获取SpringBoot 配置信息 + * + * @param property 属性key + * @param requiredType 返回类型 + * @return / + */ + public static T getProperties(String property, Class requiredType) { + return getProperties(property, null, requiredType); + } + + /** + * 检查ApplicationContext不为空. + */ + private static void assertContextInjected() { + if (applicationContext == null) { + throw new IllegalStateException("applicationContext属性未注入, 请在applicationContext" + + ".xml中定义SpringContextHolder或在SpringBoot启动类中注册SpringContextHolder."); + } + } + + /** + * 清除SpringContextHolder中的ApplicationContext为Null. + */ + private static void clearHolder() { + log.debug("清除SpringContextHolder中的ApplicationContext:" + + applicationContext); + applicationContext = null; + } + + @Override + public void destroy() { + SpringContextHolder.clearHolder(); + } + + @Override + public void setApplicationContext(@NonNull ApplicationContext applicationContext) throws BeansException { + if (SpringContextHolder.applicationContext != null) { + log.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + SpringContextHolder.applicationContext); + } + SpringContextHolder.applicationContext = applicationContext; + if (addCallback) { + for (CallBack callBack : SpringContextHolder.CALL_BACKS) { + callBack.executor(); + } + CALL_BACKS.clear(); + } + SpringContextHolder.addCallback = false; + } + + /** + * 获取当前启用的配置文件 + *
    + *
  • 生产环境:prod
  • + *
  • 开发环境:dev
  • + *
+ * + * @return java.lang.String + * @author WendyYang + **/ + public static String getActiveProfile() { + String[] strings = applicationContext.getEnvironment().getActiveProfiles(); + return strings[0]; + } + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/controller/DscSxAdsShareItemQltQlsxCommonIDVKqController.java b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/controller/DscSxAdsShareItemQltQlsxCommonIDVKqController.java new file mode 100644 index 0000000..d8cfe52 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/controller/DscSxAdsShareItemQltQlsxCommonIDVKqController.java @@ -0,0 +1,26 @@ +package com.ningdatech.kqapi.zzsfw.controller; + +import io.swagger.annotations.Api; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 省回流_政务服务_数据共享_事项基本信息表 前端控制器 + *

+ * + * @author ZPF + * @since 2023-10-25 + */ +@Slf4j +@Validated +@RestController +@RequestMapping("/api/v1/zzsfw/") +@Api(value = "DscSxAdsShareItemQltQlsxCommonIDVKqController", tags = "柯桥-政务数据") +@RequiredArgsConstructor +public class DscSxAdsShareItemQltQlsxCommonIDVKqController { + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/controller/NdKqZzsfwMenuController.java b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/controller/NdKqZzsfwMenuController.java new file mode 100644 index 0000000..4745531 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/controller/NdKqZzsfwMenuController.java @@ -0,0 +1,42 @@ +package com.ningdatech.kqapi.zzsfw.controller; + + +import com.ningdatech.kqapi.zzsfw.entity.vo.MattersVO; +import com.ningdatech.kqapi.zzsfw.entity.vo.ZoneVO; +import com.ningdatech.kqapi.zzsfw.manage.MatterManage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + *

+ * 前端控制器 + *

+ * + * @author ZPF + * @since 2023-10-27 + */ +@Slf4j +@Validated +@RestController +@RequestMapping("/api/v1/zzsfw/") +@Api(value = "NdKqZzsfwMenuController", tags = "柯桥-政务数据") +@RequiredArgsConstructor +public class NdKqZzsfwMenuController { + private final MatterManage matterManage; + + @ApiOperation(value = "获取政务事项数据列表", notes = "获取政务事项数据列表") + @GetMapping("/matters") + public List getMatters() { + return matterManage.getMatters(); + } +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/entity/DscSxAdsShareItemQltQlsxCommonIDVKq.java b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/entity/DscSxAdsShareItemQltQlsxCommonIDVKq.java new file mode 100644 index 0000000..dc7df47 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/entity/DscSxAdsShareItemQltQlsxCommonIDVKq.java @@ -0,0 +1,422 @@ +package com.ningdatech.kqapi.zzsfw.entity.entity; + +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalDateTime; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + *

+ * 省回流_政务服务_数据共享_事项基本信息表 + *

+ * + * @author ZPF + * @since 2023-10-25 + */ +@Data +@TableName("dsc_sx_ads_share_item_qlt_qlsx_common_i_d_v_kq") +@ApiModel(value = "DscSxAdsShareItemQltQlsxCommonIDVKq对象", description = "省回流_政务服务_数据共享_事项基本信息表") +public class DscSxAdsShareItemQltQlsxCommonIDVKq implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("事项唯一标识") + @TableId + private String rowguid; + + @ApiModelProperty("写入同步时间") + private LocalDateTime updateDate; + + @ApiModelProperty("事项更新类型") + private String updateType; + + @ApiModelProperty("事项类型") + private String qlKind; + + @ApiModelProperty("主项编码") + private String qlMainitemId; + + @ApiModelProperty("子项编码") + private String qlSubitemId; + + @ApiModelProperty("事权层级") + private String shiquancj; + + @ApiModelProperty("行政区划代码") + private String belongxiaqucode; + + @ApiModelProperty("实施机关组织机构代码(主管部门组织机构代码)") + private String qlDepOrgcdoe; + + @ApiModelProperty("权力来源") + private String itemsource; + + @ApiModelProperty("版本号") + private String versionNumber; + + @ApiModelProperty("事项入库时间") + private LocalDateTime versionDate; + + @ApiModelProperty("事项状态生效时间") + private LocalDateTime qlEffectTime; + + @ApiModelProperty("事项内部编码") + private String qlInnerCode; + + @ApiModelProperty("事项名称") + private String qlName; + + @ApiModelProperty("事项状态") + private String qlState; + + @ApiModelProperty("法定依据(审批依据;实施依据)") + private String lawbasis; + + @ApiModelProperty("法定期限") + private Long anticipateDay; + + @ApiModelProperty("法定期限单位") + private String anticipateType; + + @ApiModelProperty("承诺期限") + private Long promiseDay; + + @ApiModelProperty("办事者到办事现场次数") + private Long applyerminCount; + + @ApiModelProperty("是否列为国家、省、市、县级行政审批制度改革试点") + private String isPilot; + + @ApiModelProperty("实施机关(主管部门名称)") + private String qlDep; + + @ApiModelProperty("实施或牵头的处(科)室名称") + private String leadDept; + + @ApiModelProperty("办件类型") + private String bjtype; + + @ApiModelProperty("本级审批性质") + private String benjispxz; + + @ApiModelProperty("办理频率") + private String handleFrequency; + + @ApiModelProperty("行政相对人性质(适用对象(行政相对人性质);服务相对人性质)") + private String xingzhenxdrxz; + + @ApiModelProperty("审批条件(申请条件;受理条件)") + private String applyCondition; + + @ApiModelProperty("办件结果文件名称(审批结果)") + private String banjianFinishfiles; + + @ApiModelProperty("咨询电话") + private String linkTel; + + @ApiModelProperty("监督投诉电话") + private String superviseTel; + + @ApiModelProperty("电脑端网上办理地址") + private String webapplyurl; + + @ApiModelProperty("网上咨询网址") + private String webconsulturl; + + @ApiModelProperty("是否收费") + private String chargeFlag; + + @ApiModelProperty("收费依据") + private String chargeBasis; + + @ApiModelProperty("法人关注点") + private String rightclassQiyezt; + + @ApiModelProperty("面向法人的对象分类") + private String rightclassQiyedx; + + @ApiModelProperty("个人关注点") + private String rightclassGerensx; + + @ApiModelProperty("面向个人的对象分类") + private String rightclassGerendx; + + @ApiModelProperty("内部流程信息") + private String inFlowInfo; + + @ApiModelProperty("业务申报材料") + private String materialInfo; + + @ApiModelProperty("材料情形说明") + private String materialCaseInfo; + + @ApiModelProperty("收费项目") + private String chargeitemInfo; + + @ApiModelProperty("常见问题解答") + private String qaInfo; + + @ApiModelProperty("受理地点信息") + private String acceptAddressInfo; + + @ApiModelProperty("交换标识") + private String syncSign; + + @ApiModelProperty("交换时间") + private LocalDateTime syncDate; + + @ApiModelProperty("交换错误描述") + private String syncErrorDesc; + + @ApiModelProperty("部门组织机构代码") + private String ouorgcode; + + @ApiModelProperty("部门编码") + private String ouguid; + + @ApiModelProperty("法人登录地址(电脑端法人认证地址)") + private String farenurl; + + @ApiModelProperty("电脑端个人认证标识") + private String gerenflag; + + @ApiModelProperty("是否统建系统(是否使用统一网上申报)") + private String isTongjian; + + @ApiModelProperty("事项编码") + private String qlFullId; + + @ApiModelProperty("委托下放") + private String entrust; + + @ApiModelProperty("委托下放说明") + private String entrustdes; + + @ApiModelProperty("最少上门次数说明") + private String applyerminCountDesc; + + @ApiModelProperty("事项所属业务类型") + private String outypecode; + + @ApiModelProperty("对外公布办理程序描述") + private String outFlowDesc; + + @ApiModelProperty("办结类型") + private String banjianFinishtype; + + @ApiModelProperty("是否允许特别程序申请") + private String isSpecialpro; + + @ApiModelProperty("删除数据标识") + private String state2; + + @ApiModelProperty("不适宜开展网上申报") + private String nosuitApply; + + @ApiModelProperty("是否接入统一办件库") + private String isUnifydo; + + @ApiModelProperty("是否是上级主管部门统建系统") + private String isUpunify; + + @ApiModelProperty("权力属性") + private String qlAtt; + + @ApiModelProperty("备注") + private String baknote; + + @ApiModelProperty("星级服务(网上办理业务模式)") + private String webapplymode; + + @ApiModelProperty("权力来源方式") + private String itemsourcetype; + + @ApiModelProperty("是否可以适用处罚简易程序") + private String isSimplepunish; + + @ApiModelProperty("是否涉及征收(税)费减免的审批") + private String isLevywaiver; + + @ApiModelProperty("征收标准") + private String feebasis; + + @ApiModelProperty("自由裁量") + private String factInfo; + + @ApiModelProperty("涉密或敏感") + private String isCs; + + @ApiModelProperty("未接入统一办件库其他原因说明") + private String unifydodes; + + @ApiModelProperty("极少业务") + private String isVlb; + + @ApiModelProperty("nounify_do") + private String nounifyDo; + + @ApiModelProperty("乡镇延伸事项的部门源事项") + private String qlInnerCodeItem; + + @ApiModelProperty("是否投资(bak1)") + private String isTouzip; + + @ApiModelProperty("行业主题分类") + private String hangyeclasstype; + + @ApiModelProperty("其他行政权力子类型") + private String qlSubKind; + + @ApiModelProperty("移动端网上办理地址") + private String appwebapplyurl; + + @ApiModelProperty("移动端网上预约地址") + private String appappointmenturl; + + @ApiModelProperty("电脑端网上预约地址") + private String appointmenturl; + + @ApiModelProperty("是否网上预约") + private String isWebappointment; + + @ApiModelProperty("网上预约时段") + private String webappointmentperiod; + + @ApiModelProperty("主要内容") + private String maincontext; + + @ApiModelProperty("共同实施单位") + private String doDept; + + @ApiModelProperty("相关附件") + private String relatedguid; + + @ApiModelProperty("相关附件信息") + private String related; + + @ApiModelProperty("是否提供快递送达") + private String isExpress; + + @ApiModelProperty("公共服务事项子类型") + private String serviceSubKind; + + @ApiModelProperty("是否列入最多跑一次事项清单") + private String ispyc; + + @ApiModelProperty("联办事项") + private String lbsx; + + @ApiModelProperty("外部流程图") + private String outFlowUrl; + + @ApiModelProperty("受理机构") + private String acpInstitution; + + @ApiModelProperty("决定机构") + private String decInstitution; + + @ApiModelProperty("涉及的内容(公共服务:主要内容)") + private String contentInvolve; + + @ApiModelProperty("适用对象说明") + private String applicableObject; + + @ApiModelProperty("行政相对人权利和义务") + private String xingzhenxdrxy; + + @ApiModelProperty("有无数量限制") + private String countLimit; + + @ApiModelProperty("数量限制情况说明") + private String countNote; + + @ApiModelProperty("禁止性要求") + private String banRequirement; + + @ApiModelProperty("事项审查类型") + private String shixiangsctype; + + @ApiModelProperty("事项审查类型说明") + private String shixiangsclx; + + @ApiModelProperty("申请方式") + private String applyType; + + @ApiModelProperty("联系电话") + private String applyTypeTel; + + @ApiModelProperty("邮箱") + private String applyTypeMail; + + @ApiModelProperty("传真") + private String applyTypeFax; + + @ApiModelProperty("办理方式") + private String handleType; + + @ApiModelProperty("手机端法人认证地址") + private String mbfarenadd; + + @ApiModelProperty("手机端个人认证标识") + private String mbgerenflag; + + @ApiModelProperty("时限说明") + private String destime; + + @ApiModelProperty("送达方式") + private String serviceMode; + + @ApiModelProperty("送达时限") + private String serviceDay; + + @ApiModelProperty("其他") + private String ununifydoOther; + + @ApiModelProperty("是否自有") + private String ishasownflow; + + @ApiModelProperty("分区") + private String dt; + + @ApiModelProperty("所属地市") + private String dscCity; + + @ApiModelProperty("所需区/县") + private String dscAdmRegion; + + @ApiModelProperty("数源单位代码") + private String dscSydepCode; + + @ApiModelProperty("数源单位") + private String dscSydepName; + + @ApiModelProperty("数据所属系统名称") + private String dscSydepSys; + + @ApiModelProperty("数源单位表名") + private String dscSydepTblname; + + @ApiModelProperty("唯一自增序列号") + private String dscBizRecordId; + + @ApiModelProperty("I插入U更新D删除") + private String dscBizOperation; + + @ApiModelProperty("源表数据同步时间") + private LocalDateTime dscBizTimestamp; + + @ApiModelProperty("数据来源表名(清洗库或基础库表名)") + private String dscDatasrTblname; + + @ApiModelProperty("业务主键MD5值(清洗增加)") + private String dscHashUnique; + + @ApiModelProperty("清洗时间(清洗增加)") + private String dscCleanTimestamp; + + @ApiModelProperty("地市仓数据入库时间") + private LocalDateTime dscDwRksj; +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/entity/NdKqZzsfwMenu.java b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/entity/NdKqZzsfwMenu.java new file mode 100644 index 0000000..951a15a --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/entity/NdKqZzsfwMenu.java @@ -0,0 +1,57 @@ +package com.ningdatech.kqapi.zzsfw.entity.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalDateTime; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + *

+ * + *

+ * + * @author ZPF + * @since 2023-10-27 + */ +@Data +@TableName("nd_kq_zzsfw_menu") +@ApiModel(value = "NdKqZzsfwMenu对象", description = "") +public class NdKqZzsfwMenu implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("id主键") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("数据同步时间") + private LocalDateTime createOn; + + @ApiModelProperty("社区名") + private String zoneName; + + @ApiModelProperty("窗口") + private String window; + + @ApiModelProperty("部门") + private String department; + + @ApiModelProperty("事项名称") + private String itemName; + + @ApiModelProperty("事项在政务中心的rowid") + private String itemRowid; + + @ApiModelProperty("排序") + private Integer sort; + + @ApiModelProperty("链接") + private String webapplyurl; + + @ApiModelProperty("是否在政务中心查到url") + private Integer hasUrl; +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/vo/MattersVO.java b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/vo/MattersVO.java new file mode 100644 index 0000000..b5eb86f --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/vo/MattersVO.java @@ -0,0 +1,34 @@ +package com.ningdatech.kqapi.zzsfw.entity.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + *

+ * 事项 + *

+ * + * @author ZPF + * @since 2023-10-25 + */ +@Data +@ApiModel(value = "MattersVO", description = "事项") +public class MattersVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("id") + private String rowguid; + + @ApiModelProperty("事项名称") + private String matterName; + + @ApiModelProperty("事项链接") + private String webapplyurl; + + @ApiModelProperty("排序编号") + private Integer sort; +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/vo/WindowVO.java b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/vo/WindowVO.java new file mode 100644 index 0000000..d932609 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/vo/WindowVO.java @@ -0,0 +1,29 @@ +package com.ningdatech.kqapi.zzsfw.entity.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 社区VO + *

+ * + * @author ZPF + * @since 2023-10-25 + */ +@Data +@ApiModel(value = "WindowVO", description = "窗口VO") +public class WindowVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("窗口") + private String windowName; + + @ApiModelProperty("事项") + private List matters; +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/vo/ZoneVO.java b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/vo/ZoneVO.java new file mode 100644 index 0000000..0a0a05f --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/entity/vo/ZoneVO.java @@ -0,0 +1,29 @@ +package com.ningdatech.kqapi.zzsfw.entity.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + *

+ * 社区VO + *

+ * + * @author ZPF + * @since 2023-10-25 + */ +@Data +@ApiModel(value = "ZoneVO", description = "社区VO") +public class ZoneVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("社区") + private String zoneName; + + @ApiModelProperty("社区") + private List windows; +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/manage/MatterManage.java b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/manage/MatterManage.java new file mode 100644 index 0000000..b8ec982 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/manage/MatterManage.java @@ -0,0 +1,76 @@ +package com.ningdatech.kqapi.zzsfw.manage; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ningdatech.kqapi.zzsfw.entity.entity.DscSxAdsShareItemQltQlsxCommonIDVKq; +import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMenu; +import com.ningdatech.kqapi.zzsfw.entity.vo.MattersVO; +import com.ningdatech.kqapi.zzsfw.entity.vo.WindowVO; +import com.ningdatech.kqapi.zzsfw.entity.vo.ZoneVO; +import com.ningdatech.kqapi.zzsfw.service.IDscSxAdsShareItemQltQlsxCommonIDVKqService; +import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * @Classname MatterManage + * @Description + * @Date 2023/10/25 14:55 + * @Author PoffyZhang + */ +@Component +@Slf4j +@RequiredArgsConstructor +public class MatterManage { + + private final INdKqZzsfwMenuService menuService; + + public List getMatters() { + List matters = menuService.list(Wrappers.lambdaQuery(NdKqZzsfwMenu.class) + .eq(NdKqZzsfwMenu::getHasUrl,1) + .orderByAsc(NdKqZzsfwMenu::getSort)); + + if(CollUtil.isEmpty(matters)){ + return Collections.emptyList(); + } + + Set zoneSet = new HashSet<>(); + return matters.stream().filter(m -> zoneSet.add(m.getZoneName())).map(m -> { + ZoneVO zone = new ZoneVO(); + zone.setZoneName(m.getZoneName()); + zone.setWindows(generateWindows(m,matters)); + return zone; + }).collect(Collectors.toList()); + } + + private List generateWindows(NdKqZzsfwMenu menu, List matters) { + return matters.stream().filter(m -> StringUtils.isNotBlank(m.getZoneName()) && m.getZoneName().equals(menu.getZoneName())) + .map(m -> { + WindowVO window = new WindowVO(); + window.setWindowName(m.getWindow()); + window.setMatters(generateMatters(m,matters)); + return window; + }).collect(Collectors.toList()); + } + + private List generateMatters(NdKqZzsfwMenu menu, List matters) { + return matters.stream().filter(m -> StringUtils.isNotBlank(m.getWindow()) && m.getWindow().equals(menu.getWindow())) + .map(m -> { + MattersVO matter = new MattersVO(); + matter.setMatterName(m.getItemName()); + matter.setWebapplyurl(m.getWebapplyurl()); + matter.setRowguid(m.getItemRowid()); + matter.setSort(m.getSort()); + return matter; + }).collect(Collectors.toList()); + } +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/mapper/DscSxAdsShareItemQltQlsxCommonIDVKqMapper.java b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/mapper/DscSxAdsShareItemQltQlsxCommonIDVKqMapper.java new file mode 100644 index 0000000..151931d --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/mapper/DscSxAdsShareItemQltQlsxCommonIDVKqMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.kqapi.zzsfw.mapper; + +import com.ningdatech.kqapi.zzsfw.entity.entity.DscSxAdsShareItemQltQlsxCommonIDVKq; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 省回流_政务服务_数据共享_事项基本信息表 Mapper 接口 + *

+ * + * @author ZPF + * @since 2023-10-25 + */ +public interface DscSxAdsShareItemQltQlsxCommonIDVKqMapper extends BaseMapper { + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/mapper/DscSxAdsShareItemQltQlsxCommonIDVKqMapper.xml b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/mapper/DscSxAdsShareItemQltQlsxCommonIDVKqMapper.xml new file mode 100644 index 0000000..023cd65 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/mapper/DscSxAdsShareItemQltQlsxCommonIDVKqMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/mapper/NdKqZzsfwMenuMapper.java b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/mapper/NdKqZzsfwMenuMapper.java new file mode 100644 index 0000000..89ce80e --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/mapper/NdKqZzsfwMenuMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.kqapi.zzsfw.mapper; + +import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMenu; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author ZPF + * @since 2023-10-27 + */ +public interface NdKqZzsfwMenuMapper extends BaseMapper { + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/mapper/NdKqZzsfwMenuMapper.xml b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/mapper/NdKqZzsfwMenuMapper.xml new file mode 100644 index 0000000..ad43de2 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/mapper/NdKqZzsfwMenuMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/service/IDscSxAdsShareItemQltQlsxCommonIDVKqService.java b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/service/IDscSxAdsShareItemQltQlsxCommonIDVKqService.java new file mode 100644 index 0000000..6dd2eab --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/service/IDscSxAdsShareItemQltQlsxCommonIDVKqService.java @@ -0,0 +1,16 @@ +package com.ningdatech.kqapi.zzsfw.service; + +import com.ningdatech.kqapi.zzsfw.entity.entity.DscSxAdsShareItemQltQlsxCommonIDVKq; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 省回流_政务服务_数据共享_事项基本信息表 服务类 + *

+ * + * @author ZPF + * @since 2023-10-25 + */ +public interface IDscSxAdsShareItemQltQlsxCommonIDVKqService extends IService { + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/service/INdKqZzsfwMenuService.java b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/service/INdKqZzsfwMenuService.java new file mode 100644 index 0000000..af7b60a --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/service/INdKqZzsfwMenuService.java @@ -0,0 +1,16 @@ +package com.ningdatech.kqapi.zzsfw.service; + +import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMenu; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author ZPF + * @since 2023-10-27 + */ +public interface INdKqZzsfwMenuService extends IService { + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/service/impl/DscSxAdsShareItemQltQlsxCommonIDVKqServiceImpl.java b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/service/impl/DscSxAdsShareItemQltQlsxCommonIDVKqServiceImpl.java new file mode 100644 index 0000000..8c60874 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/service/impl/DscSxAdsShareItemQltQlsxCommonIDVKqServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.kqapi.zzsfw.service.impl; + +import com.ningdatech.kqapi.zzsfw.entity.entity.DscSxAdsShareItemQltQlsxCommonIDVKq; +import com.ningdatech.kqapi.zzsfw.mapper.DscSxAdsShareItemQltQlsxCommonIDVKqMapper; +import com.ningdatech.kqapi.zzsfw.service.IDscSxAdsShareItemQltQlsxCommonIDVKqService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 省回流_政务服务_数据共享_事项基本信息表 服务实现类 + *

+ * + * @author ZPF + * @since 2023-10-25 + */ +@Service +public class DscSxAdsShareItemQltQlsxCommonIDVKqServiceImpl extends ServiceImpl implements IDscSxAdsShareItemQltQlsxCommonIDVKqService { + +} diff --git a/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/service/impl/NdKqZzsfwMenuServiceImpl.java b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/service/impl/NdKqZzsfwMenuServiceImpl.java new file mode 100644 index 0000000..db100d2 --- /dev/null +++ b/kqapi/src/main/java/com/ningdatech/kqapi/zzsfw/service/impl/NdKqZzsfwMenuServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.kqapi.zzsfw.service.impl; + +import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMenu; +import com.ningdatech.kqapi.zzsfw.mapper.NdKqZzsfwMenuMapper; +import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author ZPF + * @since 2023-10-27 + */ +@Service +public class NdKqZzsfwMenuServiceImpl extends ServiceImpl implements INdKqZzsfwMenuService { + +} diff --git a/kqapi/src/main/resources/application-dev.yml b/kqapi/src/main/resources/application-dev.yml new file mode 100644 index 0000000..0bb9896 --- /dev/null +++ b/kqapi/src/main/resources/application-dev.yml @@ -0,0 +1,123 @@ +server: + port: 33060 + servlet: + context-path: /kq + +spring: + mvc: + pathmatch: + matching-strategy: ant_path_matcher + session: + store-type: redis + redis: + namespace: "spring:session" + timeout: 864000 + redis: + timeout: 5000 + host: 47.98.125.47 + port: 26379 + database: 7 + password: Ndkj1234 + jedis: + pool: + max-active: 200 + max-idle: 500 + min-idle: 8 + max-wait: 10000 + application: + name: kq + jackson: + default-property-inclusion: non_null + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + jpa: + properties: + hibernate: + default_schema: PUBLIC + hbm2ddl: + auto: update + show_sql: true + show-sql: true + hibernate: + ddl-auto: update + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://47.98.125.47:3306/kqzzsfw?serverTimezone=Asia/Shanghai&characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false + username: root + password: NingdaKeji123! + # 数据源 + hikari: + # 是客户端等待连接池连接的最大毫秒数 + connection-timeout: 30000 + # 是允许连接在连接池中空闲的最长时间 + minimum-idle: 5 + # 配置最大池大小 + maximum-pool-size: 300 + # 是允许连接在连接池中空闲的最长时间(以毫秒为单位) + idle-timeout: 60000 + # 池中连接关闭后的最长生命周期(以毫秒为单位) + max-lifetime: 600000 + # 配置从池返回的连接的默认自动提交行为。默认值为true。 + auto-commit: true + # 开启连接监测泄露 + leak-detection-threshold: 10000 + # 测试连接数据库 + connection-test-query: SELECT 1 + #设置上传 单个文件的大小 + servlet: + multipart: + max-file-size: 100MB + max-request-size: 150MB +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + logic-delete-value: true + logic-not-delete-value: false +logging: + config: classpath:logback-spring.xml + #日志配置 + level: + root: info + file: + path: logs +nd: + cache: + type: REDIS + serializerType: ProtoStuff + cacheNullVal: true + def: + keyPrefix: kq + log: + enabled: true + type: DB + # 文件存储 + file: + storage-type: ALI_OSS + ali: + protocol: https:// + bucket: devplat + urlPrefix: oss-cn-hangzhou.aliyuncs.com + endpoint: oss-cn-hangzhou.aliyuncs.com + accessKeyId: LTAI4GL7uypycnBjiRn55rMG + accessKeySecret: qwYC7bW9bkStsko7qkLVnToAzj0Y98 +# 日志文件配置 +log: + path: ./logs + info: + file-size: 50MB + max-size: 5 + total-size: 200MB + error: + file-size: 10MB + max-size: 5 + total-size: 50MB + +swagger: + enabled: true + +hostname: iZbp13nwyvib53j4j1p2xoZ + + diff --git a/kqapi/src/main/resources/application-pre.yml b/kqapi/src/main/resources/application-pre.yml new file mode 100644 index 0000000..908d625 --- /dev/null +++ b/kqapi/src/main/resources/application-pre.yml @@ -0,0 +1,121 @@ +server: + port: 33060 + servlet: + context-path: /kq + +spring: + mvc: + pathmatch: + matching-strategy: ant_path_matcher + session: + store-type: redis + redis: + namespace: "spring:session" + timeout: 864000 + redis: + timeout: 5000 + host: 47.98.125.47 + port: 26379 + database: 7 + password: Ndkj1234 + jedis: + pool: + max-active: 200 + max-idle: 500 + min-idle: 8 + max-wait: 10000 + application: + name: kq + jackson: + default-property-inclusion: non_null + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + jpa: + properties: + hibernate: + default_schema: PUBLIC + hbm2ddl: + auto: update + show_sql: true + show-sql: true + hibernate: + ddl-auto: update + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://47.98.125.47:3306/kqzzsfw?serverTimezone=Asia/Shanghai&characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false + username: root + password: NingdaKeji123! + # 数据源 + hikari: + # 是客户端等待连接池连接的最大毫秒数 + connection-timeout: 30000 + # 是允许连接在连接池中空闲的最长时间 + minimum-idle: 5 + # 配置最大池大小 + maximum-pool-size: 300 + # 是允许连接在连接池中空闲的最长时间(以毫秒为单位) + idle-timeout: 60000 + # 池中连接关闭后的最长生命周期(以毫秒为单位) + max-lifetime: 600000 + # 配置从池返回的连接的默认自动提交行为。默认值为true。 + auto-commit: true + # 开启连接监测泄露 + leak-detection-threshold: 5000 + # 测试连接数据库 + connection-test-query: SELECT 1 + #设置上传 单个文件的大小 + servlet: + multipart: + max-file-size: 100MB + max-request-size: 150MB +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + logic-delete-value: true + logic-not-delete-value: false +logging: + config: classpath:logback-spring.xml + #日志配置 + level: + root: info + file: + path: logs +nd: + cache: + type: REDIS + serializerType: ProtoStuff + cacheNullVal: true + def: + keyPrefix: kq + log: + enabled: true + type: DB + # 文件存储 + file: + storage-type: ALI_OSS + ali: + protocol: https:// + bucket: devplat + urlPrefix: oss-cn-hangzhou.aliyuncs.com + endpoint: oss-cn-hangzhou.aliyuncs.com + accessKeyId: LTAI4GL7uypycnBjiRn55rMG + accessKeySecret: qwYC7bW9bkStsko7qkLVnToAzj0Y98 +# 日志文件配置 +log: + path: ./logs + info: + file-size: 50MB + max-size: 5 + total-size: 200MB + error: + file-size: 10MB + max-size: 5 + total-size: 50MB + +swagger: + enabled: true + +hostname: iZbp13nwyvib53j4j1p2xoZ \ No newline at end of file diff --git a/kqapi/src/main/resources/application-prod.yml b/kqapi/src/main/resources/application-prod.yml new file mode 100644 index 0000000..4728dca --- /dev/null +++ b/kqapi/src/main/resources/application-prod.yml @@ -0,0 +1,123 @@ +server: + port: 33060 + servlet: + context-path: /kq + +spring: + mvc: + pathmatch: + matching-strategy: ant_path_matcher + session: + store-type: redis + redis: + namespace: "spring:session" + timeout: 864000 + redis: + timeout: 5000 + host: 47.98.125.47 + port: 26379 + database: 7 + password: Ndkj1234 + jedis: + pool: + max-active: 200 + max-idle: 500 + min-idle: 8 + max-wait: 10000 + application: + name: kq + jackson: + default-property-inclusion: non_null + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + jpa: + properties: + hibernate: + default_schema: PUBLIC + hbm2ddl: + auto: update + show_sql: true + show-sql: true + hibernate: + ddl-auto: update + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://47.98.125.47:3306/kqzzsfw?serverTimezone=Asia/Shanghai&characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false + username: root + password: NingdaKeji123! + # 数据源 + hikari: + # 是客户端等待连接池连接的最大毫秒数 + connection-timeout: 30000 + # 是允许连接在连接池中空闲的最长时间 + minimum-idle: 5 + # 配置最大池大小 + maximum-pool-size: 300 + # 是允许连接在连接池中空闲的最长时间(以毫秒为单位) + idle-timeout: 60000 + # 池中连接关闭后的最长生命周期(以毫秒为单位) + max-lifetime: 600000 + # 配置从池返回的连接的默认自动提交行为。默认值为true。 + auto-commit: true + # 开启连接监测泄露 + leak-detection-threshold: 5000 + # 测试连接数据库 + connection-test-query: SELECT 1 + #设置上传 单个文件的大小 + servlet: + multipart: + max-file-size: 100MB + max-request-size: 150MB +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + logic-delete-value: true + logic-not-delete-value: false +logging: + config: classpath:logback-spring.xml + #日志配置 + level: + root: info + file: + path: logs +nd: + cache: + type: REDIS + serializerType: ProtoStuff + cacheNullVal: true + def: + keyPrefix: kq + log: + enabled: true + type: DB + # 文件存储 + file: + storage-type: ALI_OSS + ali: + protocol: https:// + bucket: devplat + urlPrefix: oss-cn-hangzhou.aliyuncs.com + endpoint: oss-cn-hangzhou.aliyuncs.com + accessKeyId: LTAI4GL7uypycnBjiRn55rMG + accessKeySecret: qwYC7bW9bkStsko7qkLVnToAzj0Y98 +# 日志文件配置 +log: + path: ./logs + info: + file-size: 50MB + max-size: 5 + total-size: 200MB + error: + file-size: 10MB + max-size: 5 + total-size: 50MB + +swagger: + enabled: true + +hostname: iZbp13nwyvib53j4j1p2xoZ + + diff --git a/kqapi/src/main/resources/application.yml b/kqapi/src/main/resources/application.yml new file mode 100644 index 0000000..3d7808a --- /dev/null +++ b/kqapi/src/main/resources/application.yml @@ -0,0 +1,3 @@ +spring: + profiles: + active: dev diff --git a/kqapi/src/main/resources/logback-spring.xml b/kqapi/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..75f5472 --- /dev/null +++ b/kqapi/src/main/resources/logback-spring.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + ${logPath}/info.log + + ${logPath}/info-%d{yyyyMMdd}-%i.log + + ${infoFileSize} + + ${infoMaxSize} + ${infoTotalSize} + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n + + + UTF-8 + + + + + + ERROR + + ${logPath}/error.log + + ${logPath}/error-%d{yyyyMMdd}-%i.log + + ${errorFileSize} + + ${errorMaxSize} + ${errorTotalSize} + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n + + + UTF-8 + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n + + UTF-8 + + + DEBUG + + + + + + + + + diff --git a/kqapi/src/main/resources/template/meeting/专家抽取表.ftl b/kqapi/src/main/resources/template/meeting/专家抽取表.ftl new file mode 100644 index 0000000..c8c4974 --- /dev/null +++ b/kqapi/src/main/resources/template/meeting/专家抽取表.ftl @@ -0,0 +1,1348 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 信息化项目专家抽取表 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 项目编码 + + + + + + + + + + + + + + + + + + + + + + + + + + ${projectCode} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 项目名称 + + + + + + + + + + + + + + + + + + + + + + + + + ${projectName} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 建设单位 + + + + + + + + + + + + + + + + + + + + + + + + ${buildOrg} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 评审地点 + + + + + + + + + + + + + + + + + + + + + + + + ${meetingAddress} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 评审时间 + + + + + + + + + + + + + + + + + + + + + + + + ${meetingTime} + + + + + + + + + + + + + + + + + + + + 评审耗时 + + + + + + + + + + + + + + + + + + + + + + + ${meetingUsageTime} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 抽取人 + + + + + + + + + + + + + + + + + + + + + + ${meetingCreateBy} + + + + + + + + + + + + + + + + + + + + 监督人 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 序号 + + + + + + + + + + + + + + + + + + + + + 姓名 + + + + + + + + + + + + + + + + + + + + + 电话 + + + + + + + + + + + + + + + + + + + + 工作单位 + + + + + + + + + + + + + + + + + + + + + 签名 + + + + + <#list experts as expert> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${expert.no} + + + + + + + + + + + + + + + + + + + + + + + ${expert.name} + + + + + + + + + + + + + + + + + + + + + + + ${expert.mobile} + + + + + + + + + + + + + + + + + + + + + + + ${expert.company} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kqapi/src/main/resources/template/meeting/专家评审单.ftl b/kqapi/src/main/resources/template/meeting/专家评审单.ftl new file mode 100644 index 0000000..2cf2ed1 --- /dev/null +++ b/kqapi/src/main/resources/template/meeting/专家评审单.ftl @@ -0,0 +1,741 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${projectName} + + + + + + + + + + 专家评审意见 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${meetingTime},${holdOrg}组织专家在${meetingAddress}对${projectName} + 进行评审。专家组认真听取了项目业主方、建设方的情况汇报,审阅了项目材料,实地查看了设备及平台演示,专家组织质询、讨论后提出以下意见: + + + + + + + + + + + + + + + + + + + + + + + + + ${(reviewResult)!} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 专家组 + + + + + + + + + + + + + + + + + + (签名 + + + + + + + + + ): + + + + + + + + + \ No newline at end of file diff --git a/kqapi/src/main/resources/template/meeting/专家费.ftl b/kqapi/src/main/resources/template/meeting/专家费.ftl new file mode 100644 index 0000000..3c01ae5 --- /dev/null +++ b/kqapi/src/main/resources/template/meeting/专家费.ftl @@ -0,0 +1,1230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 丽水市大数据局信息化项目专家费 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 项目名称: + + + + + + + + ${projectName} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 验收地点: + + + + + + + + ${meetingAddress} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 日 期: + + + + + + + + ${meetingTime} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 姓名 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 身份证号 + + + + + + + + + + + + + + + + + + + + 单位 + + + + + + + + + + + + + + + + + + + + 联系电话 + + + + + + + + + + + + + + + + + + + + 评审费 + + + + + + + + + + + + + + + + + + + + 开户行 + + + + + + + + + + + + + + + + + + + + + 账号 + + + + + + + + + + + + + + + + + + + + + 签名 + + + + + <#list experts as rowData> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${rowData.no} + + + + + + + + + + + + + + + + + + + + + + + + + ${rowData.name} + + + + + + + + + + + + + + + + + + + + + + + + ${rowData.sex} + + + + + + + + + + + + + + + + + + + + + + + + ${rowData.idcard} + + + + + + + + + + + + + + + + + + + + + + + + ${rowData.company} + + + + + + + + + + + + + + + + + + + + + + + + ${rowData.mobile} + + + + + + + + + + + + + + + + + + + + + + + + ${rowData.fee} + + + + + + + + + + + + + + + + + + + + + + + + + ${(rowData.bank)!} + + + + + + + + + + + + + + + + + + + + + + + ${rowData.bankNo} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 经办人 + + + + + + + + + + + + (签字 + + + + + + ): + + + + + + + + + \ No newline at end of file diff --git a/kqapi/src/main/resources/template/meeting/劳务费发放.ftl b/kqapi/src/main/resources/template/meeting/劳务费发放.ftl new file mode 100644 index 0000000..9195664 --- /dev/null +++ b/kqapi/src/main/resources/template/meeting/劳务费发放.ftl @@ -0,0 +1,2657 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 劳务费发放审批单 + + + + + + + + + + + + + + + + + + + + + + 制表单位(盖章): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 劳务活动项目 + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${projectName} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 活动时间 + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${meetingTime} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 劳务费类别 + + + + + + + + + + + + + + + + + + + + + + + + + + + + □讲课费□稿费□考务(监考费) + + + + + + + + + + + + + + + + + + □评审费□其他项目 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 发放标准 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 500元/人 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 有关情况说明 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 通过市信息化专家库系统抽取 + + + + + + + + + ${expertCount} + + + + + + + + + 名专家。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 发放清单 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 姓名 + + + + + + + + + + + + + + + + + + + + + + + + + + + 工作单位 + + + + + + + + + + + + + + + + + + + + + + + + + + + 职务(职称) + + + + + + + + + + + + + + + + + + + + + + + + + + + 标准 + + + + + + + + + + + + + + + + + + + + + + + + + + + + 发放金额 + + + + + + + + + + + + + + + + + + + + (元) + + + + + + + + + + + + + + + + + + + + + + + + + + + 签字 + + + + + <#list experts as expert> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${expert.name} + + + + + + + + + + + + + + + + + + + + + + + + + + + ${expert.company} + + + + + + + + + + + + + + + + + + + + + + + + + + + ${(expert.job)!} + + + + + + + + + + + + + + + + + + + + + + + + + + + ${meetingUsageTime} + + + + + + + + + + + + + + + + + + + + + + + + + + + 500 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 发放单位审批意见 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 业务部门意见 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 分管领导意见 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 单位负责人 + + + + + + + + + + + + + + + + + + + + (财务审批人)意见 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 经办人意见 + + + + + + + + + + + + + + + + + + + + + + + + + + + 部门负责人意见 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (签字) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (签字): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 分管领导(签字): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 负责人(财务审批人) + + + + + + + + + + + + + + + + + + + + (签字): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kqapi/src/main/resources/template/simsun.ttc b/kqapi/src/main/resources/template/simsun.ttc new file mode 100644 index 0000000..40e9693 Binary files /dev/null and b/kqapi/src/main/resources/template/simsun.ttc differ diff --git a/kqapi/src/main/resources/template/丽水市2023年数字化项目年度计划编辑表(空).xls b/kqapi/src/main/resources/template/丽水市2023年数字化项目年度计划编辑表(空).xls new file mode 100644 index 0000000..c43cd89 Binary files /dev/null and b/kqapi/src/main/resources/template/丽水市2023年数字化项目年度计划编辑表(空).xls differ diff --git a/kqapi/src/main/resources/template/丽水市2023年数字化项目年度计划编辑表.xls b/kqapi/src/main/resources/template/丽水市2023年数字化项目年度计划编辑表.xls new file mode 100644 index 0000000..d06cdad Binary files /dev/null and b/kqapi/src/main/resources/template/丽水市2023年数字化项目年度计划编辑表.xls differ diff --git a/kqapi/src/main/resources/template/区县-预审申请单.html b/kqapi/src/main/resources/template/区县-预审申请单.html new file mode 100644 index 0000000..c5242c9 --- /dev/null +++ b/kqapi/src/main/resources/template/区县-预审申请单.html @@ -0,0 +1,294 @@ + + + + + + Document + + + +
+

+ #title# +

+
+

+ + 项目编号: + #projectCode# + + #time# +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
项目基本信息
项目名称#projectName#
是否临时增补#isTemporaryAugment#是否一地创新全省共享项目#isInnovateWholeProvinceShare#
项目负责人#responsibleMan#负责人手机号#responsibleManMobile#
项目联系人#contactName#项目联系人手机号#contactPhone#
建设单位#buildOrgName#建设单位统一社会信用代码#orgCreditCode#
项目类型#projectType#是否首次新建#isFirst#
预算年度#projectYear#建设起止时间#beginAndEndTime#
四大体系#fourSystems#
是否数字化改革项目#isDigitalReform#综合业务领域#bizDomain#
立项依据#buildBasisList#
是否上云#isCloud#云类型#cloudType#
项目简介 +

#projectIntroduction#

+
资金申报情况
申报金额#declareAmount#
自有资金#declareHaveAmount#政府投资-本级财政资金#declareGovOwnFinanceAmount#
政府投资-上级补助资金#declareGovSuperiorFinanceAmount#银行贷款#declareBankLendingAmount#
其他资金#declareOtherAmount#
本年计划投资(万元)#yearPlanInvest#
资金分配情况
软件开发#softwareDevelopmentAmount#云资源、硬件购置#cloudHardwarePurchaseAmount#
第三方服务#thirdPartyAmount#
年度支付计划
年度支付金额#annualPlanAmount#
自有资金#annualPlanHaveAmount#政府投资-本级财政资金#annualPlanGovOwnFinanceAmount#
政府投资-上级补助资金#annualPlanGovSuperiorFinanceAmount#银行贷款#annualPlanBankLendingAmount#
其他资金#annualPlanOtherAmount#
备注
备注

#projectRemarks#

单位意见
本级主管单位意见(盖章) +
+
+ #superOrgOpinion# +
+
+ #superOrgAuditDate# +
+
+
上级主管单位意见(盖章) +
+
+ #higherOrgOpinion# +
+
+ #higherOrgAuditDate# +
+
+
+
+
+ + diff --git a/kqapi/src/main/resources/template/市级-预审申请单.html b/kqapi/src/main/resources/template/市级-预审申请单.html new file mode 100644 index 0000000..e6ffff5 --- /dev/null +++ b/kqapi/src/main/resources/template/市级-预审申请单.html @@ -0,0 +1,281 @@ + + + + + + Document + + + +
+

+ #title# +

+
+

+ + 项目编号: + #projectCode# + + #time# +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
项目基本信息
项目名称#projectName#
是否临时增补#isTemporaryAugment#是否一地创新全省共享项目#isInnovateWholeProvinceShare#
项目负责人#responsibleMan#负责人手机号#responsibleManMobile#
项目联系人#contactName#项目联系人手机号#contactPhone#
建设单位#buildOrgName#建设单位统一社会信用代码#orgCreditCode#
项目类型#projectType#是否首次新建#isFirst#
预算年度#projectYear#建设起止时间#beginAndEndTime#
四大体系#fourSystems#
是否数字化改革项目#isDigitalReform#综合业务领域#bizDomain#
立项依据#buildBasisList#
是否上云#isCloud#云类型#cloudType#
项目简介 +

#projectIntroduction#

+
资金申报情况
申报金额#declareAmount#
自有资金#declareHaveAmount#政府投资-本级财政资金#declareGovOwnFinanceAmount#
政府投资-上级补助资金#declareGovSuperiorFinanceAmount#银行贷款#declareBankLendingAmount#
其他资金#declareOtherAmount#
本年计划投资(万元)#yearPlanInvest#
资金分配情况
软件开发#softwareDevelopmentAmount#云资源、硬件购置#cloudHardwarePurchaseAmount#
第三方服务#thirdPartyAmount#
年度支付计划
年度支付金额#annualPlanAmount#
自有资金#annualPlanHaveAmount#政府投资-本级财政资金#annualPlanGovOwnFinanceAmount#
政府投资-上级补助资金#annualPlanGovSuperiorFinanceAmount#银行贷款#annualPlanBankLendingAmount#
其他资金#annualPlanOtherAmount#
备注
备注

#projectRemarks#

单位意见
本级主管单位意见(盖章) +
+
+ #superOrgOpinion# +
+
+ #superOrgAuditDate# +
+
+
+
+
+ + diff --git a/kqapi/src/main/resources/template/建设方案申请单.html b/kqapi/src/main/resources/template/建设方案申请单.html new file mode 100644 index 0000000..c548ce8 --- /dev/null +++ b/kqapi/src/main/resources/template/建设方案申请单.html @@ -0,0 +1,281 @@ + + + + + + Document + + + +
+

+ #title# +

+
+

+ + 项目编号: + #projectCode# + + #time# +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
项目基本信息
项目名称#projectName#
是否临时增补#isTemporaryAugment#是否一地创新全省共享项目#isInnovateWholeProvinceShare#
项目负责人#responsibleMan#负责人手机号#responsibleManMobile#
项目联系人#contactName#项目联系人手机号#contactPhone#
建设单位#buildOrgName#建设单位统一社会信用代码#orgCreditCode#
项目类型#projectType#是否首次新建#isFirst#
预算年度#projectYear#建设起止时间#beginAndEndTime#
四大体系#fourSystems#
是否数字化改革项目#isDigitalReform#综合业务领域#bizDomain#
立项依据#buildBasisList#
是否上云#isCloud#云类型#cloudType#
项目简介 +

#projectIntroduction#

+
资金申报情况
申报金额#declareAmount#
自有资金#declareHaveAmount#政府投资-本级财政资金#declareGovOwnFinanceAmount#
政府投资-上级补助资金#declareGovSuperiorFinanceAmount#银行贷款#declareBankLendingAmount#
其他资金#declareOtherAmount#
本年计划投资(万元)#yearPlanInvest#
资金分配情况
软件开发#softwareDevelopmentAmount#云资源、硬件购置#cloudHardwarePurchaseAmount#
第三方服务#thirdPartyAmount#
年度支付计划
年度支付金额#annualPlanAmount#
自有资金#annualPlanHaveAmount#政府投资-本级财政资金#annualPlanGovOwnFinanceAmount#
政府投资-上级补助资金#annualPlanGovSuperiorFinanceAmount#银行贷款#annualPlanBankLendingAmount#
其他资金#annualPlanOtherAmount#
备注
备注

#projectRemarks#

单位意见
大数据局主管单位意见(盖章) +
+
+ #bigDataBureauOpinion# +
+
+ #bigDataBureauAuditDate# +
+
+
+
+
+ + diff --git a/kqapi/src/test/java/com/ningdatech/kqapi/AppTests.java b/kqapi/src/test/java/com/ningdatech/kqapi/AppTests.java new file mode 100644 index 0000000..a86f1d9 --- /dev/null +++ b/kqapi/src/test/java/com/ningdatech/kqapi/AppTests.java @@ -0,0 +1,19 @@ +package com.ningdatech.kqapi; + +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +/** + *

+ * AppRunTests + *

+ * + * @author WendyYang + * @since 19:27 2022/5/10 + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = App.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class AppTests { + +} diff --git a/kqapi/src/test/java/com/ningdatech/kqapi/menu/ExcelSplitMergedCells.java b/kqapi/src/test/java/com/ningdatech/kqapi/menu/ExcelSplitMergedCells.java new file mode 100644 index 0000000..bb3731f --- /dev/null +++ b/kqapi/src/test/java/com/ningdatech/kqapi/menu/ExcelSplitMergedCells.java @@ -0,0 +1,60 @@ +package com.ningdatech.kqapi.menu; + +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; + +public class ExcelSplitMergedCells { + public static void main(String[] args) throws IOException { + // 打开Excel文件 + FileInputStream fis = new FileInputStream("C:\\Users\\PoffyZhang\\Desktop\\8.8柯桥区企业综合服务中心政务服务事项清单.xlsx"); + Workbook workbook = new XSSFWorkbook(fis); + Sheet sheet = workbook.getSheetAt(0); + + // 获取合并单元格的范围 + CellRangeAddress mergedRegion = sheet.getMergedRegion(0); // 0表示第一个合并的单元格 + int firstRow = mergedRegion.getFirstRow(); + int lastRow = mergedRegion.getLastRow(); + int firstCol = mergedRegion.getFirstColumn(); + int lastCol = mergedRegion.getLastColumn(); + + // 取消合并单元格 + sheet.removeMergedRegion(0); + Integer num = 0; + // 创建新的单元格并复制内容 + for (int i = firstRow; i <= lastRow; i++) { + Row row = sheet.getRow(i); + for (int j = firstCol; j <= lastCol; j++) { + Cell oldCell = row.getCell(j); + Cell newCell = row.createCell(j); + newCell.setCellType(oldCell.getCellType()); + switch (oldCell.getCellType()) { + case STRING: + newCell.setCellValue(oldCell.getStringCellValue()); + break; + case NUMERIC: + newCell.setCellValue(oldCell.getNumericCellValue()); + break; + case BOOLEAN: + newCell.setCellValue(oldCell.getBooleanCellValue()); + break; + case FORMULA: + newCell.setCellFormula(oldCell.getCellFormula()); + break; + default: + newCell.setCellValue(""); + } + } + } + + // 保存修改后的Excel文件 + fis.close(); + FileOutputStream fos = new FileOutputStream("C:\\Users\\PoffyZhang\\Desktop\\8.8柯桥区企业综合服务中心政务服务事项清单2.xlsx"); + workbook.write(fos); + fos.close(); + } +} \ No newline at end of file diff --git a/kqapi/src/test/java/com/ningdatech/kqapi/menu/MenuTest.java b/kqapi/src/test/java/com/ningdatech/kqapi/menu/MenuTest.java new file mode 100644 index 0000000..72d45b4 --- /dev/null +++ b/kqapi/src/test/java/com/ningdatech/kqapi/menu/MenuTest.java @@ -0,0 +1,85 @@ +package com.ningdatech.kqapi.menu; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ningdatech.kqapi.AppTests; +import com.ningdatech.kqapi.zzsfw.entity.entity.DscSxAdsShareItemQltQlsxCommonIDVKq; +import com.ningdatech.kqapi.zzsfw.entity.entity.NdKqZzsfwMenu; +import com.ningdatech.kqapi.zzsfw.service.IDscSxAdsShareItemQltQlsxCommonIDVKqService; +import com.ningdatech.kqapi.zzsfw.service.INdKqZzsfwMenuService; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.junit.Assert; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; +import java.io.FileInputStream; +import java.io.IOException; +import java.time.LocalDateTime; +import java.util.Objects; + +/** + * @Classname MenuTest + * @Description + * @Date 2023/10/27 9:51 + * @Author PoffyZhang + */ +public class MenuTest extends AppTests { + + @Autowired + private INdKqZzsfwMenuService menuService; + + @Autowired + private IDscSxAdsShareItemQltQlsxCommonIDVKqService itemQltQlsxCommonIDVKqService; + + @Test + public void test() throws IOException { + FileInputStream fis = new FileInputStream("C:\\Users\\PoffyZhang\\Desktop\\8.8柯桥区企业综合服务中心政务服务事项清单2.xlsx"); + Workbook workbook = new XSSFWorkbook(fis); + Assert.assertNotNull(workbook); + Row row; + if (workbook != null) { + //获取最大行数 + Sheet sheet = workbook.getSheetAt(0); + int rownum = sheet.getPhysicalNumberOfRows(); + //获取第一行 + row = sheet.getRow(0); + //获取最大列数 + Integer num = 1; + for (int i = 2; i < rownum; i++) { + row = sheet.getRow(i); + if(row.getZeroHeight()){ + continue; + } + System.out.println("记数:" + (num++)); + System.out.println(row.getCell(0).getStringCellValue()); + System.out.println(row.getCell(1).getStringCellValue()); + System.out.println(row.getCell(2).getStringCellValue()); + Double numericCellValue = row.getCell(3).getNumericCellValue(); + String itemName = row.getCell(4).getStringCellValue(); + System.out.println(itemName); + + NdKqZzsfwMenu menu = new NdKqZzsfwMenu(); + menu.setItemName(itemName); + menu.setZoneName(row.getCell(0).getStringCellValue()); + menu.setWindow(row.getCell(1).getStringCellValue()); + menu.setCreateOn(LocalDateTime.now()); + menu.setDepartment(row.getCell(2).getStringCellValue()); + menu.setSort(numericCellValue.intValue()); + + //去查询 url + DscSxAdsShareItemQltQlsxCommonIDVKq item = itemQltQlsxCommonIDVKqService.getOne(Wrappers.lambdaQuery(DscSxAdsShareItemQltQlsxCommonIDVKq.class) + .select(DscSxAdsShareItemQltQlsxCommonIDVKq::getRowguid, DscSxAdsShareItemQltQlsxCommonIDVKq::getWebapplyurl, DscSxAdsShareItemQltQlsxCommonIDVKq::getQlName) + .eq(DscSxAdsShareItemQltQlsxCommonIDVKq::getQlName, itemName) + .isNotNull(DscSxAdsShareItemQltQlsxCommonIDVKq::getWebapplyurl) + .last("limit 1")); + if(Objects.nonNull(item)){ + menu.setHasUrl(1); + menu.setWebapplyurl(item.getWebapplyurl()); + menu.setItemRowid(item.getRowguid()); + } + + menuService.save(menu); + } + } + } + +} diff --git a/kqapi/src/test/resources/application-dev.yml b/kqapi/src/test/resources/application-dev.yml new file mode 100644 index 0000000..0bb9896 --- /dev/null +++ b/kqapi/src/test/resources/application-dev.yml @@ -0,0 +1,123 @@ +server: + port: 33060 + servlet: + context-path: /kq + +spring: + mvc: + pathmatch: + matching-strategy: ant_path_matcher + session: + store-type: redis + redis: + namespace: "spring:session" + timeout: 864000 + redis: + timeout: 5000 + host: 47.98.125.47 + port: 26379 + database: 7 + password: Ndkj1234 + jedis: + pool: + max-active: 200 + max-idle: 500 + min-idle: 8 + max-wait: 10000 + application: + name: kq + jackson: + default-property-inclusion: non_null + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + jpa: + properties: + hibernate: + default_schema: PUBLIC + hbm2ddl: + auto: update + show_sql: true + show-sql: true + hibernate: + ddl-auto: update + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://47.98.125.47:3306/kqzzsfw?serverTimezone=Asia/Shanghai&characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false + username: root + password: NingdaKeji123! + # 数据源 + hikari: + # 是客户端等待连接池连接的最大毫秒数 + connection-timeout: 30000 + # 是允许连接在连接池中空闲的最长时间 + minimum-idle: 5 + # 配置最大池大小 + maximum-pool-size: 300 + # 是允许连接在连接池中空闲的最长时间(以毫秒为单位) + idle-timeout: 60000 + # 池中连接关闭后的最长生命周期(以毫秒为单位) + max-lifetime: 600000 + # 配置从池返回的连接的默认自动提交行为。默认值为true。 + auto-commit: true + # 开启连接监测泄露 + leak-detection-threshold: 10000 + # 测试连接数据库 + connection-test-query: SELECT 1 + #设置上传 单个文件的大小 + servlet: + multipart: + max-file-size: 100MB + max-request-size: 150MB +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + logic-delete-value: true + logic-not-delete-value: false +logging: + config: classpath:logback-spring.xml + #日志配置 + level: + root: info + file: + path: logs +nd: + cache: + type: REDIS + serializerType: ProtoStuff + cacheNullVal: true + def: + keyPrefix: kq + log: + enabled: true + type: DB + # 文件存储 + file: + storage-type: ALI_OSS + ali: + protocol: https:// + bucket: devplat + urlPrefix: oss-cn-hangzhou.aliyuncs.com + endpoint: oss-cn-hangzhou.aliyuncs.com + accessKeyId: LTAI4GL7uypycnBjiRn55rMG + accessKeySecret: qwYC7bW9bkStsko7qkLVnToAzj0Y98 +# 日志文件配置 +log: + path: ./logs + info: + file-size: 50MB + max-size: 5 + total-size: 200MB + error: + file-size: 10MB + max-size: 5 + total-size: 50MB + +swagger: + enabled: true + +hostname: iZbp13nwyvib53j4j1p2xoZ + + diff --git a/kqapi/src/test/resources/application-pre.yml b/kqapi/src/test/resources/application-pre.yml new file mode 100644 index 0000000..908d625 --- /dev/null +++ b/kqapi/src/test/resources/application-pre.yml @@ -0,0 +1,121 @@ +server: + port: 33060 + servlet: + context-path: /kq + +spring: + mvc: + pathmatch: + matching-strategy: ant_path_matcher + session: + store-type: redis + redis: + namespace: "spring:session" + timeout: 864000 + redis: + timeout: 5000 + host: 47.98.125.47 + port: 26379 + database: 7 + password: Ndkj1234 + jedis: + pool: + max-active: 200 + max-idle: 500 + min-idle: 8 + max-wait: 10000 + application: + name: kq + jackson: + default-property-inclusion: non_null + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + jpa: + properties: + hibernate: + default_schema: PUBLIC + hbm2ddl: + auto: update + show_sql: true + show-sql: true + hibernate: + ddl-auto: update + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://47.98.125.47:3306/kqzzsfw?serverTimezone=Asia/Shanghai&characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false + username: root + password: NingdaKeji123! + # 数据源 + hikari: + # 是客户端等待连接池连接的最大毫秒数 + connection-timeout: 30000 + # 是允许连接在连接池中空闲的最长时间 + minimum-idle: 5 + # 配置最大池大小 + maximum-pool-size: 300 + # 是允许连接在连接池中空闲的最长时间(以毫秒为单位) + idle-timeout: 60000 + # 池中连接关闭后的最长生命周期(以毫秒为单位) + max-lifetime: 600000 + # 配置从池返回的连接的默认自动提交行为。默认值为true。 + auto-commit: true + # 开启连接监测泄露 + leak-detection-threshold: 5000 + # 测试连接数据库 + connection-test-query: SELECT 1 + #设置上传 单个文件的大小 + servlet: + multipart: + max-file-size: 100MB + max-request-size: 150MB +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + logic-delete-value: true + logic-not-delete-value: false +logging: + config: classpath:logback-spring.xml + #日志配置 + level: + root: info + file: + path: logs +nd: + cache: + type: REDIS + serializerType: ProtoStuff + cacheNullVal: true + def: + keyPrefix: kq + log: + enabled: true + type: DB + # 文件存储 + file: + storage-type: ALI_OSS + ali: + protocol: https:// + bucket: devplat + urlPrefix: oss-cn-hangzhou.aliyuncs.com + endpoint: oss-cn-hangzhou.aliyuncs.com + accessKeyId: LTAI4GL7uypycnBjiRn55rMG + accessKeySecret: qwYC7bW9bkStsko7qkLVnToAzj0Y98 +# 日志文件配置 +log: + path: ./logs + info: + file-size: 50MB + max-size: 5 + total-size: 200MB + error: + file-size: 10MB + max-size: 5 + total-size: 50MB + +swagger: + enabled: true + +hostname: iZbp13nwyvib53j4j1p2xoZ \ No newline at end of file diff --git a/kqapi/src/test/resources/application-prod.yml b/kqapi/src/test/resources/application-prod.yml new file mode 100644 index 0000000..4728dca --- /dev/null +++ b/kqapi/src/test/resources/application-prod.yml @@ -0,0 +1,123 @@ +server: + port: 33060 + servlet: + context-path: /kq + +spring: + mvc: + pathmatch: + matching-strategy: ant_path_matcher + session: + store-type: redis + redis: + namespace: "spring:session" + timeout: 864000 + redis: + timeout: 5000 + host: 47.98.125.47 + port: 26379 + database: 7 + password: Ndkj1234 + jedis: + pool: + max-active: 200 + max-idle: 500 + min-idle: 8 + max-wait: 10000 + application: + name: kq + jackson: + default-property-inclusion: non_null + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + jpa: + properties: + hibernate: + default_schema: PUBLIC + hbm2ddl: + auto: update + show_sql: true + show-sql: true + hibernate: + ddl-auto: update + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://47.98.125.47:3306/kqzzsfw?serverTimezone=Asia/Shanghai&characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false + username: root + password: NingdaKeji123! + # 数据源 + hikari: + # 是客户端等待连接池连接的最大毫秒数 + connection-timeout: 30000 + # 是允许连接在连接池中空闲的最长时间 + minimum-idle: 5 + # 配置最大池大小 + maximum-pool-size: 300 + # 是允许连接在连接池中空闲的最长时间(以毫秒为单位) + idle-timeout: 60000 + # 池中连接关闭后的最长生命周期(以毫秒为单位) + max-lifetime: 600000 + # 配置从池返回的连接的默认自动提交行为。默认值为true。 + auto-commit: true + # 开启连接监测泄露 + leak-detection-threshold: 5000 + # 测试连接数据库 + connection-test-query: SELECT 1 + #设置上传 单个文件的大小 + servlet: + multipart: + max-file-size: 100MB + max-request-size: 150MB +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + logic-delete-value: true + logic-not-delete-value: false +logging: + config: classpath:logback-spring.xml + #日志配置 + level: + root: info + file: + path: logs +nd: + cache: + type: REDIS + serializerType: ProtoStuff + cacheNullVal: true + def: + keyPrefix: kq + log: + enabled: true + type: DB + # 文件存储 + file: + storage-type: ALI_OSS + ali: + protocol: https:// + bucket: devplat + urlPrefix: oss-cn-hangzhou.aliyuncs.com + endpoint: oss-cn-hangzhou.aliyuncs.com + accessKeyId: LTAI4GL7uypycnBjiRn55rMG + accessKeySecret: qwYC7bW9bkStsko7qkLVnToAzj0Y98 +# 日志文件配置 +log: + path: ./logs + info: + file-size: 50MB + max-size: 5 + total-size: 200MB + error: + file-size: 10MB + max-size: 5 + total-size: 50MB + +swagger: + enabled: true + +hostname: iZbp13nwyvib53j4j1p2xoZ + + diff --git a/kqapi/src/test/resources/application.yml b/kqapi/src/test/resources/application.yml new file mode 100644 index 0000000..3d7808a --- /dev/null +++ b/kqapi/src/test/resources/application.yml @@ -0,0 +1,3 @@ +spring: + profiles: + active: dev diff --git a/kqapi/src/test/resources/integration/zwdd-dev.yml b/kqapi/src/test/resources/integration/zwdd-dev.yml new file mode 100644 index 0000000..cc28814 --- /dev/null +++ b/kqapi/src/test/resources/integration/zwdd-dev.yml @@ -0,0 +1,12 @@ +#专有钉钉 +integration: + zwdd: + #扫码 + app-auth-key: ls-rebuild_dingoa-rgeWs3YVr26z + app-auth-secret: 37qCe6ylNMW0N8K2741z0c2b9vJP2gtuMRQQtZ9P + #免登/获取信息 + app-key: ls_rebuild-10c8n5X0707yFV7jURr + app-secret: gN8J3WazyXLMWKDuFmx6C4yaH5lFUY41x8rYLLo6 + #专有钉钉在开发管理工作台,右键查看网页源码realmId: '31141',浙政钉固定196729 + tenantId: 31141 + domain: openplatform.dg-work.cn \ No newline at end of file diff --git a/kqapi/src/test/resources/integration/zwdd-prod.yml b/kqapi/src/test/resources/integration/zwdd-prod.yml new file mode 100644 index 0000000..6b30e1b --- /dev/null +++ b/kqapi/src/test/resources/integration/zwdd-prod.yml @@ -0,0 +1,12 @@ +#浙政钉 +integration: + zwdd: + #扫码 + app-auth-key: ls_project_managment_din-b1Y3I1g7Rr94yX76KfFkpp18Uy4WHtU0b6rINJ3 + app-auth-secret: 75e8PMHv984KYF0Mcy6v4pxt480y73dbD7kB65dD + #免登/获取信息 + app-key: ls_project-c32LNu87v60UiANZVja + app-secret: R14QgbBr21751LTGml3Vt8oX9doPl4Lk1ROzZNfG + #专有钉钉在开发管理工作台,右键查看网页源码realmId: '31141',浙政钉固定196729 + tenantId: 196729 + domain: openplatform-pro.ding.zj.gov.cn \ No newline at end of file diff --git a/kqapi/src/test/resources/logback-spring.xml b/kqapi/src/test/resources/logback-spring.xml new file mode 100644 index 0000000..75f5472 --- /dev/null +++ b/kqapi/src/test/resources/logback-spring.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + ${logPath}/info.log + + ${logPath}/info-%d{yyyyMMdd}-%i.log + + ${infoFileSize} + + ${infoMaxSize} + ${infoTotalSize} + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n + + + UTF-8 + + + + + + ERROR + + ${logPath}/error.log + + ${logPath}/error-%d{yyyyMMdd}-%i.log + + ${errorFileSize} + + ${errorMaxSize} + ${errorTotalSize} + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n + + + UTF-8 + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n + + UTF-8 + + + DEBUG + + + + + + + + + diff --git a/kqapi/src/test/resources/security/auth-dev.yml b/kqapi/src/test/resources/security/auth-dev.yml new file mode 100644 index 0000000..53ec385 --- /dev/null +++ b/kqapi/src/test/resources/security/auth-dev.yml @@ -0,0 +1,68 @@ +security: + auth: + auth-require-url: /api/v1/user/auth/auth-require + invalid-session-url: /api/v1/user/auth/invalid-session + password-login-url: /api/v1/user/auth/login + agent-login-url: /api/v1/user/auth/agent-login + logout-url: /api/v1/user/auth/logout + common-login-url: /api/v1/user/auth/common-login + ignore-auth-urls: + - /v2/api-docs + - /swagger-ui.html + - /webjars/** + - /swagger-resources/** + - /webjars/ + - /api/v1/user/auth/register + - /api/v1/user/auth/auth-require + - /api/v1/user/auth/invalid-session + - /api/v1/user/auth/login/password + - /api/v1/user/auth/forget-password + - /api/v1/user/auth/common-login + - /doc.html + - /ok.html + - /open/api/** + - /oa/** + - /wflow/** + - /sys/** + - /api/v1/verification/** + - /api/v1/expert/registration + - /api/v1/meta/dictionary/list + - /api/v1/meta/tag + - /api/v1/organization/tree-list + - /api/v1/organization/get-child-list + - /api/v1/region/tree + ignore-csrf-urls: + - /api/v1/user/auth/** + - /v2/api-docs + - /swagger-ui.html + - /webjars/** + - /swagger-resources/** + - /webjars/ + - /doc.html + - /ok.html + - /api/v1/** + - /file/** + - /optLog/** + - /dict/** + - /oa/** + - /wflow/** + - /sys/** + - /api/v1/verification/** + - /api/v1/expert/registration + - /api/v1/meta/dictionary/list + - /api/v1/meta/tag + - /api/v1/organization/tree-list + - /api/v1/organization/get-child-list + - /api/v1/region/tree + role-map: + "engineer": + "project_manager": + - /api/v1/user-info/kick-off/** + "enterprise_admin": + "regional_general_manager": + "driver": + "super_admin": + - /api/v1/user-info/save + - /api/v1/user-info/del + - /api/v1/user-info/kick-off/** + - /api/v1/user-info/password/mod \ No newline at end of file diff --git a/kqapi/src/test/resources/security/auth-prod.yml b/kqapi/src/test/resources/security/auth-prod.yml new file mode 100644 index 0000000..53ec385 --- /dev/null +++ b/kqapi/src/test/resources/security/auth-prod.yml @@ -0,0 +1,68 @@ +security: + auth: + auth-require-url: /api/v1/user/auth/auth-require + invalid-session-url: /api/v1/user/auth/invalid-session + password-login-url: /api/v1/user/auth/login + agent-login-url: /api/v1/user/auth/agent-login + logout-url: /api/v1/user/auth/logout + common-login-url: /api/v1/user/auth/common-login + ignore-auth-urls: + - /v2/api-docs + - /swagger-ui.html + - /webjars/** + - /swagger-resources/** + - /webjars/ + - /api/v1/user/auth/register + - /api/v1/user/auth/auth-require + - /api/v1/user/auth/invalid-session + - /api/v1/user/auth/login/password + - /api/v1/user/auth/forget-password + - /api/v1/user/auth/common-login + - /doc.html + - /ok.html + - /open/api/** + - /oa/** + - /wflow/** + - /sys/** + - /api/v1/verification/** + - /api/v1/expert/registration + - /api/v1/meta/dictionary/list + - /api/v1/meta/tag + - /api/v1/organization/tree-list + - /api/v1/organization/get-child-list + - /api/v1/region/tree + ignore-csrf-urls: + - /api/v1/user/auth/** + - /v2/api-docs + - /swagger-ui.html + - /webjars/** + - /swagger-resources/** + - /webjars/ + - /doc.html + - /ok.html + - /api/v1/** + - /file/** + - /optLog/** + - /dict/** + - /oa/** + - /wflow/** + - /sys/** + - /api/v1/verification/** + - /api/v1/expert/registration + - /api/v1/meta/dictionary/list + - /api/v1/meta/tag + - /api/v1/organization/tree-list + - /api/v1/organization/get-child-list + - /api/v1/region/tree + role-map: + "engineer": + "project_manager": + - /api/v1/user-info/kick-off/** + "enterprise_admin": + "regional_general_manager": + "driver": + "super_admin": + - /api/v1/user-info/save + - /api/v1/user-info/del + - /api/v1/user-info/kick-off/** + - /api/v1/user-info/password/mod \ No newline at end of file diff --git a/kqapi/src/test/resources/template/simsun.ttc b/kqapi/src/test/resources/template/simsun.ttc new file mode 100644 index 0000000..40e9693 Binary files /dev/null and b/kqapi/src/test/resources/template/simsun.ttc differ diff --git a/kqapi/src/test/resources/template/预审申请单.html b/kqapi/src/test/resources/template/预审申请单.html new file mode 100644 index 0000000..2641489 --- /dev/null +++ b/kqapi/src/test/resources/template/预审申请单.html @@ -0,0 +1,286 @@ + + + + + + Document + + + +
+

+ #title# +

+
+

+ + 项目编号: + #projectNo# + + #time# +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
项目基本信息
项目名称#projectName#
是否临时增补#isTemporaryAugment#是否一地创新全省共享项目#isInnovateWholeProvinceShare#
项目负责人#responsibleMan#负责人手机号#responsibleManMobile#
项目联系人#contactName#项目联系人手机号#contactPhone#
建设单位#buildOrgName#建设单位统一社会信用代码#orgCreditCode#
项目类型#projectType#是否首次新建#isFirst#
预算年度#projectYear#建设起止时间#beginAndEndTime#
四大体系#fourSystems#
是否数字化改革项目#isDigitalReform#综合业务领域#bizDomain#
立项依据#buildBasisList#
是否上云#isCloud#云类型#cloudType#
项目简介#projectIntroduction#
资金申报情况
申报金额#declareAmount#
自有资金#declareHaveAmount#政府投资-本级财政资金#declareGovOwnFinanceAmount#
政府投资-上级补助资金#declareGovSuperiorFinanceAmount#银行贷款#declareBankLendingAmount#
其他资金#declareOtherAmount#
本年计划投资(万元)#yearPlanInvest#
资金分配情况
软件开发#softwareDevelopmentAmount#云资源、硬件购置#cloudHardwarePurchaseAmount#
第三方服务#thirdPartyAmount#
年度支付计划
年度支付金额#annualPlanAmount#
自有资金#annualPlanHaveAmount#政府投资-本级财政资金#annualPlanGovOwnFinanceAmount#
政府投资-上级补助资金#annualPlanGovSuperiorFinanceAmount#银行贷款#annualPlanBankLendingAmount#
其他资金#annualPlanOtherAmount#
备注
备注#projectRemarks#
单位意见
本级主管单位意见(盖章) +
+

+ #superOrgOpinion# +

+

+ #superOrgAuditDate# +

+
+
上级主管单位意见(盖章) +
+

+ #higherOrgOpinion# +

+

+ #higherOrgAuditDate# +

+
+
+ #bigDataBureauName# + 意见(盖章) + +
+

+ #bigDataBureauOpinion# +

+

+ #bigDataBureauAuditDate# +

+
+
+
+
+ + diff --git a/kqapi/src/test/resources/wsdl-prod.xml b/kqapi/src/test/resources/wsdl-prod.xml new file mode 100644 index 0000000..0302851 --- /dev/null +++ b/kqapi/src/test/resources/wsdl-prod.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kqapi/src/test/resources/wsdl.xml b/kqapi/src/test/resources/wsdl.xml new file mode 100644 index 0000000..eed87a7 --- /dev/null +++ b/kqapi/src/test/resources/wsdl.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ningda-generator/pom.xml b/ningda-generator/pom.xml new file mode 100644 index 0000000..f457603 --- /dev/null +++ b/ningda-generator/pom.xml @@ -0,0 +1,66 @@ + + + + kq-value-added-project + com.ningdatech + 1.0.0 + + 4.0.0 + + ningda-generator + + + + com.baomidou + mybatis-plus-boot-starter + + + + com.baomidou + mybatis-plus-generator + ${mybatis.plus.version} + + + + org.freemarker + freemarker + + + + + mysql + mysql-connector-java + + + + + org.apache.directory.studio + org.apache.commons.codec + 1.8 + + + junit + junit + 4.12 + test + + + + org.springframework.boot + spring-boot-starter-test + + + + org.springframework.boot + spring-boot-starter-test + + + + com.ningdatech + ningda-car-api + 1.0.0 + + + diff --git a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java new file mode 100644 index 0000000..3d64278 --- /dev/null +++ b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java @@ -0,0 +1,63 @@ +package com.ningdatech.generator.config; + +import com.baomidou.mybatisplus.generator.FastAutoGenerator; +import com.baomidou.mybatisplus.generator.config.OutputFile; +import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; + +import java.util.Collections; + +/** + * @description: 自动生成code代码 + * @author: zpf + * @date: 2023/01/03 09:20 + */ +public class GeneratorCodeKingbaseConfig { + + private static final String PATH_LXX = "/Users/liuxinxin/IdeaProjects/project-management/pmapi/src/main/java"; + private static final String PATH_YYD = "/Users/wendy/code project/java/project-management/pmapi/src/main/java"; + private static final String PATH_LS = ""; + private static final String PATH_ZPF = "D:\\ningda\\kq-value-added-project\\kqapi\\src\\main\\java"; + private static final String PATH_CMM = "D:\\work\\project-management\\project-management\\pmapi\\src\\main\\java"; + + private static final String URL = "jdbc:mysql://47.98.125.47:3306/kqzzsfw?serverTimezone=Asia/Shanghai&characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false"; + private static final String USER_NAME = "root"; + private static final String PASSWORD = "NingdaKeji123!"; + + private static void generate(String author, String packageName, String path, String... tableNames) { + FastAutoGenerator.create(URL, USER_NAME, PASSWORD) + .globalConfig(builder -> { + // 设置作者 + builder.author(author) + // 开启 swagger 模式 + .enableSwagger() + // 覆盖已生成文件 + .fileOverride() + // 指定输出目录 + .outputDir(path); + }) + .packageConfig(builder -> { + // 设置父包名 + builder.parent("com.ningdatech") + // 设置父包模块名 + .moduleName("kqapi." + packageName) + // 设置mapperXml生成路径 + .pathInfo(Collections.singletonMap(OutputFile.mapperXml, + //设置自己的生成路径 + path + "/com/ningdatech/kqapi/" + packageName + "/mapper")); + }) + .strategyConfig(builder -> { + builder.addTablePrefix(""); + // 设置需要生成的表名 + builder.addInclude(tableNames); + }) + // 使用Freemarker引擎模板,默认的是Velocity引擎模板 + .templateEngine(new FreemarkerTemplateEngine()) + .execute(); + } + + public static void main(String[] args) { + //generate("Liuxinxin", "expert", PATH_LXX, "expert_gov_business_strip"); + generate("ZPF", "zzsfw", PATH_ZPF, "nd_kq_zzsfw_menu"); + } + +} diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..2a9e976 --- /dev/null +++ b/pom.xml @@ -0,0 +1,153 @@ + + + 4.0.0 + + com.ningdatech + kq-value-added-project + pom + 1.0.0 + kq-value-added-project + 柯桥增值式服务项目 + + + true + UTF-8 + 2.6.11 + 1.8 + 1.8 + 3.7.0 + 3.5.1 + 3.0.0 + 3.0.3 + 1.2.83 + 31.1-jre + 2.11.1 + + + + + + org.apache.poi + poi + 5.2.2 + + + org.apache.poi + poi-ooxml + 5.2.2 + + + com.alibaba + fastjson + ${fastjson.version} + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + com.baomidou + mybatis-plus-boot-starter + ${mybatis.plus.version} + + + com.google.guava + guava + ${guava.version} + + + com.ningdatech + nd-basic + 1.0.0 + + + com.baomidou + mybatis-plus-extension + ${mybatis.plus.version} + + + com.ningdatech + nd-swagger2-starter + 1.0.0 + + + + com.alibaba + easyexcel-core + 3.1.2 + + + com.ningdatech + nd-file-starter + 1.0.0 + + + com.ningdatech + nd-zwdd-starter + 1.0.0 + + + com.ningdatech + nd-cache-starter + 1.0.0 + + + com.ningdatech + nd-log-starter + 1.0.0 + + + com.ningdatech + nd-irs-starter + 1.0.0 + + + joda-time + joda-time + 2.10.6 + + + + + + + + + aliyun + aliyun + https://maven.aliyun.com/repository/public + + true + + + false + + + + + + + + + spring-plugin + spring-plugin + https://maven.aliyun.com/repository/spring-plugin + + true + + + false + + + + + + kqapi + ningda-generator + +