Commit c5cdc232 by 邓实川

电子合同

parent 45b594ed
...@@ -45,6 +45,7 @@ import cn.timer.api.controller.dzht.cn.tign.hz.constant.ConfigConstant; ...@@ -45,6 +45,7 @@ import cn.timer.api.controller.dzht.cn.tign.hz.constant.ConfigConstant;
import cn.timer.api.controller.dzht.cn.tign.hz.enums.RequestType; import cn.timer.api.controller.dzht.cn.tign.hz.enums.RequestType;
import cn.timer.api.controller.dzht.cn.tign.hz.exception.DefineException; import cn.timer.api.controller.dzht.cn.tign.hz.exception.DefineException;
import cn.timer.api.dto.dzht.DzhtRzDto; import cn.timer.api.dto.dzht.DzhtRzDto;
import cn.timer.api.utils.QueryUtil;
import cn.timer.api.utils.Result; import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil; import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -233,7 +234,20 @@ public class DzhtController { ...@@ -233,7 +234,20 @@ public class DzhtController {
return ResultUtil.data(list); return ResultUtil.data(list);
} }
final static String savePath = "esignTemplate";// 本地服务器文件保存路径
public static String savePath() {
String savePath = null;
String name = System.getProperty("os.name");
if (name.startsWith("Windows")) {
savePath = "E:\\esignTemplate"; // Windows本地服务器文件保存路径包
}else if(name.startsWith("Linux")){
savePath = "esignTemplate"; // Linux远程服务器文件保存路径包
}else {
savePath = "esignTemplate"; // 其他服务器文件保存路径包
}
return savePath;
}
final static String APP_ID = ConfigConstant.PROJECT_ID;// 项目id final static String APP_ID = ConfigConstant.PROJECT_ID;// 项目id
final static String APP_SECRET = ConfigConstant.PROJECT_SECRET;// 项目密码 final static String APP_SECRET = ConfigConstant.PROJECT_SECRET;// 项目密码
// final static String RE_TOKEN = "8b58973c290cc848b67ff0017cd424ff"; // final static String RE_TOKEN = "8b58973c290cc848b67ff0017cd424ff";
...@@ -595,7 +609,7 @@ public class DzhtController { ...@@ -595,7 +609,7 @@ public class DzhtController {
String filePath = null; String filePath = null;
try { try {
filePath = FileHelper.downLoadFromUrl(ossUrl, fileName, savePath); filePath = FileHelper.downLoadFromUrl(ossUrl, fileName, savePath());
} catch (IOException e1) { } catch (IOException e1) {
e1.printStackTrace(); e1.printStackTrace();
} }
...@@ -678,18 +692,11 @@ public class DzhtController { ...@@ -678,18 +692,11 @@ public class DzhtController {
} }
@GetMapping("/queryName") @GetMapping("/queryName")
@ApiOperation(value = "查版本名字", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "查名字", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> getName(@RequestParam String empNum) { public Result<Object> getName(@RequestParam(required = false)Integer empNum) {
String a = System.getProperty("os.name"); String name = QueryUtil.queryEmpName(empNum);
String b = System.getProperty("os.arch"); Map<String, String> map = QueryUtil.queryVersionName();
String c = System.getProperty("os.version"); return ResultUtil.datas(map, name, "查询成功");
Map<String, String> map = new HashMap<>();
map.put("os.name", a);
map.put("os.arch", b);
map.put("os.version", c);
return ResultUtil.data(map);
// return ResultUtil.data(YgglMainEmp.builder().build()
// .selectOne(new QueryWrapper<YgglMainEmp>().eq("emp_num", empNum)).getName());
} }
/*************************** 设置请求头 ***************************************/ /*************************** 设置请求头 ***************************************/
......
...@@ -724,7 +724,7 @@ public class DzhtController2 { ...@@ -724,7 +724,7 @@ public class DzhtController2 {
String filePath = null; String filePath = null;
try { try {
filePath = FileHelper.downLoadFromUrl(ossUrl, fileName, DzhtController.savePath); filePath = FileHelper.downLoadFromUrl(ossUrl, fileName, DzhtController.savePath());
tpyz.setFilePath(filePath); tpyz.setFilePath(filePath);
} catch (IOException e1) { } catch (IOException e1) {
e1.printStackTrace(); e1.printStackTrace();
......
package cn.timer.api.utils;
import java.util.HashMap;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.timer.api.bean.yggl.YgglMainEmp;
public class QueryUtil {
/**
* 查询当前系统名字与版本号
* @return
*/
public static Map<String, String> queryVersionName() {
String a = System.getProperty("os.name");
String b = System.getProperty("os.arch");
String c = System.getProperty("os.version");
Map<String, String> map = new HashMap<>();
map.put("os.name", a);
map.put("os.arch", b);
map.put("os.version", c);
return map;
}
/**
* 查询员工姓名
* @param empNum
* @return
*/
public static String queryEmpName(Integer empNum) {
return YgglMainEmp.builder().build()
.selectOne(new QueryWrapper<YgglMainEmp>().eq("emp_num", empNum)).getName();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment