diff --git a/config-gz b/config-gz index 6fe3b43..980e05b 100644 --- a/config-gz +++ b/config-gz @@ -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 \ No newline at end of file diff --git a/deployment-gz.yaml b/deployment-gz.yaml index 4d9e7d4..50b0f2d 100644 --- a/deployment-gz.yaml +++ b/deployment-gz.yaml @@ -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: diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/controller/AuthorizeController.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/controller/AuthorizeController.java new file mode 100644 index 0000000..eaac104 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/controller/AuthorizeController.java @@ -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; + } + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/BizExportDictServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/BizExportDictServiceImpl.java index 0b7ede0..e2ff4f4 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/BizExportDictServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/BizExportDictServiceImpl.java @@ -56,14 +56,9 @@ public class BizExportDictServiceImpl extends BaseServiceImpl> 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 getClientByVersion() { + List checkList = clientVersionCheckService.list(); + if (checkList.isEmpty()){ + return BaseResponse.fail(new ClientVersionCheck()); + } + return BaseResponse.success(checkList.get(0)); + } } diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/dao/ClientVersionCheckMapper.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/dao/ClientVersionCheckMapper.java new file mode 100644 index 0000000..3a6fd5a --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/dao/ClientVersionCheckMapper.java @@ -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 { + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/dao/mapper/BizBidClientVersionMapper.xml b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/dao/mapper/BizBidClientVersionMapper.xml index 3195b5a..af1178d 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/dao/mapper/BizBidClientVersionMapper.xml +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/dao/mapper/BizBidClientVersionMapper.xml @@ -7,6 +7,7 @@ + diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/dao/mapper/ClientVersionCheckMapper.xml b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/dao/mapper/ClientVersionCheckMapper.xml new file mode 100644 index 0000000..6c08f5a --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/dao/mapper/ClientVersionCheckMapper.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/entity/BizBidClientVersion.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/entity/BizBidClientVersion.java index dd5bcf1..836e5cb 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/entity/BizBidClientVersion.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/entity/BizBidClientVersion.java @@ -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客户端版本号 */ diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/entity/ClientVersionCheck.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/entity/ClientVersionCheck.java new file mode 100644 index 0000000..652352e --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/entity/ClientVersionCheck.java @@ -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; + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/ClientVersionCheckService.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/ClientVersionCheckService.java new file mode 100644 index 0000000..a4d4381 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/ClientVersionCheckService.java @@ -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{ + + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/impl/BizBidClientVersionServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/impl/BizBidClientVersionServiceImpl.java index 727c1f3..74bc426 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/impl/BizBidClientVersionServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/impl/BizBidClientVersionServiceImpl.java @@ -60,11 +60,15 @@ public class BizBidClientVersionServiceImpl extends BaseServiceImpl 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 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(); diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/impl/ClientVersionCheckServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/impl/ClientVersionCheckServiceImpl.java new file mode 100644 index 0000000..87378b0 --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/templatewarehouse/sevice/impl/ClientVersionCheckServiceImpl.java @@ -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 implements ClientVersionCheckService { + + +} diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java index bfd086d..d88c289 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java @@ -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); diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/tsa/SystemTime.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/tsa/SystemTime.java index 8915664..1683127 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/tsa/SystemTime.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/tsa/SystemTime.java @@ -11,8 +11,10 @@ import lombok.experimental.Accessors; @Data @Accessors(chain = true) public class SystemTime { - - + /** + * 时间 + */ + private String timestamp; /** * 年 */ diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/tsa/TtsAgent.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/tsa/TtsAgent.java index 62e02b5..b4b6e1c 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/tsa/TtsAgent.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/tsa/TtsAgent.java @@ -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; diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 4c0be9d..63a3334 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -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 diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index d34e52a..ca20abb 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -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 diff --git a/src/main/resources/application-uat.yml b/src/main/resources/application-uat.yml index d30ec4b..5249254 100644 --- a/src/main/resources/application-uat.yml +++ b/src/main/resources/application-uat.yml @@ -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: diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index fc3033b..f2b90d5 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,3 +1,3 @@ spring: profiles: - active: pro \ No newline at end of file + active: uat \ No newline at end of file