|  |  |  | 
|---|
|  |  |  | <artifactId>xmlbeans</artifactId> | 
|---|
|  |  |  | <version>5.1.0</version> | 
|---|
|  |  |  | </dependency> | 
|---|
|  |  |  | <dependency> | 
|---|
|  |  |  | <groupId>org.postgresql</groupId> | 
|---|
|  |  |  | <artifactId>postgresql</artifactId> | 
|---|
|  |  |  | <version>42.6.0</version> <!-- è¯·æ ¹æ®éè¦éæ©ææ°ç欠--> | 
|---|
|  |  |  | </dependency> | 
|---|
|  |  |  | </dependencies> | 
|---|
|  |  |  | <build> | 
|---|
|  |  |  | <plugins> | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.ruoyi.web.component; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import afu.org.checkerframework.checker.oigj.qual.O; | 
|---|
|  |  |  | import com.alibaba.fastjson2.JSONObject; | 
|---|
|  |  |  | import com.fasterxml.jackson.databind.ObjectMapper; | 
|---|
|  |  |  | import com.google.gson.Gson; | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.smartor.service.IBaseSmsaccountService; | 
|---|
|  |  |  | import com.smartor.service.IServiceOutPathService; | 
|---|
|  |  |  | import com.smartor.service.IServiceSubtaskRecordService; | 
|---|
|  |  |  | import com.sun.org.apache.bcel.internal.generic.NEW; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.apache.commons.collections4.CollectionUtils; | 
|---|
|  |  |  | import org.apache.commons.lang3.ObjectUtils; | 
|---|
|  |  |  | 
|---|
|  |  |  | import java.util.concurrent.Executors; | 
|---|
|  |  |  | import java.util.concurrent.TimeUnit; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import static cn.hutool.core.convert.Convert.numberToWord; | 
|---|
|  |  |  | import static cn.hutool.core.convert.Convert.toHex; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.ruoyi.web.controller.smartor; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import org.springframework.security.access.prepost.PreAuthorize; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.GetMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.PostMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.PutMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.DeleteMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.PathVariable; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestBody; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  | import com.ruoyi.common.annotation.Log; | 
|---|
|  |  |  | import com.ruoyi.common.core.controller.BaseController; | 
|---|
|  |  |  | import com.ruoyi.common.core.domain.AjaxResult; | 
|---|
|  |  |  | import com.ruoyi.common.enums.BusinessType; | 
|---|
|  |  |  | import com.ruoyi.smartor.domain.SchemeAutofinshrule; | 
|---|
|  |  |  | import com.ruoyi.smartor.service.ISchemeAutofinshruleService; | 
|---|
|  |  |  | import com.ruoyi.common.utils.poi.ExcelUtil; | 
|---|
|  |  |  | import com.ruoyi.common.core.page.TableDataInfo; | 
|---|
|  |  |  | import com.ruoyi.common.enums.BusinessType; | 
|---|
|  |  |  | import com.ruoyi.common.utils.poi.ExcelUtil; | 
|---|
|  |  |  | import com.ruoyi.smartor.domain.SchemeAutofinshrule; | 
|---|
|  |  |  | import com.smartor.service.ISchemeAutofinshruleService; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ¹æ¡ç»æ¡è§åController | 
|---|
|  |  |  | 
|---|
|  |  |  | #        å
¬å¸ | 
|---|
|  |  |  | #        url: jdbc:mysql://192.168.2.9:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | 
|---|
|  |  |  | #        ä¸½æ°´ | 
|---|
|  |  |  | #        url: jdbc:mysql://127.0.0.1:3308/smartor-lisui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | 
|---|
|  |  |  | #        username: smartor | 
|---|
|  |  |  | #        password: Smartor.2023 | 
|---|
|  |  |  | #        driverClassName: com.mysql.cj.jdbc.Driver | 
|---|
|  |  |  | url: jdbc:mysql://127.0.0.1:3308/smartor-lisui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | 
|---|
|  |  |  | username: smartor | 
|---|
|  |  |  | password: Smartor.2023 | 
|---|
|  |  |  | driverClassName: com.mysql.cj.jdbc.Driver | 
|---|
|  |  |  | #        æ²³å | 
|---|
|  |  |  | #        url: jdbc:mysql://127.0.0.1:3308/smartor_hn?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | 
|---|
|  |  |  | #        username: root | 
|---|
|  |  |  | #        password: 123456 | 
|---|
|  |  |  | #        driverClassName: com.mysql.cj.jdbc.Driver | 
|---|
|  |  |  | #        url: jdbc:mysql://127.0.0.1:3308/smartor_hn?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | 
|---|
|  |  |  | #        username: root | 
|---|
|  |  |  | #        password: 123456 | 
|---|
|  |  |  | #        driverClassName: com.mysql.cj.jdbc.Driver | 
|---|
|  |  |  | #        # æ°å | 
|---|
|  |  |  | #        url: jdbc:mysql://192.168.191.181:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | 
|---|
|  |  |  | #        username: smartor | 
|---|
|  |  |  | 
|---|
|  |  |  | #        driverClassName: com.mysql.cj.jdbc.Driver | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #  å
¬å¸äº | 
|---|
|  |  |  | url: jdbc:mysql://116.62.18.175:6002/smartor_lisui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | 
|---|
|  |  |  | username: hxsoft | 
|---|
|  |  |  | password: Hxerp2000 | 
|---|
|  |  |  | driverClassName: com.mysql.cj.jdbc.Driver | 
|---|
|  |  |  | #        url: jdbc:mysql://116.62.18.175:6002/smartor_lisui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 | 
|---|
|  |  |  | #        username: hxsoft | 
|---|
|  |  |  | #        password: Hxerp2000 | 
|---|
|  |  |  | #        driverClassName: com.mysql.cj.jdbc.Driver | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #        # é«æ¯æ°æ®åºé
ç½® | 
|---|
|  |  |  | #        url: jdbc:postgresql://127.0.0.1:5432/smartorlishui | 
|---|
|  |  |  | #        username: gaussdb | 
|---|
|  |  |  | #        password: Ls@123456 | 
|---|
|  |  |  | #        driverClassName: org.postgresql.Driver | 
|---|
|  |  |  |  | 
|---|
|  |  |  | # ä»åºæ°æ®æº | 
|---|
|  |  |  | slave: | 
|---|
|  |  |  | 
|---|
|  |  |  | <!-- <setting name="mapUnderscoreToCamelCase" value="true"/> --> | 
|---|
|  |  |  | </settings> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <plugins> | 
|---|
|  |  |  | <!-- SQLè½¬æ¢æ¦æªå¨ --> | 
|---|
|  |  |  | <plugin interceptor="com.ruoyi.common.mybatis.SqlConverterInterceptor"/> | 
|---|
|  |  |  | </plugins> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </configuration> | 
|---|
| ¶Ô±ÈÐÂÎļþ | 
|  |  |  | 
|---|
|  |  |  | package com.ruoyi.common.mybatis; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.ruoyi.common.utils.SqlConverter; | 
|---|
|  |  |  | import com.ruoyi.common.utils.SpringContextUtils; | 
|---|
|  |  |  | import org.apache.ibatis.executor.statement.StatementHandler; | 
|---|
|  |  |  | import org.apache.ibatis.plugin.*; | 
|---|
|  |  |  | import org.springframework.stereotype.Component; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.sql.Connection; | 
|---|
|  |  |  | import java.util.Properties; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * SQLè½¬æ¢æ¦æªå¨ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Component | 
|---|
|  |  |  | @Intercepts({ | 
|---|
|  |  |  | @Signature(type = StatementHandler.class, method = "prepare", args = {Connection.class, Integer.class}) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | public class SqlConverterInterceptor implements Interceptor { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private SqlConverter sqlConverter; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public Object intercept(Invocation invocation) throws Throwable { | 
|---|
|  |  |  | if (sqlConverter == null) { | 
|---|
|  |  |  | if (SpringContextUtils.getContext() == null) { | 
|---|
|  |  |  | // Spring容å¨è¿æ²¡åå§åï¼ç´æ¥è·³è¿è½¬æ¢ | 
|---|
|  |  |  | return invocation.proceed(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | sqlConverter = SpringContextUtils.getBean(SqlConverter.class); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | StatementHandler statementHandler = (StatementHandler) invocation.getTarget(); | 
|---|
|  |  |  | String sql = statementHandler.getBoundSql().getSql(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // è½¬æ¢SQL | 
|---|
|  |  |  | String convertedSql = sqlConverter.convertSql(sql); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // ä½¿ç¨åå°è®¾ç½®è½¬æ¢åçSQL | 
|---|
|  |  |  | java.lang.reflect.Field field = statementHandler.getBoundSql().getClass().getDeclaredField("sql"); | 
|---|
|  |  |  | field.setAccessible(true); | 
|---|
|  |  |  | field.set(statementHandler.getBoundSql(), convertedSql); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return invocation.proceed(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public Object plugin(Object target) { | 
|---|
|  |  |  | return Plugin.wrap(target, this); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void setProperties(Properties properties) { | 
|---|
|  |  |  | // ä¸éè¦è®¾ç½®å±æ§ | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
| ¶Ô±ÈÐÂÎļþ | 
|  |  |  | 
|---|
|  |  |  | package com.ruoyi.common.utils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import org.springframework.context.ApplicationContext; | 
|---|
|  |  |  | import org.springframework.context.ApplicationContextAware; | 
|---|
|  |  |  | import org.springframework.stereotype.Component; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Component | 
|---|
|  |  |  | public class SpringContextUtils implements ApplicationContextAware { | 
|---|
|  |  |  | private static ApplicationContext context; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void setApplicationContext(ApplicationContext applicationContext) { | 
|---|
|  |  |  | context = applicationContext; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static <T> T getBean(Class<T> clazz) { | 
|---|
|  |  |  | return context.getBean(clazz); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static ApplicationContext getContext() { | 
|---|
|  |  |  | return context; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
| ¶Ô±ÈÐÂÎļþ | 
|  |  |  | 
|---|
|  |  |  | package com.ruoyi.common.utils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Value; | 
|---|
|  |  |  | import org.springframework.stereotype.Component; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * SQLè¯æ³è½¬æ¢å·¥å
·ç±» | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Component | 
|---|
|  |  |  | public class SqlConverter { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Value("${spring.datasource.druid.master.driverClassName}") | 
|---|
|  |  |  | private String driverClassName; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * è½¬æ¢SQLè¯æ³ | 
|---|
|  |  |  | * @param sql åå§SQL | 
|---|
|  |  |  | * @return è½¬æ¢åçSQL | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public String convertSql(String sql) { | 
|---|
|  |  |  | // å¤ææ¯å¦æ¯é«æ¯æ°æ®åº | 
|---|
|  |  |  | if (isGaussDB()) { | 
|---|
|  |  |  | return convertToGaussSql(sql); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return sql; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * å¤ææ¯å¦æ¯é«æ¯æ°æ®åº | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private boolean isGaussDB() { | 
|---|
|  |  |  | return driverClassName.contains("postgresql"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * å°MySQLè¯æ³è½¬æ¢ä¸ºé«æ¯æ°æ®åºè¯æ³ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String convertToGaussSql(String sql) { | 
|---|
|  |  |  | if (sql == null || sql.trim().isEmpty()) { | 
|---|
|  |  |  | return sql; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // è½¬æ¢LIMITè¯æ³ | 
|---|
|  |  |  | sql = sql.replaceAll("LIMIT\\s+(\\d+)\\s*,\\s*(\\d+)", "LIMIT $2 OFFSET $1"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // è½¬æ¢æ¥æå½æ° | 
|---|
|  |  |  | sql = sql.replaceAll("DATE_FORMAT\\(([^,]+),\\s*'%Y-%m-%d'\\)", "TO_CHAR($1, 'YYYY-MM-DD')"); | 
|---|
|  |  |  | sql = sql.replaceAll("DATE_FORMAT\\(([^,]+),\\s*'%Y-%m-%d %H:%i:%s'\\)", "TO_CHAR($1, 'YYYY-MM-DD HH24:MI:SS')"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // è½¬æ¢åç¬¦ä¸²è¿æ¥ | 
|---|
|  |  |  | sql = sql.replaceAll("CONCAT\\(([^)]+)\\)", "CONCAT_WS('', $1)"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // è½¬æ¢IFNULL彿°ï¼å¿½ç¥å¤§å°åï¼ | 
|---|
|  |  |  | sql = sql.replaceAll("(?i)ifnull\\(([^,]+),\\s*([^)]+)\\)", "coalesce($1, $2)"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // è½¬æ¢NOW()彿° | 
|---|
|  |  |  | sql = sql.replaceAll("NOW\\(\\)", "CURRENT_TIMESTAMP"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // æ¿æ¢ sysdate() ä¸º CURRENT_TIMESTAMP | 
|---|
|  |  |  | sql = sql.replaceAll("sysdate\\(\\)", "CURRENT_TIMESTAMP"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // å»é¤ææåå¼å· | 
|---|
|  |  |  | sql = sql.replaceAll("`", ""); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // è½¬æ¢GROUP_CONCAT_WS为string_aggï¼å¿½ç¥å¤§å°åï¼ | 
|---|
|  |  |  | sql = sql.replaceAll("(?i)group_concat_ws\\s*\\(([^,]+),\\s*([^)]+)\\)", "string_agg($2, $1)"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return sql; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.ruoyi.framework.config; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.io.IOException; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.Arrays; | 
|---|
|  |  |  | import java.util.HashSet; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import javax.sql.DataSource; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.ruoyi.framework.interceptor.HospitalFilterInterceptor; | 
|---|
|  |  |  | import com.ruoyi.common.utils.StringUtils; | 
|---|
|  |  |  | import org.apache.ibatis.io.VFS; | 
|---|
|  |  |  | import org.apache.ibatis.plugin.Interceptor; | 
|---|
|  |  |  | import org.apache.ibatis.session.SqlSessionFactory; | 
|---|
|  |  |  | import org.mybatis.spring.SqlSessionFactoryBean; | 
|---|
|  |  |  | import org.mybatis.spring.boot.autoconfigure.ConfigurationCustomizer; | 
|---|
|  |  |  | import org.mybatis.spring.boot.autoconfigure.SpringBootVFS; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.context.annotation.Bean; | 
|---|
|  |  |  | 
|---|
|  |  |  | import org.springframework.core.type.classreading.MetadataReader; | 
|---|
|  |  |  | import org.springframework.core.type.classreading.MetadataReaderFactory; | 
|---|
|  |  |  | import org.springframework.util.ClassUtils; | 
|---|
|  |  |  | import com.ruoyi.common.utils.StringUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.sql.DataSource; | 
|---|
|  |  |  | import java.io.IOException; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.Arrays; | 
|---|
|  |  |  | import java.util.HashSet; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * Mybatisæ¯æ*å¹é
æ«æå | 
|---|
|  |  |  | 
|---|
|  |  |  | orgid = loginUser.getUser().getOrgid(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | //            e.printStackTrace(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (StringUtils.isEmpty(orgid)) { | 
|---|
|  |  |  | return invocation.proceed(); | 
|---|
|  |  |  | 
|---|
|  |  |  | * @return ä¿®æ¹åç SQL | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private String modifySqlWithorgidId(String originalSql, String orgid) { | 
|---|
|  |  |  | if (originalSql.contains("insert into") || originalSql.contains("INSERT INTO") || originalSql.contains("from sys_menu") || originalSql.contains("update sys_menu") || originalSql.contains("information_schema.tables") || originalSql.contains("information_schema.columns") || originalSql.contains("gen_table") || originalSql.toUpperCase().contains("ORGID IS NULL")) { | 
|---|
|  |  |  | if (originalSql.contains("insert into") || originalSql.contains("INSERT INTO") || originalSql.contains("from sys_menu")  || originalSql.contains("sys_job") || originalSql.contains("update sys_menu") || originalSql.contains("information_schema.tables") || originalSql.contains("information_schema.columns") || originalSql.contains("gen_table") || originalSql.toUpperCase().contains("ORGID IS NULL")) { | 
|---|
|  |  |  | return originalSql; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // æå orgid ç WHERE åå¥ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * é¿æä»»å¡æ§è¡ï¼çµè¯ï¼ | 
|---|
|  |  |  | * é¿æä»»å¡æ§è¡ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public void longTaskSend() { | 
|---|
|  |  |  | //è·åä»»å¡ä¿¡æ¯ | 
|---|
|  |  |  | 
|---|
|  |  |  | serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if (descByCode.equals("çä¿¡")) { | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else if (descByCode.equals("çä¿¡")) { | 
|---|
|  |  |  | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); | 
|---|
|  |  |  | String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key); | 
|---|
|  |  |  | for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if (descByCode.equals("å
¬ä¼å·")) { | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else if (descByCode.equals("å
¬ä¼å·")) { | 
|---|
|  |  |  | log.error("å
¬ä¼å·è¿æ¥äºåï¼{}", descByCode); | 
|---|
|  |  |  | //å
¬ä¼å· | 
|---|
|  |  |  | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Excel(name = "ç»å½å°å") | 
|---|
|  |  |  | private String ipaddr; | 
|---|
|  |  |  | private String guid; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * ç»å½å°ç¹ | 
|---|
|  |  |  | 
|---|
|  |  |  | </resultMap> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <insert id="insertLogininfor" parameterType="SysLogininfor"> | 
|---|
|  |  |  | insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time,guid,orgid) | 
|---|
|  |  |  | values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate(),guid,orgid) | 
|---|
|  |  |  | insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) | 
|---|
|  |  |  | values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate()) | 
|---|
|  |  |  | </insert> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult"> | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.ruoyi.smartor.mapper; | 
|---|
|  |  |  | package com.smartor.mapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import com.ruoyi.smartor.domain.SchemeAutofinshrule; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ¹æ¡ç»æ¡è§åMapperæ¥å£ | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @author smartor | 
|---|
|  |  |  | * @date 2023-03-04 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public interface SchemeAutofinshruleMapper | 
|---|
|  |  |  | public interface SchemeAutofinshruleMapper | 
|---|
|  |  |  | { | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ¥è¯¢æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param id æ¹æ¡ç»æ¡è§åä¸»é® | 
|---|
|  |  |  | * @return æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ¥è¯¢æ¹æ¡ç»æ¡è§åå表 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * @return æ¹æ¡ç»æ¡è§åéå | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ°å¢æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * @return ç»æ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * ä¿®æ¹æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * @return ç»æ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * å é¤æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param id æ¹æ¡ç»æ¡è§åä¸»é® | 
|---|
|  |  |  | * @return ç»æ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ¹éå é¤æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå | 
|---|
|  |  |  | * @return ç»æ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.ruoyi.smartor.service; | 
|---|
|  |  |  | package com.smartor.service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import com.ruoyi.smartor.domain.SchemeAutofinshrule; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ¹æ¡ç»æ¡è§åServiceæ¥å£ | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @author smartor | 
|---|
|  |  |  | * @date 2023-03-04 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public interface ISchemeAutofinshruleService | 
|---|
|  |  |  | public interface ISchemeAutofinshruleService | 
|---|
|  |  |  | { | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ¥è¯¢æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param id æ¹æ¡ç»æ¡è§åä¸»é® | 
|---|
|  |  |  | * @return æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ¥è¯¢æ¹æ¡ç»æ¡è§åå表 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * @return æ¹æ¡ç»æ¡è§åéå | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ°å¢æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * @return ç»æ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * ä¿®æ¹æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * @return ç»æ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ¹éå é¤æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param ids éè¦å é¤çæ¹æ¡ç»æ¡è§å主é®éå | 
|---|
|  |  |  | * @return ç»æ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * å é¤æ¹æ¡ç»æ¡è§åä¿¡æ¯ | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param id æ¹æ¡ç»æ¡è§åä¸»é® | 
|---|
|  |  |  | * @return ç»æ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | package com.ruoyi.smartor.service.impl; | 
|---|
|  |  |  | package com.smartor.service.impl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import com.ruoyi.common.utils.DateUtils; | 
|---|
|  |  |  | import com.ruoyi.smartor.domain.SchemeAutofinshrule; | 
|---|
|  |  |  | import com.smartor.service.ISchemeAutofinshruleService; | 
|---|
|  |  |  | import com.smartor.mapper.SchemeAutofinshruleMapper; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | import com.ruoyi.smartor.mapper.SchemeAutofinshruleMapper; | 
|---|
|  |  |  | import com.ruoyi.smartor.domain.SchemeAutofinshrule; | 
|---|
|  |  |  | import com.ruoyi.smartor.service.ISchemeAutofinshruleService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ¹æ¡ç»æ¡è§åServiceä¸å¡å±å¤ç | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @author smartor | 
|---|
|  |  |  | * @date 2023-03-04 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Service | 
|---|
|  |  |  | public class SchemeAutofinshruleServiceImpl implements ISchemeAutofinshruleService | 
|---|
|  |  |  | public class SchemeAutofinshruleServiceImpl implements ISchemeAutofinshruleService | 
|---|
|  |  |  | { | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private SchemeAutofinshruleMapper schemeAutofinshruleMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ¥è¯¢æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param id æ¹æ¡ç»æ¡è§åä¸»é® | 
|---|
|  |  |  | * @return æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ¥è¯¢æ¹æ¡ç»æ¡è§åå表 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * @return æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ°å¢æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * @return ç»æ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * ä¿®æ¹æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param schemeAutofinshrule æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * @return ç»æ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * æ¹éå é¤æ¹æ¡ç»æ¡è§å | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param ids éè¦å é¤çæ¹æ¡ç»æ¡è§åä¸»é® | 
|---|
|  |  |  | * @return ç»æ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * å é¤æ¹æ¡ç»æ¡è§åä¿¡æ¯ | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param id æ¹æ¡ç»æ¡è§åä¸»é® | 
|---|
|  |  |  | * @return ç»æ | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | tid = Long.valueOf(serviceSubTaskCacheReq.getParam1()); | 
|---|
|  |  |  | pid = Long.valueOf(serviceSubTaskCacheReq.getParam2()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (serviceSubTaskCacheReq.getType() != null && serviceSubTaskCacheReq.getType() == 2) { | 
|---|
|  |  |  | if (CollectionUtils.isNotEmpty(serviceSubTaskCacheReq.getSvyLibTemplateScriptVOS()) &&  serviceSubTaskCacheReq.getSvyLibTemplateScriptVOS().size() > 0) { | 
|---|
|  |  |  | //é®å· | 
|---|
|  |  |  | redisCache.deleteObject(pid + "-" + tid + "-WJscriptCache"); | 
|---|
|  |  |  | redisCache.setCacheListRight(pid + "-" + tid + "-WJscriptCache", serviceSubTaskCacheReq.getSvyLibTemplateScriptVOS()); | 
|---|
|  |  |  | 
|---|
|  |  |  | Long tims = Long.valueOf(3 * 24 * 3600); | 
|---|
|  |  |  | boolean expire = redisCache.expire(pid + "-" + tid + "-WJscriptCache", tims); | 
|---|
|  |  |  | return 1; | 
|---|
|  |  |  | } else if (serviceSubTaskCacheReq.getType() != null && serviceSubTaskCacheReq.getType() == 1) { | 
|---|
|  |  |  | } else if (CollectionUtils.isNotEmpty(serviceSubTaskCacheReq.getIvrLibaTemplateScriptVOList()) && serviceSubTaskCacheReq.getIvrLibaTemplateScriptVOList().size() > 0) { | 
|---|
|  |  |  | //é®å· | 
|---|
|  |  |  | redisCache.deleteObject(pid + "-" + tid + "-SFscriptCache"); | 
|---|
|  |  |  | redisCache.setCacheListRight(pid + "-" + tid + "-SFscriptCache", serviceSubTaskCacheReq.getIvrLibaTemplateScriptVOList()); | 
|---|
|  |  |  | 
|---|
|  |  |  | return serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public List<ServiceSubtask> selectServiceSubtaskListAgain(ServiceSubtaskVO serviceSubtaskVO){ | 
|---|
|  |  |  | public List<ServiceSubtask> selectServiceSubtaskListAgain(ServiceSubtaskVO serviceSubtaskVO) { | 
|---|
|  |  |  | return serviceSubtaskMapper.selectServiceSubtaskListAgain(serviceSubtaskVO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | serviceSubtask1.setIsVisitAgain(2); | 
|---|
|  |  |  | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1); | 
|---|
|  |  |  | return "æ é忬¡é访ï¼ä»»å¡è¢«æ è®°ä¸å¨æ§è¡"; | 
|---|
|  |  |  | } else if (patArchive.getNotrequiredFlag().equals("1")) { | 
|---|
|  |  |  | } else if (StringUtils.isNotEmpty(patArchive.getNotrequiredFlag()) && patArchive.getNotrequiredFlag().equals("1")) { | 
|---|
|  |  |  | serviceSubtask1.setIsVisitAgain(2); | 
|---|
|  |  |  | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1); | 
|---|
|  |  |  | return "æ é忬¡éè®¿ï¼æ£è
被æ è®°ä¸éè¦è¢«æå¡"; | 
|---|
|  |  |  | 
|---|
|  |  |  | <!DOCTYPE mapper | 
|---|
|  |  |  | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | 
|---|
|  |  |  | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 
|---|
|  |  |  | <mapper namespace="com.ruoyi.smartor.mapper.SchemeAutofinshruleMapper"> | 
|---|
|  |  |  | <mapper namespace="com.smartor.mapper.SchemeAutofinshruleMapper"> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <resultMap type="SchemeAutofinshrule" id="SchemeAutofinshruleResult"> | 
|---|
|  |  |  | <result property="id" column="id"/> | 
|---|