Browse Source

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

wangyu 6 years ago
parent
commit
8ee1734fd5
56 changed files with 1102 additions and 930 deletions
  1. 49 0
      diagbotman-service/src/main/java/com/diagbot/enums/ServiceTypeEnum.java
  2. 43 32
      diagbotman-service/src/main/java/com/diagbot/facade/ProductServiceFacade.java
  3. 29 14
      diagbotman-service/src/main/java/com/diagbot/facade/ServiceInfoFacade.java
  4. 6 10
      diagbotman-service/src/main/java/com/diagbot/mapper/ProductServiceMapper.java
  5. 1 11
      diagbotman-service/src/main/java/com/diagbot/mapper/ServiceInfoMapper.java
  6. 6 5
      diagbotman-service/src/main/java/com/diagbot/service/ProductServiceService.java
  7. 1 10
      diagbotman-service/src/main/java/com/diagbot/service/ServiceInfoService.java
  8. 7 16
      diagbotman-service/src/main/java/com/diagbot/service/impl/ProductServiceServiceImpl.java
  9. 1 16
      diagbotman-service/src/main/java/com/diagbot/service/impl/ServiceInfoServiceImpl.java
  10. 11 9
      diagbotman-service/src/main/java/com/diagbot/web/ProductOrderController.java
  11. 15 0
      diagbotman-service/src/main/java/com/diagbot/web/ProductServiceController.java
  12. 19 0
      diagbotman-service/src/main/java/com/diagbot/web/ServiceInfoController.java
  13. 20 0
      diagbotman-service/src/main/java/com/diagbot/web/ServiceTokenController.java
  14. 1 14
      diagbotman-service/src/main/resources/mapper/ProductServiceMapper.xml
  15. 0 17
      diagbotman-service/src/main/resources/mapper/ServiceInfoMapper.xml
  16. 125 2
      user-service/src/main/java/com/diagbot/dto/UserInfoDTO.java
  17. 15 12
      user-service/src/main/java/com/diagbot/dto/UserInfoExportDTO.java
  18. 44 40
      user-service/src/main/java/com/diagbot/facade/UserAuthenticationFacade.java
  19. 89 1
      user-service/src/main/java/com/diagbot/facade/UserFacade.java
  20. 49 45
      user-service/src/main/java/com/diagbot/facade/VerFacade.java
  21. 0 7
      user-service/src/main/java/com/diagbot/mapper/OrganizationMapper.java
  22. 0 1
      user-service/src/main/java/com/diagbot/mapper/UserAuthenticationMapper.java
  23. 1 1
      user-service/src/main/java/com/diagbot/mapper/UserMapper.java
  24. 1 0
      user-service/src/main/java/com/diagbot/service/EnumsDataService.java
  25. 2 0
      user-service/src/main/java/com/diagbot/service/ImgVerService.java
  26. 1 9
      user-service/src/main/java/com/diagbot/service/OrganizationService.java
  27. 1 0
      user-service/src/main/java/com/diagbot/service/SmsVerService.java
  28. 1 2
      user-service/src/main/java/com/diagbot/service/UserAuthenticationService.java
  29. 1 1
      user-service/src/main/java/com/diagbot/service/UserOrganizationService.java
  30. 9 8
      user-service/src/main/java/com/diagbot/service/UserService.java
  31. 1 8
      user-service/src/main/java/com/diagbot/service/impl/OrganizationServiceImpl.java
  32. 0 3
      user-service/src/main/java/com/diagbot/service/impl/UserAuthenticationServiceImpl.java
  33. 1 1
      user-service/src/main/java/com/diagbot/service/impl/UserServiceImpl.java
  34. 127 130
      user-service/src/main/java/com/diagbot/util/ExportBeanExcelUtil.java
  35. 6 7
      user-service/src/main/java/com/diagbot/util/SmsCodeUtil.java
  36. 53 43
      user-service/src/main/java/com/diagbot/util/VerifyCodeUtils.java
  37. 8 10
      user-service/src/main/java/com/diagbot/vo/OrganizationVO.java
  38. 3 3
      user-service/src/main/java/com/diagbot/vo/SmsVerCreatVO.java
  39. 1 1
      user-service/src/main/java/com/diagbot/vo/SmsVerVerVO.java
  40. 12 13
      user-service/src/main/java/com/diagbot/vo/UserAndOrganizationVO.java
  41. 0 1
      user-service/src/main/java/com/diagbot/vo/UserAuthenticationVO.java
  42. 5 8
      user-service/src/main/java/com/diagbot/vo/UserExportVO.java
  43. 10 14
      user-service/src/main/java/com/diagbot/vo/UserInfoAuditVO.java
  44. 11 15
      user-service/src/main/java/com/diagbot/vo/UserInfoOrganizationsVO.java
  45. 4 8
      user-service/src/main/java/com/diagbot/vo/UserInfoVO.java
  46. 1 1
      user-service/src/main/java/com/diagbot/vo/UserSaveVO.java
  47. 2 2
      user-service/src/main/java/com/diagbot/web/EnumsController.java
  48. 15 98
      user-service/src/main/java/com/diagbot/web/ReportFormController.java
  49. 3 3
      user-service/src/main/java/com/diagbot/web/TestController.java
  50. 32 16
      user-service/src/main/java/com/diagbot/web/UserAuthenticationController.java
  51. 56 54
      user-service/src/main/java/com/diagbot/web/UserController.java
  52. 179 179
      user-service/src/main/java/com/diagbot/web/UserInfoController.java
  53. 15 10
      user-service/src/main/java/com/diagbot/web/VerController.java
  54. 0 5
      user-service/src/main/resources/mapper/OrganizationMapper.xml
  55. 0 5
      user-service/src/main/resources/mapper/UserAuthenticationMapper.xml
  56. 9 9
      user-service/src/main/resources/mapper/UserMapper.xml

+ 49 - 0
diagbotman-service/src/main/java/com/diagbot/enums/ServiceTypeEnum.java

@@ -0,0 +1,49 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:服务端类型
+ * @author: zhaops
+ * @time: 2018/9/25 18:00
+ */
+public enum ServiceTypeEnum implements KeyedNamed {
+    User_Create(1, "用户建立"),
+    Sys_Create(2, "系统生成");
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    ServiceTypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static ServiceTypeEnum getEnum(Integer key) {
+        for (ServiceTypeEnum item : ServiceTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        ServiceTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 43 - 32
diagbotman-service/src/main/java/com/diagbot/facade/ProductServiceFacade.java

@@ -1,5 +1,7 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.dto.ProductServiceDTO;
@@ -44,9 +46,10 @@ public class ProductServiceFacade extends ProductServiceServiceImpl {
     private OpenedProductsFacade openedProductsFacade;
 
     /**
-     * @Description:建立产品服务端关联并生成令牌
-     * @author: zhaops
-     * @time: 2018/9/18 16:33
+     * 建立产品服务端关联并生成令牌
+     *
+     * @param productServiceSaveVO
+     * @return
      */
     public ProductServiceDTO genProductService(ProductServiceSaveVO productServiceSaveVO) {
         ProductServiceDTO productServiceDTO = new ProductServiceDTO();
@@ -66,10 +69,11 @@ public class ProductServiceFacade extends ProductServiceServiceImpl {
                     "当前登录用户没有关联服务端【" + serviceInfo.getName() + "】");
         }
 
-        Map<String, Object> map = new HashMap<>();
-        map.put("productId", productServiceSaveVO.getProductId());
-        map.put("serviceId", productServiceSaveVO.getServiceId());
-        ProductService productService = this.findByProductIdAndServiceId(map);
+        QueryWrapper<ProductService> qwps = new QueryWrapper<>();
+        qwps.eq("product_id", productServiceSaveVO.getProductId());
+        qwps.eq("service_id", productServiceSaveVO.getServiceId());
+        qwps.eq("is_deleted", "N");
+        ProductService productService = this.getOne(qwps);
         if (productService == null) {
             productService = new ProductService();
             productService.setProductId(productServiceSaveVO.getProductId());
@@ -120,15 +124,17 @@ public class ProductServiceFacade extends ProductServiceServiceImpl {
     }
 
     /**
-     * @Description:删除产品服务端关联,级联删除令牌
-     * @author: zhaops
-     * @time: 2018/9/18 16:33
+     * 删除产品服务端关联,级联删除令牌
+     *
+     * @param productServiceSaveVO
+     * @return
      */
     public Boolean deleteProductService(ProductServiceSaveVO productServiceSaveVO) {
-        Map<String, Object> map = new HashMap<>();
-        map.put("productId", productServiceSaveVO.getProductId());
-        map.put("serviceId", productServiceSaveVO.getServiceId());
-        ProductService productService = this.findByProductIdAndServiceId(map);
+        QueryWrapper<ProductService> qwps = new QueryWrapper<>();
+        qwps.eq("product_id", productServiceSaveVO.getProductId());
+        qwps.eq("service_id", productServiceSaveVO.getServiceId());
+        qwps.eq("is_deleted", "N");
+        ProductService productService = this.getOne(qwps);
         if (productService == null) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "找不到产品服务端");
@@ -136,38 +142,43 @@ public class ProductServiceFacade extends ProductServiceServiceImpl {
         //删除关联令牌
         serviceTokenFacade.deleteByProductServiceId(productService.getId());
         //删除产品服务端
-        this.delById(productService.getId());
+        UpdateWrapper<ProductService> uwps = new UpdateWrapper<>();
+        productService.setIsDeleted("Y");
+        this.updateById(productService);
+        //this.delById(productService.getId());
         return true;
     }
 
+
     /**
-     * @Description:获取当前用户产品服务关联列表
-     * @author: zhaops
-     * @time: 2018/9/18 16:33
+     * 获取当前用户产品服务关联列表
+     *
+     * @param page
+     * @return
      */
     public IPage<ProductServiceWrapper> selectProductServiceByCurrentUserPage(Page<ProductServiceWrapper> page) {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
         //当前登录用户服务端列表
-        Map<String, Object> columnMap = new HashMap<>();
-        columnMap.put("is_deleted", "N");
-        columnMap.put("user_id", userId);
-        List<ServiceInfo> serviceInfoList = (List) serviceInfoFacade.listByMap(columnMap);
+        QueryWrapper<ServiceInfo> qwService = new QueryWrapper<>();
+        qwService.eq("is_deleted", "N");
+        qwService.eq("user_id", userId);
+        List<ServiceInfo> serviceInfoList = serviceInfoFacade.list(qwService);
         Map<Long, ServiceInfo> serviceData = EntityUtil.makeEntityMap(serviceInfoList, "id");
         //服务令牌列表
-        columnMap.clear();
-        columnMap.put("is_deleted", "N");
-        List<ServiceToken> serviceTokenList = (List) serviceTokenFacade.listByMap(columnMap);
+        QueryWrapper<ServiceToken> qwToken = new QueryWrapper<>();
+        qwToken.eq("is_deleted", "N");
+        List<ServiceToken> serviceTokenList = serviceTokenFacade.list(qwToken);
         Map<Long, ServiceToken> tokenData = EntityUtil.makeEntityMap(serviceTokenList, "productServiceId");
         //产品列表
-        columnMap.clear();
-        columnMap.put("is_deleted", "N");
-        List<LantoneProduct> lantoneProductList = (List) lantoneProductFacade.listByMap(columnMap);
+        QueryWrapper<LantoneProduct> qwProduct = new QueryWrapper<>();
+        qwProduct.eq("is_deleted", "N");
+        List<LantoneProduct> lantoneProductList = lantoneProductFacade.list(qwProduct);
         Map<Long, LantoneProduct> lantoneProductData = EntityUtil.makeEntityMap(lantoneProductList, "id");
         //当前用户开通的产品列表
-        columnMap.clear();
-        columnMap.put("is_deleted", "N");
-        columnMap.put("user_id", userId);
-        List<OpenedProducts> openedProductsList = (List) openedProductsFacade.listByMap(columnMap);
+        QueryWrapper<OpenedProducts> qwOpenedProducts = new QueryWrapper<>();
+        qwOpenedProducts.eq("is_deleted", "N");
+        qwOpenedProducts.eq("user_id", userId);
+        List<OpenedProducts> openedProductsList = openedProductsFacade.list(qwOpenedProducts);
         Map<Long, OpenedProducts> openedProductData = EntityUtil.makeEntityMap(openedProductsList, "productId");
 
         ProductServiceWrapper productServiceVO = new ProductServiceWrapper();

+ 29 - 14
diagbotman-service/src/main/java/com/diagbot/facade/ServiceInfoFacade.java

@@ -1,8 +1,10 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.entity.ServiceInfo;
+import com.diagbot.enums.ServiceTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.ServiceInfoServiceImpl;
@@ -21,9 +23,10 @@ import java.util.List;
 @Component
 public class ServiceInfoFacade extends ServiceInfoServiceImpl {
     /**
-     * @Description: 新建服务端
-     * @author: zhaops
-     * @time: 2018/9/18 16:31
+     * 新建服务端
+     *
+     * @param serviceSaveVO
+     * @return
      */
     public ServiceInfo createService(ServiceSaveVO serviceSaveVO) {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
@@ -39,9 +42,10 @@ public class ServiceInfoFacade extends ServiceInfoServiceImpl {
     }
 
     /**
-     * @Description: 修改服务端
-     * @author: zhaops
-     * @time: 2018/9/18 16:31
+     * 修改服务端
+     *
+     * @param serviceInfo
+     * @return
      */
     public Boolean updateService(ServiceInfo serviceInfo) {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
@@ -56,26 +60,37 @@ public class ServiceInfoFacade extends ServiceInfoServiceImpl {
     }
 
     /**
-     * @Description: 获取当前登录用户服务列表
-     * @author: zhaops
-     * @time: 2018/9/18 16:31
+     * 获取当前登录用户服务列表
+     *
+     * @return
      */
     public List<ServiceInfo> getServiceListByCurrentUser() {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
-        List<ServiceInfo> list = this.getListByUserId(userId);
+        QueryWrapper<ServiceInfo> qw = new QueryWrapper<>();
+        qw.eq("user_id", userId);
+        //服务端类型(1:用户建立,2:系统生成)
+        qw.eq("type", ServiceTypeEnum.User_Create.getKey());
+        qw.eq("is_deleted", "N");
+        List<ServiceInfo> list = this.list(qw);
         return list;
     }
 
     /**
-     * @Description: 获取当前登录用户服务分页列表
-     * @author: zhaops
-     * @time: 2018/9/19 14:05
+     * 获取当前登录用户服务分页列表
+     *
+     * @param page
+     * @return
      */
     public IPage<ServiceInfo> getServiceListPageByCurrentUser(Page<ServiceInfo> page) {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
         ServiceInfo serviceInfoVO = new ServiceInfo();
         serviceInfoVO.setUserId(userId);
-        IPage<ServiceInfo> pagelist = this.selectServiceListPage(page, serviceInfoVO);
+        serviceInfoVO.setType(ServiceTypeEnum.User_Create.getKey());
+        QueryWrapper<ServiceInfo> qw = new QueryWrapper<>();
+        qw.eq("is_deleted", "N");
+        qw.eq("type", ServiceTypeEnum.User_Create.getKey());
+        qw.eq("user_id", userId);
+        IPage<ServiceInfo> pagelist = this.page(page, qw);
         return pagelist;
     }
 }

+ 6 - 10
diagbotman-service/src/main/java/com/diagbot/mapper/ProductServiceMapper.java

@@ -4,13 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.entity.ProductService;
-import com.diagbot.entity.User;
 import com.diagbot.entity.wrapper.ProductServiceWrapper;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.List;
-import java.util.Map;
-
 /**
  * <p>
  * 服务端维护表 Mapper 接口
@@ -21,11 +17,11 @@ import java.util.Map;
  */
 public interface ProductServiceMapper extends BaseMapper<ProductService> {
 
-    ProductService findByProductIdAndServiceId(Map<String, Object> map);
-
-    List<ProductService> findByProductId(Long productId);
-
+    /**
+     * 根据用户id获取产品与服务端的关联列表(分页)
+     * @param page
+     * @param productService
+     * @return
+     */
     IPage<ProductServiceWrapper> selectProductServiceByUserIdPage(Page page, @Param("productService") ProductServiceWrapper productService);
-
-    Integer delById(Long id);
 }

+ 1 - 11
diagbotman-service/src/main/java/com/diagbot/mapper/ServiceInfoMapper.java

@@ -1,12 +1,7 @@
 package com.diagbot.mapper;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.diagbot.entity.ServiceInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
+import com.diagbot.entity.ServiceInfo;
 
 /**
  * <p>
@@ -17,9 +12,4 @@ import java.util.List;
  * @since 2018-09-17
  */
 public interface ServiceInfoMapper extends BaseMapper<ServiceInfo> {
-    List<ServiceInfo> findByName(String name);
-
-    List<ServiceInfo> getListByUserId(Long userId);
-
-    IPage<ServiceInfo> selectServiceListPage(Page page, @Param("serviceInfo") ServiceInfo serviceInfo);
 }

+ 6 - 5
diagbotman-service/src/main/java/com/diagbot/service/ProductServiceService.java

@@ -19,11 +19,12 @@ import java.util.Map;
  * @since 2018-09-17
  */
 public interface ProductServiceService extends IService<ProductService> {
-    ProductService findByProductIdAndServiceId(Map<String, Object> map);
-
-    List<ProductService> findByProductId(Long productId);
 
+    /**
+     * 根据用户id获取产品与服务端的关联列表(分页)
+     * @param page
+     * @param productService
+     * @return
+     */
     IPage<ProductServiceWrapper> selectProductServiceByUserIdPage(Page<ProductServiceWrapper> page, ProductServiceWrapper productService);
-
-    Integer delById(Long id);
 }

+ 1 - 10
diagbotman-service/src/main/java/com/diagbot/service/ServiceInfoService.java

@@ -1,11 +1,7 @@
 package com.diagbot.service;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.diagbot.entity.ServiceInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
-
-import java.util.List;
+import com.diagbot.entity.ServiceInfo;
 
 /**
  * <p>
@@ -16,9 +12,4 @@ import java.util.List;
  * @since 2018-09-17
  */
 public interface ServiceInfoService extends IService<ServiceInfo> {
-    List<ServiceInfo> findByName(String name);
-
-    List<ServiceInfo> getListByUserId(Long userId);
-
-    IPage<ServiceInfo> selectServiceListPage(Page<ServiceInfo> page, ServiceInfo serviceInfo);
 }

+ 7 - 16
diagbotman-service/src/main/java/com/diagbot/service/impl/ProductServiceServiceImpl.java

@@ -2,17 +2,13 @@ package com.diagbot.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.entity.ProductService;
 import com.diagbot.entity.wrapper.ProductServiceWrapper;
 import com.diagbot.mapper.ProductServiceMapper;
 import com.diagbot.service.ProductServiceService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
-import java.util.Map;
-
 /**
  * <p>
  * 服务端维护表 服务实现类
@@ -23,19 +19,14 @@ import java.util.Map;
  */
 @Service
 public class ProductServiceServiceImpl extends ServiceImpl<ProductServiceMapper, ProductService> implements ProductServiceService {
-    public ProductService findByProductIdAndServiceId(Map<String, Object> map) {
-        return baseMapper.findByProductIdAndServiceId(map);
-    }
-
-    public List<ProductService> findByProductId(Long productId) {
-        return baseMapper.findByProductId(productId);
-    }
 
+    /**
+     * 根据用户id获取产品与服务端的关联列表(分页)
+     * @param page
+     * @param productService
+     * @return
+     */
     public IPage<ProductServiceWrapper> selectProductServiceByUserIdPage(Page<ProductServiceWrapper> page, ProductServiceWrapper productService) {
         return baseMapper.selectProductServiceByUserIdPage(page, productService);
     }
-
-    public Integer delById(Long id) {
-        return baseMapper.delById(id);
-    }
 }

+ 1 - 16
diagbotman-service/src/main/java/com/diagbot/service/impl/ServiceInfoServiceImpl.java

@@ -1,15 +1,11 @@
 package com.diagbot.service.impl;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.entity.ServiceInfo;
 import com.diagbot.mapper.ServiceInfoMapper;
 import com.diagbot.service.ServiceInfoService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
-
 /**
  * <p>
  * 用户服务表 服务实现类
@@ -20,15 +16,4 @@ import java.util.List;
  */
 @Service
 public class ServiceInfoServiceImpl extends ServiceImpl<ServiceInfoMapper, ServiceInfo> implements ServiceInfoService {
-    public List<ServiceInfo> findByName(String name) {
-        return baseMapper.findByName(name);
-    }
-
-    public List<ServiceInfo> getListByUserId(Long userId) {
-        return baseMapper.getListByUserId(userId);
-    }
-
-    public IPage<ServiceInfo> selectServiceListPage(Page<ServiceInfo> page, ServiceInfo serviceInfo) {
-        return baseMapper.selectServiceListPage(page, serviceInfo);
-    }
 }

+ 11 - 9
diagbotman-service/src/main/java/com/diagbot/web/ProductOrderController.java

@@ -24,6 +24,8 @@ import com.diagbot.dto.WaitExamOrderCouDTO;
 import com.diagbot.entity.OpenedProducts;
 import com.diagbot.entity.wrapper.OrderDetailsWapper;
 import com.diagbot.entity.wrapper.ProductOrderWrapper;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
 import com.diagbot.facade.LantoneProductFacade;
 import com.diagbot.facade.OpenedProductsFacade;
 import com.diagbot.facade.ProductOrderFacade;
@@ -128,10 +130,10 @@ public class ProductOrderController {
 		openedProducts.setGmtCreate(DateUtil.now());
 		openedProducts.setServiceStatus(startAndendByUserIdVO.getServiceStatus());
 		boolean res =openedProductsFacade.startAndendByuserId(openedProducts);
-		if(res !=true  ){
-			return RespDTO.onSuc("操作失败!");
+		if (!res){
+			throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
 		}
-		return RespDTO.onSuc("操作成功!");
+		return RespDTO.onSuc(res);
 	}
 
 	@ApiOperation(value = "根据用户id和产品id,删除开通信息[by:wangfeng]", notes = "删除开通信息")
@@ -145,10 +147,10 @@ public class ProductOrderController {
 		openedProducts.setCreator(UserUtils.getCurrentPrincipleID());
 		openedProducts.setGmtCreate(DateUtil.now());
 		boolean res =openedProductsFacade.delInformationAvailable(openedProducts);
-		if(res !=true  ){
-			return RespDTO.onSuc("操作失败!");
+		if (!res){
+			throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
 		}
-		return RespDTO.onSuc("操作成功!");
+		return RespDTO.onSuc(res);
 	}
 
 	@ApiOperation(value = "根据用户id和产品id,修改开通时间[by:wangfeng]", notes = "修改开通时间")
@@ -164,10 +166,10 @@ public class ProductOrderController {
 		//TODO wangfeng openedProducts.setCreator(UserUtils.getCurrentPrincipleID());
 		openedProducts.setGmtCreate(DateUtil.now());
 		boolean res = openedProductsFacade.modifyOpeningTime(openedProducts);
-		if(res !=true  ){
-			return RespDTO.onSuc("操作失败!");
+		if (!res){
+			throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
 		}
-		return RespDTO.onSuc("操作成功!");
+		return RespDTO.onSuc(res);
 	}
 
 	@ApiOperation(value = "查询所有订单明细[by:wangyu]",

+ 15 - 0
diagbotman-service/src/main/java/com/diagbot/web/ProductServiceController.java

@@ -33,6 +33,11 @@ public class ProductServiceController {
     @Autowired
     private ProductServiceFacade productServiceFacade;
 
+    /**
+     * 服务端关联到产品接口
+     * @param productServiceSaveVO
+     * @return
+     */
     @ApiOperation(value = "服务端关联到产品接口[by:zhaops]",
             notes = "productId:产品Id,必填<br>" +
                     "serviceId:服务Id,必填<br> " +
@@ -45,6 +50,11 @@ public class ProductServiceController {
         return RespDTO.onSuc(productServiceDTO);
     }
 
+    /**
+     * 删除产品服务端
+     * @param productServiceSaveVO
+     * @return
+     */
     @ApiOperation(value = "删除产品服务端[by:zhaops]",
             notes = "productId:产品Id,必填<br>" +
                     "serviceId:服务Id,必填<br> " +
@@ -57,6 +67,11 @@ public class ProductServiceController {
         return RespDTO.onSuc(isSuccess);
     }
 
+    /**
+     * 根据用户id获取产品服务关联信息
+     * @param page
+     * @return
+     */
     @ApiOperation(value = "根据用户id获取产品服务关联信息[by:zhaops]", notes = "根据用户id获取产品服务关联信息")
     @PostMapping("/getProductServiceByCurrentUser")
     @SysLogger("getProductServiceByCurrentUser")

+ 19 - 0
diagbotman-service/src/main/java/com/diagbot/web/ServiceInfoController.java

@@ -37,6 +37,11 @@ public class ServiceInfoController {
     @Autowired
     private ServiceInfoFacade serviceInfoFacade;
 
+    /**
+     * 新增服务
+     * @param serviceSaveVO
+     * @return
+     */
     @ApiOperation(value = "新增服务[by:zhaops]",
             notes = "name:产品名称,必填<br>" +
                     "description:产品简介,必填<br> ")
@@ -48,6 +53,11 @@ public class ServiceInfoController {
         return RespDTO.onSuc(serviceInfo);
     }
 
+    /**
+     * 修改服务
+     * @param serviceInfo
+     * @return
+     */
     @ApiOperation(value = "修改服务[by:zhaops]",
             notes = "id:id,必填<br>" +
                     "name:产品名称,必填<br>" +
@@ -61,6 +71,10 @@ public class ServiceInfoController {
         return RespDTO.onSuc(isSuccess);
     }
 
+    /**
+     * 获取当前登录用户的服务列表
+     * @return
+     */
     @ApiOperation(value = "获取当前登录用户的服务列表[by:zhaops]")
     @PostMapping("/getServiceListByCurrentUser")
     @SysLogger("getServiceListByCurrentUser")
@@ -70,6 +84,11 @@ public class ServiceInfoController {
         return RespDTO.onSuc(list);
     }
 
+    /**
+     * 获取当前登录用户的服务分页列表
+     * @param page
+     * @return
+     */
     @ApiOperation(value = "获取当前登录用户的服务分页列表[by:zhaops]")
     @PostMapping("/getServiceListPageByCurrentUser")
     @SysLogger("getServiceListPageByCurrentUser")

+ 20 - 0
diagbotman-service/src/main/java/com/diagbot/web/ServiceTokenController.java

@@ -48,6 +48,11 @@ public class ServiceTokenController {
         return serviceTokenFacade.hasPermission(serviceTokenVo);
     }
 
+    /**
+     * 生成令牌
+     * @param productServiceSaveVO
+     * @return
+     */
     @ApiOperation(value = "生成令牌[by:zhaops]",
             notes = "productId:产品Id,必填<br>" +
                     "serviceId:服务Id,必填<br> ")
@@ -59,6 +64,11 @@ public class ServiceTokenController {
         return RespDTO.onSuc(productServiceDTO);
     }
 
+    /**
+     * 令牌禁用
+     * @param productServiceId
+     * @return
+     */
     @ApiOperation(value = "令牌禁用[by:zhaops]",
             notes = "productServiceId:产品服务id,必填<br>")
     @PostMapping("/disableToken")
@@ -69,6 +79,11 @@ public class ServiceTokenController {
         return RespDTO.onSuc(count);
     }
 
+    /**
+     * 令牌启用
+     * @param productServiceId
+     * @return
+     */
     @ApiOperation(value = "令牌启用[by:zhaops]",
             notes = "productServiceId:产品服务id,必填<br>")
     @PostMapping("/enableToken")
@@ -79,6 +94,11 @@ public class ServiceTokenController {
         return RespDTO.onSuc(count);
     }
 
+    /**
+     * 令牌删除
+     * @param productServiceId
+     * @return
+     */
     @ApiOperation(value = "令牌删除[by:zhaops]",
             notes = "productServiceId:产品服务id,必填<br>")
     @PostMapping("/deleteTokenByProductServiceId")

+ 1 - 14
diagbotman-service/src/main/resources/mapper/ProductServiceMapper.xml

@@ -28,24 +28,11 @@
         <result column="remark" property="remark" />
     </resultMap>
 
-    <select id="findByProductIdAndServiceId" resultMap="BaseResultMap" parameterType="java.util.Map">
-        select * from diag_product_service
-        where product_id = #{productId} and service_id=#{serviceId} and is_deleted = 'N'
-    </select>
-
-    <select id="findByProductId" resultMap="BaseResultMap" parameterType="java.lang.Long">
-        select * from diag_product_service
-        where product_id = #{productId} and is_deleted = 'N'
-    </select>
-
+    <!-- 根据用户id获取产品与服务端的关联列表(分页) -->
     <select id="selectProductServiceByUserIdPage" resultMap="BaseResultWrapperMap">
         select a.* from diag_product_service a,diag_opened_products b,diag_service_info c ,diag_lantone_product d
         where a.product_id=b.product_id and a.product_id=d.id and a.service_id=c.id and a.is_deleted='N' and b.is_deleted='N' and c.is_deleted='N' and b.service_status=1  and d.is_deleted='N'
         and b.user_id=#{productService.userId} and c.user_id=#{productService.userId} and (find_in_set('1',d.access_type) or FIND_IN_SET('2',d.access_type))
     </select>
 
-    <update id="delById" parameterType="java.lang.Long">
-        update diag_product_service set is_deleted='Y'
-        where id = #{id} and is_deleted = 'N'
-    </update>
 </mapper>

+ 0 - 17
diagbotman-service/src/main/resources/mapper/ServiceInfoMapper.xml

@@ -15,21 +15,4 @@
         <result column="user_id" property="userId" />
         <result column="type" property="type" />
     </resultMap>
-
-    <!-- 通过名称查询 -->
-    <select id="findByName" resultMap="BaseResultMap" parameterType="java.lang.String">
-        select * from diag_service_info
-        where name = #{name} and is_deleted = 'N'
-    </select>
-
-    <!-- 通过用户id查询服务列表 -->
-    <select id="getListByUserId" resultMap="BaseResultMap" parameterType="java.lang.Long">
-        select * from diag_service_info
-        where user_id = #{userId} and is_deleted = 'N' and type=1;
-    </select>
-
-    <!-- 通过用户id查询服务分页列表 -->
-    <select id="selectServiceListPage" resultMap="BaseResultMap">
-        select * from diag_service_info where user_id=#{serviceInfo.userId} and is_deleted='N' and type=1;
-    </select>
 </mapper>

+ 125 - 2
user-service/src/main/java/com/diagbot/dto/UserInfoDTO.java

@@ -6,6 +6,8 @@ import java.util.Date;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.diagbot.enums.AuthStatusEnum;
+import com.diagbot.enums.OrganizationTypeEnum;
 
 import lombok.Getter;
 import lombok.Setter;
@@ -16,8 +18,6 @@ import lombok.Setter;
  * @Description: 用户信息类表
  * @date 2018年9月17日 下午4:35:35
  */
-@Setter
-@Getter
 public class UserInfoDTO implements Serializable{
 	
 	 private static final long serialVersionUID = 1L;
@@ -33,6 +33,7 @@ public class UserInfoDTO implements Serializable{
 	    private Date orgGmtCreate;//记录创建时间
 	    private String orgName;//机构名称
 	    private Integer orgType;//机构属性
+	    private String  orgTypeStr;//机构属性String
 	    private String orgPrincipal;//负责人
 	    private String orgAddress;//机构地址
 	    private Long orgParentId;//上级机构id
@@ -40,5 +41,127 @@ public class UserInfoDTO implements Serializable{
 	    private String autPosition;//岗位信息
 	    private Integer autIsReject;//是否通过认证 N:未通过,Y:已通过
 	    private Integer autStatus;//认证状态
+	    private String autStatusStr;//认证状态String
+		public Long getUserId() {
+			return userId;
+		}
+		public void setUserId(Long userId) {
+			this.userId = userId;
+		}
+		public Date getUserGmtCreate() {
+			return userGmtCreate;
+		}
+		public void setUserGmtCreate(Date userGmtCreate) {
+			this.userGmtCreate = userGmtCreate;
+		}
+		public String getUserName() {
+			return userName;
+		}
+		public void setUserName(String userName) {
+			this.userName = userName;
+		}
+		public String getLinKman() {
+			return linKman;
+		}
+		public void setLinKman(String linKman) {
+			this.linKman = linKman;
+		}
+		public String getEmail() {
+			return email;
+		}
+		public void setEmail(String email) {
+			this.email = email;
+		}
+		public Long getOrgId() {
+			return orgId;
+		}
+		public void setOrgId(Long orgId) {
+			this.orgId = orgId;
+		}
+		public Date getOrgGmtCreate() {
+			return orgGmtCreate;
+		}
+		public void setOrgGmtCreate(Date orgGmtCreate) {
+			this.orgGmtCreate = orgGmtCreate;
+		}
+		public String getOrgName() {
+			return orgName;
+		}
+		public void setOrgName(String orgName) {
+			this.orgName = orgName;
+		}
+		public Integer getOrgType() {
+			return orgType;
+		}
+		public void setOrgType(Integer orgType) {
+			if(orgType!=null){
+				setOrgTypeStr(OrganizationTypeEnum.getName(orgType));	
+			}
+			this.orgType = orgType;
+		}
+		public String getOrgTypeStr() {
+			return orgTypeStr;
+		}
+		public void setOrgTypeStr(String orgTypeStr) {
+			this.orgTypeStr = orgTypeStr;
+		}
+		public String getOrgPrincipal() {
+			return orgPrincipal;
+		}
+		public void setOrgPrincipal(String orgPrincipal) {
+			this.orgPrincipal = orgPrincipal;
+		}
+		public String getOrgAddress() {
+			return orgAddress;
+		}
+		public void setOrgAddress(String orgAddress) {
+			this.orgAddress = orgAddress;
+		}
+		public Long getOrgParentId() {
+			return orgParentId;
+		}
+		public void setOrgParentId(Long orgParentId) {
+			this.orgParentId = orgParentId;
+		}
+		public Integer getOrgSubNum() {
+			return orgSubNum;
+		}
+		public void setOrgSubNum(Integer orgSubNum) {
+			this.orgSubNum = orgSubNum;
+		}
+		public String getAutPosition() {
+			return autPosition;
+		}
+		public void setAutPosition(String autPosition) {
+			this.autPosition = autPosition;
+		}
+		public Integer getAutIsReject() {
+			return autIsReject;
+		}
+		public void setAutIsReject(Integer autIsReject) {
+			this.autIsReject = autIsReject;
+		}
+		public Integer getAutStatus() {
+			return autStatus;
+		}
+		public void setAutStatus(Integer autStatus) {
+			if(autStatus!=null){
+				setAutStatusStr(AuthStatusEnum.getName(autStatus));
+			}
+			this.autStatus = autStatus;
+		}
+		public static long getSerialversionuid() {
+			return serialVersionUID;
+		}
+		public String getAutStatusStr() {
+			return autStatusStr;
+		}
+		public void setAutStatusStr(String autStatusStr) {
+			this.autStatusStr = autStatusStr;
+		}
+	
+	    
+	    
+	    
 
 }

+ 15 - 12
user-service/src/main/java/com/diagbot/dto/UserInfoExportDTO.java

@@ -19,26 +19,26 @@ import lombok.Setter;
 @Getter
 public class UserInfoExportDTO {
 	private static final long serialVersionUID = 1L;
-    private Long userId;//用户ID
-    private Date userGmtCreate;//记录创建时间
+    private String userId;//用户ID
+    private String userGmtCreate;//记录创建时间
     private String userName;// 用户名
     private String linKman;//联系人
     private String email;// 邮箱
-    private Long orgId;//机构ID
-    private Date orgGmtCreate;//记录创建时间
+    private String orgId;//机构ID
+    private String orgGmtCreate;//记录创建时间
     private String orgName;//机构名称
-    private Integer orgType;//机构属性
+    private String orgType;//机构属性
     private String orgPrincipal;//负责人
     private String orgAddress;//机构地址
-    private Long orgParentId;//上级机构id
-    private Integer orgSubNum;//下属机构数量
+    private String orgParentId;//上级机构id
+    private String orgSubNum;//下属机构数量
     private String autPosition;//岗位信息
-    private Integer autIsReject;//是否通过认证 N:未通过,Y:已通过
-    private Integer autStatus;//认证状态
+    private String autIsReject;//是否通过认证 N:未通过,Y:已通过
+    private String autStatus;//认证状态
     
-    public UserInfoExportDTO(Long userId, Date userGmtCreate, String userName, String linKman, String email, Long orgId,
-			String orgName, Integer orgType, String orgPrincipal, String orgAddress, Long orgParentId,
-			Integer orgSubNum, String autPosition, Integer autIsReject, Integer autStatus) {
+    public UserInfoExportDTO(String userId, String userGmtCreate, String userName, String linKman, String email, String orgId,
+			String orgName, String orgType, String orgPrincipal, String orgAddress, String orgParentId,
+			String orgSubNum, String autPosition, String autIsReject, String autStatus) {
 		this.userId = userId;
 		this.userGmtCreate=userGmtCreate;
 		this.userName=userName;
@@ -55,4 +55,7 @@ public class UserInfoExportDTO {
 		this.autIsReject=autIsReject;
 		this.autStatus=autStatus;
 	}
+    public UserInfoExportDTO(){
+    	
+    }
 }

+ 44 - 40
user-service/src/main/java/com/diagbot/facade/UserAuthenticationFacade.java

@@ -1,13 +1,6 @@
 package com.diagbot.facade;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.QueryAuthProgressDTO;
 import com.diagbot.dto.UserAuthenticationDTO;
 import com.diagbot.dto.WaitAuthenDTO;
@@ -21,6 +14,12 @@ import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.UserAuthenticationServiceImpl;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.UserAuthenticationVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * @Description:用户认证业务层
@@ -35,9 +34,10 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
     private OrganizationFacade organizationFacade;
 
     /**
-     * @Description:用户认证
-     * @author: zhaops
-     * @time: 2018/9/13 19:30
+     * 用户认证
+     *
+     * @param userAuthenticationVO
+     * @return
      */
     public UserAuthenticationDTO userAuthentication(UserAuthenticationVO userAuthenticationVO) {
         UserAuthenticationDTO userAuthenticationDTO = new UserAuthenticationDTO();
@@ -59,7 +59,10 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
                     "当前用户没有关联机构,不允许验证");
         }
         //更新机构信息
-        Organization organization = organizationFacade.getByName(userAuthenticationVO.getOrganization());
+        QueryWrapper<Organization> qwOrganization = new QueryWrapper<>();
+        qwOrganization.eq("name", userAuthenticationVO.getOrganization());
+        qwOrganization.eq("is_deleted", "N");
+        Organization organization = organizationFacade.getOne(qwOrganization);
         if (organization == null) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "找不到机构【" + userAuthenticationVO.getOrganization() + "】");
@@ -76,7 +79,10 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
         organizationFacade.updateById(organization);
 
         //更新验证信息
-        UserAuthentication userAuthentication = this.getByUserId(userId);
+        QueryWrapper<UserAuthentication> qwAuthentication = new QueryWrapper<>();
+        qwAuthentication.eq("user_id", userId);
+        qwAuthentication.eq("is_deleted", "N");
+        UserAuthentication userAuthentication = this.getOne(qwAuthentication);
         if (userAuthentication == null) {
             userAuthentication = new UserAuthentication();
             userAuthentication.setCreator(userId.toString());
@@ -102,15 +108,18 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
     }
 
     /**
-     * @Description:获取用户认证信息
-     * @author: zhaops
-     * @time: 2018/9/13 19:30
+     * 获取待认证用户信息
+     *
+     * @return
      */
     public UserAuthenticationDTO getuserAuthenticationInfo() {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
         User user = userFacade.getById(userId);
         Organization organization = organizationFacade.getByUserId(userId);
-        UserAuthentication userAuthentication = this.getByUserId(userId);
+        QueryWrapper<UserAuthentication> qw = new QueryWrapper<>();
+        qw.eq("user_id", userId);
+        qw.eq("is_deleted", "N");
+        UserAuthentication userAuthentication = this.getOne(qw);
         UserAuthenticationDTO userAuthenticationDTO = new UserAuthenticationDTO();
         userAuthenticationDTO.setUser(user);
         userAuthenticationDTO.setOrganization(organization);
@@ -124,32 +133,22 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
     }
 
     /**
-     * @Description:获取用户认证状态
-     * @author: zhaops
-     * @time: 2018/9/13 19:30
+     * 获取用户认证状态
+     *
+     * @return
      */
     public Map<Integer, Object> getUserAuthenticationStatus() {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
-        UserAuthentication userAuthentication = this.getByUserId(userId);
+        QueryWrapper<UserAuthentication> qw = new QueryWrapper<>();
+        qw.eq("user_id", userId);
+        qw.eq("is_deleted", "N");
+        UserAuthentication userAuthentication = this.getOne(qw);
         Map<Integer, Object> map = new HashMap<>();
         if (userAuthentication == null) {
             map.put(99, "当前用户没有认证信息");
         } else {
             Integer status = userAuthentication.getStatus();
             String statusName = AuthStatusEnum.getName(status);
-//            switch (status) {
-//                case 0:
-//                    statusName = AuthStatusEnum.Unauthorized.getName();
-//                    break;
-//                case 1:
-//                    statusName = AuthStatusEnum.Authorized.getName();
-//                    break;
-//                case 2:
-//                    statusName = AuthStatusEnum.Authorizing.getName();
-//                    break;
-//                default:
-//                    break;
-//            }
             map.put(status, statusName);
         }
         return map;
@@ -157,11 +156,15 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
 
     /**
      * 控制台-获取用户账号的认证进度
+     *
      * @return 包含当前账号的认证状态
      */
     public QueryAuthProgressDTO queryAuthProgress() {
         Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
-        UserAuthentication userAuthentication = this.getByUserId(userId);
+        QueryWrapper<UserAuthentication> qw = new QueryWrapper<>();
+        qw.eq("user_id", userId);
+        qw.eq("is_deleted", "N");
+        UserAuthentication userAuthentication = this.getOne(qw);
 
         QueryAuthProgressDTO queryAuthProgressDTO = new QueryAuthProgressDTO();
         queryAuthProgressDTO.setStatus(userAuthentication.getStatus());
@@ -170,14 +173,15 @@ public class UserAuthenticationFacade extends UserAuthenticationServiceImpl {
 
         return queryAuthProgressDTO;
     }
-    
+
     /**
      * 控制台-获取待认证的账号数量
+     *
      * @return 待认证的账号个数
      */
-    public WaitAuthenDTO waitAuthen(){
-    	WaitAuthenDTO waitAuthenDTO = new WaitAuthenDTO();
-    	waitAuthenDTO.setCount(baseMapper.getAllWaitAuthCou());
-    	return waitAuthenDTO;
+    public WaitAuthenDTO waitAuthen() {
+        WaitAuthenDTO waitAuthenDTO = new WaitAuthenDTO();
+        waitAuthenDTO.setCount(baseMapper.getAllWaitAuthCou());
+        return waitAuthenDTO;
     }
 }

+ 89 - 1
user-service/src/main/java/com/diagbot/facade/UserFacade.java

@@ -1,11 +1,14 @@
 package com.diagbot.facade;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.client.AuthServiceClient;
 import com.diagbot.dto.GetConsoleUserInfoDTO;
 import com.diagbot.dto.LoginDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.UserInfoDTO;
+import com.diagbot.dto.UserInfoExportDTO;
 import com.diagbot.dto.UserOrgDTO;
 import com.diagbot.entity.JWT;
 import com.diagbot.entity.Organization;
@@ -14,17 +17,23 @@ import com.diagbot.entity.UserAuthentication;
 import com.diagbot.entity.UserOrganization;
 import com.diagbot.entity.UserRole;
 import com.diagbot.entity.wrapper.MenuWrapper;
+import com.diagbot.enums.AuthStatusEnum;
+import com.diagbot.enums.OrganizationTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.exception.ServiceErrorCode;
 import com.diagbot.service.impl.UserServiceImpl;
 import com.diagbot.util.BeanUtil;
+import com.diagbot.util.DateUtil;
 import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExportBeanExcelUtil;
+import com.diagbot.util.GsonUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.RegexValidateUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.ImgVerVerVO;
+import com.diagbot.vo.UserExportVO;
 import com.diagbot.vo.UserSaveVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.CacheEvict;
@@ -371,7 +380,10 @@ public class UserFacade extends UserServiceImpl {
 		Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
 	    User user = this.getById(userId);
 	    Organization organization = organizationFacade.getByUserId(userId);
-	    UserAuthentication userAuthentication = userAuthenticationFacade.getByUserId(userId);
+        QueryWrapper<UserAuthentication> qw = new QueryWrapper<>();
+        qw.eq("user_id", userId);
+        qw.eq("is_deleted", "N");
+        UserAuthentication userAuthentication = userAuthenticationFacade.getOne(qw);
 	        
 	    GetConsoleUserInfoDTO getConsoleUserInfoDTO = new GetConsoleUserInfoDTO();
 	    getConsoleUserInfoDTO.setUser(user);
@@ -399,4 +411,80 @@ public class UserFacade extends UserServiceImpl {
         }
         return userIdList;
     }
+    /**
+	 * 
+	 * @param userExportVO
+	 * @return 导出Excel文件 
+	 */
+	public RespDTO export(UserExportVO userExportVO){
+		Map<String, Object> userMap = new HashMap<String, Object>();
+		userMap.put("startTime", userExportVO.getStartTime());
+		userMap.put("endTime", userExportVO.getEndTime());
+		List<UserInfoDTO> datas = dependentuserInfoByTime(userMap);
+		GsonUtil.toJson(datas);
+		List<String> listName = new ArrayList<>();
+
+		listName.add("用户id");
+		listName.add("记录创建时间");
+		listName.add("用户名");
+		listName.add("联系人");
+		listName.add("邮箱");
+		listName.add("机构ID");
+		listName.add("机构名称");
+		listName.add("机构属性");
+		listName.add("负责人");
+		listName.add("机构地址");
+		listName.add("上级机构id");
+		listName.add("下属机构数量");
+		listName.add("岗位信息");
+		listName.add("是否通过认证 ");
+		listName.add("认证状态");
+		
+		List<String> listId = new ArrayList<>();
+		listId.add("userId");//用户ID
+		listId.add("userGmtCreate");//记录创建时间
+		listId.add("userName");// 用户名
+		listId.add("linKman");//联系人
+		listId.add("email");// 邮箱
+		listId.add("orgId");//机构ID
+		//listId.add("orgGmtCreate");//记录创建时间
+		listId.add("orgName");//机构名称
+		listId.add("orgType");//机构属性
+		listId.add("orgPrincipal");//负责人
+        listId.add("orgAddress");//机构地址
+        listId.add("orgParentId");//上级机构id
+        listId.add("orgSubNum");//下属机构数量
+        listId.add("autPosition");//岗位信息
+        listId.add("autIsReject");//是否通过认证 N:未通过,Y:已通过
+        listId.add("autStatus");//认证状态
+		
+		List<UserInfoExportDTO> list = new ArrayList<>();
+		for (int i = 0; i < datas.size(); i++) {
+			UserInfoDTO userInfo = datas.get(i); 
+			list.add(new UserInfoExportDTO(String.valueOf(userInfo.getUserId()),
+					DateUtil.formatDate(userInfo.getUserGmtCreate()),
+					userInfo.getUserName(),
+					userInfo.getLinKman(),
+					userInfo.getEmail(),
+					String.valueOf(userInfo.getOrgId()),
+					userInfo.getOrgName(),
+					OrganizationTypeEnum.getName(userInfo.getOrgType()),
+					userInfo.getOrgPrincipal(),
+					userInfo.getOrgAddress(),
+					String.valueOf(userInfo.getOrgParentId()),
+					String.valueOf(userInfo.getOrgSubNum()),
+					userInfo.getAutPosition(),
+					String.valueOf(userInfo.getAutIsReject()),
+					AuthStatusEnum.getName(userInfo.getAutStatus())));
+		}
+		//response.setContentType("text/html;charset=UTF-8");
+		String filePath =userExportVO.getFilePath();//文件路径
+		String fileName = userExportVO.getFileName();//文件名
+		ExportBeanExcelUtil ex = new ExportBeanExcelUtil();
+		RespDTO resul = ex.exportExcel("测试POI导出EXCEL文档", listName, listId, list,filePath,fileName);
+		
+		return resul;
+		
+		
+	}
 }

+ 49 - 45
user-service/src/main/java/com/diagbot/facade/VerFacade.java

@@ -41,9 +41,10 @@ public class VerFacade {
 
     /**
      * 获取用户图片验证信息
+     *
      * @return 图片验证码信息
      */
-    public ImgVerCreatDTO getImgVerification(){
+    public ImgVerCreatDTO getImgVerification() {
         ImgVerCreatDTO imgVerCreatDTO = new ImgVerCreatDTO();
         String imgId = visibleIdCreater.getNextId(VisibleIdTypeEnum.IS_IMG_VER.getKey()).toString();
         ImgVerInfo imgVerInfo = new ImgVerInfo();
@@ -56,10 +57,11 @@ public class VerFacade {
 
     /**
      * 验证用户图片验证码是否有效
+     *
      * @param imgVerVerVO 图片验证码验证输入信息
      * @return 验证是否成功
      */
-    public Boolean verifyImgVerification(ImgVerVerVO imgVerVerVO){
+    public Boolean verifyImgVerification(ImgVerVerVO imgVerVerVO) {
         ImgVerInfo imgVerInfo = new ImgVerInfo();
         BeanUtil.copyProperties(imgVerVerVO, imgVerInfo);
         return imgVerService.verifyImgVerification(imgVerInfo);
@@ -67,24 +69,25 @@ public class VerFacade {
 
     /**
      * 获取短信验证码
+     *
      * @param smsVerCreatVO 获取短信验证码输入参数
      * @return 获取短信验证码是否成功
      */
-    public Boolean getSmsVerification(SmsVerCreatVO smsVerCreatVO){
+    public Boolean getSmsVerification(SmsVerCreatVO smsVerCreatVO) {
         //参数验证
-        if (StringUtil.isBlank(smsVerCreatVO.getImgId())){
+        if (StringUtil.isBlank(smsVerCreatVO.getImgId())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "图片验证码唯一标志不能为空!");
         }
-        if (StringUtil.isBlank(smsVerCreatVO.getCode())){
+        if (StringUtil.isBlank(smsVerCreatVO.getCode())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "图片验证码不能为空!");
         }
-        if (StringUtil.isBlank(smsVerCreatVO.getMobile())){
+        if (StringUtil.isBlank(smsVerCreatVO.getMobile())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "用户电话不能为空!");
         }
-        if (!RegexValidateUtil.checkMobileNumber(smsVerCreatVO.getMobile())){
+        if (!RegexValidateUtil.checkMobileNumber(smsVerCreatVO.getMobile())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
                     "请输入正确的手机号!");
         }
@@ -92,17 +95,17 @@ public class VerFacade {
         ImgVerInfo imgVerInfo = new ImgVerInfo();
         BeanUtil.copyProperties(smsVerCreatVO, imgVerInfo);
         Boolean imgVerRes = imgVerService.verifyImgVerification(imgVerInfo);
-        if (imgVerRes){
+        if (imgVerRes) {
             User bean = userFacade.getUserInfo(smsVerCreatVO.getMobile());
-            if (bean != null){
+            if (bean != null) {
                 throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "该号码已经被注册!");
             }
 
             //验证是否超过三分钟
             SwsVerInfo swsVerInfoCheck = smsVerService.getSmsVerification(smsVerCreatVO.getMobile());
-            if (null != swsVerInfoCheck){
+            if (null != swsVerInfoCheck) {
                 if (DateUtil.after(DateUtil.addMinutes(swsVerInfoCheck.getCreateTime(), VerFacade.SMS_MINS),
-                        DateUtil.now())){
+                        DateUtil.now())) {
                     throw new CommonException(ServiceErrorCode.SMS_SEND_ERROR,
                             "同一用户三分钟之内不能重复发送验证短信,请三分钟之后再次发送!");
                 }
@@ -123,40 +126,40 @@ public class VerFacade {
     }
 
 
-
     /**
      * 忘记密码获取短信验证码
+     *
      * @param smsVerCreatVO 获取短信验证码输入参数
      * @return 获取短信验证码是否成功
      */
-    public Boolean getSmsWithResetPassword(SmsVerCreatVO smsVerCreatVO){
+    public Boolean getSmsWithResetPassword(SmsVerCreatVO smsVerCreatVO) {
         //参数验证
-        if (StringUtil.isBlank(smsVerCreatVO.getImgId())){
+        if (StringUtil.isBlank(smsVerCreatVO.getImgId())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "图片验证码唯一标志不能为空!");
         }
-        if (StringUtil.isBlank(smsVerCreatVO.getCode())){
+        if (StringUtil.isBlank(smsVerCreatVO.getCode())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "图片验证码不能为空!");
         }
-        if (StringUtil.isBlank(smsVerCreatVO.getMobile())){
+        if (StringUtil.isBlank(smsVerCreatVO.getMobile())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "用户电话不能为空!");
         }
-        if (!RegexValidateUtil.checkMobileNumber(smsVerCreatVO.getMobile())){
+        if (!RegexValidateUtil.checkMobileNumber(smsVerCreatVO.getMobile())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
                     "请输入正确的手机号!");
         }
         User bean = userFacade.getUserInfo(smsVerCreatVO.getMobile());
-        if (bean == null){
+        if (bean == null) {
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "手机号未注册!");
         }
 
         //验证是否超过三分钟
         SwsVerInfo swsVerInfoCheck = smsVerService.getSmsVerification(smsVerCreatVO.getMobile());
-        if (null != swsVerInfoCheck){
+        if (null != swsVerInfoCheck) {
             if (DateUtil.after(DateUtil.addMinutes(swsVerInfoCheck.getCreateTime(), 3000), //TODO 方便测试先加大时间间隔
-                    DateUtil.now())){
+                    DateUtil.now())) {
                 throw new CommonException(ServiceErrorCode.SMS_SEND_ERROR,
                         "同一用户三分钟之内不能重复发送验证短信,请三分钟之后再次发送!");
             }
@@ -176,53 +179,54 @@ public class VerFacade {
 
     /**
      * 验证短信码
+     *
      * @param smsVerVerVO 短信验证码验证输入信息
      * @return 校验短信验证码是否通过
      */
-    public Boolean verifySmsVerification(SmsVerVerVO smsVerVerVO){
+    public Boolean verifySmsVerification(SmsVerVerVO smsVerVerVO) {
         //参数验证
-        if (null == smsVerVerVO){
+        if (null == smsVerVerVO) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "短信验证码验证输入信息不能为空!");
         }
-//        if (StringUtil.isBlank(smsVerVerVO.getImgId())){
-//            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-//                    "图片验证码唯一标志不能为空!");
-//        }
-//        if (StringUtil.isBlank(smsVerVerVO.getCode())){
-//            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
-//                    "图片验证码不能为空!");
-//        }
-        if (StringUtil.isBlank(smsVerVerVO.getMobile())){
+        //        if (StringUtil.isBlank(smsVerVerVO.getImgId())){
+        //            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+        //                    "图片验证码唯一标志不能为空!");
+        //        }
+        //        if (StringUtil.isBlank(smsVerVerVO.getCode())){
+        //            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+        //                    "图片验证码不能为空!");
+        //        }
+        if (StringUtil.isBlank(smsVerVerVO.getMobile())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "用户电话不能为空!");
         }
-        if (StringUtil.isBlank(smsVerVerVO.getSmsCode())){
+        if (StringUtil.isBlank(smsVerVerVO.getSmsCode())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "短信验证码不能为空!");
         }
-        if (!RegexValidateUtil.checkMobileNumber(smsVerVerVO.getMobile())){
+        if (!RegexValidateUtil.checkMobileNumber(smsVerVerVO.getMobile())) {
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR,
                     "请输入正确的手机号!");
         }
         //验证图片验证码
-//        ImgVerInfo imgVerInfo = new ImgVerInfo();
-//        BeanUtil.copyProperties(smsVerVerVO, imgVerInfo);
-//        Boolean imgVerRes = imgVerService.verifyImgVerification(imgVerInfo);
-//        if (imgVerRes){
-//            User bean = userFacade.getUserInfo(smsVerVerVO.getMobile());
-//            if (bean != null){
-//                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "该号码已经被注册!");
-//            }
-//        } else {
-//            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "输入图形验证码有误!");
-//        }
+        //        ImgVerInfo imgVerInfo = new ImgVerInfo();
+        //        BeanUtil.copyProperties(smsVerVerVO, imgVerInfo);
+        //        Boolean imgVerRes = imgVerService.verifyImgVerification(imgVerInfo);
+        //        if (imgVerRes){
+        //            User bean = userFacade.getUserInfo(smsVerVerVO.getMobile());
+        //            if (bean != null){
+        //                throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "该号码已经被注册!");
+        //            }
+        //        } else {
+        //            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "输入图形验证码有误!");
+        //        }
         //验证用户短信信息
         SwsVerInfo swsVerInfo = new SwsVerInfo();
         swsVerInfo.setMobile(smsVerVerVO.getMobile());
         swsVerInfo.setCode(smsVerVerVO.getSmsCode());
         Boolean smsVer = smsVerService.verifySmsVerification(swsVerInfo);
-        if (!smsVer){
+        if (!smsVer) {
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "短信验证码输入有误,请重新输入!");
         }
         return true;

+ 0 - 7
user-service/src/main/java/com/diagbot/mapper/OrganizationMapper.java

@@ -22,13 +22,6 @@ public interface OrganizationMapper extends BaseMapper<Organization> {
      */
     public Organization getByUserId(Long userId);
 
-    /**
-     * @Description: 通过机构名称获取组织结构
-     * @Author: zhaops
-     * @Date: 2018/9/13 19:24
-     */
-    public Organization getByName(String name);
-
     /**
      * @Description: 模糊查询机构名称
      * @Author: wangfeng

+ 0 - 1
user-service/src/main/java/com/diagbot/mapper/UserAuthenticationMapper.java

@@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @since 2018-09-17
  */
 public interface UserAuthenticationMapper extends BaseMapper<UserAuthentication> {
-    UserAuthentication getByUserId(Long userId);
     
     int getAllWaitAuthCou();
 }

+ 1 - 1
user-service/src/main/java/com/diagbot/mapper/UserMapper.java

@@ -55,7 +55,7 @@ public interface UserMapper extends BaseMapper<User> {
     
     public Integer updateById(Map<String,String> map);
     
-    public List<UserInfoExportDTO> dependentuserInfoByTime(@Param("userExport") Map<String,Object> map);
+    public List<UserInfoDTO> dependentuserInfoByTime(@Param("userExport") Map<String,Object> map);
 
     public List<User> getUserByOrgName(String orgName);
 

+ 1 - 0
user-service/src/main/java/com/diagbot/service/EnumsDataService.java

@@ -13,6 +13,7 @@ import java.util.Map;
 public interface EnumsDataService {
     /**
      * 用户枚举数据获取
+     *
      * @return 用户枚举类map
      */
     Map<String, List<EnumEntriesBuilder.Entry>> getEnumsData();

+ 2 - 0
user-service/src/main/java/com/diagbot/service/ImgVerService.java

@@ -11,6 +11,7 @@ public interface ImgVerService {
 
     /**
      * 创建用户图片验证信息
+     *
      * @param imgVerInfo 图片验证码验证信息
      * @return 图片验证码数据流
      */
@@ -23,6 +24,7 @@ public interface ImgVerService {
 
     /**
      * 获取用户图片验证码信息
+     *
      * @param imgId
      * @return
      */

+ 1 - 9
user-service/src/main/java/com/diagbot/service/OrganizationService.java

@@ -6,8 +6,6 @@ import com.diagbot.entity.Organization;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.ibatis.annotations.Param;
-
 /**
  * @Description: 机构service
  * @Author: ztg
@@ -30,13 +28,7 @@ public interface OrganizationService extends IService<Organization> {
      */
     public Organization getByUserId(Long userId);
 
-    /**
-     * @Description: 通过机构名称获取组织结构
-     * @Author: zhaops
-     * @Date: 2018/9/13 19:24
-     */
-    public Organization getByName(String name);
-    
+
     /**
      * @Description: 模糊查询机构名称
      * @Author: wangfeng

+ 1 - 0
user-service/src/main/java/com/diagbot/service/SmsVerService.java

@@ -25,6 +25,7 @@ public interface SmsVerService {
 
     /**
      * 获取用户短信验证码信息
+     *
      * @param mobile 用户电话
      * @return 用户短信验证信息
      */

+ 1 - 2
user-service/src/main/java/com/diagbot/service/UserAuthenticationService.java

@@ -1,7 +1,7 @@
 package com.diagbot.service;
 
-import com.diagbot.entity.UserAuthentication;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.entity.UserAuthentication;
 
 /**
  * <p>
@@ -12,5 +12,4 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @since 2018-09-17
  */
 public interface UserAuthenticationService extends IService<UserAuthentication> {
-    UserAuthentication getByUserId(Long userId);
 }

+ 1 - 1
user-service/src/main/java/com/diagbot/service/UserOrganizationService.java

@@ -19,6 +19,6 @@ public interface UserOrganizationService extends IService<UserOrganization> {
      * @Date: 2018/9/17 15:16
      */
     public List<UserOrganization> selectByMap(Map map);
-    
+
     public List<UserOrganization> getAgencyPersonnel(UserOrganization userORG);
 }

+ 9 - 8
user-service/src/main/java/com/diagbot/service/UserService.java

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.diagbot.dto.UserInfoDTO;
-import com.diagbot.dto.UserInfoExportDTO;
 import com.diagbot.dto.UserOrgDTO;
 import com.diagbot.entity.User;
 
@@ -13,7 +12,7 @@ import java.util.Map;
 
 /**
  * <p>
- *  服务类
+ * 服务类
  * </p>
  *
  * @author gaodm
@@ -23,6 +22,7 @@ public interface UserService extends IService<User> {
 
     /**
      * 根据用户查找信息
+     *
      * @param username 用户名
      * @return 用户信息
      */
@@ -30,17 +30,18 @@ public interface UserService extends IService<User> {
 
     /**
      * 根据用户id获取用户信息(示例)
+     *
      * @param page 翻页信息
      * @param user 用户输入信息
      * @return 翻页用户信息
      */
     IPage<User> selectUserListPage(Page<User> page, User user);
-    
-    public IPage<UserInfoDTO>  selectUserInfoListPage(Page<UserInfoDTO> page,UserInfoDTO userInfo);
-    
+
+    public IPage<UserInfoDTO> selectUserInfoListPage(Page<UserInfoDTO> page, UserInfoDTO userInfo);
+
     public boolean updateUserInfoAll(Map<String, Object> userMap);
 
-    boolean updateDeleted(Map<String,Object> map);
+    boolean updateDeleted(Map<String, Object> map);
 
     IPage<User> indexPage(Page<User> page, User user);
 
@@ -48,9 +49,9 @@ public interface UserService extends IService<User> {
 
     public List<UserOrgDTO> getUserOrgByIds(List<Long> userIds);
 
-    public boolean auditUserInfoAll(Map<String,Object> auditMap);
+    public boolean auditUserInfoAll(Map<String, Object> auditMap);
 
-    public List<UserInfoExportDTO> dependentuserInfoByTime(Map<String,Object> map);
+    public List<UserInfoDTO> dependentuserInfoByTime(Map<String, Object> map);
 
     public List<User> getUserByOrgName(String orgName);
 }

+ 1 - 8
user-service/src/main/java/com/diagbot/service/impl/OrganizationServiceImpl.java

@@ -37,14 +37,7 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
     public Organization getByUserId(Long userId){
         return baseMapper.getByUserId(userId);
     }
-    /**
-     * @Description: 通过机构名称获取组织结构
-     * @Author: zhaops
-     * @Date: 2018/9/13 19:24
-     */
-    public Organization getByName(String name){
-        return baseMapper.getByName(name);
-    }
+
 
     /**
      * @Description: 模糊查询机构名称

+ 0 - 3
user-service/src/main/java/com/diagbot/service/impl/UserAuthenticationServiceImpl.java

@@ -16,7 +16,4 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class UserAuthenticationServiceImpl extends ServiceImpl<UserAuthenticationMapper, UserAuthentication> implements UserAuthenticationService {
-    public UserAuthentication getByUserId(Long userId) {
-        return baseMapper.getByUserId(userId);
-    }
 }

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

@@ -93,7 +93,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     }
 
 	@Override
-	public List<UserInfoExportDTO> dependentuserInfoByTime(Map<String, Object> map) {
+	public List<UserInfoDTO> dependentuserInfoByTime(Map<String, Object> map) {
 
 		return baseMapper.dependentuserInfoByTime(map);
 	}

+ 127 - 130
user-service/src/main/java/com/diagbot/util/ExportBeanExcelUtil.java

@@ -1,5 +1,13 @@
 package com.diagbot.util;
 
+import com.diagbot.dto.RespDTO;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFCellStyle;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -12,142 +20,131 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.poi.hssf.usermodel.HSSFCell;
-import org.apache.poi.hssf.usermodel.HSSFCellStyle;
-import org.apache.poi.hssf.usermodel.HSSFRow;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+@SuppressWarnings({ "deprecation" })
+public class ExportBeanExcelUtil<T> {
+    private final String MSG_SUCCESS = "操作成功!";
+    private final String MSG_ERROR = "操作失败!";
 
-import com.diagbot.dto.RespDTO;
-import org.apache.poi.ss.usermodel.HorizontalAlignment;
+    /**
+     * 这是一个通用的方法,利用了JAVA的反射机制,可以将放置在JAVA集合中并且符号一定条件的数据以EXCEL 的形式输出
+     * <p>
+     * title         表格标题名
+     * headersName  表格属性列名数组
+     * headersId    表格属性列名对应的字段---你需要导出的字段名(为了更灵活控制你想要导出的字段)
+     * dtoList     需要显示的数据集合,集合中一定要放置符合javabean风格的类的对象
+     * out         与输出设备关联的流对象,可以将EXCEL文档导出到本地文件或者网络中
+     */
+    public RespDTO exportExcel(String title, List<String> headersName, List<String> headersId,
+                               List<T> dtoList, String lujing, String fileName) {
+        /*(一)表头--标题栏*/
+        Map<Integer, String> headersNameMap = new HashMap<>();
+        int key = 0;
+        for (int i = 0; i < headersName.size(); i++) {
+            if (!headersName.get(i).equals(null)) {
+                headersNameMap.put(key, headersName.get(i));
+                key++;
+            }
+        }
+        /*(二)字段*/
+        Map<Integer, String> titleFieldMap = new HashMap<>();
+        int value = 0;
+        for (int i = 0; i < headersId.size(); i++) {
+            if (!headersId.get(i).equals(null)) {
+                titleFieldMap.put(value, headersId.get(i));
+                value++;
+            }
+        }
+        /* (三)声明一个工作薄:包括构建工作簿、表格、样式*/
+        HSSFWorkbook wb = new HSSFWorkbook();
+        HSSFSheet sheet = wb.createSheet(title);
+        sheet.setDefaultColumnWidth((short) 15);
+        // 生成一个样式
+        HSSFCellStyle style = wb.createCellStyle();
+        HSSFRow row = sheet.createRow(0);
+        style.setAlignment(HorizontalAlignment.CENTER);
+        HSSFCell cell;
+        Collection c = headersNameMap.values();//拿到表格所有标题的value的集合
+        Iterator<String> it = c.iterator();//表格标题的迭代器
+        /*(四)导出数据:包括导出标题栏以及内容栏*/
+        //根据选择的字段生成表头
+        short size = 0;
+        while (it.hasNext()) {
+            cell = row.createCell(size);
+            cell.setCellValue(it.next().toString());
+            cell.setCellStyle(style);
+            size++;
+        }
+        //表格标题一行的字段的集合
+        Collection zdC = titleFieldMap.values();
+        Iterator<T> labIt = dtoList.iterator();//总记录的迭代器
+        int zdRow = 0;//列序号
+        while (labIt.hasNext()) {//记录的迭代器,遍历总记录
+            int zdCell = 0;
+            zdRow++;
+            row = sheet.createRow(zdRow);
+            T l = (T) labIt.next();
+            // 利用反射,根据javabean属性的先后顺序,动态调用getXxx()方法得到属性值
+            Field[] fields = l.getClass().getDeclaredFields();//获得JavaBean全部属性
+            for (short i = 0; i < fields.length; i++) {//遍历属性,比对
+                Field field = fields[i];
+                String fieldName = field.getName();//属性名
+                Iterator<String> zdIt = zdC.iterator();//一条字段的集合的迭代器
+                while (zdIt.hasNext()) {//遍历要导出的字段集合
+                    if (zdIt.next().equals(fieldName)) {//比对JavaBean的属性名,一致就写入,不一致就丢弃
+                        String getMethodName = "get"
+                                + fieldName.substring(0, 1).toUpperCase()
+                                + fieldName.substring(1);//拿到属性的get方法
+                        Class tCls = l.getClass();//拿到JavaBean对象
+                        try {
+                            Method getMethod = tCls.getMethod(getMethodName,
+                                    new Class[] {});//通过JavaBean对象拿到该属性的get方法,从而进行操控
+                            Object val = getMethod.invoke(l, new Object[] {});//操控该对象属性的get方法,从而拿到属性值
+                            String textVal = null;
+                            if (val != null) {
+                                textVal = String.valueOf(val);//转化成String
+                            } else {
+                                textVal = null;
+                            }
+                            row.createCell((short) zdCell).setCellValue(textVal);//写进excel对象
+                            zdCell++;
+                        } catch (SecurityException e) {
+                            e.printStackTrace();
+                        } catch (IllegalArgumentException e) {
+                            e.printStackTrace();
+                        } catch (NoSuchMethodException e) {
+                            e.printStackTrace();
+                        } catch (IllegalAccessException e) {
+                            e.printStackTrace();
+                        } catch (InvocationTargetException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+            }
+        }
+        RespDTO resultMode = new RespDTO();
+        try {
 
-@SuppressWarnings( { "deprecation" })
-	public class ExportBeanExcelUtil<T> {
-	    private final String MSG_SUCCESS = "操作成功!";
-	    private final String MSG_ERROR = "操作失败!";
 
-		    /**
-		     * 这是一个通用的方法,利用了JAVA的反射机制,可以将放置在JAVA集合中并且符号一定条件的数据以EXCEL 的形式输出
-		     *
-		     * title         表格标题名
-		     * headersName  表格属性列名数组
-		     * headersId    表格属性列名对应的字段---你需要导出的字段名(为了更灵活控制你想要导出的字段)
-		     *  dtoList     需要显示的数据集合,集合中一定要放置符合javabean风格的类的对象
-		     *  out         与输出设备关联的流对象,可以将EXCEL文档导出到本地文件或者网络中
-		     */
-		    public   RespDTO exportExcel(String title, List<String> headersName,List<String> headersId,
-		                            List<T> dtoList,String lujing,String fileName) {
-		        /*(一)表头--标题栏*/
-		        Map<Integer, String> headersNameMap = new HashMap<>();
-		        int key=0;
-		        for (int i = 0; i < headersName.size(); i++) {
-		            if (!headersName.get(i).equals(null)) {
-		                headersNameMap.put(key, headersName.get(i));
-		                key++;
-		            }
-		        }
-		        /*(二)字段*/
-		        Map<Integer, String> titleFieldMap = new HashMap<>();
-		        int value = 0;
-		        for (int i = 0; i < headersId.size(); i++) {
-		            if (!headersId.get(i).equals(null)) {
-		                titleFieldMap.put(value, headersId.get(i));
-		                value++;
-		            }
-		        }
-		        /* (三)声明一个工作薄:包括构建工作簿、表格、样式*/
-		        HSSFWorkbook wb = new HSSFWorkbook();
-		        HSSFSheet sheet = wb.createSheet(title);
-		        sheet.setDefaultColumnWidth((short)15);
-		        // 生成一个样式
-		        HSSFCellStyle style = wb.createCellStyle();
-		        HSSFRow row = sheet.createRow(0);
-		        style.setAlignment(HorizontalAlignment.CENTER);
-		        HSSFCell cell;
-		        Collection c = headersNameMap.values();//拿到表格所有标题的value的集合
-		        Iterator<String> it = c.iterator();//表格标题的迭代器
-		        /*(四)导出数据:包括导出标题栏以及内容栏*/
-		        //根据选择的字段生成表头
-		        short size = 0;
-		        while (it.hasNext()) {
-		            cell = row.createCell(size);
-		            cell.setCellValue(it.next().toString());
-		            cell.setCellStyle(style);
-		            size++;
-		        }
-		        //表格标题一行的字段的集合
-		        Collection zdC = titleFieldMap.values();
-		        Iterator<T> labIt = dtoList.iterator();//总记录的迭代器
-		        int zdRow =0;//列序号
-		        while (labIt.hasNext()) {//记录的迭代器,遍历总记录
-		            int zdCell = 0;
-		            zdRow++;
-		            row = sheet.createRow(zdRow);
-		            T l = (T) labIt.next();
-		            // 利用反射,根据javabean属性的先后顺序,动态调用getXxx()方法得到属性值
-		            Field[] fields = l.getClass().getDeclaredFields();//获得JavaBean全部属性
-		            for (short i = 0; i < fields.length; i++) {//遍历属性,比对
-		                Field field = fields[i];
-		                String fieldName = field.getName();//属性名
-		                Iterator<String> zdIt = zdC.iterator();//一条字段的集合的迭代器
-		                while (zdIt.hasNext()) {//遍历要导出的字段集合
-		                    if (zdIt.next().equals(fieldName)) {//比对JavaBean的属性名,一致就写入,不一致就丢弃
-		                        String getMethodName = "get"
-		                                + fieldName.substring(0, 1).toUpperCase()
-		                                + fieldName.substring(1);//拿到属性的get方法
-		                        Class tCls = l.getClass();//拿到JavaBean对象
-		                        try {
-		                            Method getMethod = tCls.getMethod(getMethodName,
-		                                    new Class[] {});//通过JavaBean对象拿到该属性的get方法,从而进行操控
-		                            Object val = getMethod.invoke(l, new Object[] {});//操控该对象属性的get方法,从而拿到属性值
-		                            String textVal = null;
-		                            if (val!= null) {
-		                                textVal = String.valueOf(val);//转化成String
-		                            }else{
-		                                textVal = null;
-		                            }
-		                            row.createCell((short) zdCell).setCellValue(textVal);//写进excel对象
-		                            zdCell++;
-		                        } catch (SecurityException e) {
-		                            e.printStackTrace();
-		                        } catch (IllegalArgumentException e) {
-		                            e.printStackTrace();
-		                        } catch (NoSuchMethodException e) {
-		                            e.printStackTrace();
-		                        } catch (IllegalAccessException e) {
-		                            e.printStackTrace();
-		                        } catch (InvocationTargetException e) {
-		                            e.printStackTrace();
-		                        }
-		                    }
-		                }
-		            }
-		        }
-		        RespDTO resultMode = new RespDTO();
-		        try {
-		        	
-		        	 
-		            FileOutputStream exportXls = new FileOutputStream(lujing+fileName+".xls");
-		            wb.write(exportXls);
-		            exportXls.close();
+            FileOutputStream exportXls = new FileOutputStream(lujing + fileName + ".xls");
+            wb.write(exportXls);
+            exportXls.close();
 /*		            resultMode.setResult(true);
 		            resultMode.setMessage(MSG_SUCCESS);*/
-		            resultMode.onSuc(MSG_SUCCESS);
-		            System.out.println("导出成功!");
-		        } catch (FileNotFoundException e) {
+            return resultMode.onSuc(MSG_SUCCESS);
+        } catch (FileNotFoundException e) {
 /*		            System.out.println("导出失败!");
 		            resultMode.setResult(false);
 			        resultMode.setMessage(MSG_ERROR);*/
-		        	 resultMode.onSuc(MSG_ERROR);
-		            e.printStackTrace();
-		        } catch (IOException e) {
-		        	 resultMode.onSuc(MSG_ERROR);
-		            System.out.println("导出失败!");
-		            e.printStackTrace();
-		        }
-		        
-		        return resultMode;
-		    }
+            e.printStackTrace();
+            return resultMode.onSuc(MSG_ERROR);
+
+        } catch (IOException e) {
+            e.printStackTrace();
+            return resultMode.onSuc(MSG_ERROR);
+
+        }
+
+        // return resultMode;
+    }
 }

+ 6 - 7
user-service/src/main/java/com/diagbot/util/SmsCodeUtil.java

@@ -13,14 +13,13 @@ public final class SmsCodeUtil {
 
     private static final String AUTH_CODE = "0123456789";
 
-    public static String getVerCode(){
+    public static String getVerCode() {
         return getVerCode(6);
     }
-    public static String getVerCode(Integer size)
-    {
+
+    public static String getVerCode(Integer size) {
         StringBuilder sb = new StringBuilder();
-        for(int i = 0; i < size; i++)
-        {
+        for (int i = 0; i < size; i++) {
             int index = new Random().nextInt(AUTH_CODE.length());
             sb.append(AUTH_CODE.charAt(index));
         }
@@ -30,9 +29,9 @@ public final class SmsCodeUtil {
     public static void main(String[] args) {
         List<String> test = new ArrayList<>();
         //int i = 0;
-        while(true){
+        while (true) {
             String result = getVerCode();
-            if(test.contains(result)){
+            if (test.contains(result)) {
                 System.out.println("出现了重复编码:" + result);
                 break;
             }

+ 53 - 43
user-service/src/main/java/com/diagbot/util/VerifyCodeUtils.java

@@ -21,40 +21,44 @@ import java.util.Random;
  * @time: 2018/9/4 13:54
  */
 public class VerifyCodeUtils {
-    //使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符
+    //字体只显示大写,去掉了1,0,i,o几个容易混淆的字符
     public static final String VERIFY_CODES = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ";
     private static Random random = new Random();
 
 
     /**
      * 使用系统默认字符源生成验证码
-     * @param verifySize    验证码长度
+     *
+     * @param verifySize 验证码长度
      * @return
      */
-    public static String generateVerifyCode(int verifySize){
+    public static String generateVerifyCode(int verifySize) {
         return generateVerifyCode(verifySize, VERIFY_CODES);
     }
+
     /**
      * 使用指定源生成验证码
-     * @param verifySize    验证码长度
-     * @param sources   验证码字符源
+     *
+     * @param verifySize 验证码长度
+     * @param sources    验证码字符源
      * @return
      */
-    public static String generateVerifyCode(int verifySize, String sources){
-        if(sources == null || sources.length() == 0){
+    public static String generateVerifyCode(int verifySize, String sources) {
+        if (sources == null || sources.length() == 0) {
             sources = VERIFY_CODES;
         }
         int codesLen = sources.length();
         Random rand = new Random(System.currentTimeMillis());
         StringBuilder verifyCode = new StringBuilder(verifySize);
-        for(int i = 0; i < verifySize; i++){
-            verifyCode.append(sources.charAt(rand.nextInt(codesLen-1)));
+        for (int i = 0; i < verifySize; i++) {
+            verifyCode.append(sources.charAt(rand.nextInt(codesLen - 1)));
         }
         return verifyCode.toString();
     }
 
     /**
      * 生成随机验证码文件,并返回验证码值
+     *
      * @param w
      * @param h
      * @param outputFile
@@ -62,7 +66,7 @@ public class VerifyCodeUtils {
      * @return
      * @throws IOException
      */
-    public static String outputVerifyImage(int w, int h, File outputFile, int verifySize) throws IOException{
+    public static String outputVerifyImage(int w, int h, File outputFile, int verifySize) throws IOException {
         String verifyCode = generateVerifyCode(verifySize);
         outputImage(w, h, outputFile, verifyCode);
         return verifyCode;
@@ -70,6 +74,7 @@ public class VerifyCodeUtils {
 
     /**
      * 输出随机验证码图片流,并返回验证码值
+     *
      * @param w
      * @param h
      * @param os
@@ -77,7 +82,7 @@ public class VerifyCodeUtils {
      * @return
      * @throws IOException
      */
-    public static String outputVerifyImage(int w, int h, OutputStream os, int verifySize) throws IOException{
+    public static String outputVerifyImage(int w, int h, OutputStream os, int verifySize) throws IOException {
         String verifyCode = generateVerifyCode(verifySize);
         outputImage(w, h, os, verifyCode);
         return verifyCode;
@@ -85,50 +90,52 @@ public class VerifyCodeUtils {
 
     /**
      * 生成指定验证码图像文件
+     *
      * @param w
      * @param h
      * @param outputFile
      * @param code
      * @throws IOException
      */
-    public static void outputImage(int w, int h, File outputFile, String code) throws IOException{
-        if(outputFile == null){
+    public static void outputImage(int w, int h, File outputFile, String code) throws IOException {
+        if (outputFile == null) {
             return;
         }
         File dir = outputFile.getParentFile();
-        if(!dir.exists()){
+        if (!dir.exists()) {
             dir.mkdirs();
         }
-        try{
+        try {
             outputFile.createNewFile();
             FileOutputStream fos = new FileOutputStream(outputFile);
             outputImage(w, h, fos, code);
             fos.close();
-        } catch(IOException e){
+        } catch (IOException e) {
             throw e;
         }
     }
 
     /**
      * 输出指定验证码图片流
+     *
      * @param w
      * @param h
      * @param os
      * @param code
      * @throws IOException
      */
-    public static void outputImage(int w, int h, OutputStream os, String code) throws IOException{
+    public static void outputImage(int w, int h, OutputStream os, String code) throws IOException {
         int verifySize = code.length();
         BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
         Random rand = new Random();
         Graphics2D g2 = image.createGraphics();
-        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
+        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
         Color[] colors = new Color[5];
         Color[] colorSpaces = new Color[] { Color.WHITE, Color.CYAN,
                 Color.GRAY, Color.LIGHT_GRAY, Color.MAGENTA, Color.ORANGE,
                 Color.PINK, Color.YELLOW };
         float[] fractions = new float[colors.length];
-        for(int i = 0; i < colors.length; i++){
+        for (int i = 0; i < colors.length; i++) {
             colors[i] = colorSpaces[rand.nextInt(colorSpaces.length)];
             fractions[i] = rand.nextFloat();
         }
@@ -139,9 +146,9 @@ public class VerifyCodeUtils {
 
         Color c = getRandColor(200, 250);
         g2.setColor(c);// 设置背景色
-        g2.fillRect(0, 2, w, h-4);
+        g2.fillRect(0, 2, w, h - 4);
 
-        //绘制干扰线
+        //1.绘制干扰线
         Random random = new Random();
         g2.setColor(getRandColor(160, 200));// 设置线条的颜色
         for (int i = 0; i < 20; i++) {
@@ -152,7 +159,7 @@ public class VerifyCodeUtils {
             g2.drawLine(x, y, x + xl + 40, y + yl + 20);
         }
 
-        // 添加噪点
+        //2.添加噪点
         float yawpRate = 0.05f;// 噪声率
         int area = (int) (yawpRate * w * h);
         for (int i = 0; i < area; i++) {
@@ -165,15 +172,16 @@ public class VerifyCodeUtils {
         shear(g2, w, h, c);// 使图片扭曲
 
         g2.setColor(getRandColor(100, 160));
-        int fontSize = h-4;
+        int fontSize = h - 4;
         Font font = new Font(null, Font.BOLD + Font.ITALIC, fontSize);
         g2.setFont(font);
         char[] chars = code.toCharArray();
-        for(int i = 0; i < verifySize; i++){
+        for (int i = 0; i < verifySize; i++) {
             AffineTransform affine = new AffineTransform();
-            affine.setToRotation(Math.PI / 4 * rand.nextDouble() * (rand.nextBoolean() ? 1 : -1), (w / verifySize) * i + fontSize/2, h/2);
+            affine.setToRotation(Math.PI / 4 * rand.nextDouble() * (rand.nextBoolean() ? 1 : -1), (w / verifySize) * i + (h - 4) / 2, h / 2);
             g2.setTransform(affine);
-            g2.drawChars(chars, i, 1, ((w-10) / verifySize) * i + 5, h/2 + fontSize/2 - 10);
+            g2.drawOval(random.nextInt(w), random.nextInt(h), 5 + random.nextInt(10), 5 + random.nextInt(10));
+            g2.drawChars(chars, i, 1, ((w - 10) / verifySize) * i + 5, h / 2 + fontSize / 2 - 10);
         }
 
         g2.dispose();
@@ -181,10 +189,12 @@ public class VerifyCodeUtils {
     }
 
     private static Color getRandColor(int fc, int bc) {
-        if (fc > 255)
+        if (fc > 255) {
             fc = 255;
-        if (bc > 255)
+        }
+        if (bc > 255) {
             bc = 255;
+        }
         int r = fc + random.nextInt(bc - fc);
         int g = fc + random.nextInt(bc - fc);
         int b = fc + random.nextInt(bc - fc);
@@ -264,36 +274,36 @@ public class VerifyCodeUtils {
      * Object[0]:验证码字符串;
      * Object[1]:验证码图片。
      */
-    public static Object[] createImage(){
-        try{
-            int w = 80, h = 32;
+    public static Object[] createImage() {
+        try {
+            int w = 125, h = 34;
             String verifyCode = generateVerifyCode(4);//生成四位随机码
             ByteArrayOutputStream bos = new ByteArrayOutputStream();
             outputImage(w, h, bos, verifyCode);
-            return new Object[]{verifyCode, bos.toByteArray()};
-        } catch (IOException e){
+            return new Object[] { verifyCode, bos.toByteArray() };
+        } catch (IOException e) {
             throw new CommonException(ServiceErrorCode.VERIFYCODE_ERROR);
         }
     }
 
 
-    public static void main(String[] args) throws IOException{
-//        File dir = new File("E:/verifies");
-//        int w = 200, h = 80;
-//        for(int i = 0; i < 50; i++){
-//            String verifyCode = generateVerifyCode(4);//生成四位随机码
-//            File file = new File(dir, verifyCode + ".jpg");
-//            outputImage(w, h, file, verifyCode);//将验证码存在指定的路径下
-//        }
+    public static void main(String[] args) throws IOException {
+        //File dir = new File("E:/verifies");
+        //int w = 200, h = 80;
+        //for(int i = 0; i < 50; i++){
+        //    String verifyCode = generateVerifyCode(4);//生成四位随机码
+        //    File file = new File(dir, verifyCode + ".jpg");
+        //    outputImage(w, h, file, verifyCode);//将验证码存在指定的路径下
+        //}
 
         File dir = new File("E:/verifies");
-        for(int i = 0; i < 50; i++){
+        for (int i = 0; i < 50; i++) {
             Object[] res = createImage();
             String code = res[0].toString().toUpperCase();
             System.out.println(code);
             File file = new File(dir, code + ".jpg");
             OutputStream out = new FileOutputStream(file);
-            byte[] b = (byte[])res[1];
+            byte[] b = (byte[]) res[1];
             out.write(b);
             out.flush();
             out.close();

+ 8 - 10
user-service/src/main/java/com/diagbot/vo/OrganizationVO.java

@@ -1,14 +1,12 @@
 package com.diagbot.vo;
 
-import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
 
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 
-import lombok.Getter;
-import lombok.Setter;
 /**
- * 
  * @author wangfeng
  * @Description: 添加机构信息
  * @date 2018年9月19日 下午4:34:30
@@ -17,30 +15,30 @@ import lombok.Setter;
 @Getter
 @Setter
 public class OrganizationVO {
-	/**
+    /**
      * 机构名称
      */
-	@NotBlank(message = "请输入机构名称!")
+    @NotBlank(message = "请输入机构名称!")
     private String organizationName;
     /**
      * 机构类型
      */
-	@NotNull(message = "请输入机构类型!")
+    @NotNull(message = "请输入机构类型!")
     private Integer type;
     /**
      * 负责人
      */
-	@NotBlank(message = "请输入机构负责人!")
+    @NotBlank(message = "请输入机构负责人!")
     private String principal;
     /**
      * 机构地址
      */
-	@NotBlank(message = "请输入机构地址!")
+    @NotBlank(message = "请输入机构地址!")
     private String address;
     /**
      * 下属机构数量
      */
     private Integer subNum;
-	
+
 
 }

+ 3 - 3
user-service/src/main/java/com/diagbot/vo/SmsVerCreatVO.java

@@ -14,10 +14,10 @@ import javax.validation.constraints.Size;
  */
 @Getter
 @Setter
-public class SmsVerCreatVO extends ImgVerVerVO{
+public class SmsVerCreatVO extends ImgVerVerVO {
     //用户电话
     @NotBlank(message = "{mobile.not.null}")
-    @Pattern(regexp="^[0-9]\\d*$", message="手机号码必须是数字")
-    @Size(max=11, message = "手机号码最多11位")
+    @Pattern(regexp = "^[0-9]\\d*$", message = "手机号码必须是数字")
+    @Size(max = 11, message = "手机号码最多11位")
     private String mobile;
 }

+ 1 - 1
user-service/src/main/java/com/diagbot/vo/SmsVerVerVO.java

@@ -10,7 +10,7 @@ import lombok.Setter;
  */
 @Getter
 @Setter
-public class SmsVerVerVO  extends ImgVerVerVO {
+public class SmsVerVerVO extends ImgVerVerVO {
     //用户电话
     private String mobile;
     //短信验证码

+ 12 - 13
user-service/src/main/java/com/diagbot/vo/UserAndOrganizationVO.java

@@ -1,14 +1,13 @@
 package com.diagbot.vo;
 
+import lombok.Getter;
+import lombok.Setter;
+
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Pattern;
 
-import lombok.Getter;
-import lombok.Setter;
-
 /**
- * 
  * @author wangfeng
  * @Description: 超级管理员与机构的绑定
  * @date 2018年9月19日 下午4:56:08
@@ -16,29 +15,29 @@ import lombok.Setter;
 @Getter
 @Setter
 public class UserAndOrganizationVO {
-	
-	/**
+
+    /**
      * 机构id
      */
-	@NotNull(message = "请输入机构id!")
+    @NotNull(message = "请输入机构id!")
     private Long organizationid;
-    
+
     /**
      * 用户密码
      */
-	@Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$",message = "密码必须数字和字母组成,并且要同时含有数字和字母,且长度要在6-16位之间")
+    @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$", message = "密码必须数字和字母组成,并且要同时含有数字和字母,且长度要在6-16位之间")
     private String passWord;
 
     /**
      * 用户名
      */
-	@Pattern(regexp = "^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\\d{8}$",message = "请输入手机号!")
+    @Pattern(regexp = "^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\\d{8}$", message = "请输入手机号!")
     private String userName;
-    
+
     /**
      * 联系人
      */
-	@NotBlank(message = "请输入联系人!")
+    @NotBlank(message = "请输入联系人!")
     private String linkman;
 
     /**
@@ -46,7 +45,7 @@ public class UserAndOrganizationVO {
      */
     @NotBlank(message = "请输入邮箱!")
     private String email;
-    
+
     /**
      * 岗位信息
      */

+ 0 - 1
user-service/src/main/java/com/diagbot/vo/UserAuthenticationVO.java

@@ -4,7 +4,6 @@ import lombok.Getter;
 import lombok.Setter;
 
 import javax.validation.constraints.NotBlank;
-import java.util.Date;
 
 /**
  * @Description:用户验证输入信息

+ 5 - 8
user-service/src/main/java/com/diagbot/vo/UserExportVO.java

@@ -1,23 +1,20 @@
 package com.diagbot.vo;
 
-import java.text.SimpleDateFormat;
-
 import lombok.Getter;
 import lombok.Setter;
 
 /**
- * 
- * @Description: 导出功能传参
  * @author wangfeng
+ * @Description: 导出功能传参
  * @date 2018年9月25日 上午10:41:08
  */
 @Getter
 @Setter
 public class UserExportVO {
-	
-	private String startTime;
-	private String endTime;
-	private String filePath;//文件路径
+
+    private String startTime;
+    private String endTime;
+    private String filePath;//文件路径
     private String fileName;//文件名
 
 }

+ 10 - 14
user-service/src/main/java/com/diagbot/vo/UserInfoAuditVO.java

@@ -1,29 +1,25 @@
 package com.diagbot.vo;
 
-import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
 
-import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Pattern;
 
-import lombok.Getter;
-import lombok.Setter;
 /**
- * 
- * @Description: 用户认证
  * @author wangfeng
+ * @Description: 用户认证
  * @date 2018年9月20日 下午1:41:56
  */
 
 @Getter
 @Setter
 public class UserInfoAuditVO {
-	  
-	  private Integer isReject;//是否通过认证 0:未通过,1:已通过
-	  private Integer rejectType;//未通过类型
-	  private String rejectComment;//认证被拒理由
-	  private Integer status;//认证状态(0:未认证,1:已认证,2:认证中)
-	  @NotNull(message = "请输入用户id!")
-	  private Long userId;//用户id
+
+    private Integer isReject;//是否通过认证 0:未通过,1:已通过
+    private Integer rejectType;//未通过类型
+    private String rejectComment;//认证被拒理由
+    private Integer status;//认证状态(0:未认证,1:已认证,2:认证中)
+    @NotNull(message = "请输入用户id!")
+    private Long userId;//用户id
 
 }

+ 11 - 15
user-service/src/main/java/com/diagbot/vo/UserInfoOrganizationsVO.java

@@ -1,16 +1,12 @@
 package com.diagbot.vo;
 
-import java.io.Serializable;
-import java.util.Date;
-
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
-
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
 /**
- * 
  * @author wangfeng
  * @Description: 用于修改用户信息及机构信息
  * @date 2018年9月18日 下午3:06:58
@@ -18,12 +14,12 @@ import lombok.Setter;
 @Getter
 @Setter
 public class UserInfoOrganizationsVO implements Serializable {
-	
-	  private String email;//邮箱
-	  private String principal;//负责人
-	  private String address;//单位地址
-	  private Integer type;//机构属性
-	  private String position;//岗位部门
-	  @NotNull(message = "请输入用户id!")
-	  private Long userId;//用户id
+
+    private String email;//邮箱
+    private String principal;//负责人
+    private String address;//单位地址
+    private Integer type;//机构属性
+    private String position;//岗位部门
+    @NotNull(message = "请输入用户id!")
+    private Long userId;//用户id
 }

+ 4 - 8
user-service/src/main/java/com/diagbot/vo/UserInfoVO.java

@@ -1,16 +1,12 @@
 package com.diagbot.vo;
 
-import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
 
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.Pattern;
 
-import lombok.Getter;
-import lombok.Setter;
-
 /**
- * 
- * 
  * @author wangfeng
  * @Description: 用于超级管理员增加用户
  * @date 2018年9月19日 下午5:25:23
@@ -19,8 +15,8 @@ import lombok.Setter;
 @Setter
 public class UserInfoVO {
 
-	@NotBlank(message = "请输入密码!")
-    @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$",message = "密码必须数字和字母组成,并且要同时含有数字和字母,且长度要在6-16位之间")
+    @NotBlank(message = "请输入密码!")
+    @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$", message = "密码必须数字和字母组成,并且要同时含有数字和字母,且长度要在6-16位之间")
     private String password;
     @NotBlank(message = "请输入手机号!")
     private String username;

+ 1 - 1
user-service/src/main/java/com/diagbot/vo/UserSaveVO.java

@@ -22,7 +22,7 @@ public class UserSaveVO {
     private String creator;
     private String modifier;
     @NotBlank(message = "请输入密码!")
-    @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$",message = "密码必须数字和字母组成,并且要同时含有数字和字母,且长度要在6-16位之间")
+    @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$", message = "密码必须数字和字母组成,并且要同时含有数字和字母,且长度要在6-16位之间")
     private String password;
     @NotBlank(message = "请输入手机号!")
     private String username;

+ 2 - 2
user-service/src/main/java/com/diagbot/web/EnumsController.java

@@ -19,7 +19,7 @@ import java.util.Map;
  * @time: 2018/9/19 14:32
  */
 @RestController
-@Api(value="用户枚举数据获取API", tags={"用户枚举数据获取API"})
+@Api(value = "用户枚举数据获取API", tags = { "用户枚举数据获取API" })
 @SuppressWarnings("unchecked")
 public class EnumsController {
     @Autowired
@@ -29,7 +29,7 @@ public class EnumsController {
             notes = "用户枚举数据获取")
     @PostMapping("/getUserEnumsData")
     @SysLogger("getUserEnumsData")
-    public RespDTO<Map<String, List<EnumEntriesBuilder.Entry>>> getEnumsData(){
+    public RespDTO<Map<String, List<EnumEntriesBuilder.Entry>>> getEnumsData() {
         return RespDTO.onSuc(enumsDataFacade.getEnumsData());
     }
 }

+ 15 - 98
user-service/src/main/java/com/diagbot/web/ReportFormController.java

@@ -25,16 +25,17 @@ import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.UserInfoDTO;
 import com.diagbot.dto.UserInfoExportDTO;
 import com.diagbot.facade.UserFacade;
+import com.diagbot.util.DateUtil;
 import com.diagbot.util.ExportBeanExcelUtil;
+import com.diagbot.util.GsonUtil;
 import com.diagbot.vo.UserExportVO;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
 /**
- * 
- * @Description: 客户中心导出功能
  * @author wangfeng
+ * @Description: 客户中心导出功能
  * @date 2018年9月25日 上午9:45:56
  */
 @RestController
@@ -42,101 +43,17 @@ import io.swagger.annotations.ApiOperation;
 @RequestMapping("/report")
 @SuppressWarnings("unchecked")
 public class ReportFormController {
-	
-	@Autowired
-	private UserFacade userFacade;
-	
-	@ApiOperation(value = "导出用户信息和机构信息:[by:wangfeng]", notes = "根据时间 导出用户信息和机构信息")
-	@PostMapping("/exportUserInfo")
-	@SysLogger("/exportUserInfo")
-	@Transactional
-	public RespDTO export(final HttpServletRequest request, final HttpServletResponse response,UserExportVO userExportVO)
-			throws Exception {
-		Map<String, Object> userMap = new HashMap<String, Object>();
-		userMap.put("startTime", userExportVO.getStartTime());
-		userMap.put("endTime", userExportVO.getEndTime());
-		List<UserInfoExportDTO> datas = userFacade.dependentuserInfoByTime(userMap);
-		List<String> listName = new ArrayList<>();
-
-		listName.add("用户id");
-		listName.add("记录创建时间");
-		listName.add("用户名");
-		listName.add("联系人");
-		listName.add("邮箱");
-		listName.add("机构ID");
-		listName.add("机构名称");
-		listName.add("机构属性");
-		listName.add("负责人");
-		listName.add("机构地址");
-		listName.add("上级机构id");
-		listName.add("下属机构数量");
-		listName.add("岗位信息");
-		listName.add("是否通过认证 ");
-		listName.add("认证状态");
-		
-		List<String> listId = new ArrayList<>();
-		listId.add("userId");//用户ID
-		listId.add("userGmtCreate");//记录创建时间
-		listId.add("userName");// 用户名
-		listId.add("linKman");//联系人
-		listId.add("email");// 邮箱
-		listId.add("orgId");//机构ID
-		//listId.add("orgGmtCreate");//记录创建时间
-		listId.add("orgName");//机构名称
-		listId.add("orgType");//机构属性
-		listId.add("orgPrincipal");//负责人
-        listId.add("orgAddress");//机构地址
-        listId.add("orgParentId");//上级机构id
-        listId.add("orgSubNum");//下属机构数量
-        listId.add("autPosition");//岗位信息
-        listId.add("autIsReject");//是否通过认证 N:未通过,Y:已通过
-        listId.add("autStatus");//认证状态
-		
-		List<UserInfoExportDTO> list = new ArrayList<>();
-		for (int i = 0; i < datas.size(); i++) {
-			UserInfoExportDTO userInfo = datas.get(i); 
-			list.add(new UserInfoExportDTO(userInfo.getUserId(),
-					userInfo.getUserGmtCreate(),
-					userInfo.getUserName(),
-					userInfo.getLinKman(),
-					userInfo.getEmail(),
-					userInfo.getOrgId(),
-					userInfo.getOrgName(),
-					userInfo.getOrgType(),
-					userInfo.getOrgPrincipal(),
-					userInfo.getOrgAddress(),
-					userInfo.getOrgParentId(),
-					userInfo.getOrgSubNum(),
-					userInfo.getAutPosition(),
-					userInfo.getAutIsReject(),
-					userInfo.getAutStatus()));
-		}
-		response.setContentType("text/html;charset=UTF-8");
-		String filePath =userExportVO.getFilePath();//文件路径
-		SimpleDateFormat df = new SimpleDateFormat();//设置日期格式
-        System.out.println();// new Date()为获取当前系统时间
-		String fileName = userExportVO.getFileName();//文件名
-		ExportBeanExcelUtil ex = new ExportBeanExcelUtil();
-		RespDTO resul = ex.exportExcel("测试POI导出EXCEL文档", listName, listId, list,filePath,fileName);
-		 return resul;
-	}
-
-	// 发送响应流方法
-	public void setResponseHeader(HttpServletResponse response, String fileName) {
-		try {
-			try {
-				fileName = new String(fileName.getBytes(), "ISO8859-1");
-			} catch (UnsupportedEncodingException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-			}
-			response.setContentType("application/octet-stream;charset=ISO8859-1");
-			response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
-			response.addHeader("Pargam", "no-cache");
-			response.addHeader("Cache-Control", "no-cache");
-		} catch (Exception ex) {
-			ex.printStackTrace();
-		}
-	}
 
+    @Autowired
+    private UserFacade userFacade;
+
+    @ApiOperation(value = "导出用户信息和机构信息:[by:wangfeng]", notes = "根据时间 导出用户信息和机构信息")
+    @PostMapping("/exportUserInfo")
+    @SysLogger("exportUserInfo")
+    @Transactional
+    public RespDTO export(UserExportVO userExportVO)
+            throws Exception {
+        RespDTO resul = userFacade.export(userExportVO);
+        return resul;
+    }
 }

+ 3 - 3
user-service/src/main/java/com/diagbot/web/TestController.java

@@ -30,10 +30,10 @@ public class TestController {
     RespDTO testSmsSend() {
         System.out.println("The time is now " + DateUtil.nowString());
         log.info("短信验证发送开始!");
-//        String code="1234";
+        //String code="1234";
         //SMS_143861902
-        String code = smsVerService.smsSend("188575800**","SMS_143861***");
-        log.info("短信验证发送结束!验证码:{}",code);
+        String code = smsVerService.smsSend("188575800**", "SMS_143861***");
+        log.info("短信验证发送结束!验证码:{}", code);
         return RespDTO.onSuc(code);
     }
 }

+ 32 - 16
user-service/src/main/java/com/diagbot/web/UserAuthenticationController.java

@@ -29,7 +29,7 @@ import java.util.Map;
  * @since 2018-09-13
  */
 @RestController
-@Api(value="用户认证API", tags={"用户认证API"})
+@Api(value = "用户认证API", tags = { "用户认证API" })
 @RequestMapping("/userAuthentication")
 @SuppressWarnings("unchecked")
 public class UserAuthenticationController {
@@ -37,6 +37,12 @@ public class UserAuthenticationController {
     private UserAuthenticationFacade userAuthenticationFacade;
 
 
+    /**
+     * 用户认证
+     *
+     * @param userAuthenticationVO
+     * @return
+     */
     @ApiOperation(value = "用户认证[by:zhaops]",
             notes = "userName:用户名,必填<br>" +
                     "organization:组织机构,必填<br>")
@@ -48,6 +54,11 @@ public class UserAuthenticationController {
         return RespDTO.onSuc(userAuthenticationDTO);
     }
 
+    /**
+     * 获取当前登录用户信息
+     *
+     * @return
+     */
     @ApiOperation(value = "获取当前用户信息[by:zhaops]")
     @PostMapping("/getuserAuthenticationInfo")
     @SysLogger("getuserAuthenticationInfo")
@@ -56,6 +67,11 @@ public class UserAuthenticationController {
         return RespDTO.onSuc(userAuthenticationDTO);
     }
 
+    /**
+     * 获取当前用户认证状态
+     *
+     * @return
+     */
     @ApiOperation(value = "获取当前用户认证状态[by:zhaops]")
     @PostMapping("/getUserAuthenticationStatus")
     @SysLogger("getUserAuthenticationStatus")
@@ -63,19 +79,19 @@ public class UserAuthenticationController {
         Map<Integer, Object> map = userAuthenticationFacade.getUserAuthenticationStatus();
         return RespDTO.onSuc(map);
     }
-    
-    @ApiOperation(value = "控制台-账号认证进度(示例)[by:rengb]",notes="控制台-账号认证进度")
-	@PostMapping("/queryAuthProgress")
-	@SysLogger("queryAuthProgress")
-	public RespDTO<QueryAuthProgressDTO> queryAuthProgress() {
-		return RespDTO.onSuc(userAuthenticationFacade.queryAuthProgress());
-	}
-	
-	@ApiOperation(value = "控制台-待认证账号数量(示例)[by:rengb]",notes="控制台-待认证账号数量")
-	@PostMapping("/waitAuthen")
-	@SysLogger("waitAuthen")
-	public RespDTO<WaitAuthenDTO> waitAuthen() {
-		return RespDTO.onSuc(userAuthenticationFacade.waitAuthen());
-	}
-    
+
+    @ApiOperation(value = "控制台-账号认证进度(示例)[by:rengb]", notes = "控制台-账号认证进度")
+    @PostMapping("/queryAuthProgress")
+    @SysLogger("queryAuthProgress")
+    public RespDTO<QueryAuthProgressDTO> queryAuthProgress() {
+        return RespDTO.onSuc(userAuthenticationFacade.queryAuthProgress());
+    }
+
+    @ApiOperation(value = "控制台-待认证账号数量(示例)[by:rengb]", notes = "控制台-待认证账号数量")
+    @PostMapping("/waitAuthen")
+    @SysLogger("waitAuthen")
+    public RespDTO<WaitAuthenDTO> waitAuthen() {
+        return RespDTO.onSuc(userAuthenticationFacade.waitAuthen());
+    }
+
 }

+ 56 - 54
user-service/src/main/java/com/diagbot/web/UserController.java

@@ -34,7 +34,7 @@ import java.util.Map;
  * @time: 2018/8/2 13:56
  */
 @RestController
-@Api(value="用户操作API", tags={"用户操作API"})
+@Api(value = "用户操作API", tags = { "用户操作API" })
 @RequestMapping("/user")
 @SuppressWarnings("unchecked")
 public class UserController {
@@ -45,17 +45,17 @@ public class UserController {
     private PermissionFacade permissionFacade;
 
     @ApiOperation(value = "注册[by:zhoutg]",
-        notes = "username:用户名,必填<br>" +
-                "password:密码,必填<br> " +
-                "organization:组织机构,必填<br>" +
-                "email:邮箱,必填<br>" +
-                "linkman:联系人,必填<br>" +
-                "imgId:图片id,必填<br>" +
-                "code:图片验证码,必填<br>")
+            notes = "username:用户名,必填<br>" +
+                    "password:密码,必填<br> " +
+                    "organization:组织机构,必填<br>" +
+                    "email:邮箱,必填<br>" +
+                    "linkman:联系人,必填<br>" +
+                    "imgId:图片id,必填<br>" +
+                    "code:图片验证码,必填<br>")
     @PostMapping("/registry")
     @SysLogger("registry")
     @Transactional
-    public RespDTO<User> createUser(@RequestBody @Valid UserSaveVO userSaveVO){
+    public RespDTO<User> createUser(@RequestBody @Valid UserSaveVO userSaveVO) {
         User user = userFacade.createUser(userSaveVO);
         return RespDTO.onSuc(user);
     }
@@ -66,8 +66,8 @@ public class UserController {
                     "password:密码, 必填<br> ")
     @PostMapping("/login")
     @SysLogger("login")
-    public RespDTO<LoginDTO> login(@RequestParam String username, @RequestParam String password){
-        return  userFacade.login(username, password);
+    public RespDTO<LoginDTO> login(@RequestParam String username, @RequestParam String password) {
+        return userFacade.login(username, password);
     }
 
 
@@ -78,17 +78,16 @@ public class UserController {
     @PostMapping("/resetPassword")
     @SysLogger("resetPassword")
     @Transactional
-    public RespDTO<Boolean> resetPassword(String username, String password, String diffPassword){
-        return  userFacade.resetPassword(username, password, diffPassword);
+    public RespDTO<Boolean> resetPassword(String username, String password, String diffPassword) {
+        return userFacade.resetPassword(username, password, diffPassword);
     }
 
 
-
     @PostMapping(value = "/getUserAndOrg")
     @SysLogger("getUserAndOrg")
     @ApiOperation(value = "获取用户和机构信息[by:zhoutg]")
     @ApiIgnore
-    RespDTO<Map<Long,UserOrgDTO>> getUserAndOrg(@RequestBody List<Long> userIds) {
+    RespDTO<Map<Long, UserOrgDTO>> getUserAndOrg(@RequestBody List<Long> userIds) {
         Map<Long, UserOrgDTO> result = userFacade.getUserAndOrg(userIds);
         return RespDTO.onSuc(result);
     }
@@ -97,14 +96,13 @@ public class UserController {
     @PostMapping(value = "/getUserByOrgName")
     @SysLogger("getUserByOrgName")
     @ApiOperation(value = "远程调用,根据机构名称获取用户信息[by:zhoutg]")
-//    @ApiIgnore
+        //    @ApiIgnore
     RespDTO<List<Long>> getUserByOrgName(@RequestBody String name) {
-        List<Long> data =  userFacade.getUserByOrgNameFac(name);
+        List<Long> data = userFacade.getUserByOrgNameFac(name);
         return RespDTO.onSuc(data);
     }
 
 
-
     /**
      * @Description: 用来测试分页,未用
      * @Author: ztg
@@ -114,7 +112,7 @@ public class UserController {
     @SysLogger("index")
     @ApiOperation(value = "用来测试分页,未用[by:zhoutg]")
     @ApiIgnore
-    public RespDTO<IPage<User>> indexUser(Page page, UserSaveVO userSaveVO){
+    public RespDTO<IPage<User>> indexUser(Page page, UserSaveVO userSaveVO) {
         return userFacade.index(page, userSaveVO);
     }
 
@@ -122,8 +120,8 @@ public class UserController {
             notes = "appkey:用户名,必填<br>" +
                     "secret:密码, 必填<br> ")
     @PostMapping("/getPermission")
-    public RespDTO<Permission> getPermission(@RequestParam String appkey, @RequestParam String secret){
-        return  permissionFacade.getPermission(appkey, secret);
+    public RespDTO<Permission> getPermission(@RequestParam String appkey, @RequestParam String secret) {
+        return permissionFacade.getPermission(appkey, secret);
     }
 
 
@@ -131,10 +129,10 @@ public class UserController {
     @PostMapping("/getByUsername")
     @SysLogger("getByUsername")
     @ApiIgnore
-//    @PreAuthorize("hasAnyAuthority('ROLE_USER')")
-    public RespDTO getUserInfo(@RequestParam String username){
+    //    @PreAuthorize("hasAnyAuthority('ROLE_USER')")
+    public RespDTO getUserInfo(@RequestParam String username) {
         //参数判读省略
-        User user=  userFacade.getUserInfo(username);
+        User user = userFacade.getUserInfo(username);
         return RespDTO.onSuc(user);
     }
 
@@ -142,33 +140,34 @@ public class UserController {
     @PostMapping("/getUserInfoByID")
     @SysLogger("getUserInfoByID")
     @ApiIgnore
-    public RespDTO getUserInfoByID(Long id, Page page){
+    public RespDTO getUserInfoByID(Long id, Page page) {
         User userVo = new User();
         userVo.setId(id);
-        IPage<User> user=  userFacade.selectUserListPage(page, userVo);
+        IPage<User> user = userFacade.selectUserListPage(page, userVo);
         return RespDTO.onSuc(user);
     }
 
-//    @ApiOperation(value = "注册事务", notes = "username和password为必选项")
-//    @PostMapping("/registryTran")
-//    @SysLogger("registryTran")
-//    @Transactional
-//    public RespDTO createUserTran(@RequestBody User user){
-//        //参数判读省略,判读该用户在数据库是否已经存在省略
-//        userFacade.createUser(user);
-//        throw new CommonException(CommonErrorCode.FAIL);
-////        return RespDTO.onSuc(user);
-//    }
-
-//    @Autowired
-//    private AmqpTemplate rabbitTemplate;
-//    @GetMapping("/test")
-//    public void test(){
-//        rabbitTemplate.convertAndSend(RabbitConfig.queueName, "Hello from RabbitMQ!");
-//    }
+    //    @ApiOperation(value = "注册事务", notes = "username和password为必选项")
+    //    @PostMapping("/registryTran")
+    //    @SysLogger("registryTran")
+    //    @Transactional
+    //    public RespDTO createUserTran(@RequestBody User user){
+    //        //参数判读省略,判读该用户在数据库是否已经存在省略
+    //        userFacade.createUser(user);
+    //        throw new CommonException(CommonErrorCode.FAIL);
+    ////        return RespDTO.onSuc(user);
+    //    }
+
+    //    @Autowired
+    //    private AmqpTemplate rabbitTemplate;
+    //    @GetMapping("/test")
+    //    public void test(){
+    //        rabbitTemplate.convertAndSend(RabbitConfig.queueName, "Hello from RabbitMQ!");
+    //    }
 
     /**
      * 增加用户
+     *
      * @param user 用户信息
      * @return 增加是否成功
      */
@@ -177,7 +176,7 @@ public class UserController {
     @SysLogger("addUser")
     @Transactional
     @ApiIgnore
-    public RespDTO addUser(@RequestBody User user){
+    public RespDTO addUser(@RequestBody User user) {
         //参数判读省略,判读该用户在数据库是否已经存在省略
         userFacade.saveUser(user);
         //        throw new CommonException(ErrorCode.FAIL);
@@ -186,6 +185,7 @@ public class UserController {
 
     /**
      * 修改用户
+     *
      * @param user 用户信息
      * @return 修改是否成功
      */
@@ -194,7 +194,7 @@ public class UserController {
     @SysLogger("updateUser")
     @Transactional
     @ApiIgnore
-    public RespDTO updateUser(@RequestBody User user){
+    public RespDTO updateUser(@RequestBody User user) {
         //参数判读省略,判读该用户在数据库是否已经存在省略
         userFacade.updateUser(user);
         return RespDTO.onSuc(user);
@@ -202,6 +202,7 @@ public class UserController {
 
     /**
      * 查询用户信息
+     *
      * @param id 用户ID
      * @return 用户信息
      */
@@ -210,12 +211,13 @@ public class UserController {
     @SysLogger("getUser")
     @Transactional
     @ApiIgnore
-    public RespDTO getUser(Long id){
+    public RespDTO getUser(Long id) {
         return RespDTO.onSuc(userFacade.getById(id));
     }
 
     /**
      * 删除用户
+     *
      * @param id 用户ID
      * @return 删除是否成功
      */
@@ -224,14 +226,14 @@ public class UserController {
     @SysLogger("delUser")
     @Transactional
     @ApiIgnore
-    public RespDTO delUser(Long id){
+    public RespDTO delUser(Long id) {
         return RespDTO.onSuc(userFacade.removeById(id));
     }
-    
-    @ApiOperation(value = "控制台账户信息(示例)[by:rengb]", notes="控制台账户信息")
-	@PostMapping("/getConsoleUserInfo")
-	@SysLogger("getConsoleUserInfo")
-	public RespDTO<GetConsoleUserInfoDTO> getConsoleUserInfo() {
-		return RespDTO.onSuc(userFacade.getConsoleUserInfo());
-	}
+
+    @ApiOperation(value = "控制台账户信息(示例)[by:rengb]", notes = "控制台账户信息")
+    @PostMapping("/getConsoleUserInfo")
+    @SysLogger("getConsoleUserInfo")
+    public RespDTO<GetConsoleUserInfoDTO> getConsoleUserInfo() {
+        return RespDTO.onSuc(userFacade.getConsoleUserInfo());
+    }
 }

+ 179 - 179
user-service/src/main/java/com/diagbot/web/UserInfoController.java

@@ -49,184 +49,184 @@ import java.util.Map;
 @SuppressWarnings("unchecked")
 public class UserInfoController {
 
-	@Autowired
-	private UserFacade userFacade;
-	@Autowired
-	OrganizationFacade organizationFacade;
-	@Autowired
-	UserOrganizationFacade userOrganizationFacade;
-	@Autowired
-	UserAuthenticationFacade userAuthenticationFacade;
-
-	@ApiOperation(value = "分页查询获取用户信息[by:wangfeng]", notes = "根据每页显示条数,默认 10,和当前页")
-	@PostMapping("/getUserInfoPag")
-	@SysLogger("getUserInfoPag")
-	// @ApiIgnore
-	public RespDTO<UserInfoDTO> getUserInfoPag(Page page, String orgName, Integer autStatus) {
-		UserInfoDTO userInfo = new UserInfoDTO();
-		userInfo.setOrgName(orgName);
-		userInfo.setAutStatus(autStatus);
-		IPage<UserInfoDTO> user = userFacade.selectUserInfoListPage(page, userInfo);
-		return RespDTO.onSuc(user);
-	}
-
-	@ApiOperation(value = "修改用户信息和机构信息[by:wangfeng]", notes = "用户信息和机构信息")
-	@PostMapping("/updateUserInfoAll")
-	@SysLogger("updateUserInfoAll")
-	@Transactional
-	public RespDTO<UserInfoOrganizationsVO> updateUserInfoAll(
-			@Valid @RequestBody UserInfoOrganizationsVO userInfoOrganizationsVO) {
-		Map<String, Object> userMap = new HashMap<String, Object>();
-		userMap.put("modifier",UserUtils.getCurrentPrincipleID());
-		userMap.put("gmtModified", DateUtil.now());
-		userMap.put("email", userInfoOrganizationsVO.getEmail());
-		userMap.put("principal", userInfoOrganizationsVO.getPrincipal());
-		userMap.put("address", userInfoOrganizationsVO.getAddress());
-		userMap.put("type", userInfoOrganizationsVO.getType());
-		userMap.put("position", userInfoOrganizationsVO.getPosition());
-		userMap.put("userId", userInfoOrganizationsVO.getUserId());
-		boolean res = userFacade.updateUserInfoAll(userMap);
-		if (!res){
-			throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
-		}
-		return RespDTO.onSuc(res);
-	}
-
-	@ApiOperation(value = "审核用户信息和机构信息[by:wangfeng]", notes = "审核用户信息和机构信息")
-	@PostMapping("/auditUserInfoAll")
-	@SysLogger("auditUserInfoAll")
-	@Transactional
-	public RespDTO<Boolean> auditUserInfoAll(@Valid @RequestBody UserInfoAuditVO userInfoAuditVO) {
-		Map<String, Object> auditMap = new HashMap<String, Object>();
-		auditMap.put("userId", userInfoAuditVO.getUserId());
-		auditMap.put("modifier",UserUtils.getCurrentPrincipleID());
-		auditMap.put("gmtModified", DateUtil.now());
-		auditMap.put("isReject", userInfoAuditVO.getIsReject());
-		auditMap.put("rejectComment", userInfoAuditVO.getRejectComment());
-		auditMap.put("rejectType", userInfoAuditVO.getRejectType());
-		// TODO 审核前先验证该用户的的认证状态
-		boolean res = userFacade.auditUserInfoAll(auditMap);
-
-		if (!res){
-			throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
-		}
-		return RespDTO.onSuc(res);
-	}
-
-	@ApiOperation(value = "删除用户信息和机构信息[by:wangfeng]", notes = "用户信息和机构信息")
-	@PostMapping("/updateDeleted")
-	@SysLogger("updateDeleted")
-	@Transactional
-	public RespDTO updateDeleted(@RequestParam String userId) {
-		Map<String, Object> map = new HashMap<String, Object>();
-		map.put("userId", userId);
-		map.put("modifier",UserUtils.getCurrentPrincipleID());
-		map.put("gmtModified", DateUtil.now());
-		boolean res = userFacade.updateDeleted(map);
-		if (!res){
-			throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
-		}
-		return RespDTO.onSuc(res);
-	}
-
-	@ApiOperation(value = "模糊查询机构信息[by:wangfeng]", notes = "机构信息")
-	@PostMapping("/findOrganization")
-	@SysLogger("findOrganization")
-	public RespDTO findOrganization(@RequestParam String organizationName) {
-		// TODO 返回机构Id和机构
-		List<Organization> organization = organizationFacade.findOrganization(organizationName);
-
-		return RespDTO.onSuc(organization);
-	}
-
-	@ApiOperation(value = "添加构信息[by:wangfeng]", notes = "机构信息")
-	@PostMapping("/addOrganization")
-	@SysLogger("addOrganization")
-	@Transactional
-	public RespDTO<Boolean> addOrganization(@Valid @RequestBody OrganizationVO organizationVO) {
-
-		String organizationName = organizationVO.getOrganizationName();
-		List<Organization> organizationList = organizationFacade.findOrganization(organizationName);
-		if (organizationList.size() > 0) {
-			return RespDTO.onSuc("该机构存在");
-		}
-		Organization organization = new Organization();
-		organization.setName(organizationVO.getOrganizationName());
-		organization.setType(organizationVO.getType());
-		organization.setPrincipal(organizationVO.getPrincipal());
-		organization.setSubNum(organizationVO.getSubNum());
-		organization.setAddress(organizationVO.getAddress());
-		organization.setGmtCreate(DateUtil.now());
-		organization.setModifier(UserUtils.getCurrentPrincipleID());
-		// organization.setCreator("5");
-
-		boolean res = organizationFacade.save(organization);
-
-		// System.out.println(GsonUtil.toJson(organization));
-		if (!res){
-			throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
-		}
-		return RespDTO.onSuc(res);
-	}
-
-	@ApiOperation(value = "添加用户信息和机构信息管理员[by:wangfeng]", notes = "用户信息和机构信息的绑定")
-	@PostMapping("/addUserInfo")
-	@SysLogger("addUserInfo")
-	@Transactional
-	public RespDTO<UserAndOrganizationVO> addUserInfo(@Valid @RequestBody UserAndOrganizationVO userAndOrganizationVO) {
-		// TODO 先查找机构,获取机构id,再注册用户,返回用户id, 取到用户id和 机构id ,查询用户机构关联表,在进行绑定
-		// User user = new User();
-		// 验证用户是否存在
-		String username = userAndOrganizationVO.getUserName();
-		User userData = userFacade.getUserInfo(username);
-		// System.out.println(user);
-		if (userData != null) {
-			return RespDTO.onSuc("该用户存在");
-		}
-		// 验证机构是否被绑定
-		UserOrganization userORG = new UserOrganization();
-		userORG.setOrganizationId(userAndOrganizationVO.getOrganizationid());
-
-		List<UserOrganization> userOrganizationData = userOrganizationFacade.getAgencyPersonnel(userORG);
-		if (userOrganizationData.size() > 0) {
-			return RespDTO.onSuc("该机构绑定了用户!");
-		}
-
-		User user = new User();
-		user.setCreator(UserUtils.getCurrentPrincipleID());
-		user.setUsername(userAndOrganizationVO.getUserName());
-		PasswordEncoder passwordEncoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
-		String entryPassword = passwordEncoder.encode(userAndOrganizationVO.getPassWord());
-		user.setPassword(entryPassword);
-		user.setLinkman(userAndOrganizationVO.getLinkman());
-		user.setGmtCreate(DateUtil.now());
-		user.setEmail(userAndOrganizationVO.getEmail());
-		boolean res = userFacade.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(1);// 是否通过认证 0:未通过,1:已通过
-			userAuthentication.setStatus(1);// 认证状态(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
-
-			userOrganizationFacade.save(userOrganization);
-		}
-
-		return RespDTO.onSuc("绑定成功");
-	}
+    @Autowired
+    private UserFacade userFacade;
+    @Autowired
+    OrganizationFacade organizationFacade;
+    @Autowired
+    UserOrganizationFacade userOrganizationFacade;
+    @Autowired
+    UserAuthenticationFacade userAuthenticationFacade;
+
+    @ApiOperation(value = "分页查询获取用户信息[by:wangfeng]", notes = "根据每页显示条数,默认 10,和当前页")
+    @PostMapping("/getUserInfoPag")
+    @SysLogger("getUserInfoPag")
+    // @ApiIgnore
+    public RespDTO<UserInfoDTO> getUserInfoPag(Page page, String orgName, Integer autStatus) {
+        UserInfoDTO userInfo = new UserInfoDTO();
+        userInfo.setOrgName(orgName);
+        userInfo.setAutStatus(autStatus);
+        IPage<UserInfoDTO> user = userFacade.selectUserInfoListPage(page, userInfo);
+        return RespDTO.onSuc(user);
+    }
+
+    @ApiOperation(value = "修改用户信息和机构信息[by:wangfeng]", notes = "用户信息和机构信息")
+    @PostMapping("/updateUserInfoAll")
+    @SysLogger("updateUserInfoAll")
+    @Transactional
+    public RespDTO<UserInfoOrganizationsVO> updateUserInfoAll(
+            @Valid @RequestBody UserInfoOrganizationsVO userInfoOrganizationsVO) {
+        Map<String, Object> userMap = new HashMap<String, Object>();
+        userMap.put("modifier", UserUtils.getCurrentPrincipleID());
+        userMap.put("gmtModified", DateUtil.now());
+        userMap.put("email", userInfoOrganizationsVO.getEmail());
+        userMap.put("principal", userInfoOrganizationsVO.getPrincipal());
+        userMap.put("address", userInfoOrganizationsVO.getAddress());
+        userMap.put("type", userInfoOrganizationsVO.getType());
+        userMap.put("position", userInfoOrganizationsVO.getPosition());
+        userMap.put("userId", userInfoOrganizationsVO.getUserId());
+        boolean res = userFacade.updateUserInfoAll(userMap);
+        if (!res) {
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
+        }
+        return RespDTO.onSuc(res);
+    }
+
+    @ApiOperation(value = "审核用户信息和机构信息[by:wangfeng]", notes = "审核用户信息和机构信息")
+    @PostMapping("/auditUserInfoAll")
+    @SysLogger("auditUserInfoAll")
+    @Transactional
+    public RespDTO<Boolean> auditUserInfoAll(@Valid @RequestBody UserInfoAuditVO userInfoAuditVO) {
+        Map<String, Object> auditMap = new HashMap<String, Object>();
+        auditMap.put("userId", userInfoAuditVO.getUserId());
+        auditMap.put("modifier", UserUtils.getCurrentPrincipleID());
+        auditMap.put("gmtModified", DateUtil.now());
+        auditMap.put("isReject", userInfoAuditVO.getIsReject());
+        auditMap.put("rejectComment", userInfoAuditVO.getRejectComment());
+        auditMap.put("rejectType", userInfoAuditVO.getRejectType());
+        // TODO 审核前先验证该用户的的认证状态
+        boolean res = userFacade.auditUserInfoAll(auditMap);
+
+        if (!res) {
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
+        }
+        return RespDTO.onSuc(res);
+    }
+
+    @ApiOperation(value = "删除用户信息和机构信息[by:wangfeng]", notes = "用户信息和机构信息")
+    @PostMapping("/updateDeleted")
+    @SysLogger("updateDeleted")
+    @Transactional
+    public RespDTO updateDeleted(@RequestParam String userId) {
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("userId", userId);
+        map.put("modifier", UserUtils.getCurrentPrincipleID());
+        map.put("gmtModified", DateUtil.now());
+        boolean res = userFacade.updateDeleted(map);
+        if (!res) {
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
+        }
+        return RespDTO.onSuc(res);
+    }
+
+    @ApiOperation(value = "模糊查询机构信息[by:wangfeng]", notes = "机构信息")
+    @PostMapping("/findOrganization")
+    @SysLogger("findOrganization")
+    public RespDTO findOrganization(@RequestParam String organizationName) {
+        // TODO 返回机构Id和机构
+        List<Organization> organization = organizationFacade.findOrganization(organizationName);
+
+        return RespDTO.onSuc(organization);
+    }
+
+    @ApiOperation(value = "添加构信息[by:wangfeng]", notes = "机构信息")
+    @PostMapping("/addOrganization")
+    @SysLogger("addOrganization")
+    @Transactional
+    public RespDTO<Boolean> addOrganization(@Valid @RequestBody OrganizationVO organizationVO) {
+
+        String organizationName = organizationVO.getOrganizationName();
+        List<Organization> organizationList = organizationFacade.findOrganization(organizationName);
+        if (organizationList.size() > 0) {
+            return RespDTO.onSuc("该机构存在");
+        }
+        Organization organization = new Organization();
+        organization.setName(organizationVO.getOrganizationName());
+        organization.setType(organizationVO.getType());
+        organization.setPrincipal(organizationVO.getPrincipal());
+        organization.setSubNum(organizationVO.getSubNum());
+        organization.setAddress(organizationVO.getAddress());
+        organization.setGmtCreate(DateUtil.now());
+        organization.setModifier(UserUtils.getCurrentPrincipleID());
+        // organization.setCreator("5");
+
+        boolean res = organizationFacade.save(organization);
+
+        // System.out.println(GsonUtil.toJson(organization));
+        if (!res) {
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL);
+        }
+        return RespDTO.onSuc(res);
+    }
+
+    @ApiOperation(value = "添加用户信息和机构信息管理员[by:wangfeng]", notes = "用户信息和机构信息的绑定")
+    @PostMapping("/addUserInfo")
+    @SysLogger("addUserInfo")
+    @Transactional
+    public RespDTO<UserAndOrganizationVO> addUserInfo(@Valid @RequestBody UserAndOrganizationVO userAndOrganizationVO) {
+        // TODO 先查找机构,获取机构id,再注册用户,返回用户id, 取到用户id和 机构id ,查询用户机构关联表,在进行绑定
+        // User user = new User();
+        // 验证用户是否存在
+        String username = userAndOrganizationVO.getUserName();
+        User userData = userFacade.getUserInfo(username);
+        // System.out.println(user);
+        if (userData != null) {
+            return RespDTO.onSuc("该用户存在");
+        }
+        // 验证机构是否被绑定
+        UserOrganization userORG = new UserOrganization();
+        userORG.setOrganizationId(userAndOrganizationVO.getOrganizationid());
+
+        List<UserOrganization> userOrganizationData = userOrganizationFacade.getAgencyPersonnel(userORG);
+        if (userOrganizationData.size() > 0) {
+            return RespDTO.onSuc("该机构绑定了用户!");
+        }
+
+        User user = new User();
+        user.setCreator(UserUtils.getCurrentPrincipleID());
+        user.setUsername(userAndOrganizationVO.getUserName());
+        PasswordEncoder passwordEncoder = PasswordEncoderFactories.createDelegatingPasswordEncoder();
+        String entryPassword = passwordEncoder.encode(userAndOrganizationVO.getPassWord());
+        user.setPassword(entryPassword);
+        user.setLinkman(userAndOrganizationVO.getLinkman());
+        user.setGmtCreate(DateUtil.now());
+        user.setEmail(userAndOrganizationVO.getEmail());
+        boolean res = userFacade.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(1);// 是否通过认证 0:未通过,1:已通过
+            userAuthentication.setStatus(1);// 认证状态(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
+
+            userOrganizationFacade.save(userOrganization);
+        }
+
+        return RespDTO.onSuc("绑定成功");
+    }
 
 }

+ 15 - 10
user-service/src/main/java/com/diagbot/web/VerController.java

@@ -23,7 +23,7 @@ import javax.validation.Valid;
  * @time: 2018/9/4 19:30
  */
 @RestController
-@Api(value="用户验证API", tags={"用户手机图片验证API"})
+@Api(value = "用户验证API", tags = { "用户手机图片验证API" })
 @RequestMapping("/userver")
 @SuppressWarnings("unchecked")
 public class VerController {
@@ -32,17 +32,19 @@ public class VerController {
 
     /**
      * 获取图片验证码
+     *
      * @return 图片验证码包括图片验证码唯一标志和图片信息
      */
     @ApiOperation(value = "获取图片验证码[by:zhoutg]", notes = "获取图片验证码包括图片验证码唯一标志和图片信息")
     @PostMapping("/getImgVerification")
     @SysLogger("getImgVerification")
-    public RespDTO<ImgVerCreatDTO> getImgVerification(){
-        return   RespDTO.onSuc(verFacade.getImgVerification());
+    public RespDTO<ImgVerCreatDTO> getImgVerification() {
+        return RespDTO.onSuc(verFacade.getImgVerification());
     }
 
     /**
      * 验证图片验证码信息
+     *
      * @param imgVerVerVO 验证图片验证码所需参数
      * @return 是否验证成功
      */
@@ -51,12 +53,13 @@ public class VerController {
                     "code:图片验证码<br>")
     @PostMapping("/verifyImgVerification")
     @SysLogger("verifyImgVerification")
-    public RespDTO<Boolean> verImgVerification(@RequestBody @Valid ImgVerVerVO imgVerVerVO){
-        return  RespDTO.onSuc(verFacade.verifyImgVerification(imgVerVerVO));
+    public RespDTO<Boolean> verImgVerification(@RequestBody @Valid ImgVerVerVO imgVerVerVO) {
+        return RespDTO.onSuc(verFacade.verifyImgVerification(imgVerVerVO));
     }
 
     /**
      * 注册获取短信验证码
+     *
      * @param smsVerCreatVO 获取短信验证码输入参数
      * @return 获取短信验证码是否成功
      */
@@ -66,13 +69,14 @@ public class VerController {
                     "code:图片验证码<br>")
     @PostMapping("/getSmsWithRegister")
     @SysLogger("getSmsWithRegister")
-    public RespDTO<Boolean> getSmsWithRegister(@RequestBody @Valid SmsVerCreatVO smsVerCreatVO){
-        return   RespDTO.onSuc(verFacade.getSmsVerification(smsVerCreatVO));
+    public RespDTO<Boolean> getSmsWithRegister(@RequestBody @Valid SmsVerCreatVO smsVerCreatVO) {
+        return RespDTO.onSuc(verFacade.getSmsVerification(smsVerCreatVO));
     }
 
 
     /**
      * 验证注册短信码并且注册为新的用户
+     *
      * @param smsVerVerVO 短信验证码验证输入信息
      * @return 用户信息是否注册到数据库
      */
@@ -81,13 +85,14 @@ public class VerController {
                     "smsCode:短信验证码,必填<br>")
     @PostMapping("/verifySmsVerification")
     @SysLogger("verifySmsVerification")
-    public RespDTO<Boolean> verifySmsVerification(@RequestBody SmsVerVerVO smsVerVerVO){
+    public RespDTO<Boolean> verifySmsVerification(@RequestBody SmsVerVerVO smsVerVerVO) {
         return RespDTO.onSuc(verFacade.verifySmsVerification(smsVerVerVO));
     }
 
 
     /**
      * 忘记密码获取短信验证码
+     *
      * @param smsVerCreatVO 获取短信验证码输入参数
      * @return 获取短信验证码是否成功
      */
@@ -97,8 +102,8 @@ public class VerController {
                     "code:图片验证码<br>")
     @PostMapping("/getSmsWithResetPassword")
     @SysLogger("getSmsWithResetPassword")
-    public RespDTO<Boolean> getSmsWithResetPassword(@RequestBody @Valid SmsVerCreatVO smsVerCreatVO){
-        return   RespDTO.onSuc(verFacade.getSmsWithResetPassword(smsVerCreatVO));
+    public RespDTO<Boolean> getSmsWithResetPassword(@RequestBody @Valid SmsVerCreatVO smsVerCreatVO) {
+        return RespDTO.onSuc(verFacade.getSmsWithResetPassword(smsVerCreatVO));
     }
 
 }

+ 0 - 5
user-service/src/main/resources/mapper/OrganizationMapper.xml

@@ -24,11 +24,6 @@
         where a.id = b.organization_id and b.user_id = #{userId} and a.is_deleted = 'N' and b.is_deleted = 'N'
     </select>
 
-    <select id="getByName" resultMap="BaseResultMap">
-        SELECT a.* FROM `sys_organization` a
-        where a.name = #{name} and a.is_deleted = 'N'
-    </select>
-
 	<select id="findOrganization" parameterType="java.lang.String" resultType="com.diagbot.entity.Organization" >
 		SELECT id,NAME FROM sys_organization WHERE is_deleted = "N" AND NAME LIKE
 		CONCAT('%',  #{organizationName}, '%')

+ 0 - 5
user-service/src/main/resources/mapper/UserAuthenticationMapper.xml

@@ -19,11 +19,6 @@
         <result column="remark" property="remark" />
     </resultMap>
 
-    <select id="getByUserId" resultMap="BaseResultMap">
-        SELECT a.* FROM `sys_user_authentication` a
-        where a.user_id=#{userId} and  a.is_deleted = 'N'
-    </select>
-    
     <select id="getAllWaitAuthCou" resultType="int">
     	select
     		count(1)

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

@@ -242,7 +242,7 @@
 
 </update>
 
-<select id="dependentuserInfoByTime" parameterType="java.util.Map" resultType="com.diagbot.dto.UserInfoExportDTO" >
+<select id="dependentuserInfoByTime" parameterType="java.util.Map" resultType="com.diagbot.dto.UserInfoDTO" >
 
 	SELECT
 	u.id AS userId,
@@ -253,14 +253,14 @@
 	org.id AS orgId,
 	org.gmt_create AS orgGmtCreate,
 	org.name AS orgName,
-	org.type,
+	org.type as orgType,
 	org.principal AS orgPrincipal,
-	org.address,
-	org.parent_id,
-	org.sub_num,
-	aut.position,
-	aut.is_reject,
-	aut.status
+	org.address as orgAddress,
+	org.parent_id as orgParent_id,
+	org.sub_num as orgSub_num,
+	aut.position as autPosition,
+	aut.is_reject as autIsReject,
+	aut.status as autStatus
 	FROM sys_user u
 	LEFT JOIN sys_user_organization uorg ON u.id = uorg.user_id
 	LEFT JOIN sys_organization org ON uorg.organization_id = org.id
@@ -274,7 +274,7 @@
 	<if test="userExport.autStatus != null">
 	   AND aut.status = #{userInfo.autStatus}  
 	</if> 
-	<if test="userExport.startTime != null and userExport.endDate != null">
+	<if test="userExport.startTime != null and userExport.endTime != null">
 	AND u.gmt_create BETWEEN #{userExport.startTime} and #{userExport.endTime}
 	</if>
 	ORDER BY u.gmt_create DESC