Browse Source

Merge branch 'develop' into 'release/v2.1.1-beta'

# Conflicts:
#   dcuc-app-service/src/main/resources/application-app.yml
黄资权 4 năm trước cách đây
mục cha
commit
31d21cf6d3

+ 4 - 0
dcuc-app-model/src/main/java/com/dragoninfo/dcuc/app/dto/ServiceResourceAcceptDTO.java

@@ -52,4 +52,8 @@ public class ServiceResourceAcceptDTO {
      * 信息创建单位——GA机构机构代码
      */
     private String XXCZDW_GAJGJGDM;
+    /**
+     * 服务提供方式代码
+     */
+    private String FWTGFSDM;
 }

+ 16 - 0
dcuc-app-model/src/main/java/com/dragoninfo/dcuc/app/dto/ServiceResourceDTO.java

@@ -32,6 +32,22 @@ public class ServiceResourceDTO extends ResourceDTO implements Serializable {
      * 服务访问地址
      */
     private String serviceUrl;
+    /**
+     * 服务类型
+     */
+    private String serviceType;
+    /**
+     * 服务提供方式
+     */
+    private String serviceProvideWay;
+    /**
+     * 是否自用服务
+     */
+    private String mustSelf;
+    /**
+     * 服务提供应用系统code
+     */
+    private String appCode;
 
     public ServiceResourceDTO() {
         super();

+ 18 - 1
dcuc-app-model/src/main/java/com/dragoninfo/dcuc/app/entity/ServiceResource.java

@@ -36,7 +36,7 @@ public class ServiceResource implements Serializable {
     private String resourceProvider;
 
     /**
-     * 服务编码
+     * 服务资源标识符
      */
     private String serviceCode;
 
@@ -141,4 +141,21 @@ public class ServiceResource implements Serializable {
     @TableField(jdbcType = JdbcType.TIMESTAMP)
     private Date updateTime;
 
+    /**
+     * 服务类型
+     */
+    private String serviceType;
+    /**
+     * 服务提供方式
+     */
+    private String serviceProvideWay;
+    /**
+     * 是否自用服务
+     */
+    private String mustSelf;
+    /**
+     * 服务提供应用系统code
+     */
+    private String appCode;
+
 }

+ 14 - 9
dcuc-app-service/src/main/java/com/dragoninfo/dcuc/app/business/impl/ResourceBusiness.java

@@ -449,15 +449,15 @@ public class ResourceBusiness implements IResourceBusiness {
      */
     public boolean acceptServiceResource(ServiceResourceAcceptDTO acceptDTO) {
         ResourceTypeEnum serviceEnum = ResourceTypeEnum.TJ_SERVICE;
-        ResourceSyncDTO syncDTO = new ResourceSyncDTO(serviceEnum.getResourceId()
-                , serviceEnum.getResourceType(), serviceEnum.getResouProvider());
-        syncDTO.setServiceCode(acceptDTO.getFWZYBSF());
-        syncDTO.setServiceName(acceptDTO.getFWZYMC());
-        syncDTO.setExtId(acceptDTO.getId());
-        syncDTO.setContent(JSON.toJSONString(acceptDTO));
-        syncDTO.setSync(BooleanEnum.TRUE.getValue());
-        syncDTO.setDeleted(BooleanEnum.FALSE.getValue());
-        syncService.insertRemoteResourceSync(syncDTO);
+//        ResourceSyncDTO syncDTO = new ResourceSyncDTO(serviceEnum.getResourceId()
+//                , serviceEnum.getResourceType(), serviceEnum.getResouProvider());
+//        syncDTO.setServiceCode(acceptDTO.getFWZYBSF());
+//        syncDTO.setServiceName(acceptDTO.getFWZYMC());
+//        syncDTO.setExtId(acceptDTO.getId());
+//        syncDTO.setContent(JSON.toJSONString(acceptDTO));
+//        syncDTO.setSync(BooleanEnum.TRUE.getValue());
+//        syncDTO.setDeleted(BooleanEnum.FALSE.getValue());
+//        syncService.insertRemoteResourceSync(syncDTO);
         //同步更新服务表
         ServiceResourceDTO serviceResourceDTO = convertToServiceDTO(acceptDTO);
         serviceResourceDTO.setResourceId(serviceEnum.getResourceId());
@@ -480,6 +480,11 @@ public class ResourceBusiness implements IResourceBusiness {
         if (ServiceStatusCons.STATUS_DELETED.equals(fwzyztdm)) {
             dto.setDeleted(BooleanEnum.TRUE.getValue());
         }
+        dto.setServiceType(acceptDTO.getFWLXDM());
+        dto.setServiceProvideWay(acceptDTO.getFWTGFSDM());
+        //是否自用服务,服务资源未返回
+//        dto.setMustSelf();
+        dto.setAppCode(acceptDTO.getTGFWZYD_YYZYBS());
         return dto;
     }
 

+ 40 - 0
dcuc-app-service/src/main/java/com/dragoninfo/dcuc/app/facade/TestFacade.java

@@ -0,0 +1,40 @@
+package com.dragoninfo.dcuc.app.facade;
+
+import com.dragoninfo.dcuc.app.business.IResourceBusiness;
+import com.dragoninfo.dcuc.app.entity.ApplyInfo;
+import com.dragoninfo.dcuc.app.service.IApplyInfoService;
+import com.dragoninfo.dcuc.app.service.IServiceResourceService;
+import com.dragonsoft.duceap.auditlog.annotations.AuditLog;
+import com.dragonsoft.duceap.auditlog.enums.OperateTypeEnum;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 代码千万行,注释第一行,编码不规范,同事两行泪
+ *
+ * @author huang(jy)
+ * @version 1.0
+ * @date 2021/4/26 16:39
+ */
+@RestController
+@RequestMapping(value = "/dcuc/app")
+public class TestFacade {
+
+    @Autowired
+    private IServiceResourceFacade applyInfoService;
+
+    @Autowired
+    private IServiceResourceService serviceResourceService;
+
+
+    @Autowired
+    private IResourceBusiness resourceBusiness;
+
+    @GetMapping(value = "/test")
+    public void applyDetail(String key) {
+        resourceBusiness.serviceIncrSync(key);
+    }
+}

+ 4 - 4
dcuc-app-service/src/main/resources/config/mysql/V4_1_0002__Init_Tables.sql

@@ -18,8 +18,8 @@ CREATE TABLE `t_service_resource` (
   `contract_unit` varchar(255) DEFAULT NULL,
   `contract_principal` varchar(100) DEFAULT NULL,
   `contract_principal_phone` varchar(50) DEFAULT NULL,
-  `create_time` datetime(3) DEFAULT NULL,
-  `update_time` datetime(3) DEFAULT NULL,
+  `create_time` datetime DEFAULT NULL,
+  `update_time` datetime DEFAULT NULL,
   `deleted` varchar(5) DEFAULT NULL,
   PRIMARY KEY (`id`),
   KEY `service_code_index` (`service_code`)
@@ -37,8 +37,8 @@ CREATE TABLE `t_resource_sync` (
   `resource_id` varchar(50) DEFAULT NULL,
   `resource_type` varchar(10) DEFAULT NULL,
   `resource_provider` varchar(10) DEFAULT NULL,
-  `create_time` datetime(3) DEFAULT NULL,
-  `update_time` datetime(3) DEFAULT NULL,
+  `create_time` datetime DEFAULT NULL,
+  `update_time` datetime DEFAULT NULL,
   `sync` varchar(5) DEFAULT NULL,
   `deleted` varchar(5) DEFAULT NULL,
   PRIMARY KEY (`id`),

+ 5 - 0
dcuc-app-service/src/main/resources/config/mysql/V4_1_0003__alert_column.sql

@@ -0,0 +1,5 @@
+ALTER TABLE `t_service_resource`
+ADD COLUMN `service_type`  varchar(20) NULL COMMENT '服务类型' AFTER `manager_unit_code`,
+ADD COLUMN `service_provide_way`  varchar(20) NULL COMMENT '服务提供方式' AFTER `service_type`,
+ADD COLUMN `must_self`  varchar(1) NULL COMMENT '是否自用服务' AFTER `service_provide_way`,
+ADD COLUMN `app_code`  varchar(100) NULL COMMENT '服务提供应用系统code' AFTER `must_self`;

+ 14 - 0
dcuc-app-service/src/main/resources/config/sql/V4_1_0004__ALERT_COLUMN_init.sql

@@ -0,0 +1,14 @@
+ALTER TABLE "T_SERVICE_RESOURCE"
+ADD ( "SERVICE_TYPE" VARCHAR2(20) NULL  ) 
+ADD ( "SERVICE_PROVIDE_WAY" VARCHAR2(20) NULL  ) 
+ADD ( "MUST_SELF" VARCHAR2(1) NULL  ) 
+ADD ( "APP_CODE" VARCHAR2(100) NULL  ) ;
+
+COMMENT ON COLUMN "T_SERVICE_RESOURCE"."SERVICE_TYPE" IS ''服务类型'';
+
+COMMENT ON COLUMN "T_SERVICE_RESOURCE"."SERVICE_PROVIDE_WAY" IS ''服务提供方式'';
+
+COMMENT ON COLUMN "T_SERVICE_RESOURCE"."MUST_SELF" IS ''是否自用服务'';
+
+COMMENT ON COLUMN "T_SERVICE_RESOURCE"."APP_CODE" IS ''服务提供应用系统code'';
+