Browse Source

'prod环境变更'

recovery
zhizhi wu 4 years ago
parent
commit
07a7c1ac00
  1. 4
      beneficiation/src/main/resources/application.yml
  2. 2
      cloudutil/src/main/resources/application-util-prod.yml
  3. 2
      cloudutil/src/main/resources/application-util-test.yml
  4. 2
      game/src/main/resources/application-prod.yml
  5. 2
      game/src/main/resources/application-prodsd.yml
  6. 2
      game/src/main/resources/application.yml
  7. 2
      ht/src/main/resources/application-prod.yml
  8. 2
      mt/src/main/resources/application-dev.yml
  9. 4
      mt/src/main/resources/application.yml
  10. 2
      ocr/src/main/resources/application-prodsd.yml
  11. 5
      ocr/src/test/java/com/ccsens/orc/test/OrcTest.java
  12. 6
      pom.xml
  13. 2
      tall/src/main/resources/application-prodsd.yml
  14. 2
      tall/src/main/resources/application-test.yml
  15. 4
      tall/src/main/resources/application.yml
  16. 1
      util/src/main/java/com/ccsens/util/PoiUtil.java
  17. 5
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/RecordDto.java
  18. 5
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/RecordVo.java
  19. 11
      wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/WisdomCarRecordDao.java
  20. 64
      wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java
  21. 2
      wisdomcar/src/main/resources/application-test.yml
  22. 27
      wisdomcar/src/main/resources/mapper_dao/WisdomCarRecordDao.xml

4
beneficiation/src/main/resources/application.yml

@ -1,6 +1,6 @@
spring: spring:
profiles: profiles:
active: test active: prod
include: common, util-test include: common, util-prod

2
cloudutil/src/main/resources/application-util-prod.yml

@ -22,7 +22,7 @@ eureka:
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/ #defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/
# defaultZone: http://admin:admin@81.70.54.64:7010/eureka/ # defaultZone: http://admin:admin@81.70.54.64:7010/eureka/
defaultZone: http://admin:admin@192.144.182.42:7010/eureka/ defaultZone: http://admin:admin@121.36.3.207:7010/eureka/
instance: instance:
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server # 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server

2
cloudutil/src/main/resources/application-util-test.yml

@ -83,7 +83,7 @@ eureka:
# 指定eureka server通信地址,注意/eureka/小尾巴不能少 # 指定eureka server通信地址,注意/eureka/小尾巴不能少
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/ #defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/
# defaultZone: http://admin:admin@49.232.6.143:7010/eureka/ # defaultZone: http://admin:admin@49.232.6.143:7010/eureka/
defaultZone: http://admin:admin@192.168.0.99:7010/eureka/ defaultZone: http://admin:admin@192.168.31.13:7010/eureka/
# defaultZone: http://admin:admin@test.tall.wiki:7010/eureka/ # defaultZone: http://admin:admin@test.tall.wiki:7010/eureka/
instance: instance:
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server # 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server

2
game/src/main/resources/application-prod.yml

@ -32,7 +32,7 @@ swagger:
enable: true enable: true
eureka: eureka:
instance: instance:
ip-address: 192.144.182.42 ip-address: 121.36.3.207
gatewayUrl: https://www.tall.wiki/gateway/ gatewayUrl: https://www.tall.wiki/gateway/
notGatewayUrl: https://www.tall.wiki/ notGatewayUrl: https://www.tall.wiki/

2
game/src/main/resources/application-prodsd.yml

@ -31,7 +31,7 @@ swagger:
enable: true enable: true
eureka: eureka:
instance: instance:
ip-address: 81.70.54.64 ip-address: 121.36.3.207
gatewayUrl: https://www.tall.wiki/gateway/ gatewayUrl: https://www.tall.wiki/gateway/
notGatewayUrl: https://www.tall.wiki/ notGatewayUrl: https://www.tall.wiki/

2
game/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring: spring:
profiles: profiles:
active: prodapi active: prod
include: common, util-prod include: common, util-prod

2
ht/src/main/resources/application-prod.yml

@ -39,5 +39,5 @@ ht:
name: 认知功能评测云平台系统 name: 认知功能评测云平台系统
eureka: eureka:
instance: instance:
ip-address: 81.70.54.64 ip-address: 121.36.3.207

2
mt/src/main/resources/application-dev.yml

@ -8,7 +8,7 @@ spring:
datasource: datasource:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
rabbitmq: rabbitmq:
host: 81.70.54.64 host: 121.36.3.207
password: 111111 password: 111111
port: 5672 port: 5672
username: admin username: admin

4
mt/src/main/resources/application.yml

@ -1,6 +1,6 @@
spring: spring:
profiles: profiles:
active: dev active: prod
include: common, util-dev include: common, util-prod

2
ocr/src/main/resources/application-prodsd.yml

@ -31,7 +31,7 @@ swagger:
enable: false enable: false
eureka: eureka:
instance: instance:
ip-address: 81.70.54.64 ip-address: 121.36.3.207
gatewayUrl: https://www.tall.wiki/gateway/ gatewayUrl: https://www.tall.wiki/gateway/
notGatewayUrl: https://www.tall.wiki/ notGatewayUrl: https://www.tall.wiki/

5
ocr/src/test/java/com/ccsens/orc/test/OrcTest.java

@ -53,8 +53,9 @@ public class OrcTest {
// 反色操作 // 反色操作
Core.bitwise_not(mat, mat); Core.bitwise_not(mat, mat);
// 将反色结果作为掩膜 // 将反色结果作为掩膜
Mat target = new Mat(mat.height(), mat.width(), CvType.CV_8UC3); Mat bg = Imgcodecs.imread("D:\\img\\e2669de7219943b8ac37f79dd8fef2f8.png");
Imgproc.resize(bg, bg, mat.size());
bg.copyTo(mat,mat);
Imgcodecs.imwrite("D:\\img\\1.png", mat); Imgcodecs.imwrite("D:\\img\\1.png", mat);
} }
} }

6
pom.xml

@ -9,9 +9,9 @@
<module>cloudutil</module> <module>cloudutil</module>
<module>util</module> <module>util</module>
<module>tall</module> <module>tall</module>
<!-- <module>ht</module>--> <module>ht</module>
<!-- <module>game</module>--> <module>game</module>
<!-- <module>mt</module>--> <module>mt</module>
<module>wisdomcar</module> <module>wisdomcar</module>
<module>beneficiation</module> <module>beneficiation</module>
<!-- <module>form</module>--> <!-- <module>form</module>-->

2
tall/src/main/resources/application-prodsd.yml

@ -31,7 +31,7 @@ swagger:
enable: false enable: false
eureka: eureka:
instance: instance:
ip-address: 81.70.54.64 ip-address: 121.36.3.207
gatewayUrl: https://www.tall.wiki/gateway/ gatewayUrl: https://www.tall.wiki/gateway/
notGatewayUrl: https://www.tall.wiki/ notGatewayUrl: https://www.tall.wiki/

2
tall/src/main/resources/application-test.yml

@ -32,7 +32,7 @@ swagger:
enable: true enable: true
eureka: eureka:
instance: instance:
ip-address: 192.168.0.99 ip-address: 127.0.0.1
# ip-address: 49.233.89.188 # ip-address: 49.233.89.188
#gatewayUrl: http://192.168.0.99/gateway/ #gatewayUrl: http://192.168.0.99/gateway/
#notGatewayUrl: http://192.168.0.99/ #notGatewayUrl: http://192.168.0.99/

4
tall/src/main/resources/application.yml

@ -1,5 +1,5 @@
spring: spring:
profiles: profiles:
active: dev active: prod
include: util-dev,common include: util-prod,common

1
util/src/main/java/com/ccsens/util/PoiUtil.java

@ -186,7 +186,6 @@ public class PoiUtil {
if(ObjectUtil.isNull(cell.value)) { if(ObjectUtil.isNull(cell.value)) {
log.info("单元格内容为空:{}", cell.value); log.info("单元格内容为空:{}", cell.value);
}else { }else {
log.info("单元格内容:{}", cell.value);
if (cell.value.length() <= 14 && cell.value.matches("\\d+")) { if (cell.value.length() <= 14 && cell.value.matches("\\d+")) {
newCell.setCellValue(Long.parseLong(cell.value)); newCell.setCellValue(Long.parseLong(cell.value));
} else { } else {

5
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/RecordDto.java

@ -26,6 +26,9 @@ public class RecordDto {
private Long startTime; private Long startTime;
@ApiModelProperty("结束时间, 默认当前时间") @ApiModelProperty("结束时间, 默认当前时间")
private Long endTime; private Long endTime;
@ApiModelProperty("数据类型 0开始 1体重 2rfid, 3称重一 4称重二 5称重三 6称重四 7震动 8剂量")
private byte[] types = {1,2};
// @ApiModelProperty("当前页,默认1") // @ApiModelProperty("当前页,默认1")
// private int pageNum=1; // private int pageNum=1;
// @ApiModelProperty("每页数量,默认100") // @ApiModelProperty("每页数量,默认100")
@ -55,6 +58,8 @@ public class RecordDto {
private Long startTime; private Long startTime;
@ApiModelProperty("结束时间, 默认当前时间") @ApiModelProperty("结束时间, 默认当前时间")
private Long endTime; private Long endTime;
@ApiModelProperty("数据类型 0开始 1体重 2rfid, 3称重一 4称重二 5称重三 6称重四 7震动 8剂量")
private byte[] types = {1,2};
{ {
endTime = System.currentTimeMillis(); endTime = System.currentTimeMillis();

5
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/RecordVo.java

@ -1,12 +1,9 @@
package com.ccsens.wisdomcar.bean.vo; package com.ccsens.wisdomcar.bean.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date;
/** /**
* @description: 数据记录 * @description: 数据记录
* @author: whj * @author: whj
@ -21,7 +18,7 @@ public class RecordVo {
@ApiModelProperty("时间") @ApiModelProperty("时间")
private Long time; private Long time;
@ApiModelProperty("类型:1体重 2rfid") @ApiModelProperty("类型:1体重 2rfid")
private Byte type; private byte type;
private String value; private String value;
private String name; private String name;
} }

11
wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/WisdomCarRecordDao.java

@ -20,4 +20,15 @@ public interface WisdomCarRecordDao extends WisdomCarRecordMapper {
* @return 称重和rfid记录 * @return 称重和rfid记录
*/ */
List<RecordVo.WeightAndRfid> queryWeightAndRfid(@Param("carId") Long carId, @Param("startTime") Long startTime, @Param("endTime") Long endTime); List<RecordVo.WeightAndRfid> queryWeightAndRfid(@Param("carId") Long carId, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
/**
* 根据类型查询平车记录
* @param carId 平车ID
* @param startTime 开始时间
* @param endTime 结束时间
* @param type 数据类型
* @return 记录
*/
List<RecordVo.WeightAndRfid> queryRecords(@Param("carId") Long carId, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("type") byte type);
} }

64
wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java

@ -151,9 +151,56 @@ public class RecordService implements IRecordService{
@Override @Override
public List<RecordVo.WeightAndRfid> queryWeightAndRfid(RecordDto.WeightAndRfid param, Long userId) { public List<RecordVo.WeightAndRfid> queryWeightAndRfid(RecordDto.WeightAndRfid param, Long userId) {
List<RecordVo.WeightAndRfid> list = queryWeightAndRfid(param.getCarId(), param.getStartTime(), param.getEndTime()); List<RecordVo.WeightAndRfid> list = queryRecord(param.getCarId(), param.getStartTime(), param.getEndTime(), param.getTypes());
return list; return list;
} }
private List<RecordVo.WeightAndRfid> queryRecord(Long carId, Long startTime, Long endTime, byte[] types) {
List<RecordVo.WeightAndRfid> records = new ArrayList<>();
if (types == null || types.length == 0) {
log.info("没有输入查询记录类型,直接返回");
return records;
}
for (byte type : types) {
List<RecordVo.WeightAndRfid> list = wisdomCarRecordDao.queryRecords(carId, startTime, endTime, type);
RecordVo.WeightAndRfid prev = null;
for (int i = 0; i < list.size(); i++) {
RecordVo.WeightAndRfid cur = list.get(i);
if (i == 0) {
records.add(cur);
prev = cur;
continue;
}
// i > 0 && cur.type == prev.type
//称重
if (cur.getType() == Constant.CAR_RECORD_WEIGHT) {
// 重量差大于10KG或时间间隔大于10分钟,保留
if (Math.abs(Integer.parseInt(cur.getValue()) - Integer.parseInt(prev.getValue())) > weightMinus
|| Math.abs(cur.getTime() - prev.getTime()) > timeMinus) {
records.add(cur);
prev = cur;
}
continue;
}
// 非称重 值不重复 或 非称重 值重复 最后一条数据
if(!cur.getValue().equals(prev.getValue()) || i == list.size() -1){
records.add(cur);
} else if (!cur.getValue().equals(list.get(i+1).getValue()) ) {
// 非称重 值重复 非最后一条数据
// 判断与下一个是否一致,一致,则不保留第一个和最后一个
records.add(cur);
}
prev = cur;
}
}
if (types.length > 1) {
log.info("重新排序");
Collections.sort(records, (o1, o2) -> (int) (o1.getTime() - o2.getTime()));
}
return records;
}
/** /**
* 查询数据 * 查询数据
@ -218,7 +265,7 @@ public class RecordService implements IRecordService{
@Override @Override
public Workbook exportWeightAndRfid(RecordDto.WeightAndRfidExport param) { public Workbook exportWeightAndRfid(RecordDto.WeightAndRfidExport param) {
log.info("数据导出:{}", param); log.info("数据导出:{}", param);
List<RecordVo.WeightAndRfid> list = queryWeightAndRfid(param.getCarId(), param.getStartTime(), param.getEndTime()); List<RecordVo.WeightAndRfid> list = queryRecord(param.getCarId(), param.getStartTime(), param.getEndTime(), param.getTypes());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 参数封装 // 参数封装
List<List<PoiUtil.PoiUtilCell>> rows = new ArrayList<>(); List<List<PoiUtil.PoiUtilCell>> rows = new ArrayList<>();
@ -246,7 +293,18 @@ public class RecordService implements IRecordService{
Date time = new Date(); Date time = new Date();
time.setTime(record.getTime()); time.setTime(record.getTime());
row.add(new PoiUtil.PoiUtilCell(sdf.format(time))); row.add(new PoiUtil.PoiUtilCell(sdf.format(time)));
row.add(new PoiUtil.PoiUtilCell(record.getType() == Constant.CAR_RECORD_WEIGHT ? "称重" : "rfid")); String type = "称重";
switch (record.getType()) {
case Constant.CAR_RECORD_WEIGHT: type = "称重";break;
case Constant.CAR_RECORD_RFID: type = "rfid";break;
case Constant.WEIGHT_SENSOR_1: type = "称重1";break;
case Constant.WEIGHT_SENSOR_2: type = "称重2";break;
case Constant.WEIGHT_SENSOR_3: type = "称重3";break;
case Constant.WEIGHT_SENSOR_4: type = "称重4";break;
case Constant.SHAKE_SENSOR: type = "震动";break;
case Constant.THROMBOLYTIC: type = "剂量";break;
}
row.add(new PoiUtil.PoiUtilCell(type));
row.add(new PoiUtil.PoiUtilCell(record.getType() == Constant.CAR_RECORD_WEIGHT ? new BigDecimal(record.getValue()).divide(new BigDecimal(1000), 3).toString() + "Kg" : record.getName())); row.add(new PoiUtil.PoiUtilCell(record.getType() == Constant.CAR_RECORD_WEIGHT ? new BigDecimal(record.getValue()).divide(new BigDecimal(1000), 3).toString() + "Kg" : record.getName()));
rows.add(row); rows.add(row);
} }

2
wisdomcar/src/main/resources/application-test.yml

@ -28,7 +28,7 @@ swagger:
enable: true enable: true
eureka: eureka:
instance: instance:
ip-address: 192.168.0.99 ip-address: 127.0.0.1
file: file:
path: /home/cloud/wisdomcar/uploads/ path: /home/cloud/wisdomcar/uploads/
signUpUrl: https://test.tall.wiki/compete/ signUpUrl: https://test.tall.wiki/compete/

27
wisdomcar/src/main/resources/mapper_dao/WisdomCarRecordDao.xml

@ -11,4 +11,31 @@
) t ) t
order by time order by time
</select> </select>
<select id="queryRecords" resultType="com.ccsens.wisdomcar.bean.vo.RecordVo$WeightAndRfid">
<choose>
<!--rfid-->
<when test="type == 2">
select r.time, r.type, if(length(HEX(CAST(value as SIGNED))) = 1, concat('0',HEX(CAST(value as SIGNED))), HEX(CAST(value as SIGNED))) as value,
IFNULL(rfid.name,if(length(HEX(CAST(value as SIGNED))) = 1, concat('0',HEX(CAST(value as SIGNED))), HEX(CAST(value as SIGNED)))) as name
from t_wisdom_car_record r left join t_rfid rfid on r.value = rfid.rfid and rfid.rec_status = 0
where r.car_id = #{carId} and r.type = 2 and r.time &gt;= #{startTime} and r.time &lt; #{endTime} and r.value != '0' and r.rec_status = 0
order by r.time
</when>
<otherwise>
select r.time, r.type, r.value,
case
when type = 1 then '称重'
when type = 3 then '称重一'
when type = 4 then '称重二'
when type = 5 then '称重三'
when type = 6 then '称重四'
when type = 7 then '震动'
when type = 8 then '剂量'
end as name
from t_wisdom_car_record r
where r.car_id = #{carId} and r.type = #{type} and r.time &gt;= #{startTime} and r.time &lt; #{endTime} and r.rec_status = 0
order by r.time
</otherwise>
</choose>
</select>
</mapper> </mapper>
Loading…
Cancel
Save