Browse Source

王宇:产品管理基础类

wangyu 6 năm trước cách đây
mục cha
commit
c035ab2db7

+ 0 - 240
diagbotman-service/src/main/java/com/diagbot/entity/DiagLantoneProduct.java

@@ -1,240 +0,0 @@
-package com.diagbot.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * <p>
- * 朗通产品表
- * </p>
- *
- * @author wangyu
- * @since 2018-09-18
- */
-@TableName("diag_lantone_product")
-public class DiagLantoneProduct implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 产品id
-     */
-    @TableId(value = "id", type = IdType.AUTO)
-    private Integer id;
-
-    /**
-     * 是否删除 N:未删除,Y:删除
-     */
-    private String isDeleted;
-
-    /**
-     * 记录创建时间
-     */
-    private Date gmtCreate;
-
-    /**
-     * 记录修改时间,如果时间是1970年则表示纪录未修改
-     */
-    private Date gmtModified;
-
-    /**
-     * 创建人,0表示无创建人值
-     */
-    private String creator;
-
-    /**
-     * 修改人,如果为0则表示纪录未修改
-     */
-    private String modifier;
-
-    /**
-     * 产品名称
-     */
-    private String name;
-
-    /**
-     * 产品介绍
-     */
-    private String decription;
-
-    /**
-     * 计费方式
-     */
-    private String chargeType;
-
-    /**
-     * 产品路径
-     */
-    private String url;
-
-    /**
-     * 机构开通数量
-     */
-    private Integer openNum;
-
-    /**
-     * 停用状态
-     */
-    private Integer serviceStatus;
-
-    /**
-     * 试用状态
-     */
-    private Integer trialStatus;
-
-    /**
-     * 试用地址
-     */
-    private String trialUrl;
-
-    /**
-     * 接入方式(1:嵌入式,2:接口方式,3:online)
-     */
-    private String accessType;
-
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public String getIsDeleted() {
-        return isDeleted;
-    }
-
-    public void setIsDeleted(String isDeleted) {
-        this.isDeleted = isDeleted;
-    }
-
-    public Date getGmtCreate() {
-        return gmtCreate;
-    }
-
-    public void setGmtCreate(Date gmtCreate) {
-        this.gmtCreate = gmtCreate;
-    }
-
-    public Date getGmtModified() {
-        return gmtModified;
-    }
-
-    public void setGmtModified(Date gmtModified) {
-        this.gmtModified = gmtModified;
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public String getModifier() {
-        return modifier;
-    }
-
-    public void setModifier(String modifier) {
-        this.modifier = modifier;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getDecription() {
-        return decription;
-    }
-
-    public void setDecription(String decription) {
-        this.decription = decription;
-    }
-
-    public String getChargeType() {
-        return chargeType;
-    }
-
-    public void setChargeType(String chargeType) {
-        this.chargeType = chargeType;
-    }
-
-    public String getUrl() {
-        return url;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-    public Integer getOpenNum() {
-        return openNum;
-    }
-
-    public void setOpenNum(Integer openNum) {
-        this.openNum = openNum;
-    }
-
-    public Integer getServiceStatus() {
-        return serviceStatus;
-    }
-
-    public void setServiceStatus(Integer serviceStatus) {
-        this.serviceStatus = serviceStatus;
-    }
-
-    public Integer getTrialStatus() {
-        return trialStatus;
-    }
-
-    public void setTrialStatus(Integer trialStatus) {
-        this.trialStatus = trialStatus;
-    }
-
-    public String getTrialUrl() {
-        return trialUrl;
-    }
-
-    public void setTrialUrl(String trialUrl) {
-        this.trialUrl = trialUrl;
-    }
-
-    public String getAccessType() {
-        return accessType;
-    }
-
-    public void setAccessType(String accessType) {
-        this.accessType = accessType;
-    }
-
-    @Override
-    public String toString() {
-        return "LantoneProduct{" +
-                "id=" + id +
-                ", isDeleted=" + isDeleted +
-                ", gmtCreate=" + gmtCreate +
-                ", gmtModified=" + gmtModified +
-                ", creator=" + creator +
-                ", modifier=" + modifier +
-                ", name=" + name +
-                ", decription=" + decription +
-                ", chargeType=" + chargeType +
-                ", url=" + url +
-                ", openNum=" + openNum +
-                ", serviceStatus=" + serviceStatus +
-                ", trialStatus=" + trialStatus +
-                ", trialUrl=" + trialUrl +
-                ", accessType=" + accessType +
-                "}";
-    }
-}

+ 50 - 51
diagbotman-service/src/main/java/com/diagbot/entity/DiagOpenedProducts.java

@@ -2,23 +2,22 @@ package com.diagbot.entity;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
- * @Description: 已开通产品实体类
+ * @Description: 订单明细实体类
  * @Author: wangyu
- * @Date: 15:39 2018/9/17
+ * @Date: 15:40 2018/9/17
  */
-@TableName("diag_opened_products")
-public class DiagOpenedProducts implements Serializable {
+public class DiagOrderDetails implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
     /**
-     * 已开通产品id
+     * 订单明细id
      */
     @TableId(value = "id", type = IdType.AUTO)
     private Long id;
@@ -48,6 +47,11 @@ public class DiagOpenedProducts implements Serializable {
      */
     private String modifier;
 
+    /**
+     * 订单编号
+     */
+    private String orderNum;
+
     /**
      * 产品id
      */
@@ -59,24 +63,19 @@ public class DiagOpenedProducts implements Serializable {
     private Integer userId;
 
     /**
-     * 开通日期
+     * 是否通过审核,N:未通过,Y:已通过
      */
-    private Date startTime;
+    private String auditStatus;
 
     /**
-     * 结束日期
+     * 单个服务的价钱
      */
-    private Date endTime;
+    private BigDecimal unitPrice;
 
     /**
-     * 停用状态
+     * 订单状态 Y:已付款,N未付款
      */
-    private Integer serviceStatus;
-
-    /**
-     * 订单id
-     */
-    private Integer orderId;
+    private String status;
 
 
     public Long getId() {
@@ -127,6 +126,14 @@ public class DiagOpenedProducts implements Serializable {
         this.modifier = modifier;
     }
 
+    public String getOrderNum() {
+        return orderNum;
+    }
+
+    public void setOrderNum(String orderNum) {
+        this.orderNum = orderNum;
+    }
+
     public Integer getProductId() {
         return productId;
     }
@@ -143,53 +150,45 @@ public class DiagOpenedProducts implements Serializable {
         this.userId = userId;
     }
 
-    public Date getStartTime() {
-        return startTime;
-    }
-
-    public void setStartTime(Date startTime) {
-        this.startTime = startTime;
-    }
-
-    public Date getEndTime() {
-        return endTime;
+    public String getAuditStatus() {
+        return auditStatus;
     }
 
-    public void setEndTime(Date endTime) {
-        this.endTime = endTime;
+    public void setAuditStatus(String auditStatus) {
+        this.auditStatus = auditStatus;
     }
 
-    public Integer getServiceStatus() {
-        return serviceStatus;
+    public BigDecimal getUnitPrice() {
+        return unitPrice;
     }
 
-    public void setServiceStatus(Integer serviceStatus) {
-        this.serviceStatus = serviceStatus;
+    public void setUnitPrice(BigDecimal unitPrice) {
+        this.unitPrice = unitPrice;
     }
 
-    public Integer getOrderId() {
-        return orderId;
+    public String getStatus() {
+        return status;
     }
 
-    public void setOrderId(Integer orderId) {
-        this.orderId = orderId;
+    public void setStatus(String status) {
+        this.status = status;
     }
 
     @Override
     public String toString() {
-        return "OpenedProducts{" +
-                "id=" + id +
-                ", isDeleted=" + isDeleted +
-                ", gmtCreate=" + gmtCreate +
-                ", gmtModified=" + gmtModified +
-                ", creator=" + creator +
-                ", modifier=" + modifier +
-                ", productId=" + productId +
-                ", userId=" + userId +
-                ", startTime=" + startTime +
-                ", endTime=" + endTime +
-                ", serviceStatus=" + serviceStatus +
-                ", orderId=" + orderId +
-                "}";
+        return "DiagOrderDetails{" +
+        "id=" + id +
+        ", isDeleted=" + isDeleted +
+        ", gmtCreate=" + gmtCreate +
+        ", gmtModified=" + gmtModified +
+        ", creator=" + creator +
+        ", modifier=" + modifier +
+        ", orderNum=" + orderNum +
+        ", productId=" + productId +
+        ", userId=" + userId +
+        ", auditStatus=" + auditStatus +
+        ", unitPrice=" + unitPrice +
+                ", status=" + status +
+        "}";
     }
 }

+ 166 - 0
diagbotman-service/src/main/java/com/diagbot/entity/DiagProductOrder.java

@@ -0,0 +1,166 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Description: 订单实体类
+ * @Author: wangyu
+ * @Date: 15:41 2018/9/17
+ */
+public class DiagProductOrder implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 订单id
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 订单编号
+     */
+    private String num;
+
+    /**
+     * 用户id
+     */
+    private Integer userId;
+
+    /**
+     * 下单时间(申请时间)
+     */
+    private Date time;
+
+    /**
+     * 订单总价
+     */
+    private BigDecimal totalPrices;
+
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public String getNum() {
+        return num;
+    }
+
+    public void setNum(String num) {
+        this.num = num;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Date getTime() {
+        return time;
+    }
+
+    public void setTime(Date time) {
+        this.time = time;
+    }
+
+    public BigDecimal getTotalPrices() {
+        return totalPrices;
+    }
+
+    public void setTotalPrices(BigDecimal totalPrices) {
+        this.totalPrices = totalPrices;
+    }
+
+    @Override
+    public String toString() {
+        return "DiagProductOrder{" +
+        "id=" + id +
+        ", isDeleted=" + isDeleted +
+        ", gmtCreate=" + gmtCreate +
+        ", gmtModified=" + gmtModified +
+        ", creator=" + creator +
+        ", modifier=" + modifier +
+        ", num=" + num +
+        ", userId=" + userId +
+        ", time=" + time +
+        ", totalPrices=" + totalPrices +
+        "}";
+    }
+}

+ 11 - 0
diagbotman-service/src/main/java/com/diagbot/entity/wrapper/LantoneProductWrapper.java

@@ -0,0 +1,11 @@
+package com.diagbot.entity.wrapper;
+
+import com.diagbot.entity.LantoneProduct;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2018/9/19 17:09
+ */
+public class LantoneProductWrapper extends LantoneProduct {
+}

+ 7 - 6
diagbotman-service/src/main/java/com/diagbot/facade/LantoneProductFacade.java

@@ -11,16 +11,16 @@ import org.springframework.stereotype.Component;
  * @time: 2018/9/19 15:52
  */
 @Component
-public class LantoneProductFacade extends LantoneProductServiceImpl{
+public class LantoneProductFacade extends LantoneProductServiceImpl {
     /**
      * @Description: 添加产品业务逻辑
      * @Author: wangyu
      * @Date: 19:59 2018/9/18
      */
     public CommonErrorCode addProducts(LantoneProduct lantoneProduct) {
-        LantoneProduct diagLantoneProduct1 =new LantoneProduct();
+        LantoneProduct diagLantoneProduct1 = new LantoneProduct();
 
-        if(!save(lantoneProduct)){
+        if (!save(lantoneProduct)) {
             return CommonErrorCode.FAIL;
         }
         return CommonErrorCode.OK;
@@ -32,7 +32,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl{
      * @Date: 19:59 2018/9/18
      */
     public CommonErrorCode updateProduct(LantoneProduct lantoneProduct) {
-        if(!updateById(lantoneProduct)){
+        if (!updateById(lantoneProduct)) {
             return CommonErrorCode.FAIL;
         }
         return CommonErrorCode.OK;
@@ -45,7 +45,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl{
      */
     public CommonErrorCode deleteProduct(LantoneProduct lantoneProduct) {
         lantoneProduct.setIsDeleted("Y");
-        if(!updateById(lantoneProduct)){
+        if (!updateById(lantoneProduct)) {
             return CommonErrorCode.FAIL;
         }
         return CommonErrorCode.OK;
@@ -57,8 +57,9 @@ public class LantoneProductFacade extends LantoneProductServiceImpl{
      * @Date: 19:59 2018/9/18
      */
     public CommonErrorCode productStatus(LantoneProduct lantoneProduct) {
-        if(!updateById(lantoneProduct)){
+        if (!updateById(lantoneProduct)) {
             return CommonErrorCode.FAIL;
         }
         return CommonErrorCode.OK;
     }
+}

+ 4 - 2
diagbotman-service/src/main/java/com/diagbot/mapper/LantoneProductMapper.java

@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.entity.LantoneProduct;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Map;
+
 /**
  * <p>
  * 朗通产品表 Mapper 接口
@@ -30,10 +32,10 @@ public interface LantoneProductMapper extends BaseMapper<LantoneProduct> {
     IPage<LantoneProduct> selectProduct(Page page, @Param("name") String name );
 
     /**
-     * @Description: 修改产品线
+     * @Description: 查询开通当前产品的所有用户
      * @Author: wangyu
      * @Date: 13:32 2018/9/18
      */
-    LantoneProduct updateProduct(LantoneProduct diagLantoneProduct);
+    IPage<LantoneProduct> opendedProduct(Page page, @Param("map") Map map);
 
 }

+ 10 - 2
diagbotman-service/src/main/java/com/diagbot/mapper/OpenedProductsMapper.java

@@ -1,7 +1,10 @@
 package com.diagbot.mapper;
 
-import com.diagbot.entity.OpenedProducts;
 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.OpenedProducts;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * <p>
@@ -12,5 +15,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @since 2018-09-18
  */
 public interface OpenedProductsMapper extends BaseMapper<OpenedProducts> {
-
+    /**
+     * 根据用户id查询已开通的产品
+     * @param userId 用户id
+     * @return
+     */
+    IPage<OpenedProducts> selectOpendInfoByUserId(Page page, @Param("userId") int userId);
 }

+ 9 - 0
diagbotman-service/src/main/java/com/diagbot/service/LantoneProductService.java

@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.diagbot.entity.LantoneProduct;
 
+import java.util.Map;
+
 /**
  * <p>
  * 朗通产品表 服务类
@@ -27,4 +29,11 @@ public interface LantoneProductService extends IService<LantoneProduct> {
      * @Date: 9:49 2018/9/18
      */
     IPage<LantoneProduct> selectProduct(Page<LantoneProduct> page, String name);
+
+    /**
+     * @Description: 查询开通当前产品的所有用户
+     * @Author: wangyu
+     * @Date: 13:32 2018/9/18
+     */
+    IPage<LantoneProduct> opendedProduct(Page page, Map map);
 }

+ 9 - 2
diagbotman-service/src/main/java/com/diagbot/service/OpenedProductsService.java

@@ -1,7 +1,9 @@
 package com.diagbot.service;
 
-import com.diagbot.entity.OpenedProducts;
+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.entity.OpenedProducts;
 
 /**
  * <p>
@@ -12,5 +14,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @since 2018-09-18
  */
 public interface OpenedProductsService extends IService<OpenedProducts> {
-
+    /**
+     * 根据用户id查询已开通的产品
+     * @param userId 用户id
+     * @return
+     */
+    IPage<OpenedProducts> selectOpendInfoByUserId(Page<OpenedProducts> page, int userId);
 }

+ 7 - 2
diagbotman-service/src/main/java/com/diagbot/service/impl/OpenedProductsServiceImpl.java

@@ -1,9 +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.OpenedProducts;
 import com.diagbot.mapper.OpenedProductsMapper;
 import com.diagbot.service.OpenedProductsService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
 /**
@@ -16,5 +18,8 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class OpenedProductsServiceImpl extends ServiceImpl<OpenedProductsMapper, OpenedProducts> implements OpenedProductsService {
-
+    @Override
+    public IPage<OpenedProducts> selectOpendInfoByUserId(Page<OpenedProducts> page, int userId) {
+        return baseMapper.selectOpendInfoByUserId(page,userId);
+    }
 }

+ 19 - 12
diagbotman-service/src/main/java/com/diagbot/web/DiagLantoneProductController.java

@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.LantoneProduct;
-import com.diagbot.facade.DiagLantoneProductFacade;
+import com.diagbot.facade.LantoneProductFacade;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -15,6 +15,9 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * @Description: 朗通产品 前端控制器
  * @Author: wangyu
@@ -24,7 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/diagLantoneProduct")
 public class DiagLantoneProductController {
     @Autowired
-    private DiagLantoneProductFacade diagLantoneProductFacade;
+    private LantoneProductFacade lantoneProductFacade;
 
     @ApiOperation(value = "添加产品线",
             notes = "name:产品名,必填<br>" +
@@ -35,7 +38,7 @@ public class DiagLantoneProductController {
     @SysLogger("addProducts")
     @Transactional
     public RespDTO<LantoneProduct> addProducts(LantoneProduct lantoneProduct){
-        return RespDTO.onSuc(diagLantoneProductFacade.addProducts(lantoneProduct));
+        return RespDTO.onSuc(lantoneProductFacade.addProducts(lantoneProduct));
     }
 
     @ApiOperation(value = "分页查询查询产品线",
@@ -44,7 +47,7 @@ public class DiagLantoneProductController {
     @GetMapping("/selectProduct")
     @SysLogger("selectProduct")
     public RespDTO<LantoneProduct> selectProduct(Page page , String name){
-        IPage<LantoneProduct> pages = diagLantoneProductFacade.selectProduct(page,name);
+        IPage<LantoneProduct> pages = lantoneProductFacade.selectProduct(page,name);
         return RespDTO.onSuc(pages);
     }
 
@@ -53,7 +56,7 @@ public class DiagLantoneProductController {
     @PostMapping("/updateProduct")
     @SysLogger("updateProduct")
     public RespDTO<LantoneProduct> updateProduct(LantoneProduct lantoneProduct){
-        return RespDTO.onSuc(diagLantoneProductFacade.updateProduct(lantoneProduct));
+        return RespDTO.onSuc(lantoneProductFacade.updateProduct(lantoneProduct));
     }
 
     @ApiOperation(value = "删除产品",
@@ -61,7 +64,7 @@ public class DiagLantoneProductController {
     @PostMapping("/deleteProduct")
     @SysLogger("deleteProduct")
     public RespDTO<LantoneProduct> deleteProduct(LantoneProduct lantoneProduct){
-        return RespDTO.onSuc(diagLantoneProductFacade.deleteProduct(lantoneProduct));
+        return RespDTO.onSuc(lantoneProductFacade.deleteProduct(lantoneProduct));
     }
 
     @ApiOperation(value = "更改产品状态(启用/停用)",
@@ -69,15 +72,19 @@ public class DiagLantoneProductController {
     @PostMapping("/productStatus")
     @SysLogger("productStatus")
     public RespDTO<LantoneProduct> productStatus(LantoneProduct lantoneProduct){
-        return RespDTO.onSuc(diagLantoneProductFacade.productStatus(lantoneProduct));
+        return RespDTO.onSuc(lantoneProductFacade.productStatus(lantoneProduct));
     }
 
-   /* @ApiOperation(value = "查询当条产品线所有已开通用户",
+    @ApiOperation(value = "查询当条产品线所有已开通用户",
             notes = "id:根据产品id查询所有已开通本产品用户,必填<br>")
-    @PostMapping("/opendedProduct")
+    @GetMapping("/opendedProduct")
     @SysLogger("opendedProduct")
-    public RespDTO<DiagLantoneProduct> opendedProduct(DiagLantoneProduct diagLantoneProduct){
-        return RespDTO.onSuc(diagLantoneProductFacade.productStatus(diagLantoneProduct));
-    }*/
+    public RespDTO<LantoneProduct> opendedProduct(Page page,LantoneProduct lantoneProduct){
+        Map map =new HashMap();
+        map.put("lantoneProduct",lantoneProduct);
+        System.out.println(map);
+        System.out.println(lantoneProductFacade.opendedProduct(page,map));
+        return RespDTO.onSuc(lantoneProductFacade.opendedProduct(page,map));
+    }
 }
 

+ 0 - 42
diagbotman-service/src/main/resources/mapper/DiagLantoneProductMapper.xml

@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.diagbot.mapper.DiagLantoneProductMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.diagbot.entity.DiagLantoneProduct">
-        <id column="id" property="id" />
-        <result column="is_deleted" property="isDeleted" />
-        <result column="gmt_create" property="gmtCreate" />
-        <result column="gmt_modified" property="gmtModified" />
-        <result column="creator" property="creator" />
-        <result column="modifier" property="modifier" />
-        <result column="name" property="name" />
-        <result column="decription" property="decription" />
-        <result column="charge_type" property="chargeType" />
-        <result column="url" property="url" />
-        <result column="open_num" property="openNum" />
-        <result column="service_status" property="serviceStatus" />
-        <result column="trial_status" property="trialStatus" />
-        <result column="trial_url" property="trialUrl" />
-        <result column="access_type" property="accessType" />
-    </resultMap>
-    <!--根据用户id查询用户是否有开通产品-->
-    <select id="productLine" resultMap="BaseResultMap">
-        SELECT * from diag_lantone_product p WHERE p.is_deleted ='N'
-        <if test="userId != null">
-            and id NOT IN (SELECT product_id FROM diag_opened_products WHERE user_id =#{userId})
-        </if>
-    </select>
-
-    <!--根据产品名称分页查询-->
-    <select id="selectProduct" resultMap="BaseResultMap">
-        SELECT * from diag_lantone_product p WHERE p.is_deleted ='N' and service_status NOT IN('0')
-        <if test="name != null and name != ''">
-            AND p.name LIKE concat ('%',#{name},'%')
-        </if>
-    </select>
-
-    <update id="updateProduct" parameterType="com.diagbot.entity.DiagLantoneProduct">
-        UPDATE `diag_lantone_product` SET `name`=#{name}, `gmtModified`=#{gmtModified}, `decription`=#{decription}, `url`=#{url},chargeType=#{chargeType} WHERE (`id`=#{id})
-    </update>
-</mapper>

+ 7 - 9
diagbotman-service/src/main/resources/mapper/DiagOpenedProductsMapper.xml

@@ -1,23 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.diagbot.mapper.DiagOpenedProductsMapper">
+<mapper namespace="com.diagbot.mapper.DiagOrderDetailsMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.diagbot.entity.DiagOpenedProducts">
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.DiagOrderDetails">
         <id column="id" property="id" />
         <result column="is_deleted" property="isDeleted" />
         <result column="gmt_create" property="gmtCreate" />
         <result column="gmt_modified" property="gmtModified" />
         <result column="creator" property="creator" />
         <result column="modifier" property="modifier" />
+        <result column="order_num" property="orderNum" />
         <result column="product_id" property="productId" />
         <result column="user_id" property="userId" />
-        <result column="start_time" property="startTime" />
-        <result column="end_time" property="endTime" />
-        <result column="service_status" property="serviceStatus" />
-        <result column="order_id" property="orderId" />
+        <result column="audit_status" property="auditStatus" />
+        <result column="unit_price" property="unitPrice" />
+        <result column="status" property="status" />
     </resultMap>
-    <select id="selectOpendInfoByUserId" resultMap="BaseResultMap" parameterType="java.util.List">
-        SELECT opend.* FROM diag_opened_products opend WHERE user_id = #{userId}
-    </select>
+
 </mapper>

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

@@ -37,8 +37,13 @@
         </if>
     </select>
 
-    <update id="updateProduct" parameterType="com.diagbot.entity.DiagLantoneProduct">
-        UPDATE `diag_lantone_product` SET `name`=#{name}, `gmtModified`=#{gmtModified}, `decription`=#{decription}, `url`=#{url},chargeType=#{chargeType} WHERE (`id`=#{id})
-    </update>
+    <select id="opendedProduct" resultMap="BaseResultMap" parameterType="java.util.Map">
+        SELECT op.id,op.start_time,op.end_time,op.service_status,pod.time,orn.`name`
+        from `sys-diagbotman`.diag_opened_products op,`sys-diagbotman`.diag_product_order pod,`sys-user`.sys_user_organization uor,`sys-user`.sys_organization orn
+        where pod.num = op.order_id AND uor.user_id =op.user_id AND orn.id =uor.organization_id AND op.product_id =#{map.id}
+        <if test="map.servicdStatus !=null and map.servicdStatus !=''">
+            op.service_status =#{map.serviceStatus}
+        </if>
+    </select>
 
 </mapper>

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

@@ -17,5 +17,7 @@
         <result column="service_status" property="serviceStatus" />
         <result column="order_id" property="orderId" />
     </resultMap>
-
+    <select id="selectOpendInfoByUserId" resultMap="BaseResultMap" parameterType="java.util.List">
+        SELECT opend.* FROM diag_opened_products opend WHERE user_id = #{userId}
+    </select>
 </mapper>