commit 7a4519ff1554d7df4e240f02f641440b9d45289b Author: wyb <1977763549@qq.com> Date: Wed Jan 3 17:35:22 2024 +0800 feat:广东省中医报告作废电生理项目初始化 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6a8a1e4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +docus-services/docus-services-system1/ + +### IntelliJ IDEA ### +*.log +.idea +*.iws +*.iml +*.ipr +mvnw* +*.cmd +*.mvn +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ +logs* \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3cc485f --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ + +框架说明 + + +项目结构 +``` +backup --业务模块 备份 + controller --前端接口层 + param --接口参数 + vo --返回视图 + feign --服务接口层 + infrastructure --基础设施层 + cache --mybatis 和 feign 接口的缓存层 + client --访问对外接口,例如 feign ,ws 等 + dao --连接数据库 + job --xxl-job + service --业务代码 + impl --service 实现类 +inspection -- 业务模块 采集器 + controller --前端接口层 + param --接口参数 + vo --返回视图 + feign --服务接口层 + infrastructure --基础设施层 + cache --mybatis 和 feign 接口的缓存层 + client --访问对外接口,例如 feign ,ws 等 + dao --连接数据库 + job --xxl-job + service --业务代码 + impl --service 实现类 +``` + + +这个是一个模板,需要启动新项目的,复制一份,并且修改 项目名称以及修改docus-demo 跟项目名称一致即可启动。 diff --git a/assembly.xml b/assembly.xml new file mode 100644 index 0000000..b6fb827 --- /dev/null +++ b/assembly.xml @@ -0,0 +1,73 @@ + + + exe + + dir + + false + + + + + /lib + ${basedir}/target/lib + + + + /config + ${basedir}/target/resources + 0755 + + *.xml + *.yml + *.properties + + + + + /dataConfig + ${basedir}/target/dataConfig + 0755 + + *.json + + + + + / + ${basedir}/target/resources/bin + 0755 + + *.bat + + + + + / + ${basedir}/target/resources/bin + 0755 + + *.xml + + + + + / + ${basedir} + 0755 + + *.exe + + + + + ${basedir}/target + / + 0755 + + ${project.build.finalName}.jar + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..725c737 --- /dev/null +++ b/pom.xml @@ -0,0 +1,353 @@ + + + + com.docus + docus-bom + 1.0-SNAPSHOT + +4.0.0 + +docus-report-manager + + + + com.docus + docus-knife4j-starter + + + + org.apache.cxf + cxf-spring-boot-starter-jaxws + 3.3.4 + + + + org.dom4j + dom4j + 2.1.1 + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + checker-qual + org.checkerframework + + + error_prone_annotations + com.google.errorprone + + + + + org.springframework.boot + spring-boot-starter-web + + + + com.baomidou + mybatis-plus-boot-starter + 3.4.0 + + + com.baomidou + dynamic-datasource-spring-boot-starter + 3.4.0 + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + HdrHistogram + org.hdrhistogram + + + jsr305 + com.google.code.findbugs + + + + + mysql + mysql-connector-java + 8.0.28 + + + org.projectlombok + lombok + 1.18.16 + compile + + + org.projectlombok + lombok + 1.18.16 + compile + + + org.bgee.log4jdbc-log4j2 + log4jdbc-log4j2-jdbc4.1 + + + com.alibaba + druid + 1.2.4 + compile + + + com.baomidou + mybatis-plus-generator + 3.4.1 + compile + + + org.apache.velocity + velocity-engine-core + 2.0 + + + com.xuxueli + xxl-job-core + + + com.docus + docus-base-starter + + + knife4j-spring-boot-autoconfigure + com.github.xiaoymin + + + + + + com.docus + docus-tool-starter + + + + com.docus + docus-shiro-starter + + + + com.docus + docus-base-starter + + + springfox-core + io.springfox + + + springfox-schema + io.springfox + + + springfox-spi + io.springfox + + + knife4j-spring-boot-autoconfigure + com.github.xiaoymin + + + + + + + org.springframework.cloud + spring-cloud-starter-netflix-hystrix + + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + junit + junit + test + + + + + com.microsoft.sqlserver + sqljdbc4 + 4.0 + + + + + + + src/main/resources + true + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.4.4 + + ZIP + + + non-exists + non-exists + + + + + + + repackage + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-dependencies + package + + copy-dependencies + + + + target/lib + false + false + runtime + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.2.0 + + + copy-resources + package + + copy-resources + + + + + src/main/resources + + **/*.* + + + + ${project.build.directory}/resources + + + + copy-bin + package + + copy-resources + + + + + src/main/resources + true + + bin/*.xml + *.yml + bin/*.bat + + + + ${project.build.directory}/resources + + + + copy-data-config + package + + copy-resources + + + + + ../../dataConfig + true + + + ${project.build.directory}/dataConfig + + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.0 + + + **/*.yml + + + + + + maven-assembly-plugin + + + + ${project.artifactId} + false + + assembly.xml + + + make-assembly + package + + single + + + + + + + + + + + dev + + prod + + + true + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/docus/server/AppRunBootstrap.java b/src/main/java/com/docus/server/AppRunBootstrap.java new file mode 100644 index 0000000..c58ef6d --- /dev/null +++ b/src/main/java/com/docus/server/AppRunBootstrap.java @@ -0,0 +1,26 @@ +package com.docus.server; + + +import lombok.extern.slf4j.Slf4j; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableAsync; + +import java.util.Properties; + + +@Slf4j +@SpringBootApplication(scanBasePackages ={"com.docus"}) +@MapperScan("com.docus.server.**.mapper") +@EnableAsync +public class AppRunBootstrap { + public static void main(String[] args) { + Properties props = System.getProperties(); + props.setProperty("org.apache.cxf.stax.allowInsecureParser", "1"); + props.setProperty("UseSunHttpHandler", "true"); + System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"); + SpringApplication.run(AppRunBootstrap.class, args); + + } +} diff --git a/src/main/java/com/docus/server/CxfConfig.java b/src/main/java/com/docus/server/CxfConfig.java new file mode 100644 index 0000000..b06f8e6 --- /dev/null +++ b/src/main/java/com/docus/server/CxfConfig.java @@ -0,0 +1,48 @@ +package com.docus.server; + + +import com.docus.server.reportmanager.service.ReportManagerService; +import org.apache.cxf.Bus; +import org.apache.cxf.bus.spring.SpringBus; +import org.apache.cxf.jaxws.EndpointImpl; +import org.apache.cxf.transport.servlet.CXFServlet; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.web.servlet.ServletRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.xml.ws.Endpoint; + +@Configuration +public class CxfConfig { + @Autowired + @Qualifier("SzyReportManagerService") + private ReportManagerService reportManagerService; + + /** + * 注入Servlet,注意beanName不能为dispatcherServlet + * + * @author Fang Ruichuan + * @date 2022/11/14 19:16 + */ + @Bean + public ServletRegistrationBean cxfServlet() { + return new ServletRegistrationBean(new CXFServlet(), "/wzhws/*"); + } + + @Bean(name = Bus.DEFAULT_BUS_ID) + public SpringBus springBus() { + return new SpringBus(); + } + + @Bean + @Qualifier("reportEndPoint") + public Endpoint reportEndPoint() { + EndpointImpl endpoint = new EndpointImpl(springBus(), reportManagerService); + endpoint.publish("/report"); + return endpoint; + } + +} diff --git a/src/main/java/com/docus/server/MybatisPlusGenerator.java b/src/main/java/com/docus/server/MybatisPlusGenerator.java new file mode 100644 index 0000000..d3fe0b5 --- /dev/null +++ b/src/main/java/com/docus/server/MybatisPlusGenerator.java @@ -0,0 +1,95 @@ +package com.docus.server;//package com.docus.server.clinicqualitycontrol.all; +// +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.generator.AutoGenerator; +import com.baomidou.mybatisplus.generator.config.*; +import com.baomidou.mybatisplus.generator.config.rules.DateType; +import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; + +import java.util.HashMap; +import java.util.Map; + +/** + * mybatis plus代码生成器 + */ +public class MybatisPlusGenerator { + + public static void main(String[] args) { + //获得entity目录 + String entity = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-interfaces\\src\\main\\java\\com\\docus\\services\\system\\entity\\"; + //获取mapper目录 + String mapper = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-application\\src\\main\\java\\com\\docus\\services\\system\\mapper"; + //获取mapper的xml目录 + String mapperxml = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-application\\src\\main\\resources\\mapper"; + //获取模块名 + //获取service目录 + String service = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-interfaces\\src\\main\\java\\com\\docus\\services\\system\\facade"; + //获得serviceimpl目录 + String serviceImpl = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-application\\src\\main\\java\\com\\docus\\services\\system\\service"; + +// //获得controller目录 + String controller = "D:\\ideaProject\\docus_inspection\\docus-services\\docus-services-inspection\\docus-services-inspection-controller\\src\\main\\java\\com\\docus\\services\\system\\controller"; + //1,代码生成器 + AutoGenerator mpg = new AutoGenerator(); + // 2、全局配置 + GlobalConfig gc = new GlobalConfig(); + gc.setFileOverride(true); //重新生成时文件是否覆盖 + + //UserServie + //gc.setServiceName("%sService"); //去掉Service接口的首字母I + gc.setAuthor("jiashi"); //自定义作者 + gc.setOpen(false); //生成后是否打开资源管理器 + gc.setIdType(IdType.INPUT); //主键策略 + gc.setDateType(DateType.ONLY_DATE);//定义生成的实体类中日期类型 + gc.setSwagger2(true);//开启Swagger2模式 + mpg.setGlobalConfig(gc); + + //数据库配置 + DataSourceConfig dataSourceConfig = new DataSourceConfig(); + dataSourceConfig.setUrl("jdbc:log4jdbc:mysql://8.134.10.251:3306/docus_inspection?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai"); + dataSourceConfig.setDriverName("net.sf.log4jdbc.sql.jdbcapi.DriverSpy"); + dataSourceConfig.setUsername("docus"); + dataSourceConfig.setPassword("docus702"); + mpg.setDataSource(dataSourceConfig); + + //包配置 + PackageConfig pc = new PackageConfig(); + //设置自定义输出目录(分布式项目使用) + Map pathInfo = new HashMap<>(); +// pathInfo.put(ConstVal.ENTITY_PATH, entity); +// pathInfo.put(ConstVal.MAPPER_PATH, mapper); +// pathInfo.put(ConstVal.XML_PATH, mapperxml); +// pathInfo.put(ConstVal.SERVICE_PATH, service); +// pathInfo.put(ConstVal.SERVICE_IMPL_PATH, serviceImpl); + pathInfo.put(ConstVal.CONTROLLER_PATH, controller); + pc.setPathInfo(pathInfo); + mpg.setPackageInfo(pc); + //设置自定义包名 + pc.setParent("com.docus.services.system"); + pc.setService("facade"); + pc.setServiceImpl("service"); + mpg.setPackageInfo(pc); + + // 5、策略配置 + StrategyConfig strategy = new StrategyConfig(); + + strategy.setInclude("inspection_status"); //要生成的表 + + strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 + strategy.setTablePrefix(pc.getModuleName() + "_"); //生成实体时去掉表前缀 + + strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略 + strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作 + + strategy.setRestControllerStyle(true); //restful api风格控制器 + strategy.setControllerMappingHyphenStyle(true); //url中驼峰转连字符 + + mpg.setStrategy(strategy); + + + // 6、执行 + mpg.execute(); + + //7,注意的是,需将service包中生成的serviceImpl中的@Service注解改成@DubboService注解 + } +} diff --git a/src/main/java/com/docus/server/XxlJobConfig.java b/src/main/java/com/docus/server/XxlJobConfig.java new file mode 100644 index 0000000..d9edbfa --- /dev/null +++ b/src/main/java/com/docus/server/XxlJobConfig.java @@ -0,0 +1,87 @@ +package com.docus.server; +import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @ProjectName: + * @Description: + * @Param 传输参数 + * @Return + * @Author: 曾文和 + * @CreateDate: 2021/5/7 16:23 + * @UpdateUser: 曾文和 + * @UpdateDate: 2021/5/7 16:23 + * @UpdateRemark: 更新说明 + * @Version: 1.0 + */ + + + +@Configuration +public class XxlJobConfig { + private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class); + + @Value("${xxl.job.admin.addresses}") + private String adminAddresses; + + @Value("${xxl.job.accessToken}") + private String accessToken; + + @Value("${xxl.job.executor.appname}") + private String appname; + + @Value("${xxl.job.executor.address}") + private String address; + + @Value("${xxl.job.executor.ip}") + private String ip; + + @Value("${xxl.job.executor.port}") + private int port; + + @Value("${xxl.job.executor.logpath}") + private String logPath; + + @Value("${xxl.job.executor.logretentiondays}") + private int logRetentionDays; + + + @Bean + public XxlJobSpringExecutor xxlJobExecutor() { + logger.info(">>>>>>>>>>> xxl-job config init."); + XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); + xxlJobSpringExecutor.setAdminAddresses(adminAddresses); + xxlJobSpringExecutor.setAppname(appname); + xxlJobSpringExecutor.setAddress(address); + xxlJobSpringExecutor.setIp(ip); + xxlJobSpringExecutor.setPort(port); + xxlJobSpringExecutor.setAccessToken(accessToken); + xxlJobSpringExecutor.setLogPath(logPath); + xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays); + + return xxlJobSpringExecutor; + } + + /** + * 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP; + * + * 1、引入依赖: + * + * org.springframework.cloud + * spring-cloud-commons + * ${version} + * + * + * 2、配置文件,或者容器启动变量 + * spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.' + * + * 3、获取IP + * String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + *//* + +*/ +} diff --git a/src/main/java/com/docus/server/reportmanager/entity/AfCollectTask.java b/src/main/java/com/docus/server/reportmanager/entity/AfCollectTask.java new file mode 100644 index 0000000..e34727c --- /dev/null +++ b/src/main/java/com/docus/server/reportmanager/entity/AfCollectTask.java @@ -0,0 +1,54 @@ +package com.docus.server.reportmanager.entity; + +import lombok.Data; + +import java.util.Date; + +@Data +public class AfCollectTask { + private Long id; + private String patientId; + private Long afArchiveDetailId; + private String sysflag; + private Date startTime; + private Date endTime; + private Long consumingTime; + private String state; + private Date syncTime; + private Date recollectTime; + private String recollectName; + private String remark; + private String pResult; + private String C1; + private String C2; + private String C3; + private String C4; + private String C5; + private String C6; + private String C7; + private String C8; + private String C9; + private String C10; + private Double N1; + private Double N2; + private Double N3; + private Double N4; + private Double N5; + private Date T1; + private Date T2; + private Date T3; + private Date T4; + private Date T5; + private Date T6; + private String C11; + private String C12; + private String C13; + private String C14; + private String C15; + private String C16; + private String C17; + private String C18; + private String C19; + private String C20; + private Date createTime; +} \ No newline at end of file diff --git a/src/main/java/com/docus/server/reportmanager/mapper/CollectTaskMapper.java b/src/main/java/com/docus/server/reportmanager/mapper/CollectTaskMapper.java new file mode 100644 index 0000000..ea9a465 --- /dev/null +++ b/src/main/java/com/docus/server/reportmanager/mapper/CollectTaskMapper.java @@ -0,0 +1,34 @@ +package com.docus.server.reportmanager.mapper; + + +import com.docus.server.reportmanager.entity.AfCollectTask; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author wyb + */ +@Mapper +public interface CollectTaskMapper { + /** + * 根据采集任务信息,查询采集任务id + * + * @param task 采集任务信息 + * @return java.util.List 采集任务id集合 + * @date 2024/1/3 16:47 + * @author YongBin Wen + */ + List getTasks(@Param("task") AfCollectTask task); + + /** + * 根据任务id作废任务 + * + * @param ids 任务id集合 + * @return int + * @date 2024/1/3 17:07 + * @author YongBin Wen + */ + int cancel(@Param("ids") List ids); +} diff --git a/src/main/java/com/docus/server/reportmanager/mapper/ScanAssortMapper.java b/src/main/java/com/docus/server/reportmanager/mapper/ScanAssortMapper.java new file mode 100644 index 0000000..3975fa5 --- /dev/null +++ b/src/main/java/com/docus/server/reportmanager/mapper/ScanAssortMapper.java @@ -0,0 +1,34 @@ +package com.docus.server.reportmanager.mapper; + + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author wyb + */ +@Mapper +public interface ScanAssortMapper { + /** + * 根据id作废文件 + * + * @param ids id集合 + * @return int + * @date 2024/1/3 17:06 + * @author YongBin Wen + */ + int cancel(@Param("ids") List ids); + + /** + * 根据病案习习和任务信息查询文件id + * + * @param patientId 病案主键 + * @param taskId 任务id + * @return java.util.List 文件id + * @date 2024/1/3 17:06 + * @author YongBin Wen + */ + List getIdByPatientTask(@Param("patientId") String patientId, @Param("taskId") Long taskId); +} diff --git a/src/main/java/com/docus/server/reportmanager/service/ReportManagerService.java b/src/main/java/com/docus/server/reportmanager/service/ReportManagerService.java new file mode 100644 index 0000000..6f95724 --- /dev/null +++ b/src/main/java/com/docus/server/reportmanager/service/ReportManagerService.java @@ -0,0 +1,21 @@ +package com.docus.server.reportmanager.service; + +import javax.jws.WebService; + +/** + * 报告管理服务接口 + * + * @author YongBin Wen + * @date 2024/1/3 16:11 + */ +@WebService +public interface ReportManagerService { + /** + * 报告删除 + * + * @param message 删除信息 + * @return 处理结果 + */ + String DeleteReport(String message); + +} diff --git a/src/main/java/com/docus/server/reportmanager/service/impl/SzyReportManagerServiceImpl.java b/src/main/java/com/docus/server/reportmanager/service/impl/SzyReportManagerServiceImpl.java new file mode 100644 index 0000000..1174b76 --- /dev/null +++ b/src/main/java/com/docus/server/reportmanager/service/impl/SzyReportManagerServiceImpl.java @@ -0,0 +1,104 @@ +package com.docus.server.reportmanager.service.impl; + +import com.docus.core.util.Func; +import com.docus.infrastructure.core.exception.BaseException; +import com.docus.infrastructure.core.utils.SpringUtil; +import com.docus.server.reportmanager.entity.AfCollectTask; +import com.docus.server.reportmanager.mapper.CollectTaskMapper; +import com.docus.server.reportmanager.mapper.ScanAssortMapper; +import com.docus.server.reportmanager.service.ReportManagerService; +import com.docus.server.reportmanager.util.XmlUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.w3c.dom.Node; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +/** + * 省中医报告管理服务接口 + * + * @author YongBin Wen + * @date 2024/1/3 16:11 + */ +@Service("SzyReportManagerService") +@Slf4j +public class SzyReportManagerServiceImpl implements ReportManagerService { + @Resource + private CollectTaskMapper collectTaskMapper; + @Resource + private ScanAssortMapper scanAssortMapper; + + @Override + public String DeleteReport(String message) { + log.info("广东省中医报告管理,收到作废报告的信息:{}", message); + try { + XmlUtil xmlUtil = XmlUtil.of(message); + Node reportNoNode = xmlUtil.getNode("/request/REPORT_NO"); + String reportNo = reportNoNode.getTextContent(); + // todo 此方法暂时只做电生理 的作废, + cancelElectrophysiologyReport(reportNo); + return success(); + } catch (BaseException baseException) { + log.error(baseException.getMessage(), baseException); + return error(baseException.getMessage()); + } catch (Exception ex) { + log.error(ex.getMessage(), ex); + return error("系统内部错误,请联系开发人员"); + } + } + + /** + * 作废电生理的报告,电生理采集来源id为 13 + * + * @param reportNo 报告唯一号 + * @date 2024/1/3 17:19 + * @author YongBin Wen + */ + private void cancelElectrophysiologyReport(String reportNo) { + final String sysFlag = "13"; + AfCollectTask task = new AfCollectTask(); + task.setC1(reportNo); + task.setSysflag(sysFlag); + List tasks = collectTaskMapper.getTasks(task); + if (Func.isEmpty(tasks)) { + throw new BaseException("无纸化系统没有可作废的电生理报告:" + reportNo); + } + ArrayList taskIds = new ArrayList<>(); + ArrayList scanAssortIds = new ArrayList<>(); + for (AfCollectTask collectTask : tasks) { + taskIds.add(collectTask.getId()); + List scanAssortIdsByTask = scanAssortMapper.getIdByPatientTask(collectTask.getPatientId(), collectTask.getId()); + scanAssortIds.addAll(scanAssortIdsByTask); + } + SzyReportManagerServiceImpl service = SpringUtil.getBean(SzyReportManagerServiceImpl.class); + service.cancelReportTaskAndFile(taskIds, scanAssortIds); + } + + + @Transactional(rollbackFor = Exception.class) + public void cancelReportTaskAndFile(List taskIds, List scanAssortIds) { + collectTaskMapper.cancel(taskIds); + scanAssortMapper.cancel(scanAssortIds); + } + + private String error(String msg) { + return "\n" + + " \n" + + " 1\n" + + " " + msg + "\n" + + " \n" + + ""; + } + + private String success() { + return "\n" + + " \n" + + " 0\n" + + " 成功\n" + + " \n" + + ""; + } +} diff --git a/src/main/java/com/docus/server/reportmanager/util/HttpUrlUtil.java b/src/main/java/com/docus/server/reportmanager/util/HttpUrlUtil.java new file mode 100644 index 0000000..2c5e30b --- /dev/null +++ b/src/main/java/com/docus/server/reportmanager/util/HttpUrlUtil.java @@ -0,0 +1,54 @@ +package com.docus.server.reportmanager.util; + +import com.docus.core.util.Func; + +import java.util.HashMap; +import java.util.Map; + +/** + * http 地址工具 + * + * @author WYBDEV + */ +public class HttpUrlUtil { + /** + * 添加url参数 + * + * @param url url + * @param param 参数 + * @return 处理过后的url + */ + public static String addUrlParam(String url, Map param) { + if (Func.isEmpty(param)) { + return url; + } + StringBuilder urlBuilder = new StringBuilder(url); + // url已经添加过参数的标记 + String addFlag = "?"; + // url 参数连接符号,如果没有添加过,连接符号置为空 + String connect = "&"; + if (!url.contains(addFlag)) { + urlBuilder.append("?"); + connect = ""; + } + + for (Map.Entry entry : param.entrySet()) { + String key = entry.getKey(); + String value = entry.getValue(); + urlBuilder.append(connect).append(key).append("=").append(value); + // 添加过参数,连接符置为& + connect = "&"; + + } + return urlBuilder.toString(); + } + + public static void main(String[] args) { + System.out.println(addUrlParam("http://www.baidu.com", null)); + System.out.println(addUrlParam("http://www.baidu.com?word=1", null)); + HashMap stringStringHashMap = new HashMap<>(); + stringStringHashMap.put("en","some"); + System.out.println(addUrlParam("http://www.baidu.com", stringStringHashMap)); + System.out.println(addUrlParam("http://www.baidu.com?word=1", stringStringHashMap)); + } +} diff --git a/src/main/java/com/docus/server/reportmanager/util/IdUtil.java b/src/main/java/com/docus/server/reportmanager/util/IdUtil.java new file mode 100644 index 0000000..2898db2 --- /dev/null +++ b/src/main/java/com/docus/server/reportmanager/util/IdUtil.java @@ -0,0 +1,19 @@ +package com.docus.server.reportmanager.util; + +import lombok.Data; + +import java.util.UUID; +import java.util.concurrent.ThreadLocalRandom; + +@Data +public class IdUtil { + /** + * 得到一个标准的 8-4-4-4-12 UUID + * @return 标准的 8-4-4-4-12 UUID + */ + public static String standardUUID(){ + ThreadLocalRandom random = ThreadLocalRandom.current(); + return (new UUID(random.nextLong(), random.nextLong())).toString(); + } + +} diff --git a/src/main/java/com/docus/server/reportmanager/util/JaxWsDynamicClient.java b/src/main/java/com/docus/server/reportmanager/util/JaxWsDynamicClient.java new file mode 100644 index 0000000..aab848c --- /dev/null +++ b/src/main/java/com/docus/server/reportmanager/util/JaxWsDynamicClient.java @@ -0,0 +1,68 @@ +package com.docus.server.reportmanager.util; + +import org.apache.cxf.endpoint.Client; +import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory; +import org.apache.cxf.transport.http.HTTPConduit; +import org.apache.cxf.transports.http.configuration.HTTPClientPolicy; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.xml.namespace.QName; +import java.util.Arrays; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * 使用JaxWsDynamicClientFactory 调用 webservice + * @author wyb + */ +public class JaxWsDynamicClient { + + private static final JaxWsDynamicClientFactory CLIENT_FACTORY = JaxWsDynamicClientFactory.newInstance(); + private static final Map CLIENT_MAP=new ConcurrentHashMap<>(); + private static final Logger logger= LoggerFactory.getLogger(JaxWsDynamicClient.class); + + public static String send(String wsdlUrl,String namespaceUri,String operationName,Object[] params){ + logger.debug("wsdlUrl:" + wsdlUrl +" ,namespaceUri: "+namespaceUri+ " ,operationName:" + operationName + ",param:" + Arrays.toString(params)); + try { + Client client = getClient(wsdlUrl); + Object[] result; + if (namespaceUri == null || namespaceUri.isEmpty()) { + result = client.invoke(operationName, params); + } else { + QName qName = new QName(namespaceUri, operationName); + result = client.invoke(qName, params); + } + if (result == null || result[0] == null) { + return null; + } + return String.valueOf(result[0]); + } catch (Exception ex) { + ex.printStackTrace(); + logger.error("wsdlUrl:" + wsdlUrl +",namespaceUri: "+namespaceUri+ " ,operationName:" + operationName + ",param:" + Arrays.toString(params)+" 调用失败了!", ex); + return null; + } + } + + public static Client getClient(String wsdlUrl){ + if(CLIENT_MAP.get(wsdlUrl)==null){ + synchronized (JaxWsDynamicClient.class){ + if(CLIENT_MAP.get(wsdlUrl)==null){ + Client client = CLIENT_FACTORY.createClient(wsdlUrl); + setClientParam(client); + CLIENT_MAP.put(wsdlUrl,client); + } + } + } + return CLIENT_MAP.get(wsdlUrl); + } + + private static void setClientParam(Client client) { + HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); + httpClientPolicy.setConnectionTimeout(30000); + httpClientPolicy.setAllowChunking(false); + httpClientPolicy.setReceiveTimeout(30000); + HTTPConduit clientConduit = (HTTPConduit) client.getConduit(); + clientConduit.setClient(httpClientPolicy); + } +} diff --git a/src/main/java/com/docus/server/reportmanager/util/TableJsonRead.java b/src/main/java/com/docus/server/reportmanager/util/TableJsonRead.java new file mode 100644 index 0000000..453a25e --- /dev/null +++ b/src/main/java/com/docus/server/reportmanager/util/TableJsonRead.java @@ -0,0 +1,196 @@ +package com.docus.server.reportmanager.util; + + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.util.StringUtils; + +import java.io.*; + +public class TableJsonRead { + + /** + * 读取数据结构 + * @param path 路径后缀 + * @param fileName 文件名称 + * @return + */ + public T Read(String path,String fileName,Class clazz){ + String currentPath=CurrentPath(); + path = currentPath+"\\"+path; + StringBuilder sb = new StringBuilder(); + T dto =null; + File file = new File(path+"\\"+fileName); + try { + if (!file.getParentFile().exists()) { + file.getParentFile().mkdirs(); + } + if (!file.exists()) { + try { + file.createNewFile(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } else { + BufferedReader bufferedReader = null; + bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file))); + String line; + while (!StringUtils.isEmpty(line = bufferedReader.readLine())) { + sb.append(line); + } + if (sb.length() > 0) { + ObjectMapper objectMapper = new ObjectMapper(); + //dto = (T)JSONObject.parse(sb.toString()); + dto= objectMapper.readValue(sb.toString(), clazz); + //dto = objectMapper.convertValue(o, new TypeReference() { }); + } + bufferedReader.close(); + } + + return dto; + } + catch (Exception ex){ + ex.printStackTrace(); + return null; + } + } + + public T Read(File file,Class clazz) { + StringBuilder sb = new StringBuilder(); + T dto =null; + try { + if (!file.getParentFile().exists()) { + file.getParentFile().mkdirs(); + } + if (!file.exists()) { + try { + file.createNewFile(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } else { + BufferedReader bufferedReader = null; + bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file))); + String line; + while (!StringUtils.isEmpty(line = bufferedReader.readLine())) { + sb.append(line); + } + if (sb.length() > 0) { + ObjectMapper objectMapper = new ObjectMapper(); + //dto = (T)JSONObject.parse(sb.toString()); + dto= objectMapper.readValue(sb.toString(), clazz); + //dto = objectMapper.convertValue(o, new TypeReference() { }); + } + bufferedReader.close(); + } + + return dto; + } + catch (Exception ex){ + ex.printStackTrace(); + return null; + } + } + /** + * 取得当前jar路径 + * @return + */ + public static String CurrentPath(){ + File dir = new File("."); + String currentpath =""; + try { + currentpath = dir.getCanonicalPath(); + } catch (IOException e) { + e.printStackTrace(); + } + return currentpath; + } + + /** + * 取得当前jar路径 + * @return + */ + public static String currentPath(String dir){ + String path = CurrentPath() + File.separator + dir; + File file = new File(path); + if (!file.exists()) { + file.mkdirs(); + } + return path; + } + + + + /** + * 读取文件内容 + * @param path + * @param fileName + * @return + */ + public String ReadContent(String path,String fileName){ + String currentPath=CurrentPath(); + path = currentPath+"\\"+path; + StringBuilder sb = new StringBuilder(); + File file = new File(path+"\\"+fileName); + try { + if (!file.getParentFile().exists()) { + file.getParentFile().mkdirs(); + } + if (!file.exists()) { + try { + file.createNewFile(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } else { + BufferedReader bufferedReader = null; + bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(file))); + String line; + while (!StringUtils.isEmpty(line = bufferedReader.readLine())) { + sb.append(line); + } + + bufferedReader.close(); + } + + return sb.toString(); + } + catch (Exception ex){ + ex.printStackTrace(); + return null; + } + } + + /** + * 保存json至文件 + * @param path 路径后缀 + * @param fileName 文件名称 + * @param data json信息 + * @return + */ + public void Save(String path,String fileName,String data){ + String currentPath=CurrentPath(); + path = currentPath+"\\"+path; + FileWriter fwriter = null; + try { + File file = new File(path); + if (!file.getParentFile().exists()) { + file.getParentFile().mkdirs(); + } + fwriter = new FileWriter(path+"\\"+fileName); + fwriter.write(data); + } catch (IOException ex) { + ex.printStackTrace(); + } finally { + try { + fwriter.flush(); + fwriter.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + +} diff --git a/src/main/java/com/docus/server/reportmanager/util/XmlUtil.java b/src/main/java/com/docus/server/reportmanager/util/XmlUtil.java new file mode 100644 index 0000000..96c9a89 --- /dev/null +++ b/src/main/java/com/docus/server/reportmanager/util/XmlUtil.java @@ -0,0 +1,315 @@ +/* + * Copyright (c) 2018-2028, DreamLu All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: DreamLu 卢春梦 (596392912@qq.com) + */ +package com.docus.server.reportmanager.util; + +import com.docus.core.util.Exceptions; +import com.docus.core.util.IoUtil; +import com.docus.core.util.StringUtil; +import org.springframework.lang.Nullable; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +import javax.xml.namespace.QName; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringReader; +import java.util.HashMap; +import java.util.Map; + +/** + * xpath解析xml + * + *
+ *     文档地址:
+ *     http://www.w3school.com.cn/xpath/index.asp
+ * 
+ * + * @author L.cm + */ +public class XmlUtil { + private final XPath path; + private final Document doc; + + private XmlUtil(InputSource inputSource) throws ParserConfigurationException, SAXException, IOException { + DocumentBuilderFactory dbf = getDocumentBuilderFactory(); + DocumentBuilder db = dbf.newDocumentBuilder(); + doc = db.parse(inputSource); + path = getXPathFactory().newXPath(); + } + + /** + * 创建工具类 + * + * @param inputSource inputSource + * @return XmlUtil + */ + private static XmlUtil create(InputSource inputSource) { + try { + return new XmlUtil(inputSource); + } catch (ParserConfigurationException | SAXException | IOException e) { + throw Exceptions.unchecked(e); + } + } + + /** + * 转换工具类 + * + * @param inputStream inputStream + * @return XmlUtil + */ + public static XmlUtil of(InputStream inputStream) { + InputSource inputSource = new InputSource(inputStream); + return create(inputSource); + } + + /** + * xml遇到的特殊字符替换 + */ + public static String specialCharacterSubstitution(String str){ + str = StringUtil.replace(str, "\u00A0", " "); + return str; + } + + /** + * 转换工具类 + * + * @param xmlStr xmlStr + * @return XmlUtil + */ + public static XmlUtil of(String xmlStr) { + xmlStr=specialCharacterSubstitution(xmlStr); + StringReader sr = new StringReader(xmlStr.trim()); + InputSource inputSource = new InputSource(sr); + XmlUtil xmlUtil = create(inputSource); + IoUtil.closeQuietly(sr); + return xmlUtil; + } + + /** + * 转换路径 + * + * @param expression 表达式 + * @param item 实体 + * @param returnType 返回类型 + * @return Object + */ + private Object evalXPath(String expression, @Nullable Object item, QName returnType) { + item = null == item ? doc : item; + try { + return path.evaluate(expression, item, returnType); + } catch (XPathExpressionException e) { + throw Exceptions.unchecked(e); + } + } + + /** + * 获取String + * + * @param expression 路径 + * @return {String} + */ + public String getString(String expression) { + return (String) evalXPath(expression, null, XPathConstants.STRING); + } + + /** + * 获取Boolean + * + * @param expression 路径 + * @return {String} + */ + public Boolean getBoolean(String expression) { + return (Boolean) evalXPath(expression, null, XPathConstants.BOOLEAN); + } + + /** + * 获取Number + * + * @param expression 路径 + * @return {Number} + */ + public Number getNumber(String expression) { + return (Number) evalXPath(expression, null, XPathConstants.NUMBER); + } + + /** + * 获取某个节点 + * + * @param expression 路径 + * @return {Node} + */ + public Node getNode(String expression) { + return (Node) evalXPath(expression, null, XPathConstants.NODE); + } + + /** + * 获取子节点 + * + * @param expression 路径 + * @return NodeList + */ + public NodeList getNodeList(String expression) { + return (NodeList) evalXPath(expression, null, XPathConstants.NODESET); + } + + + /** + * 获取String + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return {String} + */ + public String getString(Object node, String expression) { + return (String) evalXPath(expression, node, XPathConstants.STRING); + } + + /** + * 获取 + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return {String} + */ + public Boolean getBoolean(Object node, String expression) { + return (Boolean) evalXPath(expression, node, XPathConstants.BOOLEAN); + } + + /** + * 获取 + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return {Number} + */ + public Number getNumber(Object node, String expression) { + return (Number) evalXPath(expression, node, XPathConstants.NUMBER); + } + + /** + * 获取某个节点 + * + * @param node 节点 + * @param expression 路径 + * @return {Node} + */ + public Node getNode(Object node, String expression) { + return (Node) evalXPath(expression, node, XPathConstants.NODE); + } + + /** + * 获取子节点 + * + * @param node 节点 + * @param expression 相对于node的路径 + * @return NodeList + */ + public NodeList getNodeList(Object node, String expression) { + return (NodeList) evalXPath(expression, node, XPathConstants.NODESET); + } + + /** + * 针对没有嵌套节点的简单处理 + * + * @return map集合 + */ + public Map toMap() { + Element root = doc.getDocumentElement(); + Map params = new HashMap<>(16); + + // 将节点封装成map形式 + NodeList list = root.getChildNodes(); + for (int i = 0; i < list.getLength(); i++) { + Node node = list.item(i); + if (node instanceof Element) { + params.put(node.getNodeName(), node.getTextContent()); + } + } + return params; + } + + private static volatile boolean preventedXXE = false; + + private static DocumentBuilderFactory getDocumentBuilderFactory() throws ParserConfigurationException { + DocumentBuilderFactory dbf = XmlHelperHolder.documentBuilderFactory; + if (!preventedXXE) { + synchronized (XmlUtil.class) { + if (!preventedXXE) { + preventXXE(dbf); + } + } + } + return dbf; + } + + /** + * preventXXE + * + * @param dbf + * @throws ParserConfigurationException + */ + private static void preventXXE(DocumentBuilderFactory dbf) throws ParserConfigurationException { + // This is the PRIMARY defense. If DTDs (doctypes) are disallowed, almost all XML entity attacks are prevented + // Xerces 2 only - http://xerces.apache.org/xerces2-j/features.html#disallow-doctype-decl + dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + + // If you can't completely disable DTDs, then at least do the following: + // Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-general-entities + // Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-general-entities + + // JDK7+ - http://xml.org/sax/features/external-general-entities + dbf.setFeature("http://xml.org/sax/features/external-general-entities", false); + + // Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-parameter-entities + // Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-parameter-entities + + // JDK7+ - http://xml.org/sax/features/external-parameter-entities + dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + + // Disable external DTDs as well + dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + + // and these as well, per Timothy Morgan's 2014 paper: "XML Schema, DTD, and Entity Attacks" + dbf.setXIncludeAware(false); + dbf.setExpandEntityReferences(false); + preventedXXE = true; + } + + private static XPathFactory getXPathFactory() { + return XmlHelperHolder.xPathFactory; + } + + /** + * 内部类单例 + */ + private static class XmlHelperHolder { + private static DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + private static XPathFactory xPathFactory = XPathFactory.newInstance(); + } + +} diff --git a/src/main/resources/bin/install.bat b/src/main/resources/bin/install.bat new file mode 100644 index 0000000..7a651bc --- /dev/null +++ b/src/main/resources/bin/install.bat @@ -0,0 +1,33 @@ +@echo off + +for /f "delims=" %%t in ('winsw.exe status') do set str=%%t +echo %str% + + + +if %str%==Started ( +echo "restart....." +winsw stop +PING 127.0.0.1 -n 10 -w 30000 >NUL +winsw start +) + + + +if %str%==Stopped ( +echo "start....." +winsw start +) + + +if %str%==NonExistent ( +echo "deploy and start....." +winsw install +winsw start +echo c +) + + + + + diff --git a/src/main/resources/bin/start.bat b/src/main/resources/bin/start.bat new file mode 100644 index 0000000..58c25cb --- /dev/null +++ b/src/main/resources/bin/start.bat @@ -0,0 +1,21 @@ +set java_opts=-Xms512m -Xmx512m +set key="java_opts" + + +rem 文件不存在,就跳过 +if not exist java-ops.ini goto end + +for /f "tokens=1,2 delims==" %%i in (java-ops.ini) do ( + if "%%i"==%key% set java_opts=%%j) +echo java_opts is : %java_opts% + +:end + +rem 启动java + +java %java_opts% -Dfile.encoding=utf-8 -jar -Dspring.profiles.active=@profile.name@ -Dloader.path=config,lib @project.build.finalName@.jar + + + + + diff --git a/src/main/resources/bin/stop.bat b/src/main/resources/bin/stop.bat new file mode 100644 index 0000000..98468a0 --- /dev/null +++ b/src/main/resources/bin/stop.bat @@ -0,0 +1,13 @@ +@echo off + +for /f "delims=" %%t in ('winsw.exe status') do set str=%%t +echo %str% + + + +if %str%==Started ( +winsw stop +@echo wait program stop ..... +PING 127.0.0.1 -n 30 -w 10000 >NUL +) + diff --git a/src/main/resources/bin/update.bat b/src/main/resources/bin/update.bat new file mode 100644 index 0000000..8c9b881 --- /dev/null +++ b/src/main/resources/bin/update.bat @@ -0,0 +1,19 @@ +@echo off + +set deployDir=%1\docus-report-manager +if %deployDir%=="" set deployDir=d:\webroot\docus-report-manager + +set curr_file=%cd% +cd /d %deployDir% +call stop.bat +cd %curr_file% +sc query docus-backup-sys |Find "RUNNING" && ping 127.0.0.1 -n 10 >nul +rd/s/q %deployDir%\lib +rd/s/q %deployDir%\dataConfig +rd/s/q %deployDir%\config +del /s/q %deployDir%\*.jar +xcopy /Y/E/I * %deployDir% + +cd /d %deployDir% +call install.bat + diff --git a/src/main/resources/bin/winsw.xml b/src/main/resources/bin/winsw.xml new file mode 100644 index 0000000..d7fe58a --- /dev/null +++ b/src/main/resources/bin/winsw.xml @@ -0,0 +1,8 @@ + + docus-report-manager + 生产-嘉时-报告管理服务 + 生产-嘉时-报告管理服务 + Automatic + %BASE%\start.bat + + \ No newline at end of file diff --git a/src/main/resources/bootstrap.yml b/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..2861362 --- /dev/null +++ b/src/main/resources/bootstrap.yml @@ -0,0 +1,77 @@ +server: + port: 9444 + +spring: + application: + name: @artifactId@ + profiles: + active: test + datasource: + dynamic: + primary: master #设置默认的数据源,默认值为master + strict: false #是否用严格模式,如果启用在味匹配到指定数据源时抛出异常 + datasource: + master: + url: jdbc:log4jdbc:mysql://db.docus.cn:3306/docus_archivefile?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai + username: docus + password: docus702 + driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy + type: com.alibaba.druid.pool.DruidDataSource + # 初始化配置 + initial-size: 3 + # 最小连接数 + min-idle: 3 + # 最大连接数 + max-active: 15 + # 获取连接超 时时间 + max-wait: 5000 + # 连接有效性检测时间 + time-between-eviction-runs-millis: 90000 + # 最大空闲时间 + min-evictable-idle-time-millis: 1800000 + test-while-idle: true + test-on-borrow: false + test-on-return: false + validation-query: select 1 + redis: + host: redis.docus.cn + password: JSdocus@702 + cloud: + nacos: + discovery: + server-addr: nacos.docus.cn + namespace: 34acdf7a-9fc6-4bbd-8aea-9a47c8007ad5 + config: + server-addr: ${spring.cloud.nacos.discovery.server-addr} + namespace: 34acdf7a-9fc6-4bbd-8aea-9a47c8007ad5 + file-extension: yml + shared-configs: + - comm.${spring.cloud.nacos.config.file-extension} + + +docus: + dbtype: mysql + +mybatis-plus: + configuration: + map-underscore-to-camel-case: true + call-setters-on-nulls: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + field-strategy: NOT_EMPTY + db-type: MYSQL +xxl: + job: + accessToken: + admin: + addresses: http://job.docus.cn:8180/xxl-job-admin + executor: + appname: docus-report-manager + address: + ip: + port: 19444 + logretentiondays: 30 + logpath: D:/xxl-job/docus-report-manager + + diff --git a/src/main/resources/log4jdbc.log4j2.properties b/src/main/resources/log4jdbc.log4j2.properties new file mode 100644 index 0000000..5cb6f99 --- /dev/null +++ b/src/main/resources/log4jdbc.log4j2.properties @@ -0,0 +1,2 @@ +# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger +log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator \ No newline at end of file diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml new file mode 100644 index 0000000..337c3c2 --- /dev/null +++ b/src/main/resources/logback.xml @@ -0,0 +1,76 @@ + + + docus-report-manager + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%contextName] [%thread] [%X{traceId}] %-5level %logger{36} - %msg%n + + + + + + + [%d{yyyy-MM-dd' 'HH:mm:ss.sss}] [%C] [%t] [%X{traceId}] [%L] [%-5p] %m%n + utf-8 + + + + + ${log.path}%d.%i.log + + 500MB + + 60 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/mapper/CollectTaskMapper.xml b/src/main/resources/mapper/CollectTaskMapper.xml new file mode 100644 index 0000000..bcb4956 --- /dev/null +++ b/src/main/resources/mapper/CollectTaskMapper.xml @@ -0,0 +1,33 @@ + + + + + UPDATE `docus_archivefile`.`af_collect_task` + SET `state` = '4' + WHERE `id` in + + #{id} + + + + + diff --git a/src/main/resources/mapper/ScanAssortMapper.xml b/src/main/resources/mapper/ScanAssortMapper.xml new file mode 100644 index 0000000..e505cf2 --- /dev/null +++ b/src/main/resources/mapper/ScanAssortMapper.xml @@ -0,0 +1,21 @@ + + + + + + UPDATE `docus_archivefile`.`t_scan_assort` + SET `is_del` = 1 + WHERE `id` in + + #{id} + + + + diff --git a/winsw.exe b/winsw.exe new file mode 100644 index 0000000..ba27e3f Binary files /dev/null and b/winsw.exe differ