瀏覽代碼

feature 代码提交

xiahan 8 月之前
父節點
當前提交
4f8e886964

+ 3 - 16
jxkh-common/pom.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://maven.apache.org/POM/4.0.0"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <artifactId>JXKH</artifactId>
@@ -18,7 +18,7 @@
     <dependencies>
         <dependency>
             <groupId>com.rongwei</groupId>
-            <artifactId>business-entity</artifactId>
+            <artifactId>jxkh-entity</artifactId>
             <version>1.0-SNAPSHOT</version>
         </dependency>
 
@@ -27,18 +27,5 @@
             <artifactId>mybatis-plus-generator</artifactId>
             <version>3.1.2</version>
         </dependency>
-
-        <dependency>
-            <groupId>org.apache.velocity</groupId>
-            <artifactId>velocity-engine-core</artifactId>
-            <version>2.2</version>
-        </dependency>
-
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>${mysql.version}</version>
-        </dependency>
-
     </dependencies>
 </project>

+ 167 - 0
jxkh-common/src/main/java/com/rongwei/bscommon/sys/utils/AttendanceAssessmentSdk.java

@@ -0,0 +1,167 @@
+package com.rongwei.bscommon.sys.utils;
+
+import cn.hutool.http.ContentType;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.json.JSONConfig;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.rongwei.bsentity.dto.ApiCallDto;
+import com.rongwei.bsentity.dto.ApiReturnDto;
+import com.rongwei.commonservice.service.ApiLogService;
+import com.rongwei.commonservice.service.RedisService;
+import com.rongwei.commonservice.service.SysConfigService;
+import com.rongwei.rwcommon.base.exception.CustomException;
+import com.rongwei.rwcommon.utils.Constants;
+import com.rongwei.rwcommon.utils.SecurityUtil;
+import com.rongwei.rwcommon.utils.StringUtils;
+import com.rongwei.rwcommonentity.commonservers.domain.ApiLogDo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 考勤考核系统对接SDK
+ */
+@Component
+public class AttendanceAssessmentSdk {
+
+
+    public static final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+    public static final String REDIS_KEY_NAME = "attendance_assessment_token";
+    public static final int TOKEN_EXPIRED_SECONDS = 1700;
+    private static final Logger logger = LoggerFactory.getLogger(AttendanceAssessmentSdk.class);
+    // 客户端ID
+    private String appId;
+    // 客户端密钥
+    private String secret;
+    // 固定值
+    private String orgCode;
+    // 服务地址
+    private String clientIp;
+    // token的虚拟目录
+    private String tokenVirtualDirectory;
+    private Map<String, String> businessDataMap = new HashMap<>(2);
+    // api路由
+    private Map<String, String> apiVirtualDirectoryMap = null;
+    @Autowired
+    private SysConfigService sysConfigService;
+    @Autowired
+    private ApiLogService apiLogService;
+    @Autowired
+    private RedisService redisService;
+
+    /**
+     * 黑名单系统对接配置初始化
+     *
+     * @author chen
+     */
+    public void init() {
+        String configContent = sysConfigService.getContentByConfigCode("sdk_config");
+        JSONObject apiReturnJson = JSONUtil.parseObj(configContent);
+        // 黑名单系统IP
+        this.appId = apiReturnJson.getStr("app_id");
+        this.secret = apiReturnJson.getStr("secret");
+        this.orgCode = apiReturnJson.getStr("client_secret");
+        this.clientIp = apiReturnJson.getStr("ip");
+        // 获取tokenIp
+        this.tokenVirtualDirectory = apiReturnJson.getStr("virtual_directory");
+        this.businessDataMap.put("APPID", this.appId);
+        this.businessDataMap.put("SECRET", this.secret);
+        this.apiVirtualDirectoryMap = JSONUtil.toBean(apiReturnJson.getJSONObject("api_virtual_directory"), Map.class);
+        System.out.println("黑名单系统对接配置初始化完毕");
+    }
+
+    public ApiReturnDto apiCall(ApiCallDto paramVo) {
+        logger.info("接口调用开始:", paramVo.getApiCode());
+        // 请求地址
+        String url = this.clientIp + this.apiVirtualDirectoryMap.get(paramVo.getApiCode());
+        logger.info("api地址:{}", url);
+        JSONConfig config = new JSONConfig();
+        config.setIgnoreNullValue(false);
+        String jsonStr = JSONUtil.toJsonStr(paramVo.getData(), config);
+        logger.info("入参:{}", jsonStr);
+        String apiResult = HttpRequest.post(url).headerMap(setHeadMap(), true).body(jsonStr).execute().body();
+        logger.info("接口返回报文:{}", apiResult);
+        ApiReturnDto apiReturnDto = JSONUtil.toBean(apiResult, ApiReturnDto.class);
+        // 接口调用结束后续逻辑处理
+        Thread td = new Thread(() -> afterAll(paramVo, jsonStr, apiResult));
+        td.start();
+        return apiReturnDto;
+    }
+
+    private String getToken() {
+        logger.info("获取token开始");
+        if (redisService.hasKey(REDIS_KEY_NAME)) {
+            logger.info("token已存在");
+            return redisService.getRedisCatchObj(REDIS_KEY_NAME).toString();
+        }
+        String url = this.clientIp + this.tokenVirtualDirectory;
+        /**********************组装请求参数**************************************/
+        Map<String, Map<String, String>> postData = new HashMap<>(2);
+        postData.put("STANDARD_DATA", getRequestData());
+        postData.put("BUSINESS_DATA", this.businessDataMap);
+
+        logger.info("请求url: {}", url);
+        String body = HttpRequest.post(url).body(postData.toString()).execute().body();
+        logger.info("接口返回: {}", body);
+        if (StringUtils.isEmptyStr(body)) {
+            throw new CustomException("请求token失败");
+        }
+        ApiReturnDto response = JSONUtil.toBean(body, ApiReturnDto.class);
+        String token = response.getToken();
+        // 将 token 放入redis;
+        redisService.redisCatchInit(REDIS_KEY_NAME, token, TOKEN_EXPIRED_SECONDS);
+        logger.info("获取token接口返回的信息: {}", response);
+        return token;
+    }
+
+    /**
+     * 自定义header
+     *
+     * @return
+     */
+    private Map<String, String> setHeadMap() {
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Content-Type", ContentType.JSON.getValue());
+        headers.put("jsonContent-Type", ContentType.JSON.getValue());
+        headers.put("Authorization", getToken());
+        return headers;
+    }
+
+    /**
+     * 接口调用结束后续逻辑处理
+     */
+    private void afterAll(ApiCallDto paramVo, String jsonStr, String apiResult) {
+        // 返回数据
+        JSONObject apiReturnJson = JSONUtil.parseObj(apiResult);
+        // 接口日志保存
+        ApiLogDo apiLogDo = new ApiLogDo();
+        apiLogDo.setId(SecurityUtil.getUUID());
+        apiLogDo.setApiip(this.clientIp);
+        apiLogDo.setApisyscode("blackDataQuery");
+        apiLogDo.setApicode(paramVo.getApiCode());
+        apiLogDo.setApiroute(this.apiVirtualDirectoryMap.get("blackApiUrl"));
+        apiLogDo.setCalltype(Constants.APILOG_CALLTYPE_OUT);
+        apiLogDo.setApisenddata(jsonStr);
+        apiLogDo.setApireturndata(apiReturnJson.toJSONString(0));
+        apiLogService.save(apiLogDo);
+    }
+
+    private String getRequestTime() {
+        return sdf.format(new Date());
+    }
+
+    private Map<String, String> getRequestData() {
+        Map<String, String> standardDataMap = new HashMap<>(3);
+        standardDataMap.put("ZINSTID", SecurityUtil.getUUID());
+        standardDataMap.put("ZZREQTIME", getRequestTime());
+        standardDataMap.put("ORGCODE", this.orgCode);
+        return standardDataMap;
+    }
+}

+ 0 - 158
jxkh-common/src/main/java/com/rongwei/bscommon/sys/utils/CodeGeneration.java

@@ -1,158 +0,0 @@
-package com.rongwei.bscommon.sys.utils;
-
-import com.baomidou.mybatisplus.annotation.DbType;
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.core.toolkit.StringPool;
-import com.baomidou.mybatisplus.generator.AutoGenerator;
-import com.baomidou.mybatisplus.generator.InjectionConfig;
-import com.baomidou.mybatisplus.generator.config.*;
-import com.baomidou.mybatisplus.generator.config.po.TableFill;
-import com.baomidou.mybatisplus.generator.config.po.TableInfo;
-import com.baomidou.mybatisplus.generator.config.rules.DateType;
-import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
-import com.rongwei.rwcommon.base.BaseDo;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author admin
- */
-public class CodeGeneration {
-
-    //main函数
-    public static void main(String[] args) {
-
-        AutoGenerator autoGenerator = new AutoGenerator();
-        // 项目路径
-        String projectPath = System.getProperty("user.dir");
-
-        //全局配置
-        GlobalConfig gc = new GlobalConfig();
-        //生成文件输出根目录
-        gc.setOutputDir("E:\\temp");
-        //生成完成后不弹出文件框
-        gc.setOpen(false);
-        gc.setFileOverride(true);  //文件覆盖
-        gc.setActiveRecord(false);// 不需要ActiveRecord特性的请改为false
-        gc.setEnableCache(false);// XML 二级缓存
-        gc.setBaseResultMap(true);// XML ResultMap
-        gc.setBaseColumnList(false);// XML columList
-        gc.setAuthor("fpy");// 作者
-        gc.setDateType(DateType.ONLY_DATE);
-
-        // 自定义文件命名,注意 %s 会自动填充表实体属性!
-        gc.setControllerName("%sController");
-        gc.setServiceName("%sService");
-        gc.setServiceImplName("%sServiceImpl");
-        gc.setMapperName("%sDao");
-        gc.setXmlName("%sDao");
-        autoGenerator.setGlobalConfig(gc);
-
-        // 数据源配置
-        DataSourceConfig dsc = new DataSourceConfig();
-        dsc.setDbType(DbType.MYSQL);   //设置数据库类型,我是postgresql
-        dsc.setDriverName("com.mysql.cj.jdbc.Driver");
-        dsc.setUsername("root");
-        dsc.setPassword("rootfpy");
-        dsc.setUrl("jdbc:mysql://localhost:3306/incontrol?characterEncoding=utf8&failOverReadOnly=false&autoReconnect=true&roundRobinLoadBalance=true&serverTimezone=GMT%2B8&useSSL=false&allowMultiQueries=true&databaseTerm=SCHEMA");  //指定数据库
-        autoGenerator.setDataSource(dsc);
-
-        // 3、包的配置
-        PackageConfig pc = new PackageConfig();
-        // pc.setModuleName("blog"); // 生成到指定模块中
-        pc.setParent("com.rongwei");
-        pc.setEntity("bsentity.domain");
-        pc.setMapper("bscommon.sys.dao");
-        pc.setService("bscommon.sys.service");
-        pc.setServiceImpl("bscommon.sys.service.impl");
-        pc.setController("bsserver.controller");
-        autoGenerator.setPackageInfo(pc);
-
-        // 自定义模板
-        TemplateConfig templateConfig = new TemplateConfig();
-        templateConfig.setController("/gentemplates/controller.java.vm");
-        templateConfig.setEntity("/gentemplates/entity.java.vm");
-        templateConfig.setMapper("/gentemplates/mapper.java.vm");
-        templateConfig.setService("/gentemplates/service.java.vm");
-        templateConfig.setServiceImpl("/gentemplates/serviceImpl.java.vm");
-        autoGenerator.setTemplate(templateConfig);
-
-        // 4、策略配置
-        StrategyConfig strategy = new StrategyConfig();
-        strategy.setSuperEntityClass(BaseDo.class);
-        strategy.setRestControllerStyle(true);
-        // 设置要映射的表名(重要,需要修改的地方)
-        strategy.setInclude("srm_balance");
-        strategy.setNaming(NamingStrategy.underline_to_camel); // 自动转换表名的驼峰命名法
-        strategy.setColumnNaming(NamingStrategy.no_change); // 自动转换列名的驼峰命名法
-        strategy.setEntityLombokModel(true); // 是否使用lombox
-        strategy.setLogicDeleteFieldName("deleted"); // 配置逻辑删除字段
-        // 自动填充策略
-        TableFill gmtCreate =  new TableFill("create", FieldFill.INSERT);
-        TableFill gmtModified =  new TableFill("updated", FieldFill.INSERT);
-        ArrayList<TableFill> tableFills = new ArrayList<>();
-        tableFills.add(gmtCreate);
-        tableFills.add(gmtModified);
-//        strategy.setTableFillList(tableFills);
-        // 乐观锁
-        strategy.setVersionFieldName("version");
-
-        autoGenerator.setStrategy(strategy);
-
-        // 自定义配置
-        InjectionConfig cfg = new InjectionConfig() {
-            @Override
-            public void initMap() {
-                // to do nothing
-            }
-        };
-        //自定义输出配置
-        List<FileOutConfig> focList = new ArrayList<>();
-        String controllerParentPath = projectPath + "\\business-server\\src\\main\\java\\com\\rongwei\\bsserver\\controller\\";
-        String entityParentPath = projectPath + "\\business-entity\\src\\main\\java\\com\\rongwei\\bsentity\\domain\\";
-        String commonPath = projectPath + "\\business-common\\src\\main\\java\\com\\rongwei\\bscommon\\sys\\";
-        // 自定义配置会被优先输出
-        focList.add(new FileOutConfig("/gentemplates/controller.java.vm") {
-            @Override
-            public String outputFile(TableInfo tableInfo) {
-                // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
-                return controllerParentPath + tableInfo.getEntityName() + "Controller" + StringPool.DOT_JAVA;
-            }
-        });
-        focList.add(new FileOutConfig("/gentemplates/entity.java.vm") {
-            @Override
-            public String outputFile(TableInfo tableInfo) {
-                // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
-                return entityParentPath + tableInfo.getEntityName() + "Do" + StringPool.DOT_JAVA;
-            }
-        });
-        focList.add(new FileOutConfig("/gentemplates/mapper.java.vm") {
-            @Override
-            public String outputFile(TableInfo tableInfo) {
-                // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
-                return commonPath + "dao\\" + tableInfo.getEntityName() + "Dao" + StringPool.DOT_JAVA;
-            }
-        });
-        focList.add(new FileOutConfig("/gentemplates/service.java.vm") {
-            @Override
-            public String outputFile(TableInfo tableInfo) {
-                // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
-                return commonPath + "service\\" + tableInfo.getEntityName() + "Service" + StringPool.DOT_JAVA;
-            }
-        });
-        focList.add(new FileOutConfig("/gentemplates/serviceImpl.java.vm") {
-            @Override
-            public String outputFile(TableInfo tableInfo) {
-                // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
-                return commonPath + "service\\impl\\" + tableInfo.getEntityName() + "ServiceImpl" + StringPool.DOT_JAVA;
-            }
-        });
-        cfg.setFileOutConfigList(focList);
-
-        autoGenerator.setCfg(cfg);
-
-        autoGenerator.execute(); // 执行
-    }
-
-}

+ 0 - 39
jxkh-common/src/main/resources/gentemplates/controller.java.ftl

@@ -1,39 +0,0 @@
-package ${package.Controller};
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-<#if restControllerStyle>
-import org.springframework.web.bind.annotation.RestController;
-<#else>
-import org.springframework.stereotype.Controller;
-</#if>
-<#if superControllerClassPackage??>
-import ${superControllerClassPackage};
-</#if>
-
-/**
- * <p>
- * ${table.comment!} 前端控制器
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-<#if restControllerStyle>
-@RestController
-<#else>
-@Controller
-</#if>
-@RequestMapping("<#if package.ModuleName??>/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
-<#if kotlin>
-class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
-<#else>
-<#if superControllerClass??>
-public class ${table.controllerName} extends ${superControllerClass} {
-<#else>
-public class ${table.controllerName} {
-</#if>
-
-}
-</#if>

+ 0 - 40
jxkh-common/src/main/resources/gentemplates/controller.java.vm

@@ -1,40 +0,0 @@
-package ${package.Controller};
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-#if(${restControllerStyle})
-import org.springframework.web.bind.annotation.RestController;
-#else
-import org.springframework.stereotype.Controller;
-#end
-#if(${superControllerClassPackage})
-import ${superControllerClassPackage};
-#end
-
-/**
- * <p>
- * $!{table.comment} 前端控制器
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-#if(${restControllerStyle})
-@RestController
-#else
-@Controller
-#end
-@RequestMapping("#if(${package.ModuleName})/${package.ModuleName}#end/#if(${controllerMappingHyphenStyle})${controllerMappingHyphen}#else${table.entityPath}#end")
-#if(${kotlin})
-class ${table.controllerName}#if(${superControllerClass}) : ${superControllerClass}()#end
-
-#else
-#if(${superControllerClass})
-public class ${table.controllerName} extends ${superControllerClass} {
-#else
-public class ${table.controllerName} {
-#end
-
-}
-
-#end

+ 0 - 152
jxkh-common/src/main/resources/gentemplates/entity.java.ftl

@@ -1,152 +0,0 @@
-package ${package.Entity};
-
-<#list table.importPackages as pkg>
-import ${pkg};
-</#list>
-<#if swagger2>
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-</#if>
-<#if entityLombokModel>
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-</#if>
-
-/**
- * <p>
- * ${table.comment!}
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-<#if entityLombokModel>
-@Data
-    <#if superEntityClass??>
-@EqualsAndHashCode(callSuper = true)
-    <#else>
-@EqualsAndHashCode(callSuper = false)
-    </#if>
-@Accessors(chain = true)
-</#if>
-<#if table.convert>
-@TableName("${table.name}")
-</#if>
-<#if swagger2>
-@ApiModel(value="${entity}对象", description="${table.comment!}")
-</#if>
-<#if superEntityClass??>
-public class ${entity} extends ${superEntityClass}<#if activeRecord><${entity}></#if> {
-<#elseif activeRecord>
-public class ${entity} extends Model<${entity}> {
-<#else>
-public class ${entity} implements Serializable {
-</#if>
-
-<#if entitySerialVersionUID>
-    private static final long serialVersionUID = 1L;
-</#if>
-<#-- ----------  BEGIN 字段循环遍历  ---------->
-<#list table.fields as field>
-    <#if field.keyFlag>
-        <#assign keyPropertyName="${field.propertyName}"/>
-    </#if>
-
-    <#if field.comment!?length gt 0>
-        <#if swagger2>
-    @ApiModelProperty(value = "${field.comment}")
-        <#else>
-    /**
-     * ${field.comment}
-     */
-        </#if>
-    </#if>
-    <#if field.keyFlag>
-        <#-- 主键 -->
-        <#if field.keyIdentityFlag>
-    @TableId(value = "${field.name}", type = IdType.AUTO)
-        <#elseif idType??>
-    @TableId(value = "${field.name}", type = IdType.${idType})
-        <#elseif field.convert>
-    @TableId("${field.name}")
-        </#if>
-        <#-- 普通字段 -->
-    <#elseif field.fill??>
-    <#-- -----   存在字段填充设置   ----->
-        <#if field.convert>
-    @TableField(value = "${field.name}", fill = FieldFill.${field.fill})
-        <#else>
-    @TableField(fill = FieldFill.${field.fill})
-        </#if>
-    <#elseif field.convert>
-    @TableField("${field.name}")
-    </#if>
-    <#-- 乐观锁注解 -->
-    <#if (versionFieldName!"") == field.name>
-    @Version
-    </#if>
-    <#-- 逻辑删除注解 -->
-    <#if (logicDeleteFieldName!"") == field.name>
-    @TableLogic
-    </#if>
-    private ${field.propertyType} ${field.propertyName};
-</#list>
-<#------------  END 字段循环遍历  ---------->
-
-<#if !entityLombokModel>
-    <#list table.fields as field>
-        <#if field.propertyType == "boolean">
-            <#assign getprefix="is"/>
-        <#else>
-            <#assign getprefix="get"/>
-        </#if>
-    public ${field.propertyType} ${getprefix}${field.capitalName}() {
-        return ${field.propertyName};
-    }
-
-    <#if entityBuilderModel>
-    public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
-    <#else>
-    public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
-    </#if>
-        this.${field.propertyName} = ${field.propertyName};
-        <#if entityBuilderModel>
-        return this;
-        </#if>
-    }
-    </#list>
-</#if>
-
-<#if entityColumnConstant>
-    <#list table.fields as field>
-    public static final String ${field.name?upper_case} = "${field.name}";
-
-    </#list>
-</#if>
-<#if activeRecord>
-    @Override
-    protected Serializable pkVal() {
-    <#if keyPropertyName??>
-        return this.${keyPropertyName};
-    <#else>
-        return null;
-    </#if>
-    }
-
-</#if>
-<#if !entityLombokModel>
-    @Override
-    public String toString() {
-        return "${entity}{" +
-    <#list table.fields as field>
-        <#if field_index==0>
-            "${field.propertyName}=" + ${field.propertyName} +
-        <#else>
-            ", ${field.propertyName}=" + ${field.propertyName} +
-        </#if>
-    </#list>
-        "}";
-    }
-</#if>
-}

+ 0 - 156
jxkh-common/src/main/resources/gentemplates/entity.java.vm

@@ -1,156 +0,0 @@
-package ${package.Entity};
-
-#foreach($pkg in ${table.importPackages})
-import ${pkg};
-#end
-#if(${swagger2})
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-#end
-#if(${entityLombokModel})
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-#end
-
-/**
- * <p>
- * $!{table.comment}
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-#if(${entityLombokModel})
-@Data
-#if(${superEntityClass})
-@EqualsAndHashCode(callSuper = true)
-#else
-@EqualsAndHashCode(callSuper = false)
-#end
-@Accessors(chain = true)
-#end
-#if(${table.convert})
-@TableName("${table.name}")
-#end
-#if(${swagger2})
-@ApiModel(value="${entity}对象", description="$!{table.comment}")
-#end
-#if(${superEntityClass})
-public class ${entity}Do extends ${superEntityClass}#if(${activeRecord})<${entity}>#end {
-#elseif(${activeRecord})
-public class ${entity}Do extends Model<${entity}> {
-#else
-public class ${entity}Do implements Serializable {
-#end
-
-#if(${entitySerialVersionUID})
-    private static final long serialVersionUID=1L;
-#end
-
-## ----------  BEGIN 字段循环遍历  ----------
-#foreach($field in ${table.fields})
-## ----------  BEGIN BaseDo中的字段不需要展示  ----------
-#if($field.propertyName != "deleted" && $field.propertyName != "remark" && $field.propertyName != "createdate" && $field.propertyName != "createuserid" && $field.propertyName != "createusername" && $field.propertyName != "modifydate" && $field.propertyName != "modifyuserid" && $field.propertyName != "modifyusername")
-#if(${field.keyFlag})
-#set($keyPropertyName=${field.propertyName})
-#end
-#if("$!field.comment" != "")
-#if(${swagger2})
-    @ApiModelProperty(value = "${field.comment}")
-#else
-    /**
-     * ${field.comment}
-     */
-#end
-#end
-#if(${field.keyFlag})
-## 主键
-#if(${field.keyIdentityFlag})
-    @TableId(value = "${field.name}", type = IdType.AUTO)
-#elseif(!$null.isNull(${idType}) && "$!idType" != "")
-    @TableId(value = "${field.name}", type = IdType.${idType})
-#elseif(${field.convert})
-    @TableId("${field.name}")
-#end
-## 普通字段
-#elseif(${field.fill})
-## -----   存在字段填充设置   -----
-#if(${field.convert})
-    @TableField(value = "${field.name}", fill = FieldFill.${field.fill})
-#else
-    @TableField(fill = FieldFill.${field.fill})
-#end
-#elseif(${field.convert})
-    @TableField("${field.name}")
-#end
-## 乐观锁注解
-#if(${versionFieldName}==${field.name})
-    @Version
-#end
-## 逻辑删除注解
-#if(${logicDeleteFieldName}==${field.name})
-    @TableLogic
-#end
-    private ${field.propertyType} ${field.propertyName};
-#end
-#end
-## ----------  END 字段循环遍历  ----------
-
-#if(!${entityLombokModel})
-#foreach($field in ${table.fields})
-#if(${field.propertyType.equals("boolean")})
-#set($getprefix="is")
-#else
-#set($getprefix="get")
-#end
-
-    public ${field.propertyType} ${getprefix}${field.capitalName}() {
-        return ${field.propertyName};
-    }
-
-#if(${entityBuilderModel})
-    public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
-#else
-    public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
-#end
-        this.${field.propertyName} = ${field.propertyName};
-#if(${entityBuilderModel})
-        return this;
-#end
-    }
-#end
-#end
-
-#if(${entityColumnConstant})
-#foreach($field in ${table.fields})
-    public static final String ${field.name.toUpperCase()} = "${field.name}";
-
-#end
-#end
-#if(${activeRecord})
-    @Override
-    protected Serializable pkVal() {
-#if(${keyPropertyName})
-        return this.${keyPropertyName};
-#else
-        return null;
-#end
-    }
-
-#end
-#if(!${entityLombokModel})
-    @Override
-    public String toString() {
-        return "${entity}{" +
-#foreach($field in ${table.fields})
-#if($!{foreach.index}==0)
-        "${field.propertyName}=" + ${field.propertyName} +
-#else
-        ", ${field.propertyName}=" + ${field.propertyName} +
-#end
-#end
-        "}";
-    }
-#end
-}

+ 0 - 115
jxkh-common/src/main/resources/gentemplates/entity.kt.ftl

@@ -1,115 +0,0 @@
-package ${package.Entity}
-
-<#list table.importPackages as pkg>
-import ${pkg}
-</#list>
-<#if swagger2>
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-</#if>
-/**
- * <p>
- * ${table.comment}
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-<#if table.convert>
-@TableName("${table.name}")
-</#if>
-<#if swagger2>
-    @ApiModel(value="${entity}对象", description="${table.comment!}")
-</#if>
-<#if superEntityClass??>
-class ${entity} : ${superEntityClass}<#if activeRecord><${entity}></#if> {
-<#elseif activeRecord>
-class ${entity} : Model<${entity}>() {
-<#else>
-class ${entity} : Serializable {
-</#if>
-
-<#-- ----------  BEGIN 字段循环遍历  ---------->
-<#list table.fields as field>
-<#if field.keyFlag>
-    <#assign keyPropertyName="${field.propertyName}"/>
-</#if>
-
-<#if field.comment!?length gt 0>
-<#if swagger2>
-        @ApiModelProperty(value = "${field.comment}")
-<#else>
-    /**
-     * ${field.comment}
-     */
-</#if>
-</#if>
-<#if field.keyFlag>
-<#-- 主键 -->
-<#if field.keyIdentityFlag>
-    @TableId(value = "${field.name}", type = IdType.AUTO)
-<#elseif idType ??>
-    @TableId(value = "${field.name}", type = IdType.${idType})
-<#elseif field.convert>
-    @TableId("${field.name}")
-</#if>
-<#-- 普通字段 -->
-<#elseif field.fill??>
-<#-- -----   存在字段填充设置   ----->
-<#if field.convert>
-    @TableField(value = "${field.name}", fill = FieldFill.${field.fill})
-<#else>
-    @TableField(fill = FieldFill.${field.fill})
-</#if>
-<#elseif field.convert>
-    @TableField("${field.name}")
-</#if>
-<#-- 乐观锁注解 -->
-<#if (versionFieldName!"") == field.name>
-    @Version
-</#if>
-<#-- 逻辑删除注解 -->
-<#if (logicDeleteFieldName!"") == field.name>
-    @TableLogic
-</#if>
-    <#if field.propertyType == "Integer">
-    var ${field.propertyName}: Int? = null
-    <#else>
-    var ${field.propertyName}: ${field.propertyType}? = null
-    </#if>
-</#list>
-<#-- ----------  END 字段循环遍历  ---------->
-
-
-<#if entityColumnConstant>
-    companion object {
-<#list table.fields as field>
-
-        const val ${field.name.toUpperCase()} : String = "${field.name}"
-
-</#list>
-    }
-
-</#if>
-<#if activeRecord>
-    override fun pkVal(): Serializable? {
-<#if keyPropertyName??>
-        return ${keyPropertyName}
-<#else>
-        return null
-</#if>
-    }
-
-</#if>
-    override fun toString(): String {
-        return "${entity}{" +
-<#list table.fields as field>
-<#if field_index==0>
-        "${field.propertyName}=" + ${field.propertyName} +
-<#else>
-        ", ${field.propertyName}=" + ${field.propertyName} +
-</#if>
-</#list>
-        "}"
-    }
-}

+ 0 - 114
jxkh-common/src/main/resources/gentemplates/entity.kt.vm

@@ -1,114 +0,0 @@
-package ${package.Entity};
-
-#foreach($pkg in ${table.importPackages})
-import ${pkg};
-#end
-#if(${swagger2})
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-#end
-/**
- * <p>
- * $!{table.comment}
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-#if(${table.convert})
-@TableName("${table.name}")
-#end
-#if(${swagger2})
-@ApiModel(value="${entity}对象", description="$!{table.comment}")
-#end
-#if(${superEntityClass})
-class ${entity} : ${superEntityClass}#if(${activeRecord})<${entity}>#end() {
-#elseif(${activeRecord})
-class ${entity} : Model<${entity}>() {
-#else
-class ${entity} : Serializable {
-#end
-
-## ----------  BEGIN 字段循环遍历  ----------
-#foreach($field in ${table.fields})
-#if(${field.keyFlag})
-#set($keyPropertyName=${field.propertyName})
-#end
-#if("$!field.comment" != "")
-    #if(${swagger2})
-    @ApiModelProperty(value = "${field.comment}")
-    #else
-    /**
-     * ${field.comment}
-     */
-    #end
-#end
-#if(${field.keyFlag})
-## 主键
-#if(${field.keyIdentityFlag})
-    @TableId(value = "${field.name}", type = IdType.AUTO)
-#elseif(!$null.isNull(${idType}) && "$!idType" != "")
-    @TableId(value = "${field.name}", type = IdType.${idType})
-#elseif(${field.convert})
-    @TableId("${field.name}")
-#end
-## 普通字段
-#elseif(${field.fill})
-## -----   存在字段填充设置   -----
-#if(${field.convert})
-    @TableField(value = "${field.name}", fill = FieldFill.${field.fill})
-#else
-    @TableField(fill = FieldFill.${field.fill})
-#end
-#elseif(${field.convert})
-    @TableField("${field.name}")
-#end
-## 乐观锁注解
-#if(${versionFieldName}==${field.name})
-    @Version
-#end
-## 逻辑删除注解
-#if(${logicDeleteFieldName}==${field.name})
-    @TableLogic
-#end
-    #if(${field.propertyType} == "Integer")
-    var ${field.propertyName}: Int? = null
-    #else
-    var ${field.propertyName}: ${field.propertyType}? = null
-    #end
-#end
-## ----------  END 字段循环遍历  ----------
-
-
-#if(${entityColumnConstant})
-    companion object {
-#foreach($field in ${table.fields})
-
-        const val ${field.name.toUpperCase()} : String = "${field.name}"
-
-#end
-    }
-
-#end
-#if(${activeRecord})
-    override fun pkVal(): Serializable? {
-#if(${keyPropertyName})
-        return ${keyPropertyName}
-#else
-        return null
-#end
-    }
-
-#end
-    override fun toString(): String {
-        return "${entity}{" +
-#foreach($field in ${table.fields})
-#if($!{foreach.index}==0)
-        "${field.propertyName}=" + ${field.propertyName} +
-#else
-        ", ${field.propertyName}=" + ${field.propertyName} +
-#end
-#end
-        "}"
-    }
-}

+ 0 - 20
jxkh-common/src/main/resources/gentemplates/mapper.java.ftl

@@ -1,20 +0,0 @@
-package ${package.Mapper};
-
-import ${package.Entity}.${entity};
-import ${superMapperClassPackage};
-
-/**
- * <p>
- * ${table.comment!} Mapper 接口
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-<#if kotlin>
-interface ${table.mapperName} : ${superMapperClass}<${entity}>
-<#else>
-public interface ${table.mapperName} extends ${superMapperClass}<${entity}> {
-
-}
-</#if>

+ 0 - 20
jxkh-common/src/main/resources/gentemplates/mapper.java.vm

@@ -1,20 +0,0 @@
-package ${package.Mapper};
-
-import ${package.Entity}.${entity}Do;
-import ${superMapperClassPackage};
-
-/**
- * <p>
- * $!{table.comment} Mapper 接口
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-#if(${kotlin})
-interface ${table.mapperName} : ${superMapperClass}<${entity}Do>
-#else
-public interface ${table.mapperName} extends ${superMapperClass}<${entity}Do> {
-
-}
-#end

+ 0 - 39
jxkh-common/src/main/resources/gentemplates/mapper.xml.ftl

@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="${package.Mapper}.${table.mapperName}">
-
-<#if enableCache>
-    <!-- 开启二级缓存 -->
-    <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>
-
-</#if>
-<#if baseResultMap>
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="${package.Entity}.${entity}">
-<#list table.fields as field>
-<#if field.keyFlag><#--生成主键排在第一位-->
-        <id column="${field.name}" property="${field.propertyName}" />
-</#if>
-</#list>
-<#list table.commonFields as field><#--生成公共字段 -->
-    <result column="${field.name}" property="${field.propertyName}" />
-</#list>
-<#list table.fields as field>
-<#if !field.keyFlag><#--生成普通字段 -->
-        <result column="${field.name}" property="${field.propertyName}" />
-</#if>
-</#list>
-    </resultMap>
-
-</#if>
-<#if baseColumnList>
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-<#list table.commonFields as field>
-        ${field.name},
-</#list>
-        ${table.fieldNames}
-    </sql>
-
-</#if>
-</mapper>

+ 0 - 39
jxkh-common/src/main/resources/gentemplates/mapper.xml.vm

@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="${package.Mapper}.${table.mapperName}">
-
-#if(${enableCache})
-    <!-- 开启二级缓存 -->
-    <cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>
-
-#end
-#if(${baseResultMap})
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="${package.Entity}.${entity}">
-#foreach($field in ${table.fields})
-#if(${field.keyFlag})##生成主键排在第一位
-        <id column="${field.name}" property="${field.propertyName}" />
-#end
-#end
-#foreach($field in ${table.commonFields})##生成公共字段
-    <result column="${field.name}" property="${field.propertyName}" />
-#end
-#foreach($field in ${table.fields})
-#if(!${field.keyFlag})##生成普通字段
-        <result column="${field.name}" property="${field.propertyName}" />
-#end
-#end
-    </resultMap>
-
-#end
-#if(${baseColumnList})
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-#foreach($field in ${table.commonFields})
-        ${field.name},
-#end
-        ${table.fieldNames}
-    </sql>
-
-#end
-</mapper>

+ 0 - 20
jxkh-common/src/main/resources/gentemplates/service.java.ftl

@@ -1,20 +0,0 @@
-package ${package.Service};
-
-import ${package.Entity}.${entity};
-import ${superServiceClassPackage};
-
-/**
- * <p>
- * ${table.comment!} 服务类
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-<#if kotlin>
-interface ${table.serviceName} : ${superServiceClass}<${entity}>
-<#else>
-public interface ${table.serviceName} extends ${superServiceClass}<${entity}> {
-
-}
-</#if>

+ 0 - 20
jxkh-common/src/main/resources/gentemplates/service.java.vm

@@ -1,20 +0,0 @@
-package ${package.Service};
-
-import ${package.Entity}.${entity}Do;
-import ${superServiceClassPackage};
-
-/**
- * <p>
- * $!{table.comment} 服务类
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-#if(${kotlin})
-interface ${table.serviceName} : ${superServiceClass}<${entity}Do>
-#else
-public interface ${table.serviceName} extends ${superServiceClass}<${entity}Do> {
-
-}
-#end

+ 0 - 26
jxkh-common/src/main/resources/gentemplates/serviceImpl.java.ftl

@@ -1,26 +0,0 @@
-package ${package.ServiceImpl};
-
-import ${package.Entity}.${entity};
-import ${package.Mapper}.${table.mapperName};
-import ${package.Service}.${table.serviceName};
-import ${superServiceImplClassPackage};
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * ${table.comment!} 服务实现类
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-@Service
-<#if kotlin>
-open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {
-
-}
-<#else>
-public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {
-
-}
-</#if>

+ 0 - 26
jxkh-common/src/main/resources/gentemplates/serviceImpl.java.vm

@@ -1,26 +0,0 @@
-package ${package.ServiceImpl};
-
-import ${package.Entity}.${entity}Do;
-import ${package.Mapper}.${table.mapperName};
-import ${package.Service}.${table.serviceName};
-import ${superServiceImplClassPackage};
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * $!{table.comment} 服务实现类
- * </p>
- *
- * @author ${author}
- * @since ${date}
- */
-@Service
-#if(${kotlin})
-open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}Do>(), ${table.serviceName} {
-
-}
-#else
-public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}Do> implements ${table.serviceName} {
-
-}
-#end

+ 16 - 0
jxkh-entity/src/main/java/com/rongwei/bsentity/dto/ApiCallDto.java

@@ -0,0 +1,16 @@
+package com.rongwei.bsentity.dto;
+
+import lombok.Data;
+
+/**
+ * ApiCallDto class
+ *
+ * @author XH
+ * @date 2024/11/30
+ */
+@Data
+public class ApiCallDto<T> {
+    private String apiCode;
+
+    private T Data;
+}

+ 48 - 0
jxkh-entity/src/main/java/com/rongwei/bsentity/dto/ApiReturnDto.java

@@ -0,0 +1,48 @@
+package com.rongwei.bsentity.dto;
+
+import lombok.Data;
+
+import java.util.Map;
+
+/**
+ * TokenDato class
+ *
+ * @author XH
+ * @date 2024/11/30
+ */
+@Data
+public class ApiReturnDto {
+
+    private StandardReturn STANDARD_RETURN;
+    private BusinessReturn BUSINESS_RETURN;
+
+    /**
+     * 请求响应业务数据
+     */
+    @Data
+    public class BusinessReturn {
+        private int CODE;
+        private String MSG;
+        private Map<String, String> DATA;
+    }
+
+    /**
+     * 请求响应标准信息
+     */
+    @Data
+    public class StandardReturn {
+        private String ZINSTID;
+        private String ZZRESTIME;
+        private String ZZSTAT;
+        private String ZZMSG;
+    }
+
+
+    public String getToken() {
+        return this.BUSINESS_RETURN.DATA.getOrDefault("TOKEN", "");
+    }
+
+    public Map<String, String> getApiReturnData(){
+        return this.getBUSINESS_RETURN().getDATA();
+    }
+}

+ 1 - 1
jxkh-server/pom.xml

@@ -14,7 +14,7 @@
     <dependencies>
         <dependency>
             <groupId>com.rongwei</groupId>
-            <artifactId>business-common</artifactId>
+            <artifactId>jxkh-common</artifactId>
             <version>1.0-SNAPSHOT</version>
         </dependency>
 

+ 2 - 23
pom.xml

@@ -13,11 +13,6 @@
         <module>jxkh-entity</module>
     </modules>
 
-    <!--<parent>
-        <groupId>org.springframework.boot</groupId>
-        <artifactId>spring-boot-starter-parent</artifactId>
-        <version>2.1.2.RELEASE</version>
-    </parent>-->
 
     <parent>
         <artifactId>InControl</artifactId>
@@ -26,19 +21,16 @@
     </parent>
 
     <properties>
-        <!--<docker.image.prefix>ag</docker.image.prefix>-->
-        <!--<docker.plugin.version>0.4.13</docker.plugin.version>-->
+
         <mapper.version>3.4.0</mapper.version>
         <maven.compile.source>1.8</maven.compile.source>
         <maven.compile.target>1.8</maven.compile.target>
-        <fastjson.version>1.2.31</fastjson.version>
-        <!--<boot.admin.client>2.1.2</boot.admin.client>-->
+        <fastjson.version>1.2.83</fastjson.version>
     </properties>
 
     <packaging>pom</packaging>
 
     <dependencies>
-        <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
@@ -147,19 +139,6 @@
                 <artifactId>maven-deploy-plugin</artifactId>
                 <version>2.8.2</version>
             </plugin>
-            <!--<plugin>-->
-            <!--<groupId>org.apache.maven.plugins</groupId>-->
-            <!--<artifactId>maven-javadoc-plugin</artifactId>-->
-            <!--<version>2.10.3</version>-->
-            <!--<executions>-->
-            <!--<execution>-->
-            <!--<id>attach-javadocs</id>-->
-            <!--<goals>-->
-            <!--<goal>jar</goal>-->
-            <!--</goals>-->
-            <!--</execution>-->
-            <!--</executions>-->
-            <!--</plugin>-->
         </plugins>
     </build>
 </project>