Selaa lähdekoodia

Merge remote-tracking branch 'origin/dev/one' into dev/one

wangyu 6 vuotta sitten
vanhempi
commit
bf93625de0

+ 5 - 0
diagbotman-service/src/main/java/com/diagbot/dto/GetConsoleOpenedDTO.java

@@ -60,4 +60,9 @@ public class GetConsoleOpenedDTO implements Serializable {
      */
     private String accessTypeMsg;
     
+    /**
+     * 是否续费中,0-否  1-是
+     */
+    private Integer renewalsStutas;
+    
 }

+ 3 - 1
diagbotman-service/src/main/resources/mapper/OpenedProductsMapper.xml

@@ -65,8 +65,10 @@
 			DATE_FORMAT(a.start_time,'%Y-%m-%d') as startTime,
 			DATE_FORMAT(a.end_time,'%Y-%m-%d') as endTime,
 			a.service_status as serviceStatus,
-			b.access_type as accessType
+			b.access_type as accessType,
+			case when c.id is null then 0 else 1 end as renewalsStutas
 		from diag_opened_products a join diag_lantone_product b on a.product_id=b.id
+		left join diag_user_renewals c on a.user_id=c.user_id and a.product_id=c.product_id 
 		where a.is_deleted='N' and b.is_deleted='N' and a.user_id=#{userId};
     </select>
 

+ 47 - 61
user-service/src/main/java/com/diagbot/facade/UserFacade.java

@@ -101,7 +101,7 @@ public class UserFacade extends UserServiceImpl {
     @Autowired
     PermissionFacade permissionFacade;
     @Autowired
-    DiagbotmanClient diagbotmanService;
+    DiagbotmanClient diagbotmanClient;
 
     /**
      * 注册
@@ -861,42 +861,37 @@ public class UserFacade extends UserServiceImpl {
         user.setLinkman(userAndOrganizationVO.getLinkman());
         user.setGmtCreate(DateUtil.now());
         user.setEmail(userAndOrganizationVO.getEmail());
-        boolean res = save(user);
-        if (res == true) {
-            Long userId = user.getId();
-            // 用户信息的认证
-            UserAuthentication userAuthentication = new UserAuthentication();
-            userAuthentication.setCreator(UserUtils.getCurrentPrincipleID());//
-            // 创建人Id
-            userAuthentication.setGmtCreate(DateUtil.now());// 记录创建时间
-            userAuthentication.setPosition(userAndOrganizationVO.getPosition());// 岗位信息
-            userAuthentication.setUserId(userId);// 用户id
-            userAuthentication.setIsReject(RejectEnum.PASS.getKey());// 是否通过认证 0:未通过,1:已通过
-            userAuthentication.setStatus(AuthStatusEnum.Authorized.getKey());// 认证状态(0:未认证,1:已认证,2:认证中)
-            userAuthenticationFacade.save(userAuthentication);
-
-            // 用户信息和机构信息的绑定
-            UserOrganization userOrganization = new UserOrganization();
-            userOrganization.setCreator(UserUtils.getCurrentPrincipleID());//
-            // 创建人Id
-            userOrganization.setGmtCreate(DateUtil.now());
-            userOrganization.setOrganizationId(userAndOrganizationVO.getOrganizationid());// 机构id
-            userOrganization.setUserId(userId);// 用户id
-
-            res = userOrganizationFacade.save(userOrganization);
-
-            UserRole userRole = new UserRole();
-            userRole.setUserId(user.getId());
-            userRole.setRoleId(1L);
-            userRole.setGmtCreate(new Date());
-            userRole.setCreator(UserUtils.getCurrentPrincipleID());
-            userRoleFacade.save(userRole);
+        save(user);
+
+        Long userId = user.getId();
+        // 用户信息的认证
+        UserAuthentication userAuthentication = new UserAuthentication();
+        userAuthentication.setCreator(UserUtils.getCurrentPrincipleID());//
+        // 创建人Id
+        userAuthentication.setGmtCreate(DateUtil.now());// 记录创建时间
+        userAuthentication.setPosition(userAndOrganizationVO.getPosition());// 岗位信息
+        userAuthentication.setUserId(userId);// 用户id
+        userAuthentication.setIsReject(RejectEnum.PASS.getKey());// 是否通过认证 0:未通过,1:已通过
+        userAuthentication.setStatus(AuthStatusEnum.Authorized.getKey());// 认证状态(0:未认证,1:已认证,2:认证中)
+        userAuthenticationFacade.save(userAuthentication);
+
+        // 用户信息和机构信息的绑定
+        UserOrganization userOrganization = new UserOrganization();
+        userOrganization.setCreator(UserUtils.getCurrentPrincipleID());//
+        // 创建人Id
+        userOrganization.setGmtCreate(DateUtil.now());
+        userOrganization.setOrganizationId(userAndOrganizationVO.getOrganizationid());// 机构id
+        userOrganization.setUserId(userId);// 用户id
 
-        } else {
-            throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED);
-        }
+        userOrganizationFacade.save(userOrganization);
 
-        return RespDTO.onSuc(res);
+        UserRole userRole = new UserRole();
+        userRole.setUserId(user.getId());
+        userRole.setRoleId(1L);
+        userRole.setGmtCreate(new Date());
+        userRole.setCreator(UserUtils.getCurrentPrincipleID());
+        userRoleFacade.save(userRole);
+        return RespDTO.onSuc(true);
     }
 
 
@@ -911,11 +906,8 @@ public class UserFacade extends UserServiceImpl {
         map.put("userId", baseIdVO.getId());
         map.put("modifier", UserUtils.getCurrentPrincipleID());
         map.put("gmtModified", DateUtil.now());
-        boolean res = updateDeleted(map);
-        if (!res) {
-            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
-        }
-        return RespDTO.onSuc(res);
+        updateDeleted(map);
+        return RespDTO.onSuc(true);
     }
 
     /**
@@ -936,7 +928,7 @@ public class UserFacade extends UserServiceImpl {
             Long userInfoId = userInfoDTO.getUserId();
             userIds.add(userInfoId);
         }
-        RespDTO<List<UserAndProdutUDTO>> InformationData = diagbotmanService.getInformationAvailableAll(userIds);
+        RespDTO<List<UserAndProdutUDTO>> InformationData = diagbotmanClient.getInformationAvailableAll(userIds);
 
         if (InformationData == null || !"0".equals(InformationData.code)) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
@@ -962,7 +954,7 @@ public class UserFacade extends UserServiceImpl {
     /**
      * 1.分页查询注册用户信息接口 queryUserInformation
      * @param page
-     * @param orgName
+     * @param userName
      * @param autStatus
      * @return
      */
@@ -1034,7 +1026,7 @@ public class UserFacade extends UserServiceImpl {
         if(userIds.size()>0){
         	
         
-        RespDTO<List<UserAndProdutUDTO>> InformationData = diagbotmanService.getInformationAvailableAll(userIds);
+        RespDTO<List<UserAndProdutUDTO>> InformationData = diagbotmanClient.getInformationAvailableAll(userIds);
 
         if (InformationData == null || !"0".equals(InformationData.code)) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
@@ -1053,7 +1045,7 @@ public class UserFacade extends UserServiceImpl {
             }
         }
         }
-        System.out.println("====================" + GsonUtil.toJson(userData));
+        //System.out.println("====================" + GsonUtil.toJson(userData));
         user.setRecords(userData);
         return RespDTO.onSuc(user);
   	}
@@ -1286,18 +1278,15 @@ public class UserFacade extends UserServiceImpl {
 
     //超管修改用户信息接口
 	public RespDTO<Boolean> updateUserInfos(AmendUserInfoVO amendUserInfoVO) {
-		 Map<String, Object> amendUserInfo = new HashMap<String, Object>();
-		 amendUserInfo.put("modifier", UserUtils.getCurrentPrincipleID());
-		 amendUserInfo.put("gmtModified", DateUtil.now());
-		 amendUserInfo.put("email", amendUserInfoVO.getEmail());
-		 amendUserInfo.put("userId", amendUserInfoVO.getUserId());
-		 amendUserInfo.put("autPosition",amendUserInfoVO.getAutPosition());
-		 amendUserInfo.put("linKman",amendUserInfoVO.getLinKman());
-	        boolean res = updateUserInfo(amendUserInfo);
-	        if (!res) {
-	            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
-	        }
-	        return RespDTO.onSuc(res);
+         Map<String, Object> amendUserInfo = new HashMap<String, Object>();
+         amendUserInfo.put("modifier", UserUtils.getCurrentPrincipleID());
+         amendUserInfo.put("gmtModified", DateUtil.now());
+         amendUserInfo.put("email", amendUserInfoVO.getEmail());
+         amendUserInfo.put("userId", amendUserInfoVO.getUserId());
+         amendUserInfo.put("autPosition",amendUserInfoVO.getAutPosition());
+         amendUserInfo.put("linKman",amendUserInfoVO.getLinKman());
+         updateUserInfo(amendUserInfo);
+         return RespDTO.onSuc(true);
 	}
 
     //超管修改机构信息
@@ -1309,11 +1298,8 @@ public class UserFacade extends UserServiceImpl {
 		 amendOrg.put("type", amendOrgVO.getOrgType());
 		 amendOrg.put("orgId", amendOrgVO.getOrgId());
 		 amendOrg.put("orgSubNum", amendOrgVO.getOrgSubNum());
-	        boolean res = updateOrganizations(amendOrg);
-	        if (!res) {
-	            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
-	        }
-	        return RespDTO.onSuc(res);
+	     updateOrganizations(amendOrg);
+	     return RespDTO.onSuc(true);
 	}
     
     

+ 4 - 4
user-service/src/main/java/com/diagbot/service/impl/UserServiceImpl.java

@@ -95,7 +95,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     //审核用户信息和机构信息
     @Override
     public boolean auditUserInfoAll(Map<String, Object> auditMap) {
-        // TODO Auto-generated method stub
+        
         return baseMapper.auditUserInfoAll(auditMap);
     }
     //导出用户和机构信息
@@ -137,20 +137,20 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 	//超管修改用户信息接口
 	@Override
 	public boolean updateUserInfo(Map<String, Object> amendUserInfo) {
-		// TODO Auto-generated method stub
+		
 		return baseMapper.updateUserInfo(amendUserInfo);
 	}
 
 	//机构信息修改接口
 	@Override
 	public boolean updateOrganizations(Map<String, Object> amendOrg) {
-		// TODO Auto-generated method stub
+		
 		return baseMapper.updateOrganizations(amendOrg);
 	}
 
 	@Override
 	public List<UserInfoDTO> exportOrganizations(Map<String, Object> map) {
-		// TODO Auto-generated method stub
+		
 		return baseMapper.exportOrganizations(map);
 	}
 	

+ 7 - 2
user-service/src/main/resources/mapper/UserMapper.xml

@@ -211,22 +211,27 @@
 
     <update id="updateDeleted" parameterType="java.util.Map">
         UPDATE sys_user u ,sys_user_organization a ,
-        sys_organization b,sys_user_authentication c
-        SET u.is_deleted = "Y",a.is_deleted= "Y",b.is_deleted= "Y",c.is_deleted="Y"
+        sys_organization b,sys_user_authentication c, sys_user_role r
+        SET u.is_deleted = "Y",a.is_deleted= "Y",b.is_deleted= "Y",c.is_deleted="Y", r.is_deleted="Y"
         <if test="map.gmtModified !=null">
             ,u.gmt_modified=#{map.gmtModified}
+            ,a.gmt_modified=#{map.gmtModified}
             ,b.gmt_modified=#{map.gmtModified}
             ,c.gmt_modified=#{map.gmtModified}
+            ,r.gmt_modified=#{map.gmtModified}
         </if>
         <if test="map.modifier != null">
             ,u.modifier=#{map.modifier}
+            ,a.modifier=#{map.modifier}
             ,b.modifier=#{map.modifier}
             ,c.modifier=#{map.modifier}
+            ,r.modifier=#{map.modifier}
         </if>
         WHERE u.id = #{map.userId}
         AND c.user_id= #{map.userId}
         AND a.user_id = #{map.userId}
         AND a.organization_id =b.id
+        AND r.user_id= #{map.userId}
     </update>
     <update id="auditUserInfoAll" parameterType="java.util.Map">
         UPDATE sys_user_authentication