Browse Source

提交:权限

mine
袁强 5 months ago
parent
commit
617c8cbeae
  1. 12
      yq-admin/src/main/java/yq/web/controller/mine/MineFaceController.java
  2. 26
      yq-admin/src/main/java/yq/web/controller/mine/MineHealthController.java
  3. 15
      yq-admin/src/main/java/yq/web/controller/mine/MineWarningController.java
  4. 2
      yq-admin/src/main/java/yq/web/controller/system/SysUserController.java
  5. 4
      yq-system/src/main/java/yq/system/domain/MineFace.java
  6. 4
      yq-system/src/main/java/yq/system/domain/MineHealth.java
  7. 6
      yq-system/src/main/java/yq/system/domain/MineWarning.java
  8. 12
      yq-system/src/main/java/yq/system/service/impl/MineFaceServiceImpl.java
  9. 28
      yq-system/src/main/java/yq/system/service/impl/MineHealthServiceImpl.java
  10. 18
      yq-system/src/main/java/yq/system/service/impl/MineWarningServiceImpl.java
  11. 8
      yq-system/src/main/resources/mapper/system/MineFaceMapper.xml
  12. 13
      yq-system/src/main/resources/mapper/system/MineHealthMapper.xml
  13. 14
      yq-system/src/main/resources/mapper/system/MineWarningMapper.xml

12
yq-admin/src/main/java/yq/web/controller/mine/MineFaceController.java

@ -1,11 +1,11 @@
package yq.web.controller.mine;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
;
import java.net.URL;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
@ -28,7 +28,7 @@ import yq.common.annotation.Log;
import yq.common.core.controller.BaseController;
import yq.common.core.domain.AjaxResult;
import yq.common.enums.BusinessType;
import yq.common.exception.ServiceException;
import yq.common.utils.FaceEnginUtil;
import yq.framework.config.ServerConfig;
import yq.system.domain.MineFace;
@ -67,7 +67,7 @@ public class MineFaceController extends BaseController
* 导出请填写功能名称列表
*/
@PreAuthorize("@ss.hasPermi('system:face:export')")
@Log(title = "【人列表导出】", businessType = BusinessType.EXPORT)
@Log(title = "【人列表导出】", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MineFace mineFace)
{
@ -111,7 +111,7 @@ public class MineFaceController extends BaseController
* 修改请填写功能名称
*/
@PreAuthorize("@ss.hasPermi('system:face:edit')")
@Log(title = "【人修改】", businessType = BusinessType.UPDATE)
@Log(title = "【人修改】", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MineFace mineFace) throws IOException {
MineFace face = mineFaceService.selectMineFaceById(mineFace.getId());
@ -132,7 +132,7 @@ public class MineFaceController extends BaseController
/**
* 修改初始健康值
*/
@PreAuthorize("@ss.hasPermi('system:face:edit')")
@PreAuthorize("@ss.hasPermi('system:face:editFace')")
@Log(title = "【初始健康值】", businessType = BusinessType.UPDATE)
@PostMapping("/editFace")
public AjaxResult editFace(@RequestBody MineFace mineFace){

26
yq-admin/src/main/java/yq/web/controller/mine/MineHealthController.java

@ -18,13 +18,11 @@ import yq.common.utils.poi.ExcelUtil;
import yq.system.domain.MineFace;
import yq.system.domain.MineHealth;
import yq.system.domain.MineWarning;
import yq.system.service.IMineFaceService;
import yq.system.service.IMineHealthService;
import yq.system.service.IMineWarningService;
import yq.system.service.ISysRoleService;
import yq.system.service.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.stream.Collectors;
/**
*
@ -42,8 +40,7 @@ public class MineHealthController extends BaseController
@Autowired
private IMineFaceService mineFaceService;
@Autowired
private ISysRoleService roleService;
/**
*/
@ -52,17 +49,7 @@ public class MineHealthController extends BaseController
public TableDataInfo list(MineHealth mineHealth)
{
startPage();
LoginUser loginUser = SecurityUtils.getLoginUser();
List<SysRole> sysRoles = roleService.selectRolesByUserId(loginUser.getUserId());
if(!sysRoles.isEmpty()){
for (SysRole sysRole : sysRoles) {
if(sysRole.getRoleKey().equals("admin") || sysRole.getRoleKey().equals("mine_admin")){
mineHealth.setUserId(null);
}else {
mineHealth.setUserId(loginUser.getUserId());
}
}
}
List<MineHealth> list = mineHealthService.selectMineHealthList(mineHealth);
return getDataTable(list);
}
@ -84,13 +71,14 @@ public class MineHealthController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('system:health:export')")
@Log(title = "【健康报告导出】", businessType = BusinessType.EXPORT)
@Log(title = "【已处理导出】", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MineHealth mineHealth)
{
List<MineHealth> list = mineHealthService.selectMineHealthList(mineHealth);
ExcelUtil<MineHealth> util = new ExcelUtil<MineHealth>(MineHealth.class);
util.exportExcel(response, list, "【健康报告】数据");
util.exportExcel(response, list, "【已处理】数据");
}

15
yq-admin/src/main/java/yq/web/controller/mine/MineWarningController.java

@ -1,6 +1,7 @@
package yq.web.controller.mine;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.util.ObjectUtil;
@ -52,6 +53,7 @@ public class MineWarningController extends BaseController
public TableDataInfo list(MineWarning mineWarning)
{
startPage();
List<MineWarning> list = mineWarningService.selectMineWarningList(mineWarning);
return getDataTable(list);
}
@ -63,6 +65,7 @@ public class MineWarningController extends BaseController
public TableDataInfo medicalList(MineWarning mineWarning)
{
startPage();
List<MineWarning> list = mineWarningService.selectMineWarningmedicalList(mineWarning);
return getDataTable(list);
}
@ -82,7 +85,7 @@ public class MineWarningController extends BaseController
/**
*/
@PreAuthorize("@ss.hasPermi('earlywarning:druid:list')")
@GetMapping("/statistic/list")
public TableDataInfo statisticList(MineWarning mineWarning){
@ -93,7 +96,7 @@ public class MineWarningController extends BaseController
/**
* 异常正常所占比
*/
@PreAuthorize("@ss.hasPermi('earlywarning:druid:list')")
@GetMapping("/normal/list")
public TableDataInfo normalList(MineWarning mineWarning){
@ -105,7 +108,7 @@ public class MineWarningController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('system:warning:export')")
@Log(title = "【预警导出】", businessType = BusinessType.EXPORT)
@Log(title = "【健康数据】", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MineWarning mineWarning){
List<MineWarning> list = mineWarningService.selectMineWarningList(mineWarning);
@ -124,14 +127,14 @@ public class MineWarningController extends BaseController
/**
*/
@PreAuthorize("@ss.hasPermi('system:warning:export')")
@Log(title = "【预警导出】", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:health:newExport')")
@Log(title = "【预警】", businessType = BusinessType.EXPORT)
@PostMapping("/medicalExport")
public void medicalExport(HttpServletResponse response, MineWarning mineWarning){
List<MineWarning> list = mineWarningService.selectMineWarningmedicalList(mineWarning);
String title="新预警";
ExcelUtil<MineWarning> util = new ExcelUtil<MineWarning>(MineWarning.class);
util.exportExcel(response, list, "预警处理",title);
util.exportExcel(response, list, "预警",title);
}

2
yq-admin/src/main/java/yq/web/controller/system/SysUserController.java

@ -242,7 +242,7 @@ public class SysUserController extends BaseController
/**
* 获取部门树列表
*/
@PreAuthorize("@ss.hasPermi('system:user:list')")
/* @PreAuthorize("@ss.hasPermi('system:user:list')")*/
@GetMapping("/deptTree")
public AjaxResult deptTree(SysDept dept)
{

4
yq-system/src/main/java/yq/system/domain/MineFace.java

@ -13,7 +13,9 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 请填写功能名称对象 mine_face
@ -74,7 +76,7 @@ public class MineFace
@NotNull(message = "未选择部门")
private Long deptId;
private String deptIdStr;
private List<Long> deptIds =new ArrayList<>();
@NotNull(message = "收缩压不能为空")

4
yq-system/src/main/java/yq/system/domain/MineHealth.java

@ -7,7 +7,9 @@ import org.springframework.format.annotation.DateTimeFormat;
import yq.common.annotation.Excel;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @auther yq
@ -51,7 +53,7 @@ public class MineHealth {
private String userName;
private Long warningId;
private List<Long> deptIds =new ArrayList<>();
private Long deptId;

6
yq-system/src/main/java/yq/system/domain/MineWarning.java

@ -12,9 +12,7 @@ import yq.common.annotation.Excel;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
/**
* @auther yq
@ -74,7 +72,7 @@ public class MineWarning {
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private Map<String, Object> params = new HashMap<>();
private String deptIdStr;
private List<Long> deptIds =new ArrayList<>();
private Long userId;
private String search;
}

12
yq-system/src/main/java/yq/system/service/impl/MineFaceServiceImpl.java

@ -1,6 +1,7 @@
package yq.system.service.impl;
import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
@ -12,6 +13,8 @@ import yq.system.domain.vo.FaceByteVo;
import yq.system.mapper.MineFaceMapper;
import yq.system.domain.MineFace;
import yq.system.service.IMineFaceService;
import yq.system.service.ISysDeptService;
import yq.system.service.ISysRoleService;
/**
* 请填写功能名称Service业务层处理
@ -24,10 +27,15 @@ public class MineFaceServiceImpl implements IMineFaceService
{
@Autowired
private MineFaceMapper mineFaceMapper;
@Autowired
private ISysRoleService roleService;
@Autowired
private ISysDeptService deptService;
@Override
public List<MineFace> selectMineFaceByList() {
return mineFaceMapper.selectMineFaceByList();
}
@ -52,6 +60,10 @@ public class MineFaceServiceImpl implements IMineFaceService
@Override
public List<MineFace> selectMineFaceList(MineFace mineFace)
{
if(ObjectUtil.isNotNull(mineFace.getDeptId())){
mineFace.setDeptIds(deptService.listChildrenDeptById(mineFace.getDeptId()));
mineFace.setDeptId(null);
}
return mineFaceMapper.selectMineFaceList(mineFace);
}

28
yq-system/src/main/java/yq/system/service/impl/MineHealthServiceImpl.java

@ -1,16 +1,23 @@
package yq.system.service.impl;
import cn.hutool.core.util.ObjectUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yq.common.core.domain.entity.SysRole;
import yq.common.core.domain.model.LoginUser;
import yq.common.utils.DateUtils;
import yq.common.utils.SecurityUtils;
import yq.system.domain.MineHealth;
import yq.system.domain.MineWarning;
import yq.system.mapper.MineHealthMapper;
import yq.system.mapper.MineWarningMapper;
import yq.system.service.IMineHealthService;
import yq.system.service.IMineWarningService;
import yq.system.service.ISysDeptService;
import yq.system.service.ISysRoleService;
import java.util.List;
import java.util.stream.Collectors;
/**
* 请填写功能名称Service业务层处理
@ -23,7 +30,10 @@ public class MineHealthServiceImpl implements IMineHealthService
{
@Autowired
private MineHealthMapper mineHealthMapper;
@Autowired
private ISysRoleService roleService;
@Autowired
private ISysDeptService deptService;
@Override
public MineHealth selectMineHealthById(Long id) {
@ -39,7 +49,21 @@ public class MineHealthServiceImpl implements IMineHealthService
@Override
public List<MineHealth> selectMineHealthList(MineHealth mineHealth)
{
LoginUser loginUser = SecurityUtils.getLoginUser();
List<SysRole> sysRoles = roleService.selectRolesByUserId(loginUser.getUserId());
if(!sysRoles.isEmpty()){
for (SysRole sysRole : sysRoles) {
if(sysRole.getRoleKey().equals("admin") || sysRole.getRoleKey().equals("mine_admin")){
mineHealth.setUserId(null);
}else {
mineHealth.setUserId(loginUser.getUserId());
}
}
}
if(ObjectUtil.isNotNull(mineHealth.getDeptId())){
mineHealth.setDeptIds(deptService.listChildrenDeptById(mineHealth.getDeptId()));
mineHealth.setDeptId(null);
}
return mineHealthMapper.selectMineHealthList(mineHealth);
}

18
yq-system/src/main/java/yq/system/service/impl/MineWarningServiceImpl.java

@ -21,6 +21,7 @@ import yq.system.mapper.MineWarningMapper;
import yq.system.service.IMineFaceService;
import yq.system.service.IMineWarningService;
import yq.system.service.ISysDeptService;
import yq.system.service.ISysRoleService;
/**
* 请填写功能名称Service业务层处理
@ -37,6 +38,10 @@ public class MineWarningServiceImpl implements IMineWarningService
private ISysDeptService sysDeptService;
@Autowired
private IMineFaceService mineFaceService;
@Autowired
private ISysRoleService roleService;
@Autowired
private ISysDeptService deptService;
/**
* 查询请填写功能名称
@ -60,17 +65,28 @@ public class MineWarningServiceImpl implements IMineWarningService
public List<MineWarning> selectMineWarningList(MineWarning mineWarning)
{
if(ObjectUtil.isNotNull(mineWarning.getDeptId())){
mineWarning.setDeptIds(deptService.listChildrenDeptById(mineWarning.getDeptId()));
mineWarning.setDeptId(null);
}
return mineWarningMapper.selectMineWarningList(mineWarning);
}
@Override
public List<MineWarning> selectMineWarningmedicalList(MineWarning mineWarning) {
if(ObjectUtil.isNotNull(mineWarning.getDeptId())){
mineWarning.setDeptIds(deptService.listChildrenDeptById(mineWarning.getDeptId()));
mineWarning.setDeptId(null);
}
return mineWarningMapper.selectMineWarningMedicalList(mineWarning);
}
@Override
public List<MineWarning> selectMineWarningUnMedicalList(MineWarning mineWarning) {
if(ObjectUtil.isNotNull(mineWarning.getDeptId())){
mineWarning.setDeptIds(deptService.listChildrenDeptById(mineWarning.getDeptId()));
mineWarning.setDeptId(null);
}
return mineWarningMapper.selectMineWarningUnMedicalList(mineWarning);
}

8
yq-system/src/main/resources/mapper/system/MineFaceMapper.xml

@ -57,11 +57,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="faceName != null and faceName != ''"> and mf.face_name like concat('%', #{faceName}, '%')</if>
<if test="age != null "> and mf.age = #{age}</if>
<if test="deptId != null "> and d.dept_id =#{deptId}</if>
<if test="facePhone != null and facePhone != ''"> and mf.face_phone = #{facePhone}</if>
<if test="faceUrl != null and faceUrl != ''"> and mf.face_url = #{faceUrl}</if>
<if test="isWork != null "> and mf.is_work = #{isWork}</if>
<if test="deptIdStr != null "> and d.dept_id in (#{deptIdStr})</if>
<if test="deptIds.size > 0">
AND d.dept_id in
<foreach item="id" collection="deptIds" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
order by d.dept_name desc
</select>

13
yq-system/src/main/resources/mapper/system/MineHealthMapper.xml

@ -63,7 +63,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectMineHealthVo"/>
<where>
<if test="deptName != null and deptName != ''"> and d.dept_name like concat('%', #{deptName}, '%')</if>
<if test="deptId != null "> and d.dept_id = #{deptId}</if>
<if test="faceName != null and faceName != ''"> and mf.face_name like concat('%', #{faceName}, '%')</if>
<if test="bpHigh != null "> and mh.bp_high = #{bpHigh}</if>
<if test="bpLow != null "> and mh.bp_low = #{bpLow}</if>
@ -75,6 +74,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="warningId != null "> and mh.waring_id = #{warningId}</if>
<if test="temperature != null and temperature != ''"> and mh.temperature = #{temperature}</if>
<if test="isWork != null "> and mf.is_work = #{isWork}</if>
<if test="deptIds.size > 0">
AND d.dept_id in
<foreach item="id" collection="deptIds" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
order by mh.user_id,mh.create_time desc
</select>
@ -98,6 +103,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="warningId != null "> and mh.waring_id = #{warningId}</if>
<if test="temperature != null and temperature != ''"> and mh.temperature = #{temperature}</if>
<if test="isWork != null "> and mf.is_work = #{isWork}</if>
<if test="deptIds.size > 0">
AND d.dept_id in
<foreach item="id" collection="deptIds" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</select>

14
yq-system/src/main/resources/mapper/system/MineWarningMapper.xml

@ -125,7 +125,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="faceName != null and faceName != ''"> and mf.face_name like concat('%', #{faceName}, '%')</if>
<if test="bpHigh != null "> and mw.bp_high = #{bpHigh}</if>
<if test="bpLow != null "> and mw.bp_low = #{bpLow}</if>
<if test="deptId != null "> and d.dept_id = #{deptId}</if>
<if test="br != null "> and mw.br = #{br}</if>
<if test="hr != null "> and mw.hr = #{hr}</if>
<if test="hrv != null "> and mw.hrv = #{hrv}</if>
@ -137,6 +136,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(mw.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<if test="deptIds.size > 0">
AND d.dept_id in
<foreach item="id" collection="deptIds" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
${params.dataScope}
order by mw.create_time desc
@ -199,7 +204,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="faceName != null and faceName != ''"> and mf.face_name like concat('%', #{faceName}, '%')</if>
<if test="bpHigh != null "> and mw.bp_high = #{bpHigh}</if>
<if test="bpLow != null "> and mw.bp_low = #{bpLow}</if>
<if test="deptId != null "> and d.dept_id = #{deptId}</if>
<if test="br != null "> and mw.br = #{br}</if>
<if test="hr != null "> and mw.hr = #{hr}</if>
<if test="hrv != null "> and mw.hrv = #{hrv}</if>
@ -211,6 +215,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(mw.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<if test="deptIds.size > 0">
AND d.dept_id in
<foreach item="id" collection="deptIds" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
)
SELECT

Loading…
Cancel
Save