Althars123 преди 3 години
родител
ревизия
cb5ca1d2dc

+ 4 - 0
jkt-admin/src/main/java/com/miaxis/pc/controller/vip/VipCodeController.java

@@ -6,6 +6,8 @@ import java.util.List;
 import java.util.Arrays;
 import java.util.Random;
 
+import com.miaxis.common.core.domain.entity.SysUser;
+import com.miaxis.common.utils.SecurityUtils;
 import com.miaxis.vip.dto.QueryVipCodeListDTO;
 import io.swagger.annotations.*;
 import com.miaxis.common.core.domain.Response;
@@ -53,6 +55,8 @@ public class VipCodeController extends BaseController{
     })
     public ResponsePageInfo<VipCode> list(@ModelAttribute QueryVipCodeListDTO dto){
         startPage();
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        dto.setAgentId(user.getUserId()==1l? null: user.getUserId());
         List<VipCode> list = vipCodeService.selectVipCodeList(dto);
         return toResponsePageInfo(list);
     }

+ 16 - 0
jkt-common/src/main/java/com/miaxis/common/core/domain/entity/SysUser.java

@@ -1,5 +1,6 @@
 package com.miaxis.common.core.domain.entity;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.miaxis.common.annotation.Excel;
@@ -96,6 +97,21 @@ public class SysUser extends BaseEntity
     @ApiModelProperty(value = "最后登录时间")
     private Date loginDate;
 
+
+    /** 代理类型 1-限制数量 2-限制时间 */
+    @ApiModelProperty(value = "代理类型 1-限制数量 2-限制时间")
+    private String agentType;
+
+
+    /** 剩余数量 */
+    @ApiModelProperty(value = "剩余数量")
+    private String agentRemainingNumber;
+
+    /** 限时过期时间 */
+    @Excel(name = "限时过期时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date agentExpireTime;
+
     /** 部门对象 */
     @Excels({
         @Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),

+ 15 - 0
jkt-service/src/main/java/com/miaxis/vip/domain/VipCode.java

@@ -56,6 +56,21 @@ public class VipCode extends BaseBusinessEntity{
     @ApiModelProperty(value = "激活用户id")
     private Long activationUserId;
 
+    /** 激活码 */
+    @Excel(name = "代理商id")
+    @TableField("agent_id")
+    @ApiModelProperty(value = "代理商id")
+    private Integer agentId;
+
+    /** 激活码 */
+    @Excel(name = "代理商名称")
+    @TableField("agent_name")
+    @ApiModelProperty(value = "代理商名称")
+    private String agentName;
+
+
+
+
     public void setId(Long id){
         this.id = id;
     }

+ 5 - 0
jkt-service/src/main/java/com/miaxis/vip/dto/QueryVipCodeListDTO.java

@@ -49,5 +49,10 @@ public class QueryVipCodeListDTO extends BaseBusinessEntity{
 //    @JsonFormat(pattern="yyyyMMdd",timezone = "GMT+8")
     private String endTime;
 
+    @Excel(name = "代理商id")
+    @TableField("agent_id")
+    @ApiModelProperty(value = "代理商id")
+    private Long agentId;
+
 
 }

+ 3 - 0
jkt-service/src/main/resources/mapper/vip/VipCodeMapper.xml

@@ -30,6 +30,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="endTime != null">
                 and DATE_FORMAT(create_time,'%Y-%m-%d') <![CDATA[ < ]]> #{endTime}
             </if>
+            <if test="agentId != null">
+                and agent_id =  #{agentId}
+            </if>
             order by create_time desc
         </where>
     </select>

+ 13 - 1
jkt-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -23,6 +23,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="updateBy"     column="update_by"    />
 		<result property="updateTime"   column="update_time"  />
 		<result property="remark"       column="remark"       />
+		<result property="agentType"     column="agent_type"    />
+		<result property="agentRemainingNumber"   column="agent_remaining_number"  />
+		<result property="agentExpireTime"       column="agent_expire_time"       />
 		<association property="dept"    column="dept_id" javaType="SysDept" resultMap="deptResult" />
 		<collection  property="roles"   javaType="java.util.List"        resultMap="RoleResult" />
 	</resultMap>
@@ -46,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</resultMap>
 
 	<sql id="selectUserVo">
-        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
+        select u.agent_type,u.agent_remaining_number,u.agent_expire_time,u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
         d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,
         r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
         from sys_user u
@@ -135,6 +138,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null and status != ''">status,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
  			<if test="remark != null and remark != ''">remark,</if>
+			<if test="agentType != null and agentType != ''">agent_type,</if>
+			<if test="agentRemainingNumber != null and agentRemainingNumber != ''">agent_remaining_number,</if>
+			<if test="agentExpireTime != null and agentExpireTime != ''">agent_expire_time,</if>
  			create_time
  		)values(
  			<if test="userId != null and userId != ''">#{userId},</if>
@@ -149,6 +155,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="status != null and status != ''">#{status},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
+			<if test="agentType != null and agentType != ''">#{agentType},</if>
+			<if test="agentRemainingNumber != null and agentRemainingNumber != ''">#{agentRemainingNumber},</if>
+			<if test="agentExpireTime != null and agentExpireTime != ''">#{agentExpireTime},</if>
  			sysdate()
  		)
 	</insert>
@@ -169,6 +178,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="loginDate != null">login_date = #{loginDate},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			<if test="remark != null">remark = #{remark},</if>
+			<if test="agentType != null and agentType != ''">agent_type = #{agentType},</if>
+			<if test="agentRemainingNumber != null and agentRemainingNumber != ''">agent_remaining_number = #{agentRemainingNumber},</if>
+			<if test="agentExpireTime != null and agentExpireTime != ''">agent_expire_time = #{agentExpireTime},</if>
  			update_time = sysdate()
  		</set>
  		where user_id = #{userId}