Sfoglia il codice sorgente

系统用户登录

5 anni fa
parent
commit
e1081568a3

+ 13 - 0
bms/src/main/java/com/hssx/bms/constant/Constant.java

@@ -0,0 +1,13 @@
+package com.hssx.bms.constant;
+
+/**
+ * Author: 吴涛涛
+ * Date : 2019 - 07 - 24 16:00
+ * Description:<描述>常量配置类
+ * Version: 1.0
+ */
+public class Constant {
+    public static final String DEFAULT_PWD = "000000";//默认密码
+    public static final Integer ADMINISTRATORS_TYPE = 0;//管理员角色类型
+    public static final Integer INSTITUTION_TYPE = 1;//培训机构角色类型
+}

+ 92 - 0
bms/src/main/java/com/hssx/bms/controller/InstitutionalInformationController.java

@@ -0,0 +1,92 @@
+package com.hssx.bms.controller;
+
+
+import com.hssx.bms.entity.InstitutionalInformation;
+import com.hssx.bms.entity.InstitutionalPic;
+import com.hssx.bms.entity.vo.InstitutionalInformationVO;
+import com.hssx.bms.service.InstitutionalInformationService;
+import com.hssx.bms.service.InstitutionalPicService;
+import com.hssx.bms.service.SystemUserService;
+import com.hssx.bms.until.HttpRespMsg;
+import io.swagger.annotations.ApiOperation;
+import org.apache.ibatis.annotations.Param;
+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.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+
+/**
+ * @author 吴涛涛
+ * @since 2019-10-15
+ */
+@Controller
+@RequestMapping("/institutional")
+public class InstitutionalInformationController {
+    @Autowired
+    private InstitutionalInformationService institutionalService;
+//    @Autowired
+//    private SystemUserService systemUserService;
+    @Autowired
+    private InstitutionalPicService institutionalPicService;
+
+    /**
+     * 教育机构的添加
+     * 参数:account 账号,name 名称,address 地址,lng 经度 lat 纬度
+     *      phone 电话,
+     * @return
+     */
+    @ApiOperation(value = "教育机构的添加", notes = "教育机构的添加方法")
+    @RequestMapping("/add")
+    @ResponseBody
+    public HttpRespMsg addInstitutionalInformation(InstitutionalInformationVO institutionalInformationVO){
+        HttpRespMsg msg = institutionalService.add(institutionalInformationVO);
+        return msg;
+    }
+    /**
+     * 教育机构信息的修改
+     * 参数:id 机构信息id,name 名称,address 地址,lng 经度 lat 纬度
+     *      phone 电话,amTime 上午上课时间,pmTime 下午上课时间,briefIntroductionPic 简介图片
+     *      classAdvantages 课程特色,briefIntroduction 机构简介说明,file 简介图片文件
+     * @return
+     */
+    @ApiOperation(value = "教育机构信息的修改", notes = "教育机构信息的修改")
+    @RequestMapping("/update")
+    @ResponseBody
+    public HttpRespMsg updateInstitutionalInformation(InstitutionalInformation institutionalInformation,@RequestParam(required = false) MultipartFile file){
+        HttpRespMsg msg = institutionalService.updateInstitutionalInformation(institutionalInformation,file);
+        return msg;
+    }
+    /**
+     * 教育机构信息的背景图片的修改
+     * 参数:id 机构信息id,file 上传的文件数组
+     * @return
+     */
+    @ApiOperation(value = "教育机构信息的背景图片的修改", notes = "教育机构信息的背景图片的修改")
+    @RequestMapping("/update")
+    @ResponseBody
+    public HttpRespMsg updateInstitutionPics(Integer id, @RequestParam(required = false) MultipartFile[] file){
+        HttpRespMsg msg = institutionalPicService.institutionalPicService(id,file);
+        return null;
+    }
+    /**
+     * 教育机构信息的背景图片的删除
+     * 参数:id 要删除的背景图片id
+     * @return
+     */
+    @ApiOperation(value = "教育机构信息的背景图片的删除", notes = "教育机构信息的背景图片的删除")
+    @RequestMapping("/delete")
+    @ResponseBody
+    public HttpRespMsg deleteInstitutionPics(Integer id){
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.data = institutionalPicService.removeById(id);
+        return msg;
+    }
+
+
+
+}
+

+ 21 - 0
bms/src/main/java/com/hssx/bms/controller/InstitutionalPicController.java

@@ -0,0 +1,21 @@
+package com.hssx.bms.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-15
+ */
+@RestController
+@RequestMapping("/institutionalpic")
+public class InstitutionalPicController {
+
+}
+

+ 16 - 2
bms/src/main/java/com/hssx/bms/controller/SystemUserController.java

@@ -27,12 +27,12 @@ public class SystemUserController {
     private SystemUserService systemUserService;
 
     /**
-     *
+     * 系统管理员及教育机构登录
      * @param user
      * 参数:account 账号 password 密码
      * @return
      */
-    @ApiOperation(value = "普通用户登录", notes = "登录方法")
+    @ApiOperation(value = "系统管理员及教育机构登录", notes = "登录方法")
     @RequestMapping("/login")
     @ResponseBody
     public HttpRespMsg sysLogin(SystemUser user, HttpServletRequest request,
@@ -41,5 +41,19 @@ public class SystemUserController {
         return msg;
     }
 
+    /**
+     * 系统管理员及教育机构登录
+     * @param user
+     * 参数:id 当前用户id  password 新密码
+     * @return
+     */
+    @ApiOperation(value = "系统管理员及教育机构修改密码", notes = "修改密码方法")
+    @RequestMapping("/updatePwd")
+    @ResponseBody
+    public HttpRespMsg updatePwd(SystemUser user){
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.data = systemUserService.updateById(user);
+        return msg;
+    }
 }
 

+ 243 - 0
bms/src/main/java/com/hssx/bms/entity/InstitutionalInformation.java

@@ -0,0 +1,243 @@
+package com.hssx.bms.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+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-15
+ */
+public class InstitutionalInformation extends Model<InstitutionalInformation> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 机构信息表主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 机构名称
+     */
+    @TableField("name")
+    private String name;
+
+    /**
+     * 电话
+     */
+    @TableField("phone")
+    private String phone;
+
+    /**
+     * 地址
+     */
+    @TableField("address")
+    private String address;
+
+    /**
+     * 系统用户表关联主键
+     */
+    @TableField("sys_id")
+    private Integer sysId;
+
+    /**
+     * 经度
+     */
+    @TableField("lng")
+    private String lng;
+
+    /**
+     * 纬度
+     */
+    @TableField("lat")
+    private String lat;
+
+    /**
+     * 上午上课时间
+     */
+    @TableField("am_time")
+    private String amTime;
+
+    /**
+     * 下午上课时间
+     */
+    @TableField("pm_time")
+    private String pmTime;
+
+    /**
+     * 简介图片地址
+     */
+    @TableField("brief_introduction_pic")
+    private String briefIntroductionPic;
+
+    /**
+     * 机构简介说明
+     */
+    @TableField("brief_introduction")
+    private String briefIntroduction;
+
+    /**
+     * 课程特色
+     */
+    @TableField("class_advantages")
+    private String classAdvantages;
+
+    /**
+     * 时间
+     */
+    @TableField("indat")
+    private LocalDateTime indat;
+
+    /**
+     * 头部图片处说明
+     */
+    @TableField("head_introduction")
+    private String headIntroduction;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public Integer getSysId() {
+        return sysId;
+    }
+
+    public void setSysId(Integer sysId) {
+        this.sysId = sysId;
+    }
+
+    public String getLng() {
+        return lng;
+    }
+
+    public void setLng(String lng) {
+        this.lng = lng;
+    }
+
+    public String getLat() {
+        return lat;
+    }
+
+    public void setLat(String lat) {
+        this.lat = lat;
+    }
+
+    public String getAmTime() {
+        return amTime;
+    }
+
+    public void setAmTime(String amTime) {
+        this.amTime = amTime;
+    }
+
+    public String getPmTime() {
+        return pmTime;
+    }
+
+    public void setPmTime(String pmTime) {
+        this.pmTime = pmTime;
+    }
+
+    public String getBriefIntroductionPic() {
+        return briefIntroductionPic;
+    }
+
+    public void setBriefIntroductionPic(String briefIntroductionPic) {
+        this.briefIntroductionPic = briefIntroductionPic;
+    }
+
+    public String getBriefIntroduction() {
+        return briefIntroduction;
+    }
+
+    public void setBriefIntroduction(String briefIntroduction) {
+        this.briefIntroduction = briefIntroduction;
+    }
+
+    public String getClassAdvantages() {
+        return classAdvantages;
+    }
+
+    public void setClassAdvantages(String classAdvantages) {
+        this.classAdvantages = classAdvantages;
+    }
+
+    public LocalDateTime getIndat() {
+        return indat;
+    }
+
+    public void setIndat(LocalDateTime indat) {
+        this.indat = indat;
+    }
+
+    public String getHeadIntroduction() {
+        return headIntroduction;
+    }
+
+    public void setHeadIntroduction(String headIntroduction) {
+        this.headIntroduction = headIntroduction;
+    }
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+    @Override
+    public String toString() {
+        return "InstitutionalInformation{" +
+        "id=" + id +
+        ", name=" + name +
+        ", phone=" + phone +
+        ", address=" + address +
+        ", sysId=" + sysId +
+        ", lng=" + lng +
+        ", lat=" + lat +
+        ", amTime=" + amTime +
+        ", pmTime=" + pmTime +
+        ", briefIntroductionPic=" + briefIntroductionPic +
+        ", briefIntroduction=" + briefIntroduction +
+        ", classAdvantages=" + classAdvantages +
+        ", indat=" + indat +
+        ", headIntroduction=" + headIntroduction +
+        "}";
+    }
+}

+ 108 - 0
bms/src/main/java/com/hssx/bms/entity/InstitutionalPic.java

@@ -0,0 +1,108 @@
+package com.hssx.bms.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+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-15
+ */
+public class InstitutionalPic extends Model<InstitutionalPic> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 上传的图片表主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 系统机构信息表关联主键
+     */
+    @TableField("information_id")
+    private Integer informationId;
+
+    /**
+     * 图片地址
+     */
+    @TableField("pic_url")
+    private String picUrl;
+
+    /**
+     * 上传时间
+     */
+    @TableField("indate")
+    private LocalDateTime indate;
+
+    /**
+     * 排序id
+     */
+    @TableField("order_id")
+    private Integer orderId;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getInformationId() {
+        return informationId;
+    }
+
+    public void setInformationId(Integer informationId) {
+        this.informationId = informationId;
+    }
+
+    public String getPicUrl() {
+        return picUrl;
+    }
+
+    public void setPicUrl(String picUrl) {
+        this.picUrl = picUrl;
+    }
+
+    public LocalDateTime getIndate() {
+        return indate;
+    }
+
+    public void setIndate(LocalDateTime indate) {
+        this.indate = indate;
+    }
+
+    public Integer getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(Integer orderId) {
+        this.orderId = orderId;
+    }
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+    @Override
+    public String toString() {
+        return "InstitutionalPic{" +
+        "id=" + id +
+        ", informationId=" + informationId +
+        ", picUrl=" + picUrl +
+        ", indate=" + indate +
+        ", orderId=" + orderId +
+        "}";
+    }
+}

+ 40 - 0
bms/src/main/java/com/hssx/bms/entity/vo/InstitutionalInformationVO.java

@@ -0,0 +1,40 @@
+package com.hssx.bms.entity.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.hssx.bms.entity.InstitutionalInformation;
+import com.hssx.bms.entity.InstitutionalPic;
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Author: 吴涛涛 cuiyi@itany.com
+ * Date : 2019 - 10 - 15 15:12
+ * Description:<描述>
+ * Version: 1.0
+ */
+@Data
+public class InstitutionalInformationVO extends InstitutionalInformation {
+    /**
+     * 账号
+     */
+    private String account;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+    /**
+     * 角色
+     */
+    private String roleName;
+
+    /**
+     * 角色类型0-管理员 1-机构
+     */
+    private Integer roleType;
+
+    List<InstitutionalPic> pics = new ArrayList<>();
+}

+ 19 - 0
bms/src/main/java/com/hssx/bms/mapper/InstitutionalInformationMapper.java

@@ -0,0 +1,19 @@
+package com.hssx.bms.mapper;
+
+import com.hssx.bms.entity.InstitutionalInformation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hssx.bms.entity.vo.InstitutionalInformationVO;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-15
+ */
+public interface InstitutionalInformationMapper extends BaseMapper<InstitutionalInformation> {
+
+    InstitutionalInformationVO selectDetail(@Param("id") Integer id);
+}

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

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

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

@@ -0,0 +1,23 @@
+package com.hssx.bms.service;
+
+import com.hssx.bms.entity.InstitutionalInformation;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hssx.bms.entity.vo.InstitutionalInformationVO;
+import com.hssx.bms.until.HttpRespMsg;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-15
+ */
+public interface InstitutionalInformationService extends IService<InstitutionalInformation> {
+
+    HttpRespMsg add(InstitutionalInformationVO institutionalInformationVO);
+
+    HttpRespMsg updateInstitutionalInformation(InstitutionalInformation institutionalInformation,MultipartFile file);
+
+}

+ 19 - 0
bms/src/main/java/com/hssx/bms/service/InstitutionalPicService.java

@@ -0,0 +1,19 @@
+package com.hssx.bms.service;
+
+import com.hssx.bms.entity.InstitutionalPic;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.hssx.bms.until.HttpRespMsg;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-15
+ */
+public interface InstitutionalPicService extends IService<InstitutionalPic> {
+
+    HttpRespMsg institutionalPicService(Integer id, MultipartFile[] file);
+}

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

@@ -0,0 +1,90 @@
+package com.hssx.bms.service.impl;
+
+import ch.qos.logback.core.util.FileUtil;
+import com.hssx.bms.entity.InstitutionalInformation;
+import com.hssx.bms.entity.SystemUser;
+import com.hssx.bms.entity.vo.InstitutionalInformationVO;
+import com.hssx.bms.mapper.InstitutionalInformationMapper;
+import com.hssx.bms.mapper.SystemUserMapper;
+import com.hssx.bms.service.InstitutionalInformationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hssx.bms.until.HttpRespMsg;
+import com.hssx.bms.until.MD5Util;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.io.IOException;
+import java.util.UUID;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-15
+ */
+@Service
+public class InstitutionalInformationServiceImpl extends ServiceImpl<InstitutionalInformationMapper, InstitutionalInformation> implements InstitutionalInformationService {
+    @Resource
+    private InstitutionalInformationMapper institutionalMapper;
+    @Resource
+    private SystemUserMapper systemUserMapper;
+    @Value("${upload.path}")
+    private String path;
+    @Override
+    public HttpRespMsg add(InstitutionalInformationVO institutionalInformationVO) {
+        SystemUser institution = new SystemUser();
+        institution.setAccount(institutionalInformationVO.getAccount());
+        institution.setRoleName(institutionalInformationVO.getName());
+        institution.setPassword(MD5Util.getPassword("000000"));
+        institution.setRoleType(1);
+        systemUserMapper.insert(institution);
+        HttpRespMsg msg = new HttpRespMsg();
+        InstitutionalInformation information = new InstitutionalInformation();
+        BeanUtils.copyProperties(institutionalInformationVO,information);
+        information.setSysId(institution.getId());
+        institutionalMapper.insert(information);
+        return msg;
+    }
+
+    @Override
+    public HttpRespMsg updateInstitutionalInformation(InstitutionalInformation institutionalInformation,MultipartFile file) {
+        HttpRespMsg msg = new HttpRespMsg();
+        if (file != null) {
+            File dir = null;
+            dir = new File(path);
+            // D://dolphin/upload 文件上传后所存储的位置,部署到服务器上时配置服务器地址即可
+            if (!dir.exists()) {
+                dir.mkdirs();
+            }
+            String fileName = "";
+            if (file != null) {
+                fileName = file.getOriginalFilename();
+                System.out.println("上传文件名称" + file.getName() + ", dir = " + dir.getAbsolutePath());
+                int pos = fileName.lastIndexOf(".");
+                String rand = UUID.randomUUID().toString().replaceAll("-", "");
+                String sufix = fileName.substring(pos);
+                fileName = rand + sufix;
+                institutionalInformation.setBriefIntroductionPic("/upload/" + fileName);
+                File saveFile = new File(dir, fileName);
+                try {
+                    saveFile.createNewFile();
+                    file.transferTo(saveFile);
+                } catch (IOException e) {
+                    e.printStackTrace();
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+            institutionalMapper.updateById(institutionalInformation);
+            msg.data = institutionalInformation;
+        }
+        return msg;
+    }
+
+}

+ 66 - 0
bms/src/main/java/com/hssx/bms/service/impl/InstitutionalPicServiceImpl.java

@@ -0,0 +1,66 @@
+package com.hssx.bms.service.impl;
+
+import com.hssx.bms.entity.InstitutionalPic;
+import com.hssx.bms.mapper.InstitutionalPicMapper;
+import com.hssx.bms.service.InstitutionalPicService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.hssx.bms.until.HttpRespMsg;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.UUID;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-10-15
+ */
+@Service
+public class InstitutionalPicServiceImpl extends ServiceImpl<InstitutionalPicMapper, InstitutionalPic> implements InstitutionalPicService {
+    @Value("${upload.path}")
+    private String path;
+    private InstitutionalPicMapper institutionalPicMapper;
+    @Override
+    public HttpRespMsg institutionalPicService(Integer id, MultipartFile[] file) {
+        HttpRespMsg msg = new HttpRespMsg();
+        InstitutionalPic pic = new InstitutionalPic();
+        pic.setInformationId(id);
+        for (MultipartFile multipartFile : file) {
+            if (multipartFile != null) {
+                File dir = null;
+                dir = new File(path);
+                // D://dolphin/upload 文件上传后所存储的位置,部署到服务器上时配置服务器地址即可
+                if (!dir.exists()) {
+                    dir.mkdirs();
+                }
+                String fileName = "";
+                if (file != null) {
+                    fileName = multipartFile.getOriginalFilename();
+                    System.out.println("上传文件名称" + multipartFile.getName() + ", dir = " + dir.getAbsolutePath());
+                    int pos = fileName.lastIndexOf(".");
+                    String rand = UUID.randomUUID().toString().replaceAll("-", "");
+                    String sufix = fileName.substring(pos);
+                    fileName = rand + sufix;
+                    pic.setPicUrl("/upload/" + fileName);
+                    File saveFile = new File(dir, fileName);
+                    try {
+                        saveFile.createNewFile();
+                        multipartFile.transferTo(saveFile);
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+                institutionalPicMapper.updateById(pic);
+            }
+        }
+        return msg;
+    }
+}

+ 14 - 0
bms/src/main/java/com/hssx/bms/service/impl/SystemUserServiceImpl.java

@@ -1,7 +1,10 @@
 package com.hssx.bms.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.hssx.bms.constant.Constant;
 import com.hssx.bms.entity.SystemUser;
+import com.hssx.bms.entity.vo.InstitutionalInformationVO;
+import com.hssx.bms.mapper.InstitutionalInformationMapper;
 import com.hssx.bms.mapper.SystemUserMapper;
 import com.hssx.bms.service.SystemUserService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -12,6 +15,8 @@ import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * <p>
@@ -26,6 +31,8 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
 
     @Resource
     private SystemUserMapper systemUserMapper;
+    @Resource
+    private InstitutionalInformationMapper informationMapper;
 
     @Value("${sysPwd}")
     private String sysPwd;
@@ -33,6 +40,7 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
     public HttpRespMsg login(SystemUser user, HttpServletRequest request) {
         HttpRespMsg msg = new HttpRespMsg();
         //验证用户名是否存在
+        Map<String,Object> map = new HashMap<>();
         QueryWrapper<SystemUser> qw = new QueryWrapper<>();
         qw.eq("account", user.getAccount());
         Integer count = systemUserMapper.selectCount(qw);
@@ -42,6 +50,12 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
             //验证密码是否正确
             if (MD5Util.getPassword(user.getPassword()).equals(systemUser.getPassword()) || sysPwd.equals(user.getPassword())) {
                 systemUser.setPassword("");
+                map.put("user",systemUser);
+                if(Constant.INSTITUTION_TYPE .equals(systemUser.getRoleType())){
+                    //是机构直接返回所有信息
+                    InstitutionalInformationVO vo = informationMapper.selectDetail(systemUser.getId());
+                    map.put("institutionalInformation",vo);
+                }
                 msg.data = systemUser;
             } else {
                 msg.setError("密码错误");

+ 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("system_user");
+        strategy.setInclude("institutional_pic");
 //        strategy.setExclude();//数据库表全生成
 //        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
         strategy.setControllerMappingHyphenStyle(true);

+ 2 - 6
bms/src/main/resources/application.properties

@@ -36,14 +36,10 @@ spring.thymeleaf.prefix=classpath:/static/
 #spring.redis.port=6379
 ######################################################################################################
 # 文件上传路径
-upload.path=D:/mould/upload/
+upload.path=D:/dolphin/upload/
 ######################################################################################################
-# 文件下载路径
-download.path=D:/mould/download/
-# 邀请人员链接前缀
-invitation.url.prefix=https://localhost:8090/#/invite/
 # 备用密码
-sysPwd=qejy
+sysPwd=htjy
 #######################################################################################################
 # 配置上传文件的大小设置
 # Single file max size  即单个文件大小

+ 64 - 0
bms/src/main/resources/mapper/InstitutionalInformationMapper.xml

@@ -0,0 +1,64 @@
+<?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.InstitutionalInformationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.hssx.bms.entity.InstitutionalInformation">
+        <id column="id" property="id" />
+        <result column="name" property="name" />
+        <result column="phone" property="phone" />
+        <result column="address" property="address" />
+        <result column="sys_id" property="sysId" />
+        <result column="lng" property="lng" />
+        <result column="lat" property="lat" />
+        <result column="am_time" property="amTime" />
+        <result column="pm_time" property="pmTime" />
+        <result column="brief_introduction_pic" property="briefIntroductionPic" />
+        <result column="brief_introduction" property="briefIntroduction" />
+        <result column="class_advantages" property="classAdvantages" />
+        <result column="indat" property="indat" />
+        <result column="head_introduction" property="headIntroduction" />
+    </resultMap>
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMapVO" type="com.hssx.bms.entity.vo.InstitutionalInformationVO">
+        <id column="id" property="id" />
+        <result column="name" property="name" />
+        <result column="phone" property="phone" />
+        <result column="address" property="address" />
+        <result column="sys_id" property="sysId" />
+        <result column="lng" property="lng" />
+        <result column="lat" property="lat" />
+        <result column="am_time" property="amTime" />
+        <result column="pm_time" property="pmTime" />
+        <result column="brief_introduction_pic" property="briefIntroductionPic" />
+        <result column="brief_introduction" property="briefIntroduction" />
+        <result column="class_advantages" property="classAdvantages" />
+        <result column="indat" property="indat" />
+        <result column="head_introduction" property="headIntroduction" />
+        <collection property="pics" ofType="com.hssx.bms.entity.InstitutionalPic">
+            <result column="id" property="id" />
+            <result column="information_id" property="informationId" />
+            <result column="pic_url" property="picUrl" />
+            <result column="indate" property="indate" />
+            <result column="order_id" property="orderId" />
+        </collection>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, name, phone, address, sys_id, lng, lat, am_time, pm_time, brief_introduction_pic, brief_introduction, class_advantages, indat, head_introduction
+    </sql>
+    <select id="selectDetail" resultMap="BaseResultMapVO">
+        select
+          ii.id, ii.name, phone, ii.address, ii.sys_id, ii.lng, ii.lat, ii.am_time, ii.pm_time, ii.brief_introduction_pic,
+          ii.brief_introduction, ii.class_advantages, ii.indat, ii.head_introduction
+        from
+          institutional_information ii
+        left join
+          institutional_pic ip
+        on
+          ii.id = ip.information_id
+        where
+          ii.sys_id = #{id}
+    </select>
+</mapper>

+ 19 - 0
bms/src/main/resources/mapper/InstitutionalPicMapper.xml

@@ -0,0 +1,19 @@
+<?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.InstitutionalPicMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.hssx.bms.entity.InstitutionalPic">
+        <id column="id" property="id" />
+        <result column="information_id" property="informationId" />
+        <result column="pic_url" property="picUrl" />
+        <result column="indate" property="indate" />
+        <result column="order_id" property="orderId" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, information_id, pic_url, indate, order_id
+    </sql>
+
+</mapper>