tangxiangan 9 maanden geleden
bovenliggende
commit
e9562429a9

+ 3 - 1
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/controller/VppMemberController.java

@@ -29,6 +29,7 @@ import pojo.ResultMap;
 import javax.annotation.Resource;
 import javax.validation.Valid;
 import java.net.CookieManager;
+import java.util.Date;
 
 /**
  * @author tangxiangan
@@ -141,7 +142,8 @@ public class VppMemberController {
         if (!ObjectUtils.isEmpty(codes)) {
             BeanUtils.copyProperties(codes, ssoMemberLicenseVO);
         }
-
+        member.setLoginTime(new Date());
+        vppMemberService.update(member);
         return new ResultMap<>(CommonConstant.SUCCESS, CommonConstant.RESULT_SUCCESS, ssoMemberLicenseVO);
     }
 

+ 19 - 1
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/model/VppMember.java

@@ -46,6 +46,8 @@ public class VppMember implements Serializable {
 
     private String directoryId;
 
+    private Date loginTime;
+
     private static final long serialVersionUID = 1L;
 
     public String getId() {
@@ -321,6 +323,19 @@ public class VppMember implements Serializable {
         this.directoryId = directoryId;
     }
 
+    public Date getLoginTime() {
+        return loginTime;
+    }
+
+    public VppMember withLoginTime(Date loginTime) {
+        this.setLoginTime(loginTime);
+        return this;
+    }
+
+    public void setLoginTime(Date loginTime) {
+        this.loginTime = loginTime;
+    }
+
     @Override
     public boolean equals(Object that) {
         if (this == that) {
@@ -353,7 +368,8 @@ public class VppMember implements Serializable {
             && (this.getJob() == null ? other.getJob() == null : this.getJob().equals(other.getJob()))
             && (this.getArea() == null ? other.getArea() == null : this.getArea().equals(other.getArea()))
             && (this.getIsSso() == null ? other.getIsSso() == null : this.getIsSso().equals(other.getIsSso()))
-            && (this.getDirectoryId() == null ? other.getDirectoryId() == null : this.getDirectoryId().equals(other.getDirectoryId()));
+            && (this.getDirectoryId() == null ? other.getDirectoryId() == null : this.getDirectoryId().equals(other.getDirectoryId()))
+            && (this.getLoginTime() == null ? other.getLoginTime() == null : this.getLoginTime().equals(other.getLoginTime()));
     }
 
     @Override
@@ -381,6 +397,7 @@ public class VppMember implements Serializable {
         result = prime * result + ((getArea() == null) ? 0 : getArea().hashCode());
         result = prime * result + ((getIsSso() == null) ? 0 : getIsSso().hashCode());
         result = prime * result + ((getDirectoryId() == null) ? 0 : getDirectoryId().hashCode());
+        result = prime * result + ((getLoginTime() == null) ? 0 : getLoginTime().hashCode());
         return result;
     }
 
@@ -411,6 +428,7 @@ public class VppMember implements Serializable {
         sb.append(", area=").append(area);
         sb.append(", isSso=").append(isSso);
         sb.append(", directoryId=").append(directoryId);
+        sb.append(", loginTime=").append(loginTime);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 60 - 0
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/model/VppMemberExample.java

@@ -1495,6 +1495,66 @@ public class VppMemberExample {
             return (Criteria) this;
         }
 
+        public Criteria andLoginTimeIsNull() {
+            addCriterion("login_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andLoginTimeIsNotNull() {
+            addCriterion("login_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andLoginTimeEqualTo(Date value) {
+            addCriterion("login_time =", value, "loginTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andLoginTimeNotEqualTo(Date value) {
+            addCriterion("login_time <>", value, "loginTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andLoginTimeGreaterThan(Date value) {
+            addCriterion("login_time >", value, "loginTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andLoginTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("login_time >=", value, "loginTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andLoginTimeLessThan(Date value) {
+            addCriterion("login_time <", value, "loginTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andLoginTimeLessThanOrEqualTo(Date value) {
+            addCriterion("login_time <=", value, "loginTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andLoginTimeIn(List<Date> values) {
+            addCriterion("login_time in", values, "loginTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andLoginTimeNotIn(List<Date> values) {
+            addCriterion("login_time not in", values, "loginTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andLoginTimeBetween(Date value1, Date value2) {
+            addCriterion("login_time between", value1, value2, "loginTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andLoginTimeNotBetween(Date value1, Date value2) {
+            addCriterion("login_time not between", value1, value2, "loginTime");
+            return (Criteria) this;
+        }
+
         public Criteria andIdLikeInsensitive(String value) {
             addCriterion("upper(id) like", value.toUpperCase(), "id");
             return (Criteria) this;

+ 1 - 1
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/pojo/vo/SSOMemberVO.java

@@ -21,7 +21,7 @@ public class SSOMemberVO implements Serializable {
     @ExcelIgnore
     private String id;
 
-    @ExcelProperty(value = "Member Name")
+    @ExcelProperty(value = "User Name")
     @ColumnWidth(34)
     private String fullName;
 

+ 2 - 0
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/pojo/vo/VppTeamAdminVO.java

@@ -23,4 +23,6 @@ public class VppTeamAdminVO implements Serializable {
 
     private Date createdAt;
 
+    private Date loginTime;
+
 }

+ 4 - 1
pdf-tech-core/src/main/java/cn/kdan/pdf/tech/core/pojo/vo/VppTeamMemberVO.java

@@ -27,7 +27,7 @@ public class VppTeamMemberVO implements Serializable {
     @ColumnWidth(34)
     private String fullName;
 
-    @ExcelProperty(value = "Email")
+    @ExcelProperty(value = "Member Email")
     @ColumnWidth(34)
     private String email;
 
@@ -45,6 +45,9 @@ public class VppTeamMemberVO implements Serializable {
 
     @ExcelIgnore
     private String createdAt;
+
+    @ExcelIgnore
+    private String loginTime;
     @ExcelIgnore
     private String updatedAt;
 

+ 22 - 7
pdf-tech-core/src/main/resources/sqlmap/VppMemberMapper.xml

@@ -23,6 +23,7 @@
     <result column="area" jdbcType="VARCHAR" property="area" />
     <result column="is_sso" jdbcType="VARCHAR" property="isSso" />
     <result column="directory_id" jdbcType="VARCHAR" property="directoryId" />
+    <result column="login_time" jdbcType="TIMESTAMP" property="loginTime" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -85,7 +86,7 @@
   <sql id="Base_Column_List">
     id, email, full_name, subscriber_type, created_at, updated_at, subscribed, digest_password, 
     phone, valid_flag, industry, company_id, last_popularize_at, last_presented_coupon_at, 
-    mailable, reset_token, "role", job, area, is_sso, directory_id
+    mailable, reset_token, "role", job, area, is_sso, directory_id, login_time
   </sql>
   <select id="selectByExample" parameterType="cn.kdan.pdf.tech.core.model.VppMemberExample" resultMap="BaseResultMap">
     select
@@ -124,16 +125,16 @@
       valid_flag, industry, company_id, 
       last_popularize_at, last_presented_coupon_at, 
       mailable, reset_token, "role", 
-      job, area, is_sso, directory_id
-      )
+      job, area, is_sso, directory_id, 
+      login_time)
     values (#{id,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{fullName,jdbcType=VARCHAR}, 
       #{subscriberType,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, 
       #{subscribed,jdbcType=INTEGER}, #{digestPassword,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, 
       #{validFlag,jdbcType=VARCHAR}, #{industry,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, 
       #{lastPopularizeAt,jdbcType=INTEGER}, #{lastPresentedCouponAt,jdbcType=TIMESTAMP}, 
       #{mailable,jdbcType=INTEGER}, #{resetToken,jdbcType=INTEGER}, #{role,jdbcType=VARCHAR}, 
-      #{job,jdbcType=VARCHAR}, #{area,jdbcType=VARCHAR}, #{isSso,jdbcType=VARCHAR}, #{directoryId,jdbcType=VARCHAR}
-      )
+      #{job,jdbcType=VARCHAR}, #{area,jdbcType=VARCHAR}, #{isSso,jdbcType=VARCHAR}, #{directoryId,jdbcType=VARCHAR}, 
+      #{loginTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="cn.kdan.pdf.tech.core.model.VppMember">
     insert into vpp_member
@@ -201,6 +202,9 @@
       <if test="directoryId != null">
         directory_id,
       </if>
+      <if test="loginTime != null">
+        login_time,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -266,6 +270,9 @@
       <if test="directoryId != null">
         #{directoryId,jdbcType=VARCHAR},
       </if>
+      <if test="loginTime != null">
+        #{loginTime,jdbcType=TIMESTAMP},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="cn.kdan.pdf.tech.core.model.VppMemberExample" resultType="java.lang.Long">
@@ -340,6 +347,9 @@
       <if test="row.directoryId != null">
         directory_id = #{row.directoryId,jdbcType=VARCHAR},
       </if>
+      <if test="row.loginTime != null">
+        login_time = #{row.loginTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     <if test="example != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -367,7 +377,8 @@
       job = #{row.job,jdbcType=VARCHAR},
       area = #{row.area,jdbcType=VARCHAR},
       is_sso = #{row.isSso,jdbcType=VARCHAR},
-      directory_id = #{row.directoryId,jdbcType=VARCHAR}
+      directory_id = #{row.directoryId,jdbcType=VARCHAR},
+      login_time = #{row.loginTime,jdbcType=TIMESTAMP}
     <if test="example != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -435,6 +446,9 @@
       <if test="directoryId != null">
         directory_id = #{directoryId,jdbcType=VARCHAR},
       </if>
+      <if test="loginTime != null">
+        login_time = #{loginTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -459,7 +473,8 @@
       job = #{job,jdbcType=VARCHAR},
       area = #{area,jdbcType=VARCHAR},
       is_sso = #{isSso,jdbcType=VARCHAR},
-      directory_id = #{directoryId,jdbcType=VARCHAR}
+      directory_id = #{directoryId,jdbcType=VARCHAR},
+      login_time = #{loginTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   <select id="selectByExampleWithRowbounds" parameterType="cn.kdan.pdf.tech.core.model.VppMemberExample" resultMap="BaseResultMap">

+ 8 - 6
pdf-tech-core/src/main/resources/sqlmap/ext/ExtVppRTeamMemberRoleMapper.xml

@@ -38,11 +38,12 @@
     <result column="full_name" jdbcType="VARCHAR" property="fullName" />
     <result column="team_names" jdbcType="VARCHAR" property="teamNames" />
     <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
+    <result column="login_time" jdbcType="TIMESTAMP" property="loginTime" />
     <result column="member_role" jdbcType="VARCHAR" property="memberRole" />
   </resultMap>
 
   <select id="memberList" resultMap="AdminListResultMap">
-    select vm.full_name,vm.email,vm.id,string_agg(vt.name, ',') team_names,vm.created_at,  min(vrtmr.role_id )       member_role
+    select vm.full_name,vm.email,vm.id,string_agg(vt.name, ',') team_names,vm.created_at,vm.login_time,  min(vrtmr.role_id )       member_role
     from vpp_r_team_member_role vrtmr
     left join vpp_team vt on vrtmr.team_id = vt.id
     left join vpp_member vm on vrtmr.member_id = vm.id
@@ -63,7 +64,7 @@
       #{item}
     </foreach>
     </if>
-    group by vm.full_name,vm.email,vm.id,vm.created_at,vrtmr.role_id
+    group by vm.full_name,vm.email,vm.id,vm.created_at,vrtmr.role_id,vm.login_time
     order by vm.created_at desc
   </select>
 
@@ -79,14 +80,15 @@
     <result column="team_name" jdbcType="VARCHAR" property="teamName" />
     <result column="is_sso" jdbcType="INTEGER" property="isSso" />
     <result column="updated_at" jdbcType="VARCHAR" property="updatedAt" />
+    <result column="login_time" jdbcType="VARCHAR" property="loginTime" />
   </resultMap>
 
   <select id="listForMember" resultMap="MemberListResultMap">
-    select a.full_name,a.email,a.id,a.created_at,a.updated_at,a.valid_flag,a.team_name,
+    select a.full_name,a.email,a.id,a.created_at,a.login_time,a.updated_at,a.valid_flag,a.team_name,
     string_agg(a.product_name, ',') product_names,
     string_agg(a.code, ',') codes
     from (
-    select vm.full_name,vm.email,vm.id,vm.created_at,vm.updated_at,vm.valid_flag ,vt.name team_name,p.name product_name, p.code
+    select vm.full_name,vm.email,vm.id,vm.created_at,vm.login_time,vm.updated_at,vm.valid_flag ,vt.name team_name,p.name product_name, p.code
     from vpp_r_team_member_role vrtmr
     left join vpp_team vt on vrtmr.team_id = vt.id
     left join vpp_member vm on vrtmr.member_id = vm.id
@@ -120,9 +122,9 @@
     <if test="status != null and status != ''">
       and vm.valid_flag = #{status}
     </if>
-    group by vm.full_name, vm.email, vm.id, vm.created_at, vm.updated_at, vt.name, vm.valid_flag, p.name, p.code
+    group by vm.full_name, vm.email, vm.id, vm.created_at,vm.login_time, vm.updated_at, vt.name, vm.valid_flag, p.name, p.code
     order by vm.created_at desc
-    ) as a   group by a.full_name,a.email,a.id,a.created_at,a.updated_at,a.valid_flag,a.team_name
+    ) as a   group by a.full_name,a.email,a.id,a.created_at,a.login_time, a.updated_at,a.valid_flag,a.team_name
 
   </select>