Merge remote-tracking branch 'origin/new-exam' into new-exam

pg_adapter
20918 8 months ago
commit f91bb1ca5b

@ -19,6 +19,7 @@ import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.domain.SysUserPost;
import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.domain.count.UserCountDTO;
import com.ruoyi.system.domain.count.UserSmCountDTO;
import com.ruoyi.system.service.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
@ -129,6 +130,31 @@ public class SysUsernumController extends BaseController {
private List<String> sharType = Arrays.asList("已登记", "已申报", "已审核", "已离职");
private List<String> smType = Arrays.asList("一般涉密人员", "重要涉密人员", "核心涉密人员");
@PostMapping("/countSm")
@ResponseBody
public AjaxResult countSm() {
UserSmCountDTO userSmCountDTO = userService.selectCountSmUser();
List<Long> yAxisData = new ArrayList<>();
smType.forEach(xAxis -> {
AtomicReference<Long> yAxis = new AtomicReference<>(0L);
if("一般涉密人员".equals(xAxis)){
yAxis.set(Long.valueOf(userSmCountDTO.getYb()));
}else if("重要涉密人员".equals(xAxis)){
yAxis.set(Long.valueOf(userSmCountDTO.getZy()));
}else{
yAxis.set(Long.valueOf(userSmCountDTO.getHx()));
}
yAxisData.add(yAxis.get());
});
JSONObject obj = new JSONObject();
obj.put("xAxisData", smType.toArray());
obj.put("yAxisData", yAxisData);
return AjaxResult.success(obj);
}
/**
*
*
@ -160,4 +186,7 @@ public class SysUsernumController extends BaseController {
}
}

@ -0,0 +1,32 @@
package com.ruoyi.system.domain.count;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* packageName com.ruoyi.system.domain.count
*
* @author wangxy
* @version JDK 8
* @className UserSmCountDTO
* @date 2024/8/8
* @description
*/
@Data
@ApiModel(value="涉密程度统计", description="涉密程度统计")
public class UserSmCountDTO implements Serializable {
@ApiModelProperty(value = "一般")
private Integer yb;
@ApiModelProperty(value = "重要")
private Integer zy;
@ApiModelProperty(value = "核心")
private Integer hx;
}

@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.domain.count.UserCountDTO;
import com.ruoyi.system.domain.count.UserSmCountDTO;
/**
*
@ -130,4 +131,6 @@ public interface SysUserMapper extends BaseMapper<SysUser>
public UserCountDTO selectCountUser();
public UserSmCountDTO selectCountSmUser();
}

@ -7,6 +7,7 @@ import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.domain.count.UserCountDTO;
import com.ruoyi.system.domain.count.UserSmCountDTO;
/**
*
@ -230,4 +231,7 @@ public interface ISysUserService extends IService<SysUser>
public UserCountDTO selectCountUser();
public UserSmCountDTO selectCountSmUser();
}

@ -8,6 +8,7 @@ import javax.validation.Validator;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.system.domain.count.UserCountDTO;
import com.ruoyi.system.domain.count.UserSmCountDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -587,4 +588,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper,SysUser> imple
public UserCountDTO selectCountUser() {
return userMapper.selectCountUser();
}
@Override
public UserSmCountDTO selectCountSmUser() {
return userMapper.selectCountSmUser();
}
}

@ -326,6 +326,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectCountSmUser" resultType="com.ruoyi.system.domain.count.UserSmCountDTO">
SELECT
SUM (CASE WHEN shemichengdu = 0 THEN 1 ELSE 0 END) AS yb,
SUM (CASE WHEN shemichengdu = 1 THEN 1 ELSE 0 END) AS zy,
SUM (CASE WHEN shemichengdu = 2 THEN 1 ELSE 0 END) AS hx
from ${prefix}sys_user where status='0' and del_flag='0'
</select>
</mapper>
Loading…
Cancel
Save