5-6 问题修改
This commit is contained in:
@@ -27,7 +27,7 @@ public interface DictTypeFeign {
|
|||||||
@ApiOperation(value = "数据字典类型分页列表")
|
@ApiOperation(value = "数据字典类型分页列表")
|
||||||
ResultBean<PagerVo<DictTypeVo>> pageList(@RequestBody PagerQuery<DictTypeQuery> pagerQuery);
|
ResultBean<PagerVo<DictTypeVo>> pageList(@RequestBody PagerQuery<DictTypeQuery> pagerQuery);
|
||||||
|
|
||||||
@DeleteMapping("/delete/{sid}")
|
@PostMapping("/delete/{sid}")
|
||||||
@ApiOperation(value = "数据字典类型删除")
|
@ApiOperation(value = "数据字典类型删除")
|
||||||
ResultBean delete(@PathVariable String sid);
|
ResultBean delete(@PathVariable String sid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.yxt.demo.system.api.sys_score;
|
|||||||
|
|
||||||
import com.yxt.demo.system.utils.ResultBean;
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
@@ -32,4 +33,8 @@ public interface SysScoreFeign {
|
|||||||
@ApiOperation(value = "删除成绩")
|
@ApiOperation(value = "删除成绩")
|
||||||
@RequestMapping("/deleteScore")
|
@RequestMapping("/deleteScore")
|
||||||
ResultBean deleteScore(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
ResultBean deleteScore(@ApiParam(value = "sid", required = true) @PathVariable("sid") String sid);
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询科目")
|
||||||
|
@RequestMapping("/selectScoreKM")
|
||||||
|
ResultBean selectScoreKM();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,4 +40,8 @@ public interface SysStudentScoreFeign {
|
|||||||
@ApiOperation(value = "查询学生升学率、就业率、考公率")
|
@ApiOperation(value = "查询学生升学率、就业率、考公率")
|
||||||
@RequestMapping("/selectStudentRate")
|
@RequestMapping("/selectStudentRate")
|
||||||
ResultBean selectStudentRate(@RequestBody SysStudentScoreYIELD sysStudentScoreYIELD);
|
ResultBean selectStudentRate(@RequestBody SysStudentScoreYIELD sysStudentScoreYIELD);
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询班级")
|
||||||
|
@RequestMapping("/selectClass")
|
||||||
|
ResultBean selectClass();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,6 @@ public class DictTypeRest implements DictTypeFeign {
|
|||||||
if (0 == dictTypeService.deleteBySid(sid)) {
|
if (0 == dictTypeService.deleteBySid(sid)) {
|
||||||
return rb.setMsg("删除失败");
|
return rb.setMsg("删除失败");
|
||||||
}
|
}
|
||||||
return rb.setMsg("删除成功");
|
return rb.success().setMsg("删除成功");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,4 +37,6 @@ public interface SysInfoMapper extends BaseMapper<SysInfo> {
|
|||||||
SysInfo selectInfoByUserSid(@Param("userSid") String userSid);
|
SysInfo selectInfoByUserSid(@Param("userSid") String userSid);
|
||||||
|
|
||||||
IPage<SysInfo> listPageVo(IPage<SysInfo> page, @Param(Constants.WRAPPER) QueryWrapper<SysInfo> qw);
|
IPage<SysInfo> listPageVo(IPage<SysInfo> page, @Param(Constants.WRAPPER) QueryWrapper<SysInfo> qw);
|
||||||
|
|
||||||
|
void updateInfoById(SysInfo sysInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="selectInfoByUserSid" resultType="com.yxt.demo.system.api.sys_info.SysInfo">
|
<select id="selectInfoByUserSid" resultType="com.yxt.demo.system.api.sys_info.SysInfo">
|
||||||
select * from sys_info where userSid = #{userSid}
|
select name,sid,id,modifyTime,calss,speciality,department,studyYear,sex,userSid,infoId from sys_info where userSid = #{userSid}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="listPageVo" resultType="com.yxt.demo.system.api.sys_info.SysInfo">
|
<select id="listPageVo" resultType="com.yxt.demo.system.api.sys_info.SysInfo">
|
||||||
@@ -43,4 +43,29 @@
|
|||||||
${ew.sqlSegment}
|
${ew.sqlSegment}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="updateInfoById" parameterType="com.yxt.demo.system.api.sys_info.SysInfo">
|
||||||
|
update sys_info
|
||||||
|
<set>
|
||||||
|
<if test="name != null">
|
||||||
|
name = #{name},
|
||||||
|
</if>
|
||||||
|
<if test="sex != null">
|
||||||
|
sex = #{sex},
|
||||||
|
</if>
|
||||||
|
<if test="studyYear != null">
|
||||||
|
studyYear = #{studyYear},
|
||||||
|
</if>
|
||||||
|
<if test="department != null">
|
||||||
|
department = #{department},
|
||||||
|
</if>
|
||||||
|
<if test="speciality != null">
|
||||||
|
speciality = #{speciality},
|
||||||
|
</if>
|
||||||
|
<if test="calss != null">
|
||||||
|
calss = #{calss},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -8,7 +8,9 @@ import com.yxt.demo.system.api.dict_common.DictCommon;
|
|||||||
import com.yxt.demo.system.api.dict_common.DictCommonQuery;
|
import com.yxt.demo.system.api.dict_common.DictCommonQuery;
|
||||||
import com.yxt.demo.system.api.dict_common.DictCommonVo;
|
import com.yxt.demo.system.api.dict_common.DictCommonVo;
|
||||||
import com.yxt.demo.system.api.sys_info.SysInfoPageCount;
|
import com.yxt.demo.system.api.sys_info.SysInfoPageCount;
|
||||||
|
import com.yxt.demo.system.api.sys_info_ship.SysInfoShip;
|
||||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||||
|
import com.yxt.demo.system.biz.sys_info_ship.SysInfoShipMapper;
|
||||||
import com.yxt.demo.system.biz.sys_user.SysUserMapper;
|
import com.yxt.demo.system.biz.sys_user.SysUserMapper;
|
||||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||||
import com.yxt.demo.system.api.sys_info.SysInfo;
|
import com.yxt.demo.system.api.sys_info.SysInfo;
|
||||||
@@ -33,6 +35,8 @@ public class SysInfoService extends MybatisBaseService<SysInfoMapper, SysInfo> {
|
|||||||
private SysUserMapper sysUserMapper;
|
private SysUserMapper sysUserMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysInfoMapper sysInfoMapper;
|
private SysInfoMapper sysInfoMapper;
|
||||||
|
@Autowired
|
||||||
|
private SysInfoShipMapper sysInfoShipMapper;
|
||||||
|
|
||||||
public SysInfo selectByNoAndName(String userName, String name) {
|
public SysInfo selectByNoAndName(String userName, String name) {
|
||||||
return baseMapper.selectByNoAndName(userName, name);
|
return baseMapper.selectByNoAndName(userName, name);
|
||||||
@@ -42,6 +46,14 @@ public class SysInfoService extends MybatisBaseService<SysInfoMapper, SysInfo> {
|
|||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
sysInfo.setModifyTime(new Date());
|
sysInfo.setModifyTime(new Date());
|
||||||
int i = baseMapper.updateById(sysInfo);
|
int i = baseMapper.updateById(sysInfo);
|
||||||
|
if (sysInfo.getUserSid() != null){
|
||||||
|
SysUser sysUser = sysUserMapper.selectUser(sysInfo.getUserSid());
|
||||||
|
if (sysUser != null){
|
||||||
|
sysUser.setName(sysInfo.getName());
|
||||||
|
sysUser.setSid(sysInfo.getUserSid());
|
||||||
|
sysUserMapper.updateById(sysUser);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (i == 0){
|
if (i == 0){
|
||||||
return rb.setMsg("修改失败");
|
return rb.setMsg("修改失败");
|
||||||
}
|
}
|
||||||
@@ -90,6 +102,7 @@ public class SysInfoService extends MybatisBaseService<SysInfoMapper, SysInfo> {
|
|||||||
SysInfo sysInfo = baseMapper.selectBySid(sid);
|
SysInfo sysInfo = baseMapper.selectBySid(sid);
|
||||||
baseMapper.deleteInfoBySid(sid);
|
baseMapper.deleteInfoBySid(sid);
|
||||||
sysUserMapper.deleteUserBySid(sysInfo.getUserSid());
|
sysUserMapper.deleteUserBySid(sysInfo.getUserSid());
|
||||||
|
sysInfoShipMapper.deleteInfoShipByStudentNo(sysInfo.getInfoId());
|
||||||
return rb.success().setMsg("删除成功");
|
return rb.success().setMsg("删除成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,4 +23,6 @@ public interface SysInfoShipMapper extends BaseMapper<SysInfoShip> {
|
|||||||
List<SysInfoShip> selectTeacherDownStudent(@Param("teacher") String teacher);
|
List<SysInfoShip> selectTeacherDownStudent(@Param("teacher") String teacher);
|
||||||
|
|
||||||
IPage<SysInfoShip> listPageVo(IPage<SysInfoShip> page, @Param(Constants.WRAPPER) QueryWrapper<SysInfoShip> qw);
|
IPage<SysInfoShip> listPageVo(IPage<SysInfoShip> page, @Param(Constants.WRAPPER) QueryWrapper<SysInfoShip> qw);
|
||||||
|
|
||||||
|
void deleteInfoShipByStudentNo(@Param("studentNo") String studentNo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,8 @@
|
|||||||
${ew.sqlSegment}
|
${ew.sqlSegment}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteInfoShipByStudentNo">
|
||||||
|
delete from sys_info_ship where studentNo = #{studentNo}
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -16,4 +16,6 @@ import java.util.List;
|
|||||||
public interface SysScoreMapper extends BaseMapper<SysScore> {
|
public interface SysScoreMapper extends BaseMapper<SysScore> {
|
||||||
|
|
||||||
List<SysScore> selectScoreList();
|
List<SysScore> selectScoreList();
|
||||||
|
|
||||||
|
List<SysScore> selectScoreKM();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,4 +4,8 @@
|
|||||||
<select id="selectScoreList" resultType="com.yxt.demo.system.api.sys_score.SysScore">
|
<select id="selectScoreList" resultType="com.yxt.demo.system.api.sys_score.SysScore">
|
||||||
select * from sys_score
|
select * from sys_score
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectScoreKM" resultType="com.yxt.demo.system.api.sys_score.SysScore">
|
||||||
|
select type,id from sys_score
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -51,4 +51,9 @@ public class SysScoreRest implements SysScoreFeign {
|
|||||||
return rb.success();
|
return rb.success();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean selectScoreKM() {
|
||||||
|
return sysScoreService.selectScoreKM();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
|||||||
import com.yxt.demo.system.api.sys_score.SysScore;
|
import com.yxt.demo.system.api.sys_score.SysScore;
|
||||||
import com.yxt.demo.system.api.sys_score.SysScoreDto;
|
import com.yxt.demo.system.api.sys_score.SysScoreDto;
|
||||||
import com.yxt.demo.system.utils.ResultBean;
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -18,6 +19,9 @@ import java.util.List;
|
|||||||
@Service
|
@Service
|
||||||
public class SysScoreService extends MybatisBaseService<SysScoreMapper, SysScore>{
|
public class SysScoreService extends MybatisBaseService<SysScoreMapper, SysScore>{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysScoreMapper sysScoreMapper;
|
||||||
|
|
||||||
public ResultBean save(SysScoreDto sysScoreDto) {
|
public ResultBean save(SysScoreDto sysScoreDto) {
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
SysScore sysScore = new SysScore();
|
SysScore sysScore = new SysScore();
|
||||||
@@ -41,4 +45,10 @@ public class SysScoreService extends MybatisBaseService<SysScoreMapper, SysScore
|
|||||||
List<SysScore> scoreList = baseMapper.selectScoreList();
|
List<SysScore> scoreList = baseMapper.selectScoreList();
|
||||||
return rb.success().setData(scoreList);
|
return rb.success().setData(scoreList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResultBean selectScoreKM() {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
List<SysScore> sysScores = sysScoreMapper.selectScoreKM();
|
||||||
|
return rb.success().setData(sysScores);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.yxt.demo.system.biz.sys_student_score;
|
package com.yxt.demo.system.biz.sys_student_score;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.yxt.demo.system.api.sys_info.SysInfo;
|
||||||
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
||||||
import com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD;
|
import com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
@@ -27,4 +28,6 @@ public interface SysStudentScoreMapper extends BaseMapper<SysStudentScore> {
|
|||||||
SysStudentScoreYIELD selectStudentScoreEmployment(SysStudentScoreYIELD sysStudentScoreYIELD);
|
SysStudentScoreYIELD selectStudentScoreEmployment(SysStudentScoreYIELD sysStudentScoreYIELD);
|
||||||
|
|
||||||
SysStudentScoreYIELD selectStudentScoreComputerKaoGong(SysStudentScoreYIELD sysStudentScoreYIELD);
|
SysStudentScoreYIELD selectStudentScoreComputerKaoGong(SysStudentScoreYIELD sysStudentScoreYIELD);
|
||||||
|
|
||||||
|
List<String> selectClass();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,4 +52,8 @@
|
|||||||
where s.kaoGong = '1'
|
where s.kaoGong = '1'
|
||||||
group by i.calss
|
group by i.calss
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectClass" resultType="string">
|
||||||
|
select distinct calss from sys_info
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -58,4 +58,9 @@ public class SysStudentScoreRest implements SysStudentScoreFeign {
|
|||||||
public ResultBean selectStudentRate(SysStudentScoreYIELD sysStudentScoreYIELD) {
|
public ResultBean selectStudentRate(SysStudentScoreYIELD sysStudentScoreYIELD) {
|
||||||
return sysStudentScoreService.selectStudentRate(sysStudentScoreYIELD);
|
return sysStudentScoreService.selectStudentRate(sysStudentScoreYIELD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultBean selectClass() {
|
||||||
|
return sysStudentScoreService.selectClass();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.yxt.demo.system.biz.sys_student_score;
|
package com.yxt.demo.system.biz.sys_student_score;
|
||||||
|
|
||||||
|
import com.yxt.demo.system.api.sys_info.SysInfo;
|
||||||
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
import com.yxt.demo.system.api.sys_student_score.SysStudentScore;
|
||||||
import com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD;
|
import com.yxt.demo.system.api.sys_student_score.SysStudentScoreYIELD;
|
||||||
import com.yxt.demo.system.api.sys_user.SysUser;
|
import com.yxt.demo.system.api.sys_user.SysUser;
|
||||||
@@ -8,6 +9,7 @@ import com.yxt.demo.system.utils.ResultBean;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -98,4 +100,18 @@ public class SysStudentScoreService extends MybatisBaseService<SysStudentScoreM
|
|||||||
}
|
}
|
||||||
return rb.success().setData(ssy);
|
return rb.success().setData(ssy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResultBean selectClass() {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
List<String> sysInfos = sysStudentScoreMapper.selectClass();
|
||||||
|
int i = 1;
|
||||||
|
List<Object> list = new ArrayList<>();
|
||||||
|
for (int j = 0;j < sysInfos.size();j++) {
|
||||||
|
Object [] a = new Object[2];
|
||||||
|
a[0] = sysInfos.get(j);
|
||||||
|
a[1] = i++;
|
||||||
|
list.add(a);
|
||||||
|
}
|
||||||
|
return rb.success().setData(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.yxt.demo.system.biz.sys_user;
|
package com.yxt.demo.system.biz.sys_user;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.yxt.demo.system.biz.sys_info.SysInfoMapper;
|
||||||
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
import com.yxt.demo.system.jdbc.service.MybatisBaseService;
|
||||||
import com.yxt.demo.system.utils.ResultBean;
|
import com.yxt.demo.system.utils.ResultBean;
|
||||||
import com.yxt.demo.system.utils.jwt.JWTUtil;
|
import com.yxt.demo.system.utils.jwt.JWTUtil;
|
||||||
@@ -12,7 +13,9 @@ import com.yxt.demo.system.biz.sys_info.SysInfoService;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author dimengzhe
|
* @Author dimengzhe
|
||||||
@@ -27,6 +30,8 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
|
|||||||
private SysInfoService sysInfoService;
|
private SysInfoService sysInfoService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserMapper sysUserMapper;
|
private SysUserMapper sysUserMapper;
|
||||||
|
@Autowired
|
||||||
|
private SysInfoMapper sysInfoMapper;
|
||||||
|
|
||||||
public ResultBean register(SysUserDto dto) {
|
public ResultBean register(SysUserDto dto) {
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
@@ -50,6 +55,9 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
|
|||||||
BeanUtil.copyProperties(dto, sysUser);
|
BeanUtil.copyProperties(dto, sysUser);
|
||||||
sysUser.setPassword(dto.getPassword());
|
sysUser.setPassword(dto.getPassword());
|
||||||
sysUser.setInfoSid(sysInfo.getSid());
|
sysUser.setInfoSid(sysInfo.getSid());
|
||||||
|
if (dto.getUserName().contains("js")){
|
||||||
|
sysUser.setType(1);
|
||||||
|
}
|
||||||
baseMapper.insert(sysUser);
|
baseMapper.insert(sysUser);
|
||||||
sysInfo.setUserSid(sysUser.getSid());
|
sysInfo.setUserSid(sysUser.getSid());
|
||||||
sysInfoService.updateById(sysInfo);
|
sysInfoService.updateById(sysInfo);
|
||||||
@@ -62,6 +70,45 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
|
|||||||
sysUser = new SysUser();
|
sysUser = new SysUser();
|
||||||
BeanUtil.copyProperties(dto, sysUser);
|
BeanUtil.copyProperties(dto, sysUser);
|
||||||
sysUser.setPassword(dto.getPassword());
|
sysUser.setPassword(dto.getPassword());
|
||||||
|
if (dto.getUserName().contains("js")){
|
||||||
|
sysUser.setType(1);
|
||||||
|
}
|
||||||
|
baseMapper.insert(sysUser);
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
}else if (dto.getUserName().contains("admin")){
|
||||||
|
if(!dto.getPassword().equals(dto.getConfirmPassword())){
|
||||||
|
return rb.setMsg("密码和确认密码不一致");
|
||||||
|
}
|
||||||
|
//验证此人基本信念是否存在
|
||||||
|
String userName = dto.getUserName();
|
||||||
|
String name = dto.getName();
|
||||||
|
SysInfo sysInfo = sysInfoService.selectByNoAndName(userName, name);
|
||||||
|
if (sysInfo != null) {
|
||||||
|
// return rb.setMsg("学号或姓名错误");
|
||||||
|
//查看该账号是否已激活
|
||||||
|
SysUser sysUser = baseMapper.selectByNo(userName);
|
||||||
|
if (sysUser != null) {
|
||||||
|
return rb.setMsg("该账号已注册");
|
||||||
|
}
|
||||||
|
sysUser = new SysUser();
|
||||||
|
BeanUtil.copyProperties(dto, sysUser);
|
||||||
|
sysUser.setPassword(dto.getPassword());
|
||||||
|
sysUser.setInfoSid(sysInfo.getSid());
|
||||||
|
sysUser.setType(2);
|
||||||
|
baseMapper.insert(sysUser);
|
||||||
|
sysInfo.setUserSid(sysUser.getSid());
|
||||||
|
sysInfoService.updateById(sysInfo);
|
||||||
|
return rb.success();
|
||||||
|
}else {
|
||||||
|
SysUser sysUser = baseMapper.selectByNo(userName);
|
||||||
|
if (sysUser != null) {
|
||||||
|
return rb.setMsg("此账号已注册");
|
||||||
|
}
|
||||||
|
sysUser = new SysUser();
|
||||||
|
BeanUtil.copyProperties(dto, sysUser);
|
||||||
|
sysUser.setPassword(dto.getPassword());
|
||||||
|
sysUser.setType(2);
|
||||||
baseMapper.insert(sysUser);
|
baseMapper.insert(sysUser);
|
||||||
return rb.success();
|
return rb.success();
|
||||||
}
|
}
|
||||||
@@ -101,12 +148,15 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
|
|||||||
|
|
||||||
public ResultBean selectUserInfo(String sid) {
|
public ResultBean selectUserInfo(String sid) {
|
||||||
ResultBean rb = ResultBean.fireFail();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
List<SysUser> sysUsers = new ArrayList<>();
|
||||||
SysUser sysUser = sysUserMapper.selectUserInfo(sid);
|
SysUser sysUser = sysUserMapper.selectUserInfo(sid);
|
||||||
if(sysUser == null){
|
if(sysUser == null){
|
||||||
SysUser sysUser1 = sysUserMapper.selectUser(sid);
|
SysUser sysUser1 = sysUserMapper.selectUser(sid);
|
||||||
return rb.success().setMsg("基础信息为空,请添加基础信息!!!").setData(sysUser1);
|
sysUsers.add(sysUser1);
|
||||||
|
return rb.success().setMsg("基础信息为空,请添加基础信息!!!").setData(sysUsers);
|
||||||
}
|
}
|
||||||
return rb.success().setData(sysUser);
|
sysUsers.add(sysUser);
|
||||||
|
return rb.success().setData(sysUsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultBean alterInfoUser(SysUser sysUser) {
|
public ResultBean alterInfoUser(SysUser sysUser) {
|
||||||
@@ -125,7 +175,7 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
|
|||||||
sysInfo1.setSex(sysUser.getSex());
|
sysInfo1.setSex(sysUser.getSex());
|
||||||
sysInfo1.setStudyYear(sysUser.getStudyYear());
|
sysInfo1.setStudyYear(sysUser.getStudyYear());
|
||||||
sysInfo1.setName(sysUser.getName());
|
sysInfo1.setName(sysUser.getName());
|
||||||
sysInfoService.alterInfo(sysInfo1);
|
sysInfoMapper.updateInfoById(sysInfo1);
|
||||||
return rb.success();
|
return rb.success();
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
return rb.setMsg("修改失败");
|
return rb.setMsg("修改失败");
|
||||||
|
|||||||
Reference in New Issue
Block a user