Merge branch 'master' into pro

# Conflicts:
#	src/main/resources/logback.xml
This commit is contained in:
付庆吉
2021-04-23 16:58:08 +08:00
20 changed files with 225 additions and 52 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v1
clusters:
- cluster:
insecure-skip-tls-verify: true
server: https://10.125.164.35:48662
server: https://10.125.164.111:42733;https://10.125.164.158:41745;https://10.125.164.8:43001
name: demok8s
contexts:
- context:
@ -14,4 +14,4 @@ kind: Config
users:
- name: cluster-admin
user:
token: df5e4896a4f6d1b1447b2584ca7405f7
token: ae123cd22080c2712d08cb31633a2fa6

View File

@ -57,7 +57,11 @@ spec:
env:
# Apollo 配置中心变量设置
- name: APOLLO_CONFIGSERVICE
value: http://10.242.31.158:6001
value: http://apollo-configservice:8080
- name: MY_POD_IP #自动获取pod ip作为agent id
valueFrom:
fieldRef:
fieldPath: status.podIP
---
kind: Service
apiVersion: v1
@ -67,7 +71,7 @@ metadata:
labels:
app: biz-service-ebtp-extend
annotations:
lb.cke.tg.unicom/target-vports: 18018-18018
# lb.cke.tg.unicom/target-vports: 18018-18018
prometheus.io/port: '18018'
prometheus.io/jl-svc: 'true'
spec:

View File

@ -0,0 +1,36 @@
package com.chinaunicom.mall.ebtp.extend.bizmessage.controller;
import java.security.Principal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseCacheUser;
import com.chinaunicom.mall.ebtp.common.base.service.IBaseCacheUserService;
@RestController
@RequestMapping("v1")
public class AuthorizeController {
private @Autowired IBaseCacheUserService service;
@GetMapping("user")
@ResponseStatus(code = HttpStatus.OK)
public Object user(Principal principal) {
BaseCacheUser cacheUser = service.getCacheUser();
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
System.out.println(auth.getName());
System.out.println(auth.getAuthorities());
System.out.println(principal);
return cacheUser;
}
}

View File

@ -56,14 +56,9 @@ public class BizExportDictServiceImpl extends BaseServiceImpl<BizExportDictMappe
.collect(Collectors.toList());
Map<String, List<BizExportDict>> resultsMap = new HashMap<>();
//是否包含开标阶段
//是否包含开标阶段
boolean toInitialOpenRoom = "procurement_mode_1".equals(proj.getBidMethodDict()) || "procurement_mode_2".equals(proj.getBidMethodDict());
if ("procurement_mode_3".equals(proj.getBidMethodDict())) {
if ("selection_method_1".equals(proj.getBiddingSignDict())) {
toInitialOpenRoom = true;
}
}
boolean toInitialOpenRoom = room.getRoomType().equals(CommonConstants.ROOM_TYPE_2);
for (BizExportDict bizExportDict : level1) {
//不含开标阶段 100 = 开标阶段
@ -105,8 +100,7 @@ public class BizExportDictServiceImpl extends BaseServiceImpl<BizExportDictMappe
"?assessRoomId=" + roomId +
// "&reviewTurnId=" + v.getReviewTurnId() +
"&projectId=" + proj.getId() +
"&sectionId=" + section.getId() +
"&reviewTurnSort=1";
"&sectionId=" + section.getId();
bizExportDict.setUrl(sbl);
}
});

View File

@ -1,20 +1,19 @@
package com.chinaunicom.mall.ebtp.extend.templatewarehouse.controller;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse;
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.BizBidClientVersion;
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.BizBidTemplateWarehouse;
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.ClientVersionCheck;
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.sevice.BizBidClientVersionService;
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.sevice.BizBidTemplateWarehouseService;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.sevice.ClientVersionCheckService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
@RestController
@Api(tags = "模板仓库")
@ -24,6 +23,8 @@ public class TemplateWarehouseController {
private BizBidTemplateWarehouseService templateWarehouseService;
@Resource
private BizBidClientVersionService bizBidClientVersionService;
@Resource
private ClientVersionCheckService clientVersionCheckService;
/**
* 通过模板类型查询模板数据
@ -79,4 +80,20 @@ public class TemplateWarehouseController {
bizBidClientVersionService.getClientByVersion(version);
return BaseResponse.success();
}
/**
* 通过版本号获得对应客户端文件id
*
* @return
*/
@ApiOperation("查询最低最高版本号")
@GetMapping("/client/check")
public BaseResponse<ClientVersionCheck> getClientByVersion() {
List<ClientVersionCheck> checkList = clientVersionCheckService.list();
if (checkList.isEmpty()){
return BaseResponse.fail(new ClientVersionCheck());
}
return BaseResponse.success(checkList.get(0));
}
}

View File

@ -0,0 +1,10 @@
package com.chinaunicom.mall.ebtp.extend.templatewarehouse.dao;
import com.chinaunicom.mall.ebtp.common.base.dao.IBaseMapper;
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.ClientVersionCheck;
public interface ClientVersionCheckMapper extends IBaseMapper<ClientVersionCheck> {
}

View File

@ -7,6 +7,7 @@
<result column="id" jdbcType="BIGINT" property="id"/>
<result column="document_center_id" jdbcType="VARCHAR" property="documentCenterId"/>
<result column="ipass_version" jdbcType="VARCHAR" property="ipassVersion"/>
<result column="config_document_id" jdbcType="VARCHAR" property="configDocumentId"/>
<result column="publish_date" jdbcType="TIMESTAMP" property="publishDate"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
</resultMap>

View File

@ -0,0 +1,12 @@
<?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="com.chinaunicom.mall.ebtp.extend.templatewarehouse.dao.ClientVersionCheckMapper">
<resultMap id="BaseResultMap"
type="com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.ClientVersionCheck">
<result column="high_version" jdbcType="VARCHAR" property="highVersion"/>
<result column="low_version" jdbcType="VARCHAR" property="lowVersion"/>
<result column="status" jdbcType="INTEGER" property="status"/>
</resultMap>
</mapper>

View File

@ -35,11 +35,18 @@ public class BizBidClientVersion implements Serializable {
private String id;
/**
* 文档中心-文档ID
*/
@ApiModelProperty(value = "文档中心-文档ID")
* 客户端对应文档中心-文档ID
*/
@ApiModelProperty(value = "客户端对应文档中心-文档ID")
private String documentCenterId;
/**
* 配置文件对应文档中心-文档ID
*/
@ApiModelProperty(value = "配置文件对应文档中心-文档ID")
private String configDocumentId;
/**
* ipass客户端版本号
*/

View File

@ -0,0 +1,44 @@
package com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chinaunicom.mall.ebtp.common.base.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* 实体类 ClientVersionCheck
*
* @auto.generated
*/
@Data
@Accessors(chain = true)
@ApiModel
@TableName(value = "client_version_check", autoResultMap = true)
public class ClientVersionCheck extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 最高版本客户端版本号
*/
@ApiModelProperty(value = "最高版本客户端版本号")
private String highVersion;
/**
* 最低版本客户端版本号
*/
@ApiModelProperty(value = "最低版本客户端版本号")
private String lowVersion;
/**
* 状态 是否启用校验 1-启用2-不启用
*/
@ApiModelProperty(value = "状态 是否启用校验 1-启用2-不启用")
private Integer status;
}

View File

@ -0,0 +1,16 @@
package com.chinaunicom.mall.ebtp.extend.templatewarehouse.sevice;
import com.chinaunicom.mall.ebtp.common.base.service.IBaseService;
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.ClientVersionCheck;
/**
* 对数据表 client_version_check 操作的 service
* @author Auto create
*
*/
public interface ClientVersionCheckService extends IBaseService<ClientVersionCheck>{
}

View File

@ -60,11 +60,15 @@ public class BizBidClientVersionServiceImpl extends BaseServiceImpl<BizBidClient
ExportExceptionEnum.FRAME_EXCEPTION_GET_DOCUMENT_CENTER.customValidName("文档获取失败", !(map.containsKey("message") && map.containsKey("success")) || "null".equals(objectInfo));
ExportExceptionEnum.FRAME_EXCEPTION_GET_DOCUMENT_CENTER.customValidName("文档中心返回信息:" + map.get("message").toString(), !(boolean) map.get("success"));
Optional<byte[]> optionalBytes = modelConvertor.toByteArray(objectInfo);
// log.info("文档中心文件下载返回数据转为byte[]数据:"+ new String(optionalBytes.get()));
String data = map.get("data").toString();
Map mapdata = (Map) JSON.parse(data);
String sysStorageVO = mapdata.get("sysStorageVO").toString();
Map mapsysStorageVO = (Map) JSON.parse(sysStorageVO);
log.info("文档中心文件下载返回文件大小数据:"+ mapsysStorageVO.get("fileSize"));
ServletOutputStream outputStream = response.getOutputStream();
// response.setContentType("application/octet-stream;charset=utf-8");
response.setHeader("Content-Disposition","attachment;filename="+ URLEncoder.encode("AutoUpdater.xml", "utf-8"));
if(optionalBytes.isPresent()){
response.setHeader("Content-Length",mapsysStorageVO.get("fileSize").toString());
outputStream.write(optionalBytes.get());
}
outputStream.flush();
@ -79,11 +83,15 @@ public class BizBidClientVersionServiceImpl extends BaseServiceImpl<BizBidClient
ExportExceptionEnum.FRAME_EXCEPTION_GET_DOCUMENT_CENTER.customValidName("文档获取失败", !(map.containsKey("message") && map.containsKey("success")) || "null".equals(objectInfo));
ExportExceptionEnum.FRAME_EXCEPTION_GET_DOCUMENT_CENTER.customValidName("文档中心返回信息:" + map.get("message").toString(), !(boolean) map.get("success"));
Optional<byte[]> optionalBytes = modelConvertor.toByteArray(objectInfo);
// log.info("文档中心s文件下载返回数据转为byte[]数据:"+ optionalBytes.get());
String data = map.get("data").toString();
Map mapdata = (Map) JSON.parse(data);
String sysStorageVO = mapdata.get("sysStorageVO").toString();
Map mapsysStorageVO = (Map) JSON.parse(sysStorageVO);
log.info("文档中心s文件下载返回文件大小数据"+ mapsysStorageVO.get("fileSize"));
ServletOutputStream outputStream = response.getOutputStream();
// response.setContentType("application/octet-stream;charset=utf-8");
response.setHeader("Content-Disposition","attachment;filename="+ URLEncoder.encode("ebtp-ca.zip", "utf-8"));
if(optionalBytes.isPresent()){
response.setHeader("Content-Length",mapsysStorageVO.get("fileSize").toString());
outputStream.write(optionalBytes.get());
}
outputStream.flush();

View File

@ -0,0 +1,18 @@
package com.chinaunicom.mall.ebtp.extend.templatewarehouse.sevice.impl;
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.dao.ClientVersionCheckMapper;
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.entity.ClientVersionCheck;
import com.chinaunicom.mall.ebtp.extend.templatewarehouse.sevice.ClientVersionCheckService;
import org.springframework.stereotype.Service;
import com.chinaunicom.mall.ebtp.common.base.service.impl.BaseServiceImpl;
/**
* 对数据表 client_version_check 操作的 serviceImpl
* @author Auto create
*
*/
@Service
public class ClientVersionCheckServiceImpl extends BaseServiceImpl<ClientVersionCheckMapper, ClientVersionCheck> implements ClientVersionCheckService {
}

View File

@ -156,7 +156,8 @@ public class TimeServiceConstant {
.setDate(date.getDate())
.setHour(date.getHours())
.setMinute(date.getMinutes())
.setSecond(date.getSeconds());
.setSecond(date.getSeconds())
.setTimestamp(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date));
return systemTime;
}catch (Exception e){
log.error("获取时间戳异常", e);

View File

@ -11,8 +11,10 @@ import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
public class SystemTime {
/**
* 时间
*/
private String timestamp;
/**
* 年
*/

View File

@ -1,5 +1,11 @@
package com.chinaunicom.mall.ebtp.extend.timeService.tsa;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
/**
* CA 时间戳服务接口
*
@ -67,7 +73,7 @@ public interface TtsAgent {
// 签名证书
private String cert;
public TtsParseResult(String timestamp, String hash, String cert) {
public TtsParseResult(String timestamp, String hash, String cert){
super();
this.timestamp = timestamp;
this.hash = hash;

View File

@ -34,10 +34,10 @@ spring:
ds0:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: root
jdbc-url: jdbc:mysql://10.242.37.148:3033/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://10.242.37.148:3033/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: mall
password: unicom
jdbc-url: jdbc:mysql://10.125.160.26:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://10.125.160.26:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
filters: stat,wall,log4j
maxActive: 20
initialSize: 1

View File

@ -42,10 +42,10 @@ spring:
ds0:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: root
jdbc-url: jdbc:mysql://10.242.37.148:3033/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://10.242.37.148:3033/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: mall
password: unicom
jdbc-url: jdbc:mysql://10.125.160.26:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://10.125.160.26:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
filters: stat,wall,log4j
maxActive: 20
initialSize: 1

View File

@ -6,12 +6,11 @@ server:
seata:
service:
vgroup-mapping:
biz-service-ebtp-extend-service-group: default
#registry:
# type: eureka
# eureka:
# serviceUrl: http://10.242.31.158:5001/eureka,http://10.242.31.158:5002/eureka,http://10.242.31.158:5003/eureka
biz-service-ebtp-extend-service-group: seata-server-jl
registry:
type: eureka
eureka:
serviceUrl: http://eureka-1:8080/eureka,http://eureka-2:8080/eureka,http://eureka-3:8080/eureka
# 对应 apollo 配置中心的应用名
app:
@ -19,7 +18,7 @@ app:
# Apollo 配置信息
apollo:
meta: http://10.242.31.158:6001/
meta: http://apollo-configservice:8080
bootstrap:
namespace: application
enabled: true
@ -40,10 +39,10 @@ spring:
ds0:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: root
jdbc-url: jdbc:mysql://10.242.31.158:3033/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://10.242.31.158:3033/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: mall
password: unicom
jdbc-url: jdbc:mysql://10.125.160.30:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://10.125.160.30:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
filters: stat,wall,log4j
maxActive: 20
initialSize: 1
@ -102,12 +101,10 @@ spring:
eureka:
client:
service-url:
defaultZone: http://10.242.31.158:5001/eureka,http://10.242.31.158:5002/eureka,http://10.242.31.158:5003/eureka
defaultZone: http://eureka-1:8080/eureka,http://eureka-2:8080/eureka,http://eureka-3:8080/eureka
instance:
prefer-ip-address: true
instance-id: http://10.242.31.158:${server.port}
# 这是客户端的注册地址, eureka 会通过这个地址建立管道
ip-address: 10.242.31.158
instance-ip: ${spring.cloud.client.ip-address}:${server.port}
mybatis-plus:
configuration:

View File

@ -1,3 +1,3 @@
spring:
profiles:
active: pro
active: uat