提交 83feb330 authored 作者: 邓砥奕's avatar 邓砥奕

更新

上级 90d3db5a
......@@ -4,7 +4,6 @@ import com.tykj.dev.blockcha.conf.BcUrl;
import com.tykj.dev.blockcha.subject.entity.*;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
......@@ -25,24 +24,24 @@ import java.util.UUID;
@Component
public class BlockChainUtilImpl implements BlockChainUtil {
// private String SECRET_KEY = "3mdeM1dw2FfHrd5h6WAuhB3WYdDG6ZAgz96CcM1nzxbiYA8QaaZHW75Je9xKixTTD2rwujyb1gVUNPYm5W6FPZQ8";
// private String SECRET_ID = "3yXRRiL9xsLfbt2kv7qRH2so6ChJX3rFkay7Njcsxfbp";
private String SECRET_KEY = "3mdeM1dw2FfHrd5h6WAuhB3WYdDG6ZAgz96CcM1nzxbiYA8QaaZHW75Je9xKixTTD2rwujyb1gVUNPYm5W6FPZQ8";
private String SECRET_ID = "3yXRRiL9xsLfbt2kv7qRH2so6ChJX3rFkay7Njcsxfbp";
//测试环境
// public String SECRET_KEY;
// public String SECRET_ID;
//测试环境
public String SECRET_KEY = "3RJWStDCXN7mqJyZAB8rF59f87arGShdk9aKyDN3wKbzq9JnaXom1Hpe6mHT1k2yx9zfE7VFWidqwuxyT7DtPjCs";
public String SECRET_ID = "JAjQyTZdR8bmbHaU6iiFGvrCuUik4cG4U4ostk8KKrbS";
// public String SECRET_KEY = "3RJWStDCXN7mqJyZAB8rF59f87arGShdk9aKyDN3wKbzq9JnaXom1Hpe6mHT1k2yx9zfE7VFWidqwuxyT7DtPjCs";
// public String SECRET_ID = "JAjQyTZdR8bmbHaU6iiFGvrCuUik4cG4U4ostk8KKrbS";
private final static String BLOCK_CHAIN_URL = "http://192.168.0.80:8076";
private final static String BLOCK_CHAIN_URL = "http://10.153.4.12:8076";
private final static String BLOCK_CHAIN_URL2 = "http://10.153.8.10:8076";
private final static String BLOCK_CHAIN_URL3 = "http://10.153.8.11:8076";
private final static String BLOCK_CHAIN_URL4 = "http://10.153.110.10:8076";
private final static String BLOCK_CHAIN_URL5 = "http://10.153.6.11:8076";
@Value("${useBlockcha:fasle")
private String useBlockcha;
// @Value("${useBlockcha:fasle")
// private String useBlockcha;
@Override
public BcStatus getStatus() {
......@@ -186,24 +185,23 @@ public class BlockChainUtilImpl implements BlockChainUtil {
@Override
public BcHash sendHash(Integer subCode, String content) {
if ("true".equals(this.useBlockcha)) {
// SortedMap<Object, Object> request = getRequest();
// request.put("content", HexUtil.hex64(content));
// request.put("subCode", subCode);
// String s = ApiSignatureUtil.getApiSignature(request, SECRET_KEY);
// log.info("apiSignature:{}",s);
// request.put("apiSignature", s);
//
// return new RestTemplate().postForObject(
// BLOCK_CHAIN_URL + BcUrl.SEND_HASH,
// request,
// BcHash.class
// );
return new BcHash();
}
else {
return new BcHash(0, "", new BcHashData("000"));
}
// if ("true".equals(this.useBlockcha)) {
SortedMap<Object, Object> request = getRequest();
request.put("content", HexUtil.hex64(content));
request.put("subCode", subCode);
String s = ApiSignatureUtil.getApiSignature(request, SECRET_KEY);
log.info("apiSignature:{}",s);
request.put("apiSignature", s);
return new RestTemplate().postForObject(
BLOCK_CHAIN_URL + BcUrl.SEND_HASH,
request,
BcHash.class
);
// }
// else {
// return new BcHash(0, "", new BcHashData("000"));
// }
}
@Override
......
package com.tykj.dev.config.base;
import com.tykj.dev.config.domin.SystemConfig;
import lombok.AllArgsConstructor;
/**
* @author dengdiyi
* 装备可见范围枚举
*/
@AllArgsConstructor
public enum DeviceInvisibleRange {
/**
* 省一级
*/
SHEN(1, "省一级"),
/**
* 县一级
*/
XIAN(3, "县一级"),
/**
* 市一级
*/
SHI(2, "市一级");
public Integer id;
public String name;
public SystemConfig toDo(){
SystemConfig systemConfig = new SystemConfig();
systemConfig.setValue(id);
systemConfig.setLabel(name);
systemConfig.setChineseName("可见范围");
systemConfig.setEnglishName("invisibleRange");
return systemConfig;
}
}
package com.tykj.dev.config.base;
import com.tykj.dev.config.domin.SystemConfig;
import lombok.AllArgsConstructor;
/**
* @author dengdiyi
* 装备生命状态枚举
*/
@AllArgsConstructor
public enum DeviceLifeStatus {
// /**
// * 入库待审核
// */
// STORAGE_WAIT_CONFIRM(0, "入库待审核"),
// /**
// * 入库审核失败
// */
// STORAGE_CONFIRM_FAILED(1, "入库审核失败"),
/**
* 在库
*/
IN_LIBRARY(2, "在库"),
/**
* 配发中
*/
IN_TRANSIT(3, "配发"),
/**
* 维修中
*/
REPAIRING(4, "维修中"),
/**
* 报废在省库
*/
SCRAP_I(5, "已报废"),
/**
* 清退
*/
SEND_BACK(6, "清退"),
// /**
// * 待退装
// */
// WAIT_RETIRED(7, "待退装"),
// /**
// * 退装
// */
// RETIRED(8, "退装"),
// /**
// * 待销毁
// */
// WAIT_DESTROY(9, "待销毁"),
/**
* 已销毁
*/
DESTROYED(10, "已销毁"),
/**
* 丢失
*/
LOSS(11, "丢失"),
/**
* 退役
*/
RETIRE(12, "退役"),
// /**
// * 报废不在省库
// */
// SCRAP_II(13, "已报废"),
/**
* 使用
*/
USE(14, "使用"),
/**
* 待退役
*/
REPEL(15,"待退役");
public Integer id;
public String name;
public SystemConfig toDo(){
SystemConfig systemConfig = new SystemConfig();
systemConfig.setValue(id);
systemConfig.setLabel(name);
systemConfig.setChineseName("生命状态");
systemConfig.setEnglishName("lifeStatus");
return systemConfig;
}
}
package com.tykj.dev.config.base;
import lombok.AllArgsConstructor;
/**
* @author dengdiyi
* 装备管理状态枚举
*/
@AllArgsConstructor
public enum DeviceManageStatus {
/**
* 不在所属单位
*/
PACKING(0, "不在所属单位"),
/**
* 在所属单位
*/
STORAGE(1, "在所属单位");
public Integer id;
public String name;
}
package com.tykj.dev.config.base;
import com.tykj.dev.config.domin.SystemConfig;
import lombok.AllArgsConstructor;
/**
* @author dengdiyi
* 装备可见范围枚举
*/
@AllArgsConstructor
public enum DeviceSecretLevel {
/**
* 省一级
*/
SECRETLEVEL_1(1, "绝密"),
/**
* 县一级
*/
SECRETLEVEL_2(2, "秘密"),
/**
* 市一级
*/
SECRETLEVEL_3(3, "机密"),
/**
* 县一级
*/
SECRETLEVEL_4(4, "无");
public Integer id;
public String name;
public SystemConfig toDo(){
SystemConfig systemConfig = new SystemConfig();
systemConfig.setValue(id);
systemConfig.setLabel(name);
systemConfig.setChineseName("密级");
systemConfig.setEnglishName("secretLevel");
return systemConfig;
}
}
package com.tykj.dev.config.vo;
import com.tykj.dev.config.domin.SystemConfig;
import com.tykj.dev.config.service.SystemConfigService;
import com.tykj.dev.misc.utils.SpringUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author dengdiyi
*/
@Data
@ApiModel("配置变量存储类")
public class ConfigVo {
@ApiModelProperty(value = "英文变量名")
private String englishName;
@ApiModelProperty(value = "中文变量名")
private String chineseName;
@ApiModelProperty(value = "变量值显示名")
private String label;
public SystemConfig toDo(){
SystemConfigService systemConfigService = SpringUtils.getBean("systemConfigServiceImpl");
SystemConfig systemConfig = new SystemConfig();
systemConfig.setEnglishName(englishName);
systemConfig.setChineseName(chineseName);
systemConfig.setLabel(label);
if (systemConfigService != null) {
systemConfig.setValue(systemConfigService.getMaxValue(englishName)==null?1:systemConfigService.getMaxValue(englishName)+1);
}
return systemConfig;
}
}
......@@ -2,4 +2,5 @@ spring.datasource.url=jdbc:mysql://192.168.100.249:3306/device?serverTimezone=As
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.hibernate.ddl-auto=update
\ No newline at end of file
spring.jpa.hibernate.ddl-auto=update
file.path=C:/Users/dengdiyi/Documents/file/
\ No newline at end of file
spring.datasource.url=jdbc:mysql://localhost:3306/equipment?serverTimezone=Asia/Shanghai&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false
spring.datasource.url=jdbc:mysql://localhost:3306/device?serverTimezone=Asia/Shanghai&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=root
\ No newline at end of file
spring.datasource.password=root
file.path=C:/Users/dengdiyi/Documents/file/
preview.path=http://124.70.145.101:8087/equip/file/
\ No newline at end of file
......@@ -3,5 +3,5 @@ spring.datasource.url=jdbc:mysql://124.70.145.101:3306/device?serverTimezone=Asi
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=device
spring.datasource.password=Qwer1234
file.path=/home/files/zb
file.path=C:/Users/dengdiyi/Documents/file/
preview.path=http://124.70.145.101:8087/equip/file/
\ No newline at end of file
......@@ -13,8 +13,6 @@ import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.JacksonUtil;
import com.tykj.dev.misc.utils.httpclientutil.HttpClientUtil;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.i18nformatter.qual.I18nFormat;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
......@@ -39,8 +37,8 @@ public class VenitalisServiceImpl implements VenitalisService {
private UserLogDao userLogDao;
// private final static String http="http://10.153.4.11:8081";
private final static String http="http://192.168.0.80:8081";
private final static String http="http://10.153.4.11:8081";
// private final static String http="http://192.168.0.80:8081";
private final static String REGISTERE="/api/v2/auth/register";
private final static String CONTRAST="/api/v2/auth/identify";
@Override
......
......@@ -43,6 +43,7 @@ public class userRun implements CommandLineRunner {
if (userService.findAll().size() == 0) {
Units units = Units.toDb();
units.setAreaId(1);
units = unitsService.save(units);
User user = User.toDb();
user.setUserId(1);
......@@ -60,6 +61,7 @@ public class userRun implements CommandLineRunner {
units = Units.toDb();
units.setName("市机要局");
units.setUnitDesc("市机要局");
units.setAreaId(2);
units = unitsService.save(units);
user = User.toDb();
user.setUserId(3);
......@@ -76,6 +78,7 @@ public class userRun implements CommandLineRunner {
units = Units.toDb();
units.setName("区机要局");
units.setUnitDesc("区机要局");
units.setAreaId(3);
units = unitsService.save(units);
user = User.toDb();
user.setUserId(5);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论