| | |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-jdbc</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-security</artifactId> |
| | | </dependency> |
| | | <!--<dependency>--> |
| | | <!--<groupId>org.springframework.boot</groupId>--> |
| | | <!--<artifactId>spring-boot-starter-security</artifactId>--> |
| | | <!--</dependency>--> |
| | | |
| | | <!-- swagger --> |
| | | <dependency> |
| | |
| | | <artifactId>batik-svggen</artifactId> |
| | | <version>1.7</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.security</groupId> |
| | | <artifactId>spring-security-config</artifactId> |
| | | <version>4.1.3.RELEASE</version> |
| | | <!--<dependency>--> |
| | | <!--<groupId>org.springframework.security</groupId>--> |
| | | <!--<artifactId>spring-security-config</artifactId>--> |
| | | <!--<version>4.1.3.RELEASE</version>--> |
| | | |
| | | </dependency> |
| | | <!--</dependency>--> |
| | | <dependency> |
| | | <groupId>org.springframework.security</groupId> |
| | | <artifactId>spring-security-config</artifactId> |
| | |
| | | |
| | | <!-- settle --> |
| | | <!-- with pentaho-kettle --> |
| | | <dependency> |
| | | <groupId>pentaho-kettle</groupId> |
| | | <artifactId>kettle-core</artifactId> |
| | | <version>${kettle-version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>pentaho-kettle</groupId> |
| | | <artifactId>kettle-engine</artifactId> |
| | | <version>${kettle-version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>pentaho</groupId> |
| | | <artifactId>metastore</artifactId> |
| | | <version>${kettle-version}</version> |
| | | </dependency> |
| | | <!--<dependency>--> |
| | | <!--<groupId>pentaho-kettle</groupId>--> |
| | | <!--<artifactId>kettle-core</artifactId>--> |
| | | <!--<version>${kettle-version}</version>--> |
| | | <!--</dependency>--> |
| | | <!--<dependency>--> |
| | | <!--<groupId>pentaho-kettle</groupId>--> |
| | | <!--<artifactId>kettle-engine</artifactId>--> |
| | | <!--<version>${kettle-version}</version>--> |
| | | <!--</dependency>--> |
| | | <!--<dependency>--> |
| | | <!--<groupId>pentaho</groupId>--> |
| | | <!--<artifactId>metastore</artifactId>--> |
| | | <!--<version>${kettle-version}</version>--> |
| | | <!--</dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>pentaho-kettle</groupId> |
| | | <artifactId>kettle-dbdialog</artifactId> |
| | | <version>${kettle-version}</version> |
| | | </dependency> |
| | | <!--<dependency>--> |
| | | <!--<groupId>pentaho-kettle</groupId>--> |
| | | <!--<artifactId>kettle-dbdialog</artifactId>--> |
| | | <!--<version>${kettle-version}</version>--> |
| | | <!--</dependency>--> |
| | | |
| | | <!--<dependency>--> |
| | | <!--<groupId>pentaho</groupId>--> |
| | |
| | | <version>1.1.9</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>fastjson</artifactId> |
| | | <version>1.2.58</version> |
| | | </dependency> |
| | | <!--<dependency>--> |
| | | <!--<groupId>com.alibaba</groupId>--> |
| | | <!--<artifactId>fastjson</artifactId>--> |
| | | <!--<version>1.2.58</version>--> |
| | | <!--</dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.commons</groupId> |
| | |
| | | <version>1.60</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.phoenix</groupId> |
| | | <artifactId>phoenix-core</artifactId> |
| | | <version>4.7.0-HBase-1.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.hbase</groupId> |
| | | <artifactId>hbase-client</artifactId> |
| | | <version>1.1.2</version> |
| | | </dependency> |
| | | <!--<dependency>--> |
| | | <!--<groupId>org.apache.phoenix</groupId>--> |
| | | <!--<artifactId>phoenix-core</artifactId>--> |
| | | <!--<version>4.7.0-HBase-1.1</version>--> |
| | | <!--</dependency>--> |
| | | <!--<dependency>--> |
| | | <!--<groupId>org.apache.hbase</groupId>--> |
| | | <!--<artifactId>hbase-client</artifactId>--> |
| | | <!--<version>1.1.2</version>--> |
| | | <!--</dependency>--> |
| | | <!-- poi --> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | |
| | | <!--<version>${kettle-version}</version>--> |
| | | <!--<scope>compile</scope>--> |
| | | <!--</dependency>--> |
| | | <!--<dependency>--> |
| | | <!--<groupId>pentaho</groupId>--> |
| | | <!--<artifactId>pentaho-database-model</artifactId>--> |
| | | <!--<version>${kettle-version}</version>--> |
| | | <!--<scope>compile</scope>--> |
| | | <!--</dependency>--> |
| | | <!--<dependency>--> |
| | | <!--<groupId>pentaho</groupId>--> |
| | | <!--<artifactId>pentaho-metadata</artifactId>--> |
| | | <!--<version>${kettle-version}</version>--> |
| | | <!--<scope>compile</scope>--> |
| | | <!--</dependency>--> |
| | | <dependency> |
| | | <groupId>pentaho</groupId> |
| | | <artifactId>pentaho-database-model</artifactId> |
| | | <version>${kettle-version}</version> |
| | | <scope>compile</scope> |
| | | <groupId>wsdl4j</groupId> |
| | | <artifactId>wsdl4j</artifactId> |
| | | <version>1.6.3</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>pentaho</groupId> |
| | | <artifactId>pentaho-metadata</artifactId> |
| | | <version>${kettle-version}</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>sqljdbc4</artifactId> |
| | |
| | | <groupId>org.apache.xmlgraphics</groupId> |
| | | <artifactId>batik-gvt</artifactId> |
| | | <version>1.7</version> |
| | | </dependency> |
| | | <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 --> |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.commons</groupId> |
| | | <artifactId>commons-lang3</artifactId> |
| | | <version>3.10</version> |
| | | </dependency> |
| | | |
| | | |
| | |
| | | </dependencies> |
| | | |
| | | <build> |
| | | |
| | | <finalName>mdm-1.2.0</finalName> |
| | | <plugins> |
| | | <!--<plugin>--> |
| | | <!--<groupId>org.apache.maven.plugins</groupId>--> |
| | | <!--<artifactId>maven-assembly-plugin</artifactId>--> |
| | | <!--<version>3.1.1</version>--> |
| | | <!--<configuration>--> |
| | | <!--<encoding>UTF-8</encoding>--> |
| | | <!--<descriptorRefs>--> |
| | | <!--<descriptorRef>jar-with-dependencies</descriptorRef>--> |
| | | <!--</descriptorRefs>--> |
| | | <!--<archive>--> |
| | | <!--<manifest>--> |
| | | <!--<mainClass>com.highdatas.mdm.MdmApplication</mainClass>--> |
| | | <!--</manifest>--> |
| | | <!--</archive>--> |
| | | <!--</configuration>--> |
| | | <!--<executions>--> |
| | | <!--<execution>--> |
| | | <!--<id>make-assembly</id>--> |
| | | <!--<phase>package</phase>--> |
| | | <!--<goals>--> |
| | | <!--<goal>single</goal>--> |
| | | <!--</goals>--> |
| | | <!--</execution>--> |
| | | <!--</executions>--> |
| | | <!--</plugin>--> |
| | | |
| | | |
| | | <!--<!– 代码混淆插件 –>--> |
| | | <!--<plugin>--> |
| | | <!--<dependencies>--> |
| | | <!--<dependency>--> |
| | | <!--<groupId>net.sf.proguard</groupId>--> |
| | | <!--<artifactId>proguard-base</artifactId>--> |
| | | <!--<!– 2019年7月15日 jdk1.8 兼容性还可以 –>--> |
| | | <!--<version>6.0.2</version>--> |
| | | <!--<scope>runtime</scope>--> |
| | | <!--</dependency>--> |
| | | <!--</dependencies>--> |
| | | <!--<groupId>com.github.wvengen</groupId>--> |
| | | <!--<artifactId>proguard-maven-plugin</artifactId>--> |
| | | <!--<!– 2019年7月15日 jdk1.8 兼容性还可以 –>--> |
| | | <!--<version>2.0.14</version>--> |
| | | <!--<executions>--> |
| | | <!--<execution>--> |
| | | <!--<!– 混淆时刻,这里是打包的时候混淆 –>--> |
| | | <!--<phase>package</phase>--> |
| | | <!--<goals>--> |
| | | <!--<!– 使用插件的什么功能,当然是混淆 –>--> |
| | | <!--<goal>proguard</goal>--> |
| | | <!--</goals>--> |
| | | <!--</execution>--> |
| | | <!--</executions>--> |
| | | <!--<configuration>--> |
| | | <!--<!– 是否将生成的PG文件安装部署 –>--> |
| | | <!--<attach>true</attach>--> |
| | | <!--<!– 是否混淆 –>--> |
| | | <!--<obfuscate>true</obfuscate>--> |
| | | <!--<!– 指定生成文件分类 –>--> |
| | | <!--<attachArtifactClassifier>pg</attachArtifactClassifier>--> |
| | | <!--<!– ProGuard配置参数(可引用cfg配置文件) –>--> |
| | | <!--<options>--> |
| | | <!--<!– JDK目标版本1.8–>--> |
| | | <!--<option>-target 1.8</option>--> |
| | | <!--<!– 不做收缩(删除注释、未被引用代码) –>--> |
| | | <!--<option>-dontshrink</option>--> |
| | | <!--<!– 不做优化(变更代码实现逻辑) –>--> |
| | | <!--<option>-dontoptimize</option>--> |
| | | <!--<!– 不路过非公用类文件及成员 –>--> |
| | | <!--<option>-dontskipnonpubliclibraryclasses</option>--> |
| | | <!--<option>-dontskipnonpubliclibraryclassmembers</option>--> |
| | | <!--<!–不用大小写混合类名机制–>--> |
| | | <!--<option>-dontusemixedcaseclassnames</option>--> |
| | | <!--<!– 优化时允许访问并修改有修饰符的类和类的成员 –>--> |
| | | <!--<option>-allowaccessmodification</option>--> |
| | | <!--<!– 确定统一的混淆类的成员名称来增加混淆 –>--> |
| | | <!--<option>-useuniqueclassmembernames</option>--> |
| | | <!--<!– 不混淆所有包名,整体混淆会出现各种各样的问题 程序又不会把你该引用的地方引用好 会直接修改类名 参数名的 建议不去除 有这个标签的话 <option>-keep class !com.package.** { *; }</option> 加入这个标签的报包名程序才会修改 –>--> |
| | | <!--<option>-keeppackagenames</option>--> |
| | | <!--<option>-adaptclassstrings</option>--> |
| | | <!--<!– <option>-keepdirectories</option> –>--> |
| | | <!--<!– 不混淆所有特殊的类 –>--> |
| | | <!--<option>-keepattributes--> |
| | | <!--Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod--> |
| | | <!--</option>--> |
| | | <!--<!– This option will save all original methods parameters in files defined--> |
| | | <!--in -keep sections, otherwise all parameter names will be obfuscate. –>--> |
| | | <!--<option>-keepparameternames</option>--> |
| | | <!--<option>-keepclassmembers class * {--> |
| | | <!--@org.springframework.beans.factory.annotation.Autowired *;--> |
| | | <!--@org.springframework.beans.factory.annotation.Value *;--> |
| | | <!--}--> |
| | | <!--</option>--> |
| | | <!--<!– 混淆这个包下的类 此处需要更改为自己需要混淆的包名–>--> |
| | | <!--<option>-keep class !com.highdatas.mdm.process.** { *; }</option>--> |
| | | <!--<option>-keep class !com.highdatas.mdm.service.** { *; }</option>--> |
| | | <!--<option>-keep class !com.highdatas.mdm.controller.** { *; }</option>--> |
| | | |
| | | <!--<!– 不混淆main方法 此处需要更改为自己的启动类路径 –>--> |
| | | <!--<option>-keep class com.highdatas.mdm.MdmApplication { *; }</option>--> |
| | | <!--<option>-keep class com.highdatas.mdm.util.** { *; }</option>--> |
| | | <!--<option>-keep class com.highdatas.mdm.mapper.** { *; }</option>--> |
| | | <!--<option>-keep class com.highdatas.mdm.job.** { *; }</option>--> |
| | | <!--<option>-keep class com.highdatas.mdm.pojo.** { *; }</option>--> |
| | | <!--<option>-keep class com.highdatas.mdm.entity.** { *; }</option>--> |
| | | |
| | | <!--<!– 不混淆所有的set/get方法,毕竟项目中使用的部分第三方框架(例如Shiro)会用到大量的set/get映射 –>--> |
| | | <!--<option>-keepclassmembers public class * {void set*(***);*** get*();}</option>--> |
| | | <!--<!– 不混淆包中的所有类以及类的属性及方法,实体包,混淆了会导致ORM框架及前端无法识别 –>--> |
| | | |
| | | <!--<!– 不对包类的类名进行混淆,但对类中的属性和方法混淆 –>--> |
| | | <!--<!–<option>-keep class com.package.util.** </option>–>--> |
| | | <!--<!– <option>-keep class com.example.service.** </option>–>--> |
| | | |
| | | <!--<!– 不混淆包下的所有类名,且类中的方法和属性也不混淆 楼主已经把它注掉了 因为没用到 –>--> |
| | | <!--<!–<option>-keep class com.example.redis.** { *; }</option>--> |
| | | <!--<option>-keep class com.example.domain.** { *; }</option>--> |
| | | <!--<option>-keep class com.example.dto.** { *; } </option>--> |
| | | <!--<option>-keep class com.example.config.**{ *; }</option>--> |
| | | <!--<option>-keep class com.example.dao.** { *; }</option>–>--> |
| | | <!--<!– 无视跳过警告 因为修改代码的过程程序检测到有些文件不能更改就会报警告导致失败 如果对自己写的代码比较有信心的话可以直接无视 –>--> |
| | | <!--<option>-dontwarn **</option>--> |
| | | <!--</options>--> |
| | | <!--<!–class 混淆后输出的jar包 –>--> |
| | | <!--<outjar>${project.build.finalName}-pg.jar</outjar>--> |
| | | <!--<!– 混淆时需要引用的java库,这些库的类不会做混淆 –>--> |
| | | <!--<libs>--> |
| | | <!--<lib>${java.home}/lib/rt.jar</lib>--> |
| | | <!--<lib>${java.home}/lib/jce.jar</lib>--> |
| | | <!--</libs>--> |
| | | <!--<!– 需要做混淆的jar或目录 –>--> |
| | | <!--<injar>classes</injar>--> |
| | | <!--<!– 输出目录 –>--> |
| | | <!--<outputDirectory>${project.build.directory}</outputDirectory>--> |
| | | <!--</configuration>--> |
| | | <!--</plugin>--> |
| | | |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-surefire-plugin</artifactId> |
| | | <version>2.22.1</version> |
| | | <configuration> |
| | | <skipTests>true</skipTests> |
| | | </configuration> |
| | | |
| | | </plugin> |
| | | |
| | | </plugins> |
| | | |
| | |
| | | } else { |
| | | type = ActivitiBusinessType.valueOf(businessType); |
| | | } |
| | | |
| | | if (type.equals(ActivitiBusinessType.maintain)) { |
| | | Maintain maintain = maintainService.selectById(businessId); |
| | | boolean canStart = maintainService.getCanAct(maintain.getTableName()); |
| | | if (!canStart) { |
| | | return Result.error(CodeMsg.ACT_RUN_ERROR); |
| | | } |
| | | } |
| | | |
| | | Object descObj = variableMap.get("desc"); |
| | | String desc; |
| | | if (descObj == null) { |
| | |
| | | return identityService.deleteUser(userId); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/test") |
| | | public Result test(@RequestParam String roleId, @RequestParam String roleId2, @RequestParam String userId) { |
| | | identityService.deleteUserRole(roleId, userId); |
| | | identityService.addUserRole(roleId, userId); |
| | | identityService.deleteUserRole(roleId2, userId); |
| | | return identityService.addUserRole(roleId2, userId); |
| | | } |
| | | } |
| | |
| | | import com.highdatas.mdm.service.*;
|
| | | import com.highdatas.mdm.util.Constant;
|
| | | import com.highdatas.mdm.util.DbUtils;
|
| | | import com.highdatas.mdm.util.RuleClient;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.apache.commons.lang3.StringUtils;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | |
| | | UnBigDataDataSourceInfo unBigDataDataSourceInfo;
|
| | | @Autowired
|
| | | JobClient client;
|
| | | @Autowired
|
| | | RuleClient ruleClient;
|
| | |
|
| | | @RequestMapping(value = "run/{id}", method = RequestMethod.GET)
|
| | | public Result trigger(@PathVariable String id, HttpServletRequest request) {
|
| | |
| | | }
|
| | | return assembleService.run(id);
|
| | | }
|
| | | @RequestMapping(value = "qulityTest/{tableName}", method = RequestMethod.GET)
|
| | | public Result qulityTest(@PathVariable String tableName, HttpServletRequest request) {
|
| | | HashMap<String, Boolean> stringBooleanHashMap = ruleClient.execuImmeForCollect(tableName, null);
|
| | | return Result.success(stringBooleanHashMap);
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "saveJobGroup", method = RequestMethod.GET)
|
| | | public Result saveJobGroup(HttpServletRequest request) {
|
| | |
| | | String maintainFieldId = masterAuthor.getMaintainFieldId(); |
| | | String tableName = masterAuthor.getTableName(); |
| | | List<Maintain> maintainByMaintainField = maintainFieldService.getMaintainByMaintainField(maintainFieldId, tableName); |
| | | if (maintainByMaintainField != null && !maintainByMaintainField.isEmpty()) { |
| | | maintainSet.addAll(maintainByMaintainField); |
| | | } |
| | | } |
| | | int unActiveCnt = masterAuthorUnactiveService.selectCount(new EntityWrapper<MasterAuthorUnactive>().in("maintain_id", maintainSet).eq("user_id", user.getUserId())); |
| | | if (maintainSet.size() != unActiveCnt) { |
| | | activeCnt++; |
| | |
| | | import com.highdatas.mdm.entity.Character; |
| | | import com.highdatas.mdm.entity.*; |
| | | import com.highdatas.mdm.mapper.TableInfoMapper; |
| | | import com.highdatas.mdm.pojo.CodeMsg; |
| | | import com.highdatas.mdm.pojo.Operate; |
| | | import com.highdatas.mdm.pojo.Result; |
| | | import com.highdatas.mdm.pojo.SysAssembleUpdateType; |
| | | import com.highdatas.mdm.pojo.*; |
| | | import com.highdatas.mdm.service.*; |
| | | import com.highdatas.mdm.util.Constant; |
| | | import com.highdatas.mdm.util.DbUtils; |
| | |
| | | jsonObject.remove(Constant.ID); |
| | | datas = jsonObject.toJSONString(); |
| | | String updateSegment = masterDataService.getUpdateSegment(maintain.getTableName(), maintain.getTableName() + Constant.RECORD, datas); |
| | | String tempTable = maintain.getTableName() + Constant.RECORD; |
| | | Segment segment = new Segment(MessageFormat.format(Constant.Alias, tempTable, Constant.STD_ID), id); |
| | | |
| | | Integer updateCount = tableInfoMapper.updateRecordByMaintainId(maintain.getTableName() + Constant.RECORD, updateSegment, DbUtils.quotedStr(maintainId)); |
| | | result = Result.success(updateCount); |
| | | tableInfoMapper.update(tempTable, updateSegment, segment.toString()); |
| | | result = Result.success(null); |
| | | break; |
| | | case create: |
| | | JSONObject createObject = JSONObject.parseObject(datas); |
| | |
| | | String menuId = menuMapping.getMenuId(); |
| | | SysMenu menu = menuService.selectById(menuId); |
| | | String preParentId = menu.getParentId(); |
| | | |
| | | menu.setName(menuMapping.getName()).updateById(); |
| | | String themeId = menuMapping.getThemeId(); |
| | | if (!preParentId.equalsIgnoreCase(themeId)) { |
| | | menu.setParentId(themeId); |
| | | menu.updateById(); |
| | | } |
| | | // if (!preParentId.equalsIgnoreCase(themeId)) { |
| | | //// menu.setParentId(themeId); |
| | | //// menu.updateById(); |
| | | //// } |
| | | boolean updated = menuMapping.updateById(); |
| | | if (updated) { |
| | | |
| | | |
| | | |
| | | TUser user = DbUtils.getUser(request); |
| | | if (menu != null) { |
| | | LinkedHashSet<String> parentIdSet = new LinkedHashSet<>(); |
| | |
| | | package com.highdatas.mdm.controller; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.highdatas.mdm.entity.*; |
| | |
| | | return Result.success(menuService.selectList(sysMenuEntityWrapper)) ; |
| | | } |
| | | |
| | | @RequestMapping(value = "/byIds" ,method = RequestMethod.POST) |
| | | public Result<List<SysMenu>> byIds(@RequestBody JSONArray ids) { |
| | | List<String> collect = ids.stream().map(o -> o.toString()).collect(Collectors.toList()); |
| | | EntityWrapper<SysMenu> sysMenuEntityWrapper = new EntityWrapper<>(); |
| | | sysMenuEntityWrapper.orderBy("parent_id, order_no"); |
| | | sysMenuEntityWrapper.in(Constant.ID, collect); |
| | | List<SysMenu> sysMenus = menuService.selectList(sysMenuEntityWrapper); |
| | | return Result.success(sysMenus) ; |
| | | } |
| | | |
| | | @RequestMapping(value = "/author/all", method = RequestMethod.GET) |
| | | public Result<List<SysMenu>> getAllBak(HttpServletRequest request) { |
| | | TUser user = DbUtils.getUser(request); |
| | |
| | | |
| | | private String id; |
| | | |
| | | private String desc; |
| | | |
| | | private Boolean audit; |
| | | |
| | | /** |
| | |
| | | if (!StringUtils.isEmpty(alias)) { |
| | | hash += alias.hashCode(); |
| | | } |
| | | if (visible == null) { |
| | | if (visible != null) { |
| | | hash += visible.hashCode(); |
| | | } |
| | | if (orderNo == null) { |
| | | if (orderNo != null) { |
| | | hash += orderNo.hashCode(); |
| | | } |
| | | if (!StringUtils.isEmpty(code)) { |
| | |
| | | |
| | | List<Map<String,Object>> selectDistinct(@Param("tableName") String tableName, @Param("fields") String fields, @Param("where") String where); |
| | | |
| | | List<Map<String,Object>> selectByPageByVersion(@Param("tableName") String tableName,@Param("tableTempName") String tableTempName, @Param("fields") String fields, @Param("tempFields") String tempFields,@Param("Hfields") String Hfields, @Param("A1fields") String A1fields, @Param("A2fields") String A2fields, @Param("tempHFields") String tempHFields, @Param("fromOrderNo") Integer fromOrderNo, @Param("toOrderNo") Integer toOrderNo, @Param("maintainId") String maintainId, @Param("where") String where, @Param("limit") String limit); |
| | | List<Map<String,Object>> selectByPageByVersion(@Param("tableName") String tableName,@Param("tableTempName") String tableTempName, @Param("fields") String fields,@Param("A1fields") String A1fields, @Param("tempFields") String tempFields,@Param("fromOrderNo") Integer fromOrderNo, @Param("toOrderNo") Integer toOrderNo, @Param("where") String where, @Param("limit") String limit); |
| | | |
| | | List<Map<String,Object>> selectByPageByMaxVersion(@Param("tableName") String tableName,@Param("tableTempName") String tableTempName, @Param("fields") String fields, @Param("tempFields") String tempFields,@Param("Hfields") String Hfields, @Param("A1fields") String A1fields, @Param("A2fields") String A2fields, @Param("tempHFields") String tempHFields, @Param("fromOrderNo") Integer fromOrderNo, @Param("toOrderNo") Integer toOrderNo,@Param("maintainId") String maintainId, @Param("where") String where, @Param("limit") String limit); |
| | | List<Map<String,Object>> selectByPageByMaxVersion(@Param("tableName") String tableName,@Param("tableTempName") String tableTempName, @Param("fields") String fields, @Param("A1fields") String A1fields, @Param("tempFields") String tempFields, @Param("fromOrderNo") Integer fromOrderNo, @Param("where") String where, @Param("limit") String limit); |
| | | |
| | | |
| | | List<Map<String,Object>> select(@Param("tableName") String tableName, @Param("fields") String fields, @Param("where") String where); |
| | | |
| | | Long getCount(@Param("tableName") String tableName, @Param("where") String where); |
| | | |
| | | Long getCountByVersion(@Param("tableName") String tableName,@Param("tableTempName") String tableTempName, @Param("fields") String fields, @Param("tempFields") String tempFields,@Param("Hfields") String Hfields,@Param("A1fields") String A1fields, @Param("A2fields") String A2fields, @Param("tempHFields") String tempHFields, @Param("fromOrderNo") Integer fromOrderNo, @Param("toOrderNo") Integer toOrderNo,@Param("maintainId") String maintainId, @Param("where") String where); |
| | | Long getCountByVersion(@Param("tableName") String tableName,@Param("tableTempName") String tableTempName, @Param("fields") String fields, @Param("tempFields") String tempFields,@Param("A1fields") String A1fields, @Param("fromOrderNo") Integer fromOrderNo, @Param("toOrderNo") Integer toOrderNo, @Param("where") String where); |
| | | |
| | | Long getCountByMaxVersion(@Param("tableName") String tableName,@Param("tableTempName") String tableTempName, @Param("fields") String fields, @Param("tempFields") String tempFields,@Param("Hfields") String Hfields,@Param("A1fields") String A1fields, @Param("A2fields") String A2fields, @Param("tempHFields") String tempHFields, @Param("fromOrderNo") Integer fromOrderNo, @Param("toOrderNo") Integer toOrderNo,@Param("maintainId") String maintainId, @Param("where") String where); |
| | | Long getCountByMaxVersion(@Param("tableName") String tableName,@Param("tableTempName") String tableTempName, @Param("fields") String fields, @Param("tempFields") String tempFields,@Param("A1fields") String A1fields, @Param("fromOrderNo") Integer fromOrderNo, @Param("where") String where); |
| | | |
| | | void insert(@Param("tableName") String tableName, @Param("fields") String fields, @Param("values") String values); |
| | | |
| | |
| | | public static CodeMsg ADDQUEUE_OVER = new CodeMsg(4012,"分发队列已满,暂不能添加"); |
| | | public static CodeMsg ADDQUEUE_FAIL = new CodeMsg(4011,"添加分发队列失败"); |
| | | public static CodeMsg MAINTAIN_UNFOUND_ERROR = new CodeMsg(4005,"未查到版本数据,或无权限"); |
| | | public static CodeMsg ACT_RUN_ERROR = new CodeMsg(4006,"已有版本审批中"); |
| | | |
| | | public CodeMsg(int code, String msg) { |
| | | this.code = code; |
| | |
| | | JSONObject compareField(String maintainId1, String maintainId2); |
| | | |
| | | Map<String, Object> getPreInfo(Maintain maintain, String id); |
| | | |
| | | boolean getCanAct(String tableName); |
| | | } |
| | |
| | | } |
| | | try { |
| | | User user = identityService.newUser(id); |
| | | |
| | | identityService.saveUser(user); |
| | | user.setFirstName(""); |
| | | identityService.saveUser(user); |
| | | return Result.success(null); |
| | | }catch (Exception e){ |
| | |
| | | try { |
| | | Group group = identityService.newGroup(id); |
| | | identityService.saveGroup(group); |
| | | group.setName(""); |
| | | identityService.saveGroup(group); |
| | | return Result.success(null); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | if (user == null) { |
| | | return Result.error(new CodeMsg(3001, "当前用户不存在,请先创建用户")); |
| | | } |
| | | Group group = identityService.createGroupQuery().groupId(roleId).singleResult(); |
| | | if (group == null) { |
| | | return Result.error(new CodeMsg(3001, "当前角色不存在,请先创建用户")); |
| | | } |
| | | |
| | | Map<String, String> memberShip = tableInfoMapper.selectActMemberShip(userId, roleId); |
| | | if (memberShip != null) { |
| | | return Result.success(null); |
| | | } |
| | | |
| | | identityService.createMembership(userId,roleId); |
| | | return Result.success(null); |
| | | } |
| | |
| | | @Transactional(rollbackFor = {RuntimeException.class, Error.class}) |
| | | public Result deleteUserRole(String roleId, String userId) { |
| | | try { |
| | | |
| | | Map<String, String> memberShip = tableInfoMapper.selectActMemberShip(userId, roleId); |
| | | if (memberShip == null) { |
| | | return Result.success(null); |
| | |
| | | if (flows.getBusinessType().equals(ActivitiBusinessType.maintain)){ |
| | | String maintainId = flows.getBusinessId(); |
| | | log.info("flow-maintain:" + maintainId); |
| | | masterModifiedService.dealFlow(maintainId, flows.getStatus()); |
| | | log.info("flow-masterModifiedService end"); |
| | | //masterModifiedService.dealFlow(maintainId, flows.getStatus()); |
| | | //log.info("flow-masterModifiedService end"); |
| | | maintainService.dealFlow(maintainId, flows.getStatus()); |
| | | log.info("flow-maintainService end"); |
| | | viewService.dealFlow(maintainId, flows.getStatus()); |
| | |
| | | return; |
| | | } |
| | | String fields = masterDataService.getTempFields(null, tableName); |
| | | String tempFields = masterDataService.getFields(tableName + Constant.RECORD); |
| | | String tempFields = masterDataService.getFields(tableName + Constant.RECORD, Constant.T); |
| | | |
| | | String tableTempName = tableName + Constant.RECORD; |
| | | // insert 2 std |
| | |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public boolean getCanAct(String tableName) { |
| | | List<Maintain> maintainList = selectList(new EntityWrapper<Maintain>().eq("table_name", tableName)); |
| | | |
| | | long count = maintainList.stream() |
| | | .filter(one -> one.getFlowId() != null) |
| | | .filter(one -> flowsService.getStatusByBusinessId(one.getId()).equals(ActivitiStatus.working)).count(); |
| | | if (count == 0) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | private void getVerionMatintains(Maintain firstVersion, Maintain secondVersion, List<String> ids) { |
| | | Integer fromNo = firstVersion.getOrderNo(); |
| | |
| | | public Long getCountByVersion (Character character, String maintainId, String tableName,String tableTempName,Integer fromOrderNo, Integer toOrderNo, String whereSegment) { |
| | | try{ |
| | | Maintain maintain = maintainService.selectById(maintainId); |
| | | |
| | | String fields = getFields(character,tableName, maintain); |
| | | String Hfields = getFields(character, tableName, Constant.H, maintain); |
| | | String tempFields = getTempFields(character, tableName, Constant.MT, maintain); |
| | | String tempFields = getTempFields(character, tableName, Constant.A1, maintain); |
| | | String A1fields = getFields(character, tableName, Constant.A1, maintain); |
| | | String A2fields = getFields(character, tableName, Constant.A2, maintain); |
| | | String tempHFields = getTempFields(character, tableName, Constant.H, maintain); |
| | | |
| | | if (StringUtils.isEmpty(whereSegment)) { |
| | | whereSegment = Constant.WHERE_DEFAULT; |
| | | } |
| | |
| | | if (StringUtils.isEmpty(fields)) { |
| | | return 0L; |
| | | } |
| | | count = mapper.getCountByVersion(tableName, tableTempName, fields, tempFields, Hfields, A1fields,A2fields,tempHFields, fromOrderNo, toOrderNo, DbUtils.quotedStr(maintainId), whereSegment); |
| | | count = mapper.getCountByVersion(tableName, tableTempName, fields, tempFields, A1fields,fromOrderNo, toOrderNo, whereSegment); |
| | | return count; |
| | | } |
| | | catch (Exception e) { |
| | |
| | | } |
| | | } |
| | | |
| | | public Long getCountByMaxVersion (Character character, String maintainId, String tableName,String tableTempName,Integer fromOrderNo, Integer toOrderNo, String whereSegment) { |
| | | public Long getCountByMaxVersion (Character character, String maintainId, String tableName,String tableTempName,Integer fromOrderNo, String whereSegment) { |
| | | try{ |
| | | Maintain maintain = maintainService.selectById(maintainId); |
| | | |
| | | String fields = getFields(character, tableName, maintain); |
| | | String Hfields = getFields(character, tableName, Constant.H, maintain); |
| | | String tempFields = getTempFields(character, tableName, Constant.MT, maintain); |
| | | |
| | | String tempFields = getTempFields(character, tableName, Constant.A1, maintain); |
| | | String A1fields = getFields(character, tableName, Constant.A1, maintain); |
| | | String A2fields = getFields(character, tableName, Constant.A2, maintain); |
| | | String tempHFields = getTempFields(character, tableName, Constant.H, maintain); |
| | | |
| | | if (StringUtils.isEmpty(whereSegment)) { |
| | | whereSegment = Constant.WHERE_DEFAULT; |
| | | } |
| | | Long count = mapper.getCountByMaxVersion(tableName, tableTempName, fields, tempFields, Hfields, A1fields,A2fields,tempHFields, fromOrderNo, toOrderNo, DbUtils.quotedStr(maintainId), whereSegment); |
| | | |
| | | Long count = mapper.getCountByMaxVersion(tableName, tableTempName, fields, tempFields, A1fields, fromOrderNo, whereSegment); |
| | | return count; |
| | | } |
| | | catch (Exception e) { |
| | |
| | | |
| | | String fields; |
| | | String tempFields; |
| | | String Hfields; |
| | | String A1fields; |
| | | String A2fields; |
| | | String A1Fields; |
| | | |
| | | String tempHfields; |
| | | |
| | | if (fieldList == null || fieldList.size() == 0) { |
| | | fields = getFields(character, tableName, maintainFromVersion); |
| | | Hfields = getFields(character, tableName,Constant.H, maintainFromVersion); |
| | | A1fields = getFields(character, tableName,Constant.A1, maintainFromVersion); |
| | | A2fields = getFields(character, tableName,Constant.A2, maintainFromVersion); |
| | | tempFields = getTempFields(character, tableName, maintainFromVersion); |
| | | tempHfields = getTempFields(character, tableName, Constant.H, maintainFromVersion); |
| | | A1Fields = getFields(character, tableName, Constant.A1, maintainFromVersion); |
| | | tempFields = getTempFields(character, tableName, Constant.A1, maintainFromVersion); |
| | | } else { |
| | | fields = fieldList.stream().collect(Collectors.joining(Constant.COMMA)); |
| | | Hfields = fieldList.stream().map(s -> MessageFormat.format(Constant.Alias,Constant.H, s)).collect(Collectors.joining(Constant.COMMA)); |
| | | A1fields = fieldList.stream().map(s -> MessageFormat.format(Constant.Alias,Constant.A1, s)).collect(Collectors.joining(Constant.COMMA)); |
| | | A2fields = fieldList.stream().map(s -> MessageFormat.format(Constant.Alias,Constant.A2, s)).collect(Collectors.joining(Constant.COMMA)); |
| | | A1Fields = fieldList.stream() |
| | | .map(s -> MessageFormat.format(Constant.Alias,Constant.A1, s)) |
| | | .collect(Collectors.joining(Constant.COMMA)); |
| | | tempFields = fieldList.stream() |
| | | .map(s -> |
| | | s.equalsIgnoreCase(Constant.ID) ? MessageFormat.format("{0} as id",Constant.STD_ID): s) |
| | | .collect(Collectors.joining(Constant.COMMA)); |
| | | |
| | | tempHfields = fieldList.stream() |
| | | .map(s -> |
| | | s.equalsIgnoreCase(Constant.ID) ? MessageFormat.format("{0} as id",Constant.STD_ID): s) |
| | | .map(s -> MessageFormat.format(Constant.Alias,Constant.H,s)) |
| | | .map(s -> MessageFormat.format(Constant.Alias,Constant.A1, s)) |
| | | .collect(Collectors.joining(Constant.COMMA)); |
| | | |
| | | } |
| | |
| | | long con = maintainIds.stream().map(s -> builder.append(DbUtils.quotedStr(s))).count(); |
| | | } |
| | | |
| | | result = mapper.selectByPageByMaxVersion(tableName,tableTempName,fields,tempFields, Hfields, A1fields, A2fields, tempHfields, fromVersionOrderNo, nowVersionOrderNo, DbUtils.quotedStr(maintainFromVersion.getId()), whereSegment, null); |
| | | result = mapper.selectByPageByMaxVersion(tableName,tableTempName,fields, A1Fields, tempFields, nowVersionOrderNo, whereSegment, null); |
| | | |
| | | }else { |
| | | result = mapper.selectByPageByVersion(tableName,tableTempName,fields,tempFields, Hfields, A1fields, A2fields, tempHfields, nowVersionOrderNo, fromVersionOrderNo, DbUtils.quotedStr(maintainFromVersion.getId()), whereSegment, null); |
| | | result = mapper.selectByPageByVersion(tableName,tableTempName,fields, A1Fields, tempFields, nowVersionOrderNo, fromVersionOrderNo, whereSegment, null); |
| | | } |
| | | |
| | | return result; |
| | |
| | | nowVersionOrderNo = nowVersionOrderNo - 1; |
| | | } |
| | | |
| | | count = getCountByMaxVersion(character, maintainFromVersion.getId(), tableName, tableTempName, fromVersionOrderNo, nowVersionOrderNo, whereSegment); |
| | | count = getCountByMaxVersion(character, maintainFromVersion.getId(), tableName, tableTempName, nowVersionOrderNo, whereSegment); |
| | | }else { |
| | | count = getCountByVersion(character, maintainFromVersion.getId(), tableName, tableTempName, nowVersionOrderNo, fromVersionOrderNo, whereSegment); |
| | | } |
| | |
| | | nowVersionOrderNo = nowVersionOrderNo - 1; |
| | | } |
| | | |
| | | count = getCountByMaxVersion(character, maintainFromVersion.getId(), tableName, tableTempName, fromVersionOrderNo, nowVersionOrderNo, whereSegment); |
| | | count = getCountByMaxVersion(character, maintainFromVersion.getId(), tableName, tableTempName, nowVersionOrderNo, whereSegment); |
| | | }else { |
| | | count = getCountByVersion(character, maintainFromVersion.getId(), tableName, tableTempName, nowVersionOrderNo, fromVersionOrderNo, whereSegment); |
| | | } |
| | |
| | | String limitSQL = page.getLimitSQL(); |
| | | String fields; |
| | | String tempFields; |
| | | String Hfields; |
| | | String A1fields; |
| | | String A2fields; |
| | | |
| | | String tempHfields; |
| | | String A1Fields; |
| | | |
| | | if (fieldList == null || fieldList.size() == 0) { |
| | | fields = getFields(character, tableName, maintainFromVersion, uuid); |
| | | A1Fields = getFields(character, tableName, Constant.A1, maintainFromVersion, uuid); |
| | | List<String> fieldStrList = DbUtils.split(fields, Constant.COMMA); |
| | | |
| | | Hfields = fieldStrList.stream().map(s -> MessageFormat.format(Constant.Alias,Constant.H, s)).collect(Collectors.joining(Constant.COMMA)); |
| | | A1fields = fieldStrList.stream().map(s -> MessageFormat.format(Constant.Alias,Constant.A1, s)).collect(Collectors.joining(Constant.COMMA)); |
| | | A2fields = fieldStrList.stream().map(s -> MessageFormat.format(Constant.Alias,Constant.A2, s)).collect(Collectors.joining(Constant.COMMA)); |
| | | tempFields = fieldStrList.stream() |
| | | .map(s -> |
| | | s.equalsIgnoreCase(Constant.ID) ? MessageFormat.format("{0} as id",Constant.STD_ID): s) |
| | | .map(s -> MessageFormat.format(Constant.Alias,Constant.MT, s)) |
| | | .collect(Collectors.joining(Constant.COMMA)); |
| | | |
| | | tempHfields = fieldStrList.stream() |
| | | .map(s -> |
| | | s.equalsIgnoreCase(Constant.ID) ? MessageFormat.format("{0} as id",Constant.STD_ID): s) |
| | | .map(s -> MessageFormat.format(Constant.Alias,Constant.H,s)) |
| | | .map(s -> MessageFormat.format(Constant.Alias,Constant.A1, s)) |
| | | .collect(Collectors.joining(Constant.COMMA)); |
| | | |
| | | } else { |
| | |
| | | fieldList.add(Constant.ID); |
| | | } |
| | | fields = fieldList.stream().collect(Collectors.joining(Constant.COMMA)); |
| | | Hfields = fieldList.stream().map(s -> MessageFormat.format(Constant.Alias,Constant.H, s)).collect(Collectors.joining(Constant.COMMA)); |
| | | A1fields = fieldList.stream().map(s -> MessageFormat.format(Constant.Alias,Constant.A1, s)).collect(Collectors.joining(Constant.COMMA)); |
| | | A2fields = fieldList.stream().map(s -> MessageFormat.format(Constant.Alias,Constant.A2, s)).collect(Collectors.joining(Constant.COMMA)); |
| | | A1Fields = fieldList.stream() |
| | | .map(s -> MessageFormat.format(Constant.Alias,Constant.A1, s)) |
| | | .collect(Collectors.joining(Constant.COMMA)); |
| | | tempFields = fieldList.stream() |
| | | .map(s -> |
| | | s.equalsIgnoreCase(Constant.ID) ? MessageFormat.format("{0} as id",Constant.STD_ID): s) |
| | | .map(s -> MessageFormat.format(Constant.Alias,Constant.MT, s)) |
| | | .collect(Collectors.joining(Constant.COMMA)); |
| | | |
| | | tempHfields = fieldList.stream() |
| | | .map(s -> |
| | | s.equalsIgnoreCase(Constant.ID) ? MessageFormat.format("{0} as id",Constant.STD_ID): s) |
| | | .map(s -> MessageFormat.format(Constant.Alias,Constant.H,s)) |
| | | .map(s -> MessageFormat.format(Constant.Alias,Constant.A1, s)) |
| | | .collect(Collectors.joining(Constant.COMMA)); |
| | | |
| | | } |
| | |
| | | long con = maintainIds.stream().map(s -> builder.append(DbUtils.quotedStr(s))).count(); |
| | | } |
| | | |
| | | result = mapper.selectByPageByMaxVersion(tableName,tableTempName,fields,tempFields, Hfields, A1fields, A2fields, tempHfields, fromVersionOrderNo, nowVersionOrderNo, DbUtils.quotedStr(maintainFromVersion.getId()), whereSegment, limitSQL); |
| | | result = mapper.selectByPageByMaxVersion(tableName,tableTempName,fields, A1Fields, tempFields, nowVersionOrderNo, whereSegment, limitSQL); |
| | | |
| | | }else { |
| | | result = mapper.selectByPageByVersion(tableName,tableTempName,fields,tempFields, Hfields, A1fields, A2fields, tempHfields, nowVersionOrderNo, fromVersionOrderNo, DbUtils.quotedStr(maintainFromVersion.getId()), whereSegment, limitSQL); |
| | | result = mapper.selectByPageByVersion(tableName,tableTempName,fields, A1Fields, tempFields, nowVersionOrderNo, fromVersionOrderNo, whereSegment, limitSQL); |
| | | } |
| | | endDate = new Date(); |
| | | log.info(MessageFormat.format("master tag:{0} MASTER-- select dataMap :{1} ms",uuid, (endDate.getTime() - startDate.getTime()))); |
| | |
| | | .setDesp("批量上传数据"); |
| | | |
| | | maintain.insert(); |
| | | connection.commit(); |
| | | } |
| | | catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | // 读数据库 |
| | | String tempTableName = tableName + Constant.RECORD; |
| | | List<Map<String, Object>> maps = mapper.selectByPage(tableName, MessageFormat.format(Constant.DISTINCT, field), Constant.WHERE_DEFAULT, null); |
| | | // List<Map<String, Object>> maps = mapper.selectByPage(tableName, MessageFormat.format(Constant.DISTINCT, field), Constant.WHERE_DEFAULT, null); |
| | | |
| | | List<Map<String, Object>> tempMaps = mapper.selectByPage(tempTableName, MessageFormat.format(Constant.DISTINCT, field), Constant.WHERE_DEFAULT, null); |
| | | maps.addAll(tempMaps); |
| | | List<Map<String, Object>> maps = mapper.selectDistinct(tempTableName, field, Constant.WHERE_DEFAULT); |
| | | |
| | | if (maps.size() == 0) { |
| | | return null; |
| | | } |
| | |
| | | .map(stringObjectMap -> stringObjectMap.get("index_name").toString()) |
| | | .filter(s -> idxName.equalsIgnoreCase(s)).count(); |
| | | if (existsIdx == 0) { |
| | | mapper.createIdx(recordTableName, idxName, Constant.STD_ID); |
| | | |
| | | mapper.createIdx(recordTableName, idxName, Constant.STD_ID + Constant.COMMA + Constant.DEAL); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | String tableNameByMenu = menuMappingService.getTableNameByMenu(assemble.getMenuId()); |
| | | boolean canAct = maintainService.getCanAct(tableNameByMenu); |
| | | if (!canAct) { |
| | | XxlJobLogger.log("当前有流程正在运行,暂时无法汇集下次数据"); |
| | | assemble.setPreMsg("当前有流程正在运行,暂时无法汇集下次数据"); |
| | | assemble.updateById(); |
| | | return Result.error(new CodeMsg(6009,"当前有流程正在运行,暂时无法汇集下次数据")); |
| | | } |
| | | |
| | | Boolean bigData = assemble.getBigdata(); |
| | | Date scheduleDate = new Date(); |
| | | XxlJobLogger.log("log info: start assemble"); |
| | |
| | | |
| | | private Result checkTempData(SysAssemble assemble) { |
| | | try { |
| | | |
| | | |
| | | SysAssembleCheckType checkType = assemble.getCheckType(); |
| | | if (checkType == null) { |
| | | return Result.error(new CodeMsg(6009, "规则校验类型为空")); |
| | |
| | | .setTopicId(mqEntity.getMsgTopicName()) |
| | | .setTagId(mqEntity.getMsgTagName()) |
| | | .setKeyId(mqEntity.getMsgKey()); |
| | | |
| | | int totalSize = mqEntity.getTotalSize(); |
| | | if (totalSize > 0) { |
| | | sysDispenseLogs.setTotal(totalSize); |
| | | } |
| | | |
| | | AtomicInteger pageNo = mqEntity.getPageNo(); |
| | | if (pageNo != null) { |
| | | sysDispenseLogs.setPageNo(pageNo.get()); |
| | |
| | | int length = tableSchemaResult.getLength(); |
| | | totalLength += length; |
| | | } |
| | | int pageSize = Constant.MaxDispenseSize / totalLength; |
| | | int pageSize = 20; |
| | | if (totalLength != 0) { |
| | | pageSize = Constant.MaxDispenseSize / totalLength; |
| | | } |
| | | page.setPageSize(pageSize); |
| | | Long viewCount = getViewCount(sysView); |
| | | if (viewCount == 0) { |
| | |
| | | String MT = "mt"; |
| | | String IDX_TEMPLATE = "IDX_{0}_{1}"; |
| | | |
| | | String T = "t"; |
| | | } |
| | |
| | | |
| | | return collect; |
| | | } |
| | | |
| | | public static int object2Int(Object total) { |
| | | try |
| | | { |
| | | return Integer.parseInt(total.toString()); |
| | | } |
| | | catch (NumberFormatException e) |
| | | {} |
| | | return 0; |
| | | } |
| | | } |
| | |
| | | if (mediaType == null){ |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | MultiValueMap<String, String> vals = new LinkedMultiValueMap(); |
| | | |
| | | if (formParams != null) { |
| | | Set<String> keySet = formParams.keySet(); |
| | | for (String key : keySet) { |
| | | String s = formParams.get(key); |
| | | List<String> strings = new ArrayList<>(); |
| | | strings.add(s); |
| | | vals.put(key,strings); |
| | | } |
| | | } |
| | | |
| | | requestEntity = new HttpEntity<MultiValueMap<String, String>>(vals, headers); |
| | |
| | | } |
| | | String s = sb.toString(); |
| | | if (s.endsWith("&")) { |
| | | s = org.apache.commons.lang.StringUtils.substringBeforeLast(s, "&"); |
| | | s = org.apache.commons.lang3.StringUtils.substringBeforeLast(s, "&"); |
| | | } |
| | | return s; |
| | | } |
| | |
| | | import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
| | | import org.springframework.http.converter.StringHttpMessageConverter;
|
| | | import org.springframework.stereotype.Component;
|
| | | import org.springframework.util.MultiValueMap;
|
| | | import org.springframework.util.StringUtils;
|
| | | import org.springframework.web.client.RestTemplate;
|
| | |
|
| | |
| | | public HashMap<String,Boolean> execuImmeForCollect(String tableName,String userId) {
|
| | | //TODO
|
| | | String url = this.url + prefix + "execuImmeForCollect";
|
| | | HashMap<String, String> params = new HashMap<>();
|
| | | HashMap<String, Object> params = new HashMap<>();
|
| | | params.put("tableName",tableName);
|
| | | params.put("createUserId",tableName);
|
| | | String s = HttpRestClient(url, HttpMethod.POST, params, null, null);
|
| | | params.put("createUserId",userId);
|
| | | String urlParamsByMap = HttpUtils.getUrlParamsByMap(params);
|
| | | String s = HttpUtils.HttpRestClient(url, HttpMethod.POST, null, urlParamsByMap, null);
|
| | | JSONObject result = (JSONObject) JSON.parse(s);
|
| | | String sucess = result.getString(Constant.Success);
|
| | | JSONObject dataObject = result.getJSONObject(Constant.Data);
|
| | |
| | | params.put("tableName",tableName);
|
| | | params.put("pageNum",pageNo.toString());
|
| | | params.put("pageSize",pageSize.toString());
|
| | | String s = HttpRestClient(url, HttpMethod.POST, params, null, null);
|
| | | String s = HttpUtils.HttpRestClient(url, HttpMethod.POST, params, null, null);
|
| | | JSONObject result = (JSONObject) JSON.parse(s);
|
| | | String sucess = result.getString(Constant.Success);
|
| | | if (StringUtils.isEmpty(sucess) || !Boolean.valueOf(sucess)) {
|
| | |
| | | params.put("tableName",tableName);
|
| | | params.put("isTemp",isTemp);
|
| | |
|
| | | String s = HttpRestClient(url, HttpMethod.POST, params,null, MediaType.APPLICATION_JSON);
|
| | | String s = HttpUtils.HttpRestClient(url, HttpMethod.POST, params,null, MediaType.APPLICATION_JSON);
|
| | | JSONObject result = (JSONObject) JSON.parse(s);
|
| | | boolean sucess = result.getBoolean(Constant.Success);
|
| | | if (!sucess) {
|
| | |
| | | }
|
| | |
|
| | |
|
| | | public String HttpRestClient(String url, HttpMethod method, HashMap<String, String> formParams, String getParams, MediaType mediaType) {
|
| | | public String HttpRestClient(String url, HttpMethod method, MultiValueMap<String, String> formParams, String getParams, MediaType mediaType) {
|
| | | if (!StringUtils.isEmpty(getParams)) {
|
| | | url = url + Constant.QUESTION + getParams;
|
| | | }
|
| | |
| | | headers.setContentType(mediaType);
|
| | | }
|
| | |
|
| | | HttpEntity<HashMap<String, String>> requestEntity = new HttpEntity<HashMap<String, String>>(formParams, headers);
|
| | | HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<MultiValueMap<String, String>>(formParams, headers);
|
| | | // 执行HTTP请求
|
| | | ResponseEntity<String> response = client.exchange(url, method, requestEntity, String.class);
|
| | |
|
| | |
| | | }
|
| | | Date createTime = logByMqEntity.getCreateTime();
|
| | | long schedule = new Date().getTime() - createTime.getTime();
|
| | | schedule = Math.abs(schedule);
|
| | | logByMqEntity.setSchedule(schedule);
|
| | | logByMqEntity.updateById();
|
| | | }
|
| | |
| | | object.fluentPut("pages", page.getPageCount());
|
| | | object.fluentPut("current", page.getPageNo());
|
| | | object.fluentPut("records", maps);
|
| | | mqEntity.getMsgBody().setTotal(Long.valueOf(page.getRecordCount()).intValue());
|
| | | content = JSONObject.toJSONString(object);
|
| | | } else {
|
| | | Result result = DbUtils.masterDataService.selectListByPageByVersion(user, maintain.getTableName(), fieldList, filter, pageNo.get(), pageSize.get(), maintain.getVersion(), false);
|
| | |
| | | object.fluentPut("current", grid.get("current"));
|
| | | object.fluentPut("records", grid.get("record"));
|
| | |
|
| | | mqEntity.getMsgBody().setTotal(grid.getInteger("total"));
|
| | | content = JSONObject.toJSONString(object);
|
| | |
|
| | | }
|
| | |
| | | private void sendOneViewPackage(AtomicInteger pageNo, AtomicInteger pageSize, SysView sysView) throws Exception {
|
| | | Result viewData = DbUtils.viewService.getViewData(sysView, pageNo.get(), pageSize.get());
|
| | | JSONObject object = (JSONObject) viewData.getData();
|
| | | mqEntity.getMsgBody().setTotal(object.getInteger("total"));
|
| | | String content = JSONObject.toJSONString(object);
|
| | | sendMqBody(pageSize.get(), content);
|
| | | }
|
| | |
| | | // String mqBody = content;
|
| | | MqEntity.MsgBodyBean msgBody = mqEntity.getMsgBody();
|
| | | msgBody.setData(mqBody);
|
| | | msgBody.setTotal(pageSize);
|
| | |
|
| | | mqEntity.setMsgBody(msgBody);
|
| | | // Thread.sleep(1000 * 60 * 3);
|
| | | mqEntity.send2Mq();
|
| | |
| | | server: |
| | | port: 9999 |
| | | port: 9998 |
| | | #url: jdbc:mysql://180.169.94.250:8306/data_admin?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=UTC&nullCatalogMeansCurrent=true |
| | | img: |
| | | url: D:/mdm/process |
| | |
| | | max-active: 100 |
| | | max-wait: 1000 |
| | | activiti: |
| | | database-schema-update: flase |
| | | database-schema-update: true |
| | | |
| | | thymeleaf: |
| | | cache: false |
| | |
| | | url: http://127.0.0.1:9107 |
| | | |
| | | user: |
| | | url: http://127.0.0.1:9107 |
| | | url: http://180.169.94.250:9107 |
| | | mq: |
| | | url: http://127.0.0.1:9107 |
| | | |
| | |
| | | appname: assemble |
| | | admin: |
| | | addresses: http://127.0.0.1:8090/xxl-job-admin |
| | | |
| | | |
| | | master: |
| | | unbigdata: |
| | |
| | | spring: |
| | | profiles: |
| | | active: |
| | | rrs |
| | | pro |
| | | |
| | | main: |
| | | allow-bean-definition-overriding: true |
| | |
| | | |
| | | <select id="getMapping" resultType="java.util.Map"> |
| | | SELECT |
| | | m.id,m.code, m.name, system_id as systemId, m.audit as audit, |
| | | m.id,m.code, m.name, system_id as systemId, m.audit as audit, m.desc, |
| | | |
| | | c2.name as cname1, c2.id as cid1, c1.name as cname2, c1.id as cid2, c.name as cname3, c.id as cid3, |
| | | start_time as startTime, end_time as endTime, m.create_time as createTime, m.update_time as updateTime, |
| | |
| | | show TABLES like #{tableName} |
| | | </select> |
| | | |
| | | <select id="selectIdxByTableName" parameterType="java.lang.String" resultType="java.util.Map" statementType="STATEMENT"> |
| | | <select id="selectIdxByTableName" parameterType="java.lang.String" resultType="java.util.Map" |
| | | statementType="STATEMENT"> |
| | | SELECT * FROM mysql.`innodb_index_stats` a WHERE a.table_name = ${tableName} |
| | | </select> |
| | | |
| | |
| | | select COLUMN_NAME as fieldName,DATA_TYPE as dbType, character_maximum_length as length from information_schema.COLUMNS where table_name = #{tableName} and table_schema = (select database()) |
| | | </select> |
| | | |
| | | <select id="getTableFieldFromDb" parameterType="com.highdatas.mdm.entity.TableSchema" resultType="com.highdatas.mdm.entity.TableSchemaResult"> |
| | | <select id="getTableFieldFromDb" parameterType="com.highdatas.mdm.entity.TableSchema" |
| | | resultType="com.highdatas.mdm.entity.TableSchemaResult"> |
| | | select COLUMN_NAME as fieldName,DATA_TYPE as dbType,character_maximum_length as length from information_schema.COLUMNS where table_name = #{tableName} and table_schema = #{dbName} |
| | | </select> |
| | | |
| | |
| | | |
| | | <select id="selectByPageByVersion" resultType="java.util.Map" statementType="STATEMENT" > |
| | | <![CDATA[ |
| | | select ${fields} from ( |
| | | SELECT |
| | | ${A1fields} from ( |
| | | SELECT ${fields} from ${tableName} m |
| | | WHERE NOT EXISTS ( |
| | | SELECT std_id FROM ${tableTempName} tm |
| | | LEFT JOIN maintain_detail ON tm.id = maintain_detail.pre_merge_id |
| | | LEFT JOIN maintain ON maintain.id = maintain_detail.parent_id |
| | | LEFT JOIN flows f on maintain.flow_id = f.id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | and operate = 'create' |
| | | AND tm.std_id = m.id |
| | | AND f.status = 'open' |
| | | and maintain.table_name = '${tableName}' |
| | | ) ) a1 |
| | | SELECT ${fields} |
| | | FROM |
| | | (SELECT ${A1fields} |
| | | FROM ${tableName} a1 |
| | | LEFT JOIN |
| | | ( |
| | | SELECT ${tempHFields} from ${tableTempName} h |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = h.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | INNER JOIN ( |
| | | SELECT MIN(m.order_no) as order_no, mt.std_id FROM ${tableTempName} mt |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = mt.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | LEFT JOIN flows f on m.flow_id = f.id |
| | | WHERE m.order_no <= ${fromOrderNo} and m.order_no > ${toOrderNo} and m.table_name = '${tableName}' |
| | | and operate = 'update' |
| | | AND f.status = 'open' |
| | | GROUP BY mt.std_id |
| | | ) a on a.order_no = m.order_no and a.std_id = h.std_id |
| | | )a2 on a1.id = a2.id WHERE a2.id is null |
| | | (SELECT DISTINCT mt1.std_id |
| | | FROM ${tableTempName} mt1 |
| | | LEFT JOIN maintain_detail md |
| | | ON md.pre_merge_id = mt1.id |
| | | LEFT JOIN maintain m |
| | | ON m.id = md.parent_id |
| | | WHERE m.order_no <= ${fromOrderNo} |
| | | AND m.order_no > ${toOrderNo} |
| | | AND m.table_name = '${tableName}' |
| | | AND (operate = 'create' |
| | | OR operate = 'update') ) v |
| | | ON v.std_id = a1.id |
| | | WHERE v.std_id IS NULL |
| | | UNION |
| | | SELECT |
| | | ${A2fields} |
| | | from ( |
| | | SELECT ${fields} from ${tableName} m |
| | | WHERE NOT EXISTS ( |
| | | SELECT std_id FROM ${tableTempName} tm |
| | | LEFT JOIN maintain_detail ON tm.id = maintain_detail.pre_merge_id |
| | | LEFT JOIN maintain ON maintain.id = maintain_detail.parent_id |
| | | LEFT JOIN flows f on maintain.flow_id = f.id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | and operate = 'create' |
| | | AND f.status = 'open' |
| | | AND tm.std_id = m.id |
| | | and maintain.table_name = '${tableName}' |
| | | ) ) a1 |
| | | LEFT JOIN |
| | | ( |
| | | SELECT ${tempHFields} from ${tableTempName} h |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = h.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | INNER JOIN ( |
| | | SELECT MIN(m.order_no) as order_no, mt.std_id FROM ${tableTempName} mt |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = mt.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | LEFT JOIN flows f on m.flow_id = f.id |
| | | WHERE m.order_no <= ${fromOrderNo} and m.order_no > ${toOrderNo} and m.table_name = '${tableName}' |
| | | and operate = 'update' |
| | | AND f.status = 'open' |
| | | GROUP BY mt.std_id |
| | | ) a on a.order_no = m.order_no and a.std_id = h.std_id |
| | | )a2 on a1.id = a2.id WHERE a2.id is not null |
| | | UNION |
| | | SELECT ${tempFields} FROM maintain_detail md |
| | | LEFT JOIN maintain ON maintain.id = md.parent_id |
| | | LEFT JOIN flows f on maintain.flow_id = f.id |
| | | LEFT JOIN ${tableTempName} mt on mt.id = md.pre_merge_id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} AND operate = 'delete' |
| | | AND f.status = 'open' |
| | | and maintain.table_name = '${tableName}' |
| | | AND NOT EXISTS ( |
| | | SELECT * FROM maintain_detail |
| | | LEFT JOIN maintain ON maintain.id = maintain_detail.parent_id |
| | | LEFT JOIN ${tableTempName} mt1 on mt1.id = maintain_detail.pre_merge_id |
| | | LEFT JOIN flows f on maintain.flow_id = f.id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | SELECT ${tempFields} |
| | | FROM |
| | | (SELECT mt.*, |
| | | m.order_no |
| | | FROM ${tableTempName} mt |
| | | LEFT JOIN maintain_detail md |
| | | ON md.pre_merge_id = mt.id |
| | | LEFT JOIN maintain m |
| | | ON md.parent_id = m.id |
| | | WHERE m.order_no <= ${fromOrderNo} |
| | | AND m.order_no > ${toOrderNo} |
| | | AND m.table_name = '${tableName}' |
| | | AND operate = 'update' ) AS a1 |
| | | INNER JOIN |
| | | (SELECT std_id, |
| | | min(order_no) AS order_no |
| | | FROM |
| | | (SELECT mt.id, |
| | | std_id, |
| | | m.order_no |
| | | FROM ${tableTempName} mt |
| | | LEFT JOIN maintain_detail md |
| | | ON md.pre_merge_id = mt.id |
| | | LEFT JOIN maintain m |
| | | ON md.parent_id = m.id |
| | | WHERE m.order_no <= ${fromOrderNo} |
| | | AND m.order_no > ${toOrderNo} |
| | | AND m.table_name = '${tableName}' |
| | | AND operate = 'update' |
| | | AND NOT EXISTS |
| | | (SELECT mt1.id |
| | | FROM ${tableTempName} mt1 |
| | | LEFT JOIN maintain_detail md |
| | | ON md.pre_merge_id = mt1.id |
| | | LEFT JOIN maintain m |
| | | ON m.id = md.parent_id |
| | | WHERE m.order_no <= ${fromOrderNo} |
| | | AND m.order_no > ${toOrderNo} |
| | | AND m.table_name = '${tableName}' |
| | | AND operate = 'create' |
| | | AND f.status = 'open' |
| | | AND mt.std_id = mt1.std_id |
| | | and maintain.table_name = '${tableName}' |
| | | ) |
| | | )a where ${where} ${limit} |
| | | AND mt1.std_id = mt.std_id ) ) AS gz |
| | | GROUP BY std_id ) AS zb |
| | | ON a1.std_id = zb.std_id |
| | | AND a1.order_no = zb.order_no |
| | | UNION |
| | | SELECT DISTINCT ${tempFields} |
| | | FROM ${tableTempName} a1 |
| | | LEFT JOIN maintain_detail md |
| | | ON md.pre_merge_id = a1.id |
| | | LEFT JOIN maintain m |
| | | ON m.id = md.parent_id |
| | | LEFT JOIN |
| | | (SELECT DISTINCT mt1.std_id |
| | | FROM ${tableTempName} mt1 |
| | | LEFT JOIN maintain_detail md |
| | | ON md.pre_merge_id = mt1.id |
| | | LEFT JOIN maintain m |
| | | ON m.id = md.parent_id |
| | | WHERE m.order_no <= ${fromOrderNo} |
| | | AND m.order_no > ${toOrderNo} |
| | | AND m.table_name = '${tableName}' |
| | | AND (operate = 'create' |
| | | OR operate = 'update') ) zb |
| | | ON zb.std_id = a1.std_id |
| | | WHERE zb.std_id is null |
| | | AND md.operate = 'delete' |
| | | AND m.order_no <= ${fromOrderNo} |
| | | AND m.order_no > ${toOrderNo} |
| | | AND m.table_name = '${tableName}' ) a |
| | | WHERE ${where} ${limit} |
| | | ]]> |
| | | </select> |
| | | |
| | | <select id="selectByPageByMaxVersion" resultType="java.util.Map" statementType="STATEMENT" > |
| | | <![CDATA[ |
| | | |
| | | select ${fields},operate, status from ( |
| | | SELECT |
| | | ${A1fields}, '' as operate, '' as status from ( |
| | | SELECT ${fields} from ${tableName} m |
| | | WHERE NOT EXISTS ( |
| | | SELECT std_id FROM ${tableTempName} tm |
| | | LEFT JOIN maintain_detail ON tm.id = maintain_detail.pre_merge_id |
| | | LEFT JOIN maintain ON maintain.id = maintain_detail.parent_id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | AND tm.std_id = m.id |
| | | and maintain.table_name = '${tableName}' |
| | | ) ) a1 |
| | | SELECT ${tempFields}, md.operate, f.`status` from ${tableTempName} a1 |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = a1.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | LEFT JOIN flows f on flow_id = f.id |
| | | WHERE order_no > ${fromOrderNo} and f.id is null |
| | | UNION |
| | | SELECT ${tempFields}, md.operate, f.`status` from ${tableTempName} a1 |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = a1.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | LEFT JOIN flows f on flow_id = f.id |
| | | WHERE order_no > ${fromOrderNo} and f.`status` = 'working' |
| | | |
| | | union |
| | | SELECT ${A1fields}, '', '' from ${tableName} a1 |
| | | LEFT JOIN |
| | | ( |
| | | SELECT ${tempHFields} from ${tableTempName} h |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = h.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | INNER JOIN ( |
| | | SELECT max(m.order_no) as order_no, mt.std_id FROM ${tableTempName} mt |
| | | SELECT DISTINCT std_id from ${tableTempName} mt |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = mt.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | WHERE m.order_no <= ${fromOrderNo} and m.order_no > ${toOrderNo} and m.table_name = '${tableName}' |
| | | and operate = 'update' |
| | | GROUP BY mt.std_id |
| | | ) a on a.order_no = m.order_no and a.std_id = h.std_id |
| | | )a2 on a1.id = a2.id WHERE a2.id is null |
| | | LEFT JOIN flows f on flow_id = f.id |
| | | WHERE order_no > ${fromOrderNo} and f.id is null |
| | | UNION |
| | | SELECT |
| | | ${A2fields}, 'update' as operate, a2.status as status |
| | | from ( |
| | | SELECT ${fields} from ${tableName} m |
| | | ) a1 |
| | | LEFT JOIN |
| | | ( |
| | | SELECT ${tempHFields}, f.status from ${tableTempName} h |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = h.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | LEFT JOIN flows f on m.flow_id = f.id |
| | | INNER JOIN ( |
| | | SELECT max(m.order_no) as order_no, mt.std_id FROM ${tableTempName} mt |
| | | SELECT DISTINCT std_id from ${tableTempName} mt |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = mt.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | WHERE m.order_no <= ${fromOrderNo} and m.order_no > ${toOrderNo} and m.table_name = '${tableName}' |
| | | and operate = 'update' |
| | | GROUP BY mt.std_id |
| | | ) a on a.order_no = m.order_no and a.std_id = h.std_id |
| | | )a2 on a1.id = a2.id WHERE a2.id is not null |
| | | UNION |
| | | SELECT ${tempFields}, 'create' as operate, f.status as status FROM maintain_detail md |
| | | LEFT JOIN maintain ON maintain.id = md.parent_id |
| | | LEFT JOIN flows f on maintain.flow_id = f.id |
| | | LEFT JOIN ${tableTempName} mt on mt.id = md.pre_merge_id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} AND operate = 'create' |
| | | and maintain.table_name = '${tableName}' |
| | | AND NOT EXISTS ( |
| | | SELECT * FROM maintain_detail |
| | | LEFT JOIN maintain ON maintain.id = maintain_detail.parent_id |
| | | LEFT JOIN ${tableTempName} mt1 on mt1.id = maintain_detail.pre_merge_id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | AND operate = 'delete' |
| | | AND mt.std_id = mt1.std_id |
| | | and maintain.table_name = '${tableName}' |
| | | ) |
| | | UNION |
| | | SELECT ${tempFields}, 'delete' as operate, f.status as status FROM maintain_detail md |
| | | LEFT JOIN maintain ON maintain.id = md.parent_id |
| | | LEFT JOIN flows f on maintain.flow_id = f.id |
| | | LEFT JOIN ${tableTempName} mt on mt.id = md.pre_merge_id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} AND operate = 'delete' |
| | | and maintain.table_name = '${tableName}' |
| | | AND NOT EXISTS ( |
| | | SELECT * FROM maintain_detail |
| | | LEFT JOIN maintain ON maintain.id = maintain_detail.parent_id |
| | | LEFT JOIN ${tableTempName} mt1 on mt1.id = maintain_detail.pre_merge_id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | AND operate = 'create' |
| | | AND mt.std_id = mt1.std_id |
| | | and maintain.table_name = '${tableName}' |
| | | ) |
| | | LEFT JOIN flows f on flow_id = f.id |
| | | WHERE order_no > ${fromOrderNo} and f.`status` = 'working' |
| | | ) a on a.std_id = a1.id where a.std_id is null |
| | | )a where ${where} ${limit} |
| | | |
| | | ]]> |
| | | </select> |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="tempDeal" statementType="STATEMENT" resultType="java.lang.Integer"> |
| | | UPDATE ${tableTempName} mt |
| | | INNER JOIN ( |
| | | SELECT pre_merge_id from |
| | | maintain_detail |
| | | WHERE maintain_detail.parent_id = ${maintainId} |
| | | )md on mt.id = md.pre_merge_id |
| | | set mt.deal = 1 |
| | | |
| | | UPDATE ${tableTempName} t |
| | | SET deal = 1 |
| | | where EXISTS ( |
| | | SELECT pre_merge_id from maintain_detail WHERE parent_id = ${maintainId} |
| | | and maintain_detail.pre_merge_id = t.id |
| | | ) |
| | | |
| | | </select> |
| | | |
| | | <select id="getCount" resultType="java.lang.Long" statementType="STATEMENT" > |
| | |
| | | |
| | | <select id="getCountByVersion" resultType="java.lang.Long" statementType="STATEMENT" > |
| | | <![CDATA[ |
| | | select count(1) from ( |
| | | SELECT |
| | | ${A1fields} |
| | | from ( |
| | | SELECT ${fields} from ${tableName} m |
| | | WHERE NOT EXISTS ( |
| | | SELECT std_id FROM ${tableTempName} tm |
| | | LEFT JOIN maintain_detail ON tm.id = maintain_detail.pre_merge_id |
| | | LEFT JOIN maintain ON maintain.id = maintain_detail.parent_id |
| | | LEFT JOIN flows f on maintain.flow_id = f.id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | and maintain.table_name = '${tableName}' |
| | | AND f.status = 'open' |
| | | and operate = 'create' |
| | | AND tm.std_id = m.id |
| | | ) ) a1 |
| | | SELECT count(1) |
| | | FROM |
| | | (SELECT ${A1fields} |
| | | FROM ${tableName} a1 |
| | | LEFT JOIN |
| | | ( |
| | | SELECT ${tempHFields} from ${tableTempName} h |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = h.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | INNER JOIN ( |
| | | SELECT MIN(m.order_no) as order_no, mt.std_id FROM ${tableTempName} mt |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = mt.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | LEFT JOIN flows f on m.flow_id = f.id |
| | | WHERE m.order_no <= ${fromOrderNo} and m.order_no > ${toOrderNo} and m.table_name = '${tableName}' |
| | | and operate = 'update' |
| | | AND f.status = 'open' |
| | | GROUP BY mt.std_id |
| | | ) a on a.order_no = m.order_no and a.std_id = h.std_id |
| | | )a2 on a1.id = a2.id WHERE a2.id is null |
| | | (SELECT DISTINCT mt1.std_id |
| | | FROM ${tableTempName} mt1 |
| | | LEFT JOIN maintain_detail md |
| | | ON md.pre_merge_id = mt1.id |
| | | LEFT JOIN maintain m |
| | | ON m.id = md.parent_id |
| | | WHERE m.order_no <= ${fromOrderNo} |
| | | AND m.order_no > ${toOrderNo} |
| | | AND m.table_name = '${tableName}' |
| | | AND (operate = 'create' |
| | | OR operate = 'update') ) v |
| | | ON v.std_id = a1.id |
| | | WHERE v.std_id IS NULL |
| | | UNION |
| | | SELECT |
| | | ${A2fields} |
| | | from ( |
| | | SELECT ${fields} from ${tableName} m |
| | | WHERE NOT EXISTS ( |
| | | SELECT std_id FROM ${tableTempName} tm |
| | | LEFT JOIN maintain_detail ON tm.id = maintain_detail.pre_merge_id |
| | | LEFT JOIN maintain ON maintain.id = maintain_detail.parent_id |
| | | LEFT JOIN flows f on maintain.flow_id = f.id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | and maintain.table_name = '${tableName}' |
| | | AND f.status = 'open' |
| | | and operate = 'create' |
| | | AND tm.std_id = m.id |
| | | ) ) a1 |
| | | LEFT JOIN |
| | | ( |
| | | SELECT ${tempHFields} from ${tableTempName} h |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = h.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | INNER JOIN ( |
| | | SELECT MIN(m.order_no) as order_no, mt.std_id FROM ${tableTempName} mt |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = mt.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | LEFT JOIN flows f on m.flow_id = f.id |
| | | WHERE m.order_no <= ${fromOrderNo} and m.order_no > ${toOrderNo} and m.table_name = '${tableName}' |
| | | and operate = 'update' |
| | | AND f.status = 'open' |
| | | GROUP BY mt.std_id |
| | | ) a on a.order_no = m.order_no and a.std_id = h.std_id |
| | | )a2 on a1.id = a2.id WHERE a2.id is not null |
| | | UNION |
| | | SELECT ${tempFields} FROM maintain_detail md |
| | | LEFT JOIN maintain ON maintain.id = md.parent_id |
| | | LEFT JOIN ${tableTempName} mt on mt.id = md.pre_merge_id |
| | | LEFT JOIN flows f on maintain.flow_id = f.id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | and maintain.table_name = '${tableName}' |
| | | AND f.status = 'open' |
| | | AND operate = 'delete' |
| | | AND NOT EXISTS ( |
| | | SELECT * FROM maintain_detail |
| | | LEFT JOIN maintain ON maintain.id = maintain_detail.parent_id |
| | | LEFT JOIN ${tableTempName} mt1 on mt1.id = maintain_detail.pre_merge_id |
| | | LEFT JOIN flows f on maintain.flow_id = f.id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | SELECT ${tempFields} |
| | | FROM |
| | | (SELECT mt.*, |
| | | m.order_no |
| | | FROM ${tableTempName} mt |
| | | LEFT JOIN maintain_detail md |
| | | ON md.pre_merge_id = mt.id |
| | | LEFT JOIN maintain m |
| | | ON md.parent_id = m.id |
| | | WHERE m.order_no <= ${fromOrderNo} |
| | | AND m.order_no > ${toOrderNo} |
| | | AND m.table_name = '${tableName}' |
| | | AND operate = 'update' ) AS a1 |
| | | INNER JOIN |
| | | (SELECT std_id, |
| | | min(order_no) AS order_no |
| | | FROM |
| | | (SELECT mt.id, |
| | | std_id, |
| | | m.order_no |
| | | FROM ${tableTempName} mt |
| | | LEFT JOIN maintain_detail md |
| | | ON md.pre_merge_id = mt.id |
| | | LEFT JOIN maintain m |
| | | ON md.parent_id = m.id |
| | | WHERE m.order_no <= ${fromOrderNo} |
| | | AND m.order_no > ${toOrderNo} |
| | | AND m.table_name = '${tableName}' |
| | | AND operate = 'update' |
| | | AND NOT EXISTS |
| | | (SELECT mt1.id |
| | | FROM ${tableTempName} mt1 |
| | | LEFT JOIN maintain_detail md |
| | | ON md.pre_merge_id = mt1.id |
| | | LEFT JOIN maintain m |
| | | ON m.id = md.parent_id |
| | | WHERE m.order_no <= ${fromOrderNo} |
| | | AND m.order_no > ${toOrderNo} |
| | | AND m.table_name = '${tableName}' |
| | | AND operate = 'create' |
| | | AND f.status = 'open' |
| | | AND mt.std_id = mt1.std_id |
| | | and maintain.table_name = '${tableName}' |
| | | ) |
| | | )a where ${where} |
| | | AND mt1.std_id = mt.std_id ) ) AS gz |
| | | GROUP BY std_id ) AS zb |
| | | ON a1.std_id = zb.std_id |
| | | AND a1.order_no = zb.order_no |
| | | UNION |
| | | SELECT DISTINCT ${tempFields} |
| | | FROM ${tableTempName} a1 |
| | | LEFT JOIN maintain_detail md |
| | | ON md.pre_merge_id = a1.id |
| | | LEFT JOIN maintain m |
| | | ON m.id = md.parent_id |
| | | LEFT JOIN |
| | | (SELECT DISTINCT mt1.std_id |
| | | FROM ${tableTempName} mt1 |
| | | LEFT JOIN maintain_detail md |
| | | ON md.pre_merge_id = mt1.id |
| | | LEFT JOIN maintain m |
| | | ON m.id = md.parent_id |
| | | WHERE m.order_no <= ${fromOrderNo} |
| | | AND m.order_no > ${toOrderNo} |
| | | AND m.table_name = '${tableName}' |
| | | AND (operate = 'create' |
| | | OR operate = 'update') ) zb |
| | | ON zb.std_id = a1.std_id |
| | | WHERE zb.std_id is null |
| | | AND md.operate = 'delete' |
| | | AND m.order_no <= ${fromOrderNo} |
| | | AND m.order_no > ${toOrderNo} |
| | | AND m.table_name = '${tableName}' ) a |
| | | WHERE ${where} |
| | | |
| | | ]]> |
| | | </select> |
| | | |
| | | <select id="getCountByMaxVersion" resultType="java.lang.Long" statementType="STATEMENT" > |
| | | <![CDATA[ |
| | | |
| | | select count(1) from ( |
| | | SELECT |
| | | ${A1fields}, '' as operate, '' as status from ( |
| | | SELECT ${fields} from ${tableName} m |
| | | WHERE NOT EXISTS ( |
| | | SELECT std_id FROM ${tableTempName} tm |
| | | LEFT JOIN maintain_detail ON tm.id = maintain_detail.pre_merge_id |
| | | LEFT JOIN maintain ON maintain.id = maintain_detail.parent_id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | and maintain.table_name = '${tableName}' |
| | | AND tm.std_id = m.id |
| | | ) ) a1 |
| | | SELECT ${tempFields}, md.operate, f.`status` from ${tableTempName} a1 |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = a1.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | LEFT JOIN flows f on flow_id = f.id |
| | | WHERE order_no > ${fromOrderNo} and f.id is null |
| | | UNION |
| | | SELECT ${tempFields}, md.operate, f.`status` from ${tableTempName} a1 |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = a1.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | LEFT JOIN flows f on flow_id = f.id |
| | | WHERE order_no > ${fromOrderNo} and f.`status` = 'working' |
| | | |
| | | union |
| | | SELECT ${A1fields}, '', '' from ${tableName} a1 |
| | | LEFT JOIN |
| | | ( |
| | | SELECT ${tempHFields} from ${tableTempName} h |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = h.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | INNER JOIN ( |
| | | SELECT max(m.order_no) as order_no, mt.std_id FROM ${tableTempName} mt |
| | | SELECT DISTINCT std_id from ${tableTempName} mt |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = mt.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | WHERE m.order_no <= ${fromOrderNo} and m.order_no > ${toOrderNo} |
| | | and m.table_name = '${tableName}' |
| | | and operate = 'update' |
| | | GROUP BY mt.std_id |
| | | ) a on a.order_no = m.order_no and a.std_id = h.std_id |
| | | )a2 on a1.id = a2.id WHERE a2.id is null |
| | | LEFT JOIN flows f on flow_id = f.id |
| | | WHERE order_no > ${fromOrderNo} and f.id is null |
| | | UNION |
| | | SELECT |
| | | ${A2fields}, 'update' as operate, a2.status as status |
| | | from ( |
| | | SELECT ${fields} from ${tableName} m |
| | | ) a1 |
| | | LEFT JOIN |
| | | ( |
| | | SELECT ${tempHFields}, f.status from ${tableTempName} h |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = h.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | LEFT JOIN flows f on m.flow_id = f.id |
| | | INNER JOIN ( |
| | | SELECT max(m.order_no) as order_no, mt.std_id FROM ${tableTempName} mt |
| | | SELECT DISTINCT std_id from ${tableTempName} mt |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = mt.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | WHERE m.order_no <= ${fromOrderNo} and m.order_no > ${toOrderNo} |
| | | and m.table_name = '${tableName}' |
| | | and operate = 'update' |
| | | GROUP BY mt.std_id |
| | | ) a on a.order_no = m.order_no and a.std_id = h.std_id |
| | | )a2 on a1.id = a2.id WHERE a2.id is not null |
| | | UNION |
| | | SELECT ${tempFields}, 'create' as operate, f.status as status FROM maintain_detail md |
| | | LEFT JOIN maintain ON maintain.id = md.parent_id |
| | | LEFT JOIN flows f on maintain.flow_id = f.id |
| | | LEFT JOIN ${tableTempName} mt on mt.id = md.pre_merge_id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | AND maintain.table_name = '${tableName}' |
| | | AND operate = 'create' |
| | | AND NOT EXISTS ( |
| | | SELECT * FROM maintain_detail |
| | | LEFT JOIN maintain ON maintain.id = maintain_detail.parent_id |
| | | LEFT JOIN ${tableTempName} mt1 on mt1.id = maintain_detail.pre_merge_id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | AND operate = 'delete' |
| | | AND mt.std_id = mt1.std_id |
| | | AND maintain.table_name = '${tableName}' |
| | | ) |
| | | UNION |
| | | SELECT ${tempFields}, 'delete' as operate, f.status as status FROM maintain_detail md |
| | | LEFT JOIN maintain ON maintain.id = md.parent_id |
| | | LEFT JOIN flows f on maintain.flow_id = f.id |
| | | LEFT JOIN ${tableTempName} mt on mt.id = md.pre_merge_id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | AND maintain.table_name = '${tableName}' |
| | | AND operate = 'delete' |
| | | AND NOT EXISTS ( |
| | | SELECT * FROM maintain_detail |
| | | LEFT JOIN maintain ON maintain.id = maintain_detail.parent_id |
| | | LEFT JOIN ${tableTempName} mt1 on mt1.id = maintain_detail.pre_merge_id |
| | | WHERE maintain.order_no <= ${fromOrderNo} and maintain.order_no > ${toOrderNo} |
| | | AND operate = 'create' |
| | | AND mt.std_id = mt1.std_id |
| | | and maintain.table_name = '${tableName}' |
| | | ) |
| | | LEFT JOIN flows f on flow_id = f.id |
| | | WHERE order_no > ${fromOrderNo} and f.`status` = 'working' |
| | | ) a on a.std_id = a1.id where a.std_id is null |
| | | )a where ${where} |
| | | |
| | | ]]> |
| | | </select> |
| | | |
| | |
| | | |
| | | |
| | | <delete id="deleteTempByMaintainId"> |
| | | DELETE FROM ${tableTempName} where EXISTS ( |
| | | SELECT pre_merge_id from maintain_detail d |
| | | where parent_id = ${maintainId} and d.pre_merge_id = ${tableTempName}.id |
| | | ) |
| | | DELETE tm FROM ${tableTempName} tm , maintain_detail md WHERE tm.id = md.pre_merge_id |
| | | and md.parent_id = ${maintainId}; |
| | | </delete> |
| | | |
| | | <!-- temp 2 standrad--> |
| | |
| | | SELECT |
| | | ${tempFields} |
| | | from ${tableTempName} t |
| | | where |
| | | EXISTS |
| | | ( |
| | | SELECT std_id from ${tableTempName} tm |
| | | LEFT JOIN maintain_detail on tm.id = maintain_detail.pre_merge_id |
| | | WHERE maintain_detail.parent_id = ${maintainId} |
| | | and operate = 'create' |
| | | and tm.id = t.id |
| | | ) |
| | | inner join maintain_detail md on t.id = md.pre_merge_id |
| | | where md.parent_id = ${maintainId} and md.operate = 'create' |
| | | |
| | | </insert> |
| | | |
| | | <select id="getTempIdByStdId" statementType="STATEMENT" resultType="java.lang.String"> |
| | |
| | | SELECT |
| | | ${fields} |
| | | from ${tableTempName} t |
| | | where |
| | | EXISTS |
| | | ( |
| | | SELECT pre_merge_id from maintain_detail |
| | | LEFT JOIN maintain on maintain.id = maintain_detail.parent_id |
| | | WHERE maintain.id = ${maintainId} |
| | | inner join maintain_detail md on md.pre_merge_id = t.id |
| | | where md.parent_id = ${maintainId} |
| | | and operate = ${operate} |
| | | and maintain_detail.pre_merge_id = t.id |
| | | ) |
| | | |
| | | </select> |
| | | |
| | | <update id="updateRecordByMaintainId" statementType="STATEMENT" > |
| | |
| | | |
| | | <select id="getOneTempFieldDataByMaintainExtent" statementType="STATEMENT" resultType="java.util.Map"> |
| | | <![CDATA[ |
| | | SELECT DISTINCT ${field} FROM ${tempTableName} t WHERE EXISTS ( |
| | | SELECT pre_merge_id FROM ( SELECT pre_merge_id FROM maintain_detail WHERE EXISTS ( |
| | | SELECT id FROM ( SELECT id FROM `maintain` WHERE |
| | | table_name = ${tableName} |
| | | AND order_no >= ${fromOrderNo} |
| | | AND order_no < ${toOrderNo} |
| | | ) a |
| | | |
| | | SELECT DISTINCT ${field} FROM ${tempTableName} t |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = t.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | |
| | | WHERE |
| | | a.id = maintain_detail.parent_id ) |
| | | ) a |
| | | WHERE t.id = a.pre_merge_id) |
| | | m.table_name = ${tableName} |
| | | AND m.order_no >= ${fromOrderNo} |
| | | AND m.order_no < ${toOrderNo} |
| | | |
| | | ]]> |
| | | </select> |
| | | |
| | | <select id="getTempDataByMaintainExtent" statementType="STATEMENT" resultType="java.util.Map"> |
| | | <![CDATA[ |
| | | SELECT * FROM ${tempTableName} t WHERE EXISTS ( |
| | | SELECT pre_merge_id FROM ( SELECT pre_merge_id FROM maintain_detail WHERE EXISTS ( |
| | | SELECT id FROM ( SELECT id FROM `maintain` WHERE |
| | | table_name = ${tableName} |
| | | AND order_no >= ${fromOrderNo} |
| | | AND order_no < ${toOrderNo} |
| | | ) a |
| | | SELECT t.* FROM ${tempTableName} t |
| | | LEFT JOIN maintain_detail md on md.pre_merge_id = t.id |
| | | LEFT JOIN maintain m on m.id = md.parent_id |
| | | |
| | | WHERE |
| | | a.id = maintain_detail.parent_id ) |
| | | ) a |
| | | WHERE t.id = a.pre_merge_id) |
| | | m.table_name = ${tableName} |
| | | AND m.order_no >= ${fromOrderNo} |
| | | AND m.order_no < ${toOrderNo} |
| | | |
| | | |
| | | ]]> |
| | | </select> |