Procházet zdrojové kódy

机构账号列表

před 5 roky
rodič
revize
135269aedc

+ 9 - 2
bms/src/main/java/com/hssx/bms/controller/InstitutionalInformationController.java

@@ -140,10 +140,17 @@ public class InstitutionalInformationController {
     }
 
     /**
-     * 教育机构信息的删除
-     * 参数:id 机构id
+     * 教育机构账号列表
+     * 参数:pageNum 当前页码,pageSize 每页条数
      * @return
      */
+    @ApiOperation(value = "教育机构账号列表", notes = "教育机构账号列表方法")
+    @RequestMapping("/accountList")
+    @ResponseBody
+    public HttpRespMsg accountList(PageUtil page){
+        HttpRespMsg msg = institutionalService.getInstitutionAccountList(page);
+        return msg;
+    }
 
 }
 

+ 1 - 0
bms/src/main/java/com/hssx/bms/controller/SystemUserController.java

@@ -55,5 +55,6 @@ public class SystemUserController {
         msg.data = systemUserService.updateById(user);
         return msg;
     }
+
 }
 

+ 46 - 0
bms/src/main/java/com/hssx/bms/controller/UserAppointmentController.java

@@ -0,0 +1,46 @@
+package com.hssx.bms.controller;
+
+
+import com.hssx.bms.entity.SystemUser;
+import com.hssx.bms.service.UserAppointmentService;
+import com.hssx.bms.until.HttpRespMsg;
+import com.hssx.bms.until.PageUtil;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-21
+ */
+@Controller
+@RequestMapping("/userappointment")
+public class UserAppointmentController {
+    @Autowired
+    private UserAppointmentService userAppointmentService;
+    /**
+     * 预约用户列表
+     * 参数:id:当前登录人的id
+     * @return
+     */
+    @ApiOperation(value = "预约用户列表", notes = "预约用户列表方法")
+    @RequestMapping("/list")
+    @ResponseBody
+    public HttpRespMsg sysLogin(SystemUser user,PageUtil page) {
+        HttpRespMsg msg = userAppointmentService.getList(user,page);
+        return msg;
+    }
+
+}
+

+ 199 - 0
bms/src/main/java/com/hssx/bms/entity/UserAppointment.java

@@ -0,0 +1,199 @@
+package com.hssx.bms.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-21
+ */
+public class UserAppointment extends Model<UserAppointment> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 预约表主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 用户id
+     */
+    @TableField("user_id")
+    private Integer userId;
+
+    /**
+     * 机构id
+     */
+    @TableField("org_id")
+    private Integer orgId;
+
+    /**
+     * 预约时间
+     */
+    @TableField("appoint_date")
+    private LocalDate appointDate;
+
+    /**
+     * 上午/下午0-上午 1-下午
+     */
+    @TableField("time")
+    private Integer time;
+
+    /**
+     * 姓名
+     */
+    @TableField("name")
+    private String name;
+
+    /**
+     * 电话
+     */
+    @TableField("mobile")
+    private String mobile;
+
+    /**
+     * 创建时间
+     */
+    @TableField("indate")
+    private LocalDateTime indate;
+
+    /**
+     * 孩子年龄
+     */
+    @TableField("age")
+    private Integer age;
+
+    /**
+     * 说明
+     */
+    @TableField("content")
+    private String content;
+
+    /**
+     * 状态
+     */
+    @TableField("stage")
+    private Integer stage;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Integer getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(Integer orgId) {
+        this.orgId = orgId;
+    }
+
+    public LocalDate getAppointDate() {
+        return appointDate;
+    }
+
+    public void setAppointDate(LocalDate appointDate) {
+        this.appointDate = appointDate;
+    }
+
+    public Integer getTime() {
+        return time;
+    }
+
+    public void setTime(Integer time) {
+        this.time = time;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public LocalDateTime getIndate() {
+        return indate;
+    }
+
+    public void setIndate(LocalDateTime indate) {
+        this.indate = indate;
+    }
+
+    public Integer getAge() {
+        return age;
+    }
+
+    public void setAge(Integer age) {
+        this.age = age;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public Integer getStage() {
+        return stage;
+    }
+
+    public void setStage(Integer stage) {
+        this.stage = stage;
+    }
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+    @Override
+    public String toString() {
+        return "UserAppointment{" +
+        "id=" + id +
+        ", userId=" + userId +
+        ", orgId=" + orgId +
+        ", appointDate=" + appointDate +
+        ", time=" + time +
+        ", name=" + name +
+        ", mobile=" + mobile +
+        ", indate=" + indate +
+        ", age=" + age +
+        ", content=" + content +
+        ", stage=" + stage +
+        "}";
+    }
+}

+ 16 - 0
bms/src/main/java/com/hssx/bms/mapper/UserAppointmentMapper.java

@@ -0,0 +1,16 @@
+package com.hssx.bms.mapper;
+
+import com.hssx.bms.entity.UserAppointment;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-21
+ */
+public interface UserAppointmentMapper extends BaseMapper<UserAppointment> {
+
+}

+ 2 - 0
bms/src/main/java/com/hssx/bms/service/InstitutionalInformationService.java

@@ -29,4 +29,6 @@ public interface InstitutionalInformationService extends IService<InstitutionalI
     HttpRespMsg addAccount(SystemUser systemUser);
 
     HttpRespMsg deleteById(InstitutionalInformation information);
+
+    HttpRespMsg getInstitutionAccountList(PageUtil page);
 }

+ 20 - 0
bms/src/main/java/com/hssx/bms/service/UserAppointmentService.java

@@ -0,0 +1,20 @@
+package com.hssx.bms.service;
+
+import com.hssx.bms.entity.SystemUser;
+import com.hssx.bms.entity.UserAppointment;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hssx.bms.until.HttpRespMsg;
+import com.hssx.bms.until.PageUtil;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-21
+ */
+public interface UserAppointmentService extends IService<UserAppointment> {
+
+    HttpRespMsg getList(SystemUser user,PageUtil page);
+}

+ 11 - 0
bms/src/main/java/com/hssx/bms/service/impl/InstitutionalInformationServiceImpl.java

@@ -7,6 +7,7 @@ import com.github.pagehelper.PageInfo;
 import com.hssx.bms.entity.InstitutionalInformation;
 import com.hssx.bms.entity.InstitutionalPic;
 import com.hssx.bms.entity.SystemUser;
+import com.hssx.bms.entity.UserAppointment;
 import com.hssx.bms.entity.vo.InstitutionalInformationVO;
 import com.hssx.bms.mapper.InstitutionalInformationMapper;
 import com.hssx.bms.mapper.InstitutionalPicMapper;
@@ -152,4 +153,14 @@ public class InstitutionalInformationServiceImpl extends ServiceImpl<Institution
         }
         return msg;
     }
+
+    @Override
+    public HttpRespMsg getInstitutionAccountList(PageUtil page) {
+        HttpRespMsg msg = new HttpRespMsg();
+        PageHelper.startPage(page.getPageNum(),page.getPageSize());
+        List<SystemUser> list = systemUserMapper.selectList(new QueryWrapper<SystemUser>().eq("role_type", 1));
+        PageInfo<SystemUser> pageInfo = new PageInfo<>(list);
+        msg.data = pageInfo;
+        return msg;
+    }
 }

+ 56 - 0
bms/src/main/java/com/hssx/bms/service/impl/UserAppointmentServiceImpl.java

@@ -0,0 +1,56 @@
+package com.hssx.bms.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.hssx.bms.entity.InstitutionalInformation;
+import com.hssx.bms.entity.SystemUser;
+import com.hssx.bms.entity.UserAppointment;
+import com.hssx.bms.mapper.InstitutionalInformationMapper;
+import com.hssx.bms.mapper.SystemUserMapper;
+import com.hssx.bms.mapper.UserAppointmentMapper;
+import com.hssx.bms.service.UserAppointmentService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hssx.bms.until.HttpRespMsg;
+import com.hssx.bms.until.PageUtil;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-21
+ */
+@Service
+public class UserAppointmentServiceImpl extends ServiceImpl<UserAppointmentMapper, UserAppointment> implements UserAppointmentService {
+    @Resource
+    private UserAppointmentMapper userAppointmentMapper;
+    @Resource
+    private SystemUserMapper systemUserMapper;
+    @Resource
+    private InstitutionalInformationMapper informationMapper;
+
+    @Override
+    public HttpRespMsg getList(SystemUser user,PageUtil page) {
+        HttpRespMsg msg = new HttpRespMsg();
+        SystemUser currentUser = systemUserMapper.selectById(user.getId());
+        List<UserAppointment> list = new ArrayList<>();
+        PageHelper.startPage(page.getPageNum(),page.getPageSize());
+        if(0 == currentUser.getRoleType()){
+            //管理员
+            list = userAppointmentMapper.selectList(new QueryWrapper<UserAppointment>());
+        }else{
+            InstitutionalInformation information = informationMapper.selectOne(new QueryWrapper<InstitutionalInformation>().eq("sys_id", currentUser.getId()));
+            list = userAppointmentMapper.selectList(new QueryWrapper<UserAppointment>().eq("org_id",information.getId()));
+        }
+        PageInfo<UserAppointment> pageInfo = new PageInfo<>(list);
+        msg.data = pageInfo;
+        return msg;
+    }
+}

+ 1 - 1
bms/src/main/java/com/hssx/bms/until/CodeGenerator.java

@@ -204,7 +204,7 @@ public class CodeGenerator {
         //若想要生成的实体类继承某个Controller,则可打开下面注释。写上需要继承的Controller的位置即可
 //        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
         //此处user是表名,多个英文逗号分割
-        strategy.setInclude("institutional_information");
+        strategy.setInclude("user_appointment");
 //        strategy.setExclude();//数据库表全生成
 //        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
         strategy.setControllerMappingHyphenStyle(true);

+ 25 - 0
bms/src/main/resources/mapper/UserAppointmentMapper.xml

@@ -0,0 +1,25 @@
+<?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.hssx.bms.mapper.UserAppointmentMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.hssx.bms.entity.UserAppointment">
+        <id column="id" property="id" />
+        <result column="user_id" property="userId" />
+        <result column="org_id" property="orgId" />
+        <result column="appoint_date" property="appointDate" />
+        <result column="time" property="time" />
+        <result column="name" property="name" />
+        <result column="mobile" property="mobile" />
+        <result column="indate" property="indate" />
+        <result column="age" property="age" />
+        <result column="content" property="content" />
+        <result column="stage" property="stage" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, user_id, org_id, appoint_date, time, name, mobile, indate, age, content, stage
+    </sql>
+
+</mapper>