Kaynağa Gözat

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

zhoutg 6 yıl önce
ebeveyn
işleme
4f1f1d7d65

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

@@ -70,4 +70,29 @@ public class GetConsoleOpenedDTO implements Serializable {
      */
     private Integer isExpire;
     
+    /**
+     * 产品地址
+     */
+    private String url;
+    
+    /**
+     * 
+     */
+    private String appKeyId;
+    
+    /**
+     * 
+     */
+    private String appKeySecret;
+    
+    /**
+     * 是否可以进入
+     */
+    private Integer isInto;
+    
+    /**
+     * 是否显示生成token
+     */
+    private Integer isCreateToken;
+    
 }

+ 13 - 0
diagbotman-service/src/main/java/com/diagbot/entity/UserRenewals.java

@@ -89,6 +89,19 @@ public class UserRenewals implements Serializable {
      */
     private Integer cancelRenewals;
 
+    /**
+     * 结束时间
+     */
+    private Date endTime;
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
     public Integer getCancelRenewals() {
         return cancelRenewals;
     }

+ 1 - 1
diagbotman-service/src/main/java/com/diagbot/enums/StatusEnum.java

@@ -9,7 +9,7 @@ import lombok.Setter;
  * @time: 2018/9/19 10:05
  */
 public enum StatusEnum implements KeyedNamed {
-    Disable(0, "用"),
+    Disable(0, "用"),
     Enable(1, "启用");
 
     @Setter

+ 17 - 15
diagbotman-service/src/main/java/com/diagbot/facade/LantoneProductFacade.java

@@ -88,7 +88,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
         lantoneProduct.setGmtCreate(DateUtil.now());
         lantoneProduct.setCreator(UserUtils.getCurrentPrincipleID());
         if (!save(lantoneProduct)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
                     "产品添加失败");
         }
         return true;
@@ -109,7 +109,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
         }
         LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
         if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y.getKey())){
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "该产品已删除");
         }
         BeanUtil.copyProperties(updateProductVO, lantoneProduct);
@@ -126,7 +126,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
             }
         }
         if (!updateById(lantoneProduct)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
                     "产品修改失败");
         }
         return true;
@@ -141,7 +141,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
     public Boolean stopProduct(UpdateProductVO updateProductVO) {
         LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
         if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y.getKey())){
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "该产品已删除");
         }
         if(updateProductVO.getServiceStatus() == lantoneProduct.getServiceStatus() && updateProductVO.getServiceStatus() == StatusEnum.Enable.getKey()){
@@ -184,7 +184,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
             }
         }
         if (!updateById(lantoneProduct)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
                     "产品修改失败");
         }
         return true;
@@ -199,7 +199,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
     public Boolean deleteProduct(UpdateProductVO updateProductVO) {
         LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
         if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y.getKey())){
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "该产品已删除");
         }
         if(lantoneProduct.getServiceStatus()==StatusEnum.Enable.getKey()){
@@ -217,11 +217,11 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
         lantoneProduct.setGmtModified(DateUtil.now());
         lantoneProduct.setIsDeleted(IsDeleteEnum.Y.getKey());
         if (!updateById(lantoneProduct)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
                     "产品删除失败");
         }
         if(!productServiceFacade.deleteByProductId(updateProductVO.getId())){
-                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
                         "产品令牌删除失败");
         }
         return true;
@@ -239,7 +239,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
         userIdList.add(userId);
         RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(userIdList);
         if (mapRespDTO == null || !"0".equals(mapRespDTO.code)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "获取用户机构信息失败");
         }
 
@@ -309,7 +309,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
         }
         RespDTO<User> mapRespDTO = userServiceClient.getUserAuthStatus(userId);
         if (mapRespDTO == null || !"0".equals(mapRespDTO.code)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "获取用户机构信息失败");
         }
         Map map =new HashMap();
@@ -327,9 +327,11 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
      * @return 当条产品线下所有订单信息
      */
     public IPage<OpendProductDTO> opendedProduct(OppendedProductVO oppendedProductVO) {
-        LantoneProduct lantoneProduct = this.getById(oppendedProductVO.getProductId());
-        if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y.getKey())){
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+        LantoneProduct lantoneProduct = new LantoneProduct();
+        lantoneProduct.setId(oppendedProductVO.getProductId());
+        LantoneProduct lantoneProducts = this.getById(lantoneProduct.getId());
+        if(lantoneProducts.getIsDeleted().equals(IsDeleteEnum.Y.getKey())){
+            throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "该产品已删除");
         }
         Page page =new Page();
@@ -345,7 +347,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
         }else{
             RespDTO<List<User>> userInfiList = userServiceClient.getUserAllInfo();
             if(userInfiList == null || !"0".equals(userInfiList.code) ) {
-                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                throw new CommonException(CommonErrorCode.RPC_ERROR,
                         "获取用户和机构信息失败");
             }
             List<Long> userIds =new ArrayList<>();
@@ -362,7 +364,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
         }
         RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(list1);
         if (mapRespDTO == null || !"0".equals(mapRespDTO.code)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "获取用户和机构信息失败");
         }
         Map<Long, UserOrgDTO> dataMap = mapRespDTO.data;

+ 18 - 5
diagbotman-service/src/main/java/com/diagbot/facade/OpenedProductsFacade.java

@@ -69,7 +69,7 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
      * @return 所有已经开通的产品
      */
     public List<GetConsoleOpenedDTO> getConsoleOpened() {
-        Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
+    	Long userId = Long.parseLong(UserUtils.getCurrentPrincipleID());
         
         List<GetConsoleOpenedDTO> retList = baseMapper.getConsoleOpened(userId);
         for(GetConsoleOpenedDTO i : retList){
@@ -79,6 +79,18 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
         	}
         	i.setAccessTypeMsg(accessTypeMsg);
         	i.setServiceStatusMsg(StatusEnum.getName(i.getServiceStatus()));
+        	
+        	if(i.getAccessType().indexOf("1")!=-1){
+        		i.setIsInto(1);
+        	}else{
+        		i.setIsInto(0);
+        		i.setUrl("");
+        	}
+        	if(i.getAccessType().replace("1", "").replace(",", "").length()>0){
+        		i.setIsCreateToken(1);
+        	}else{
+        		i.setIsCreateToken(0);
+        	}
         }
         
         return retList;
@@ -204,7 +216,7 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
         openedProducts.setServiceStatus(startAndendByUserIdVO.getServiceStatus());
          RespDTO<User> userData = userServiceClient.getUserAuthStatus(startAndendByUserIdVO.getUserId());
          User user = userData.data;
-         if(user==null){
+         if(user.getIsDeleted().equals("Y")){
            	 return RespDTO.onError("该用户已不存在"); 
             }
          //当用户是操作是启用的时候,先判断该产品是否是启用状态
@@ -213,7 +225,7 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
 			lantoneProduct.setId(startAndendByUserIdVO.getProductId());
 			LantoneProduct lantone = lantoneProductFacade.getById(lantoneProduct);
 			if (lantone.getServiceStatus().equals(StatusEnum.Disable.getKey())) {
-				return RespDTO.onError("该产品已停用");
+				return RespDTO.onError("该产品线已停用");
 			}
 		}
 		//判断该用户是否有续费申请单
@@ -232,7 +244,7 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
         if(OpenedProductsData != null){
         	for(OpenedProducts openedProductsNew : OpenedProductsData){
         		if(openedProductsNew.getServiceStatus().equals(startAndendByUserIdVO.getServiceStatus())){
-        			return RespDTO.onError("该产品已被"+StatusEnum.getName(startAndendByUserIdVO.getServiceStatus())+"无需处理");	
+        			return RespDTO.onError("该产品已被"+StatusEnum.getName(startAndendByUserIdVO.getServiceStatus())+"无需处理");	
         		}
         	}	
         }
@@ -279,7 +291,7 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
         }
         for (OpenedProducts openedProducts1 :opendList) {
             if(beforeTime(openedProducts1.getEndTime(),modifyOpeningTimeVO.getEndTime())){
-                throw new CommonException(CommonErrorCode.NOT_EXISTS, "输入有误,续费时间需大于到期时间");
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "输入有误,续费时间需大于到期时间");
             }
         }
         openedProducts.setEndTime(DateUtil.parseDateTime(DateUtil.formatDateTime(DateUtil.getLastTimeOfDay(DateUtil.parseDate(modifyOpeningTimeVO.getEndTime())))));
@@ -289,6 +301,7 @@ public class OpenedProductsFacade extends OpenedProductsServiceImpl {
         userRenewals.setRenewalsStatus(RenewalsEnum.RENEWALS.getKey());
         userRenewals.setGmtModified(DateUtil.now());
         userRenewals.setModifier(UserUtils.getCurrentPrincipleID());
+        userRenewals.setEndTime(DateUtil.parseDateTime(DateUtil.formatDateTime(DateUtil.getLastTimeOfDay(DateUtil.parseDate(modifyOpeningTimeVO.getEndTime())))));
         userRenewals.setRenewalsNo(modifyOpeningTimeVO.getRenewalsNo());
        //修改续费时间
         boolean res = modifyOpeningTime(openedProducts);

+ 3 - 3
diagbotman-service/src/main/java/com/diagbot/facade/OrderDetailsFacade.java

@@ -99,14 +99,14 @@ public class OrderDetailsFacade extends OrderDetailsServiceImpl {
                 orderDetails.setRejectType(auditStatusVO.getRejectType());
             }
             if(!this.updateById(orderDetails)){
-                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
                         "审核状态修改失败");
             }
             return productOrderFacade.updateProductOrderStatus(orderDetails.getOrderNum());
         }
         orderDetails.setStatus(PaymentMethodEnum.PAY.getKey());
         if(!this.updateById(orderDetails)){
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
                     "审核状态修改失败");
         }
         Long userId =Long.parseLong(UserUtils.getCurrentPrincipleID());
@@ -164,7 +164,7 @@ public class OrderDetailsFacade extends OrderDetailsServiceImpl {
         }
         RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(list1);
         if(mapRespDTO == null || !"0".equals(mapRespDTO.code) ) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "获取用户和机构信息失败");
         }
         Map<Long, UserOrgDTO> dataMap = mapRespDTO.data;

+ 8 - 8
diagbotman-service/src/main/java/com/diagbot/facade/ProductOrderFacade.java

@@ -143,7 +143,7 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
         userIdList.add(userId);
         RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(userIdList);
         if (mapRespDTO == null || !"0".equals(mapRespDTO.code)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "获取用户机构信息失败");
         }
         Map<Long, UserOrgDTO> dataMap =mapRespDTO.data;
@@ -172,7 +172,7 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
         productOrder.setUserId(userId);
         productOrder.setTime(DateUtil.now());
         if (!save(productOrder)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "添加订单失败");
+            throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "添加订单失败");
         }
         OrderDetails orderDetails = null;
         List<OrderDetails> list =new ArrayList();
@@ -191,7 +191,7 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "获取产品信息失败");
         }
         if(orderDetailsFacade.saveOrderDetails(list)){
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "添加订单失败");
+            throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED, "添加订单失败");
         }
         return true;
     }
@@ -217,7 +217,7 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
         WaitExamOrderCouDTO waitExamOrderCouDTO = new WaitExamOrderCouDTO();
         RespDTO<List<User>> userInfiList = userServiceClient.getUserAllInfo();
         if(userInfiList == null || !"0".equals(userInfiList.code) ) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "获取用户和机构信息失败");
         }
         List<Long> userIds =new ArrayList<>();
@@ -244,7 +244,7 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
         if(productOrderVO.getOrgName()!=null&&productOrderVO.getOrgName()!=""){
             RespDTO<List<Long>> rlist = userServiceClient.getUserByOrgName(productOrderVO.getOrgName());
             if(rlist == null || !"0".equals(rlist.code) ) {
-                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                throw new CommonException(CommonErrorCode.RPC_ERROR,
                         "获取用户和机构信息失败");
             }
             if(rlist.data.size() == 0){
@@ -254,7 +254,7 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
         }else{
             RespDTO<List<User>> userInfiList = userServiceClient.getUserAllInfo();
             if(userInfiList == null || !"0".equals(userInfiList.code) ) {
-                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                throw new CommonException(CommonErrorCode.RPC_ERROR,
                         "获取用户和机构信息失败");
             }
             List<Long> userIds =new ArrayList<>();
@@ -277,7 +277,7 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
 		List<OrderDetialsDTO> orderDetilList = orderDetailsFacade.getAllOrderDetials(orderDetialsVO);
 		RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(list1);
 		if(mapRespDTO == null || !"0".equals(mapRespDTO.code) ) {
-			throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+			throw new CommonException(CommonErrorCode.RPC_ERROR,
 					"获取用户和机构信息失败");
 		}
 		Map<Long, UserOrgDTO> dataMap = mapRespDTO.data;
@@ -331,7 +331,7 @@ public class ProductOrderFacade extends ProductOrderServiceImpl {
         productOrder.setGmtModified(DateUtil.now());
         productOrder.setModifier(UserUtils.getCurrentPrincipleID());
         if(!this.updateById(productOrder)){
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
                     "用户订单审核状态修改失败");
         }
         return true;

+ 9 - 7
diagbotman-service/src/main/java/com/diagbot/facade/UserRenewalsFacade.java

@@ -103,7 +103,7 @@ public class UserRenewalsFacade extends UserRenewalsServiceImpl {
         }else{
             RespDTO<List<User>> userInfiList = userServiceClient.getUserAllInfo();
             if(userInfiList == null || !"0".equals(userInfiList.code) ) {
-                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                throw new CommonException(CommonErrorCode.RPC_ERROR,
                         "获取用户和机构信息失败");
             }
             List<Long> userIds =new ArrayList<>();
@@ -123,7 +123,7 @@ public class UserRenewalsFacade extends UserRenewalsServiceImpl {
         List<OpenedProducts> opendList = openedProductsFacade.getOpendInfos();
         RespDTO<Map<Long, UserOrgDTO>> mapRespDTO = userServiceClient.getUserAndOrg(userIds);
         if(mapRespDTO == null || !"0".equals(mapRespDTO.code) ) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "获取用户和机构信息失败");
         }
         Map<Long, UserOrgDTO> dataMap = mapRespDTO.data;
@@ -135,9 +135,11 @@ public class UserRenewalsFacade extends UserRenewalsServiceImpl {
 //                    bean.setProductName(productLineDTO.getName());
 //                }
 //            }
-            for (OpenedProducts openedProducts:opendList) {
-                if(openedProducts.getUserId().longValue() == bean.getUserId().longValue()&&openedProducts.getProductId().longValue() == bean.getProductId().longValue()){
-                    bean.setEndTime(openedProducts.getEndTime());
+            if(bean.getRenewalsStatus().intValue() == RenewalsEnum.NOT_RENEWALS.getKey()){
+                for (OpenedProducts openedProducts:opendList) {
+                    if(openedProducts.getUserId().longValue() == bean.getUserId().longValue()&&openedProducts.getProductId().longValue() == bean.getProductId().longValue()){
+                        bean.setEndTime(openedProducts.getEndTime());
+                    }
                 }
             }
             if (null != productMap && null != productMap.get(bean.getProductId())){
@@ -163,7 +165,7 @@ public class UserRenewalsFacade extends UserRenewalsServiceImpl {
         userRenewals.setModifier(UserUtils.getCurrentPrincipleID());
         userRenewals.setGmtModified(DateUtil.now());
         if(!this.updateById(userRenewals)){
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
                     "删除失败");
         }
         return true;
@@ -187,7 +189,7 @@ public class UserRenewalsFacade extends UserRenewalsServiceImpl {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "续费单已审核,请刷新重试");
         }
         if(!this.updateById(userRenewals)){
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL,
                     "取消失败");
         }
         return true;

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

@@ -103,7 +103,7 @@
 			  and c.num=d.order_num
               and d.audit_status=1
               and a.is_deleted='N' and b.is_deleted='N' and c.is_deleted='N' and d.is_deleted='N'
-              and (find_in_set('2',a.access_type) or FIND_IN_SET('3',a.access_type))
+              -- and (find_in_set('2',a.access_type) or FIND_IN_SET('3',a.access_type))
               and b.user_id=#{userId}  and c.user_id=#{userId}  and d.user_id=#{userId}
     </select>
     

+ 19 - 0
diagbotman-service/src/main/resources/mapper/OpenedProductsMapper.xml

@@ -62,11 +62,30 @@
 			DATE_FORMAT(a.start_time,'%Y-%m-%d') as startTime,
 			DATE_FORMAT(a.end_time,'%Y-%m-%d') as endTime,
 			a.service_status as serviceStatus,
+			b.url as url,
 			b.access_type as accessType,
+			d.app_key_id as appKeyId,
+			d.app_key_secret as appKeySecret,
 			case when c.id is null then 0 else 1 end as renewalsStutas,
 			case when sysdate()>a.end_time then 0 else 1 end as isExpire
 		from diag_opened_products a join diag_lantone_product b on a.product_id=b.id
 		left join diag_user_renewals c on a.user_id=c.user_id and a.product_id=c.product_id and c.renewals_status=0 and c.cancel_renewals=0 and c.is_deleted='N'
+		left join 
+		(SELECT
+		b.product_id,
+		c.app_key_id,
+		c.app_key_secret
+		FROM
+		diag_service_info a
+		JOIN diag_product_service b ON a.id = b.service_id
+		JOIN diag_service_token c ON b.id = c.product_service_id
+		WHERE
+		a.is_deleted = 'N'
+		AND b.is_deleted = 'N'
+		AND c.is_deleted = 'N'
+		AND a.user_id = #{userId}
+		AND a.type = 1
+		AND c.type = 1) d on b.id=d.product_id
 		where a.is_deleted='N' and b.is_deleted='N' and a.user_id=#{userId}
     </select>
 

+ 2 - 1
diagbotman-service/src/main/resources/mapper/UserRenewalsMapper.xml

@@ -54,7 +54,8 @@
 	  <trim prefix="set" suffixOverrides=",">
 	  <if test="gmtModified != null">a.gmt_modified = #{gmtModified} ,</if>
 	  <if test="modifier != null">a.modifier = #{modifier},</if> 
-	  <if test="renewalsStatus != null">a.renewals_status = #{renewalsStatus} </if>
+	  <if test="renewalsStatus != null">a.renewals_status = #{renewalsStatus},</if>
+      <if test="endTime != null">a.end_time = #{endTime}</if>
 	  </trim>
 	  WHERE a.renewals_no = #{renewalsNo}
 </update>

+ 1 - 0
docs/003.20181024初始化脚本/init_diagbotcloud.sql

@@ -180,6 +180,7 @@ CREATE TABLE `diag_user_renewals` (
   `apply_time` datetime NOT NULL  COMMENT '申请时间',
   `renewals_no` varchar(100) NOT NULL DEFAULT '' COMMENT '续费单号',
   `cancel_renewals` int(10) NOT NULL DEFAULT '0' COMMENT '取消续费状态(0.未取消1.取消)',
+  `end_time` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='用户续费申请表';
 

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

@@ -957,7 +957,7 @@ public class UserFacade extends UserServiceImpl {
         map.put("modifier", UserUtils.getCurrentPrincipleID());
         map.put("gmtModified", DateUtil.now());
          User userDate = getById(baseIdVO.getId());
-         if(userDate==null){
+         if(userDate.getIsDeleted().equals("Y")){
         	 return RespDTO.onError("该用户已不存在"); 
          }
         //客户中心-查询用户续费数量
@@ -980,7 +980,7 @@ public class UserFacade extends UserServiceImpl {
         int auditSum = auditSums.data;
         //System.out.println("=========auditSumauditSum===="+auditSum);
         if(auditSum>0){
-   		 return RespDTO.onError("该用户产品申请单,请先审核");
+   		 return RespDTO.onError("该用户存在产品申请单,请先审核");
     	}
         List<Long> userIds = new ArrayList<>();
         userIds.add(baseIdVO.getId());
@@ -1399,7 +1399,7 @@ public class UserFacade extends UserServiceImpl {
         amendUserInfo.put("position", amendUserInfoVO.getPosition());
         amendUserInfo.put("linkman", amendUserInfoVO.getLinkman());
         User userDate = getById(amendUserInfoVO.getUserId());
-        if(userDate==null){
+        if(userDate.getIsDeleted().equals("Y")){
        	 return RespDTO.onError("该用户已不存在"); 
         }
         boolean res = updateUserInfo(amendUserInfo);