Commit 623fc9f8 by sdif

修改统计条件

parent dc777019
...@@ -25,6 +25,11 @@ public class TableDataInfo<T> implements Serializable { ...@@ -25,6 +25,11 @@ public class TableDataInfo<T> implements Serializable {
private long total; private long total;
/** /**
* 总页码
*/
private long totalNumber;
/**
* 列表数据 * 列表数据
*/ */
private List<T> rows; private List<T> rows;
...@@ -56,6 +61,7 @@ public class TableDataInfo<T> implements Serializable { ...@@ -56,6 +61,7 @@ public class TableDataInfo<T> implements Serializable {
rspData.setMsg("查询成功"); rspData.setMsg("查询成功");
rspData.setRows(page.getRecords()); rspData.setRows(page.getRecords());
rspData.setTotal(page.getTotal()); rspData.setTotal(page.getTotal());
rspData.setTotalNumber((int)Math.ceil((double) page.getTotal() / page.getSize()));
return rspData; return rspData;
} }
......
...@@ -92,6 +92,8 @@ public class DepartmentServiceImpl implements IDepartmentService { ...@@ -92,6 +92,8 @@ public class DepartmentServiceImpl implements IDepartmentService {
@Override @Override
public List<DepartmentVo> departmentByHospitalId(Integer hospitalId) { public List<DepartmentVo> departmentByHospitalId(Integer hospitalId) {
Hospital hospital = hospitalMapper.selectById(hospitalId); Hospital hospital = hospitalMapper.selectById(hospitalId);
List<DepartmentVo> departments = new ArrayList<>();
if(StringUtils.isNotEmpty(hospital.getDepartments())){
// 移除字符串中的方括号和双引号 // 移除字符串中的方括号和双引号
String trimmedString = hospital.getDepartments().substring(1, hospital.getDepartments().length() - 1).replace("\"", ""); String trimmedString = hospital.getDepartments().substring(1, hospital.getDepartments().length() - 1).replace("\"", "");
...@@ -103,7 +105,7 @@ public class DepartmentServiceImpl implements IDepartmentService { ...@@ -103,7 +105,7 @@ public class DepartmentServiceImpl implements IDepartmentService {
for (String numberString : numberStrings) { for (String numberString : numberStrings) {
integerList.add(Integer.parseInt(numberString)); integerList.add(Integer.parseInt(numberString));
} }
List<DepartmentVo> departments = baseMapper.selectVoList(new LambdaQueryWrapper<Department>().in(Department::getId, integerList)); departments = baseMapper.selectVoList(new LambdaQueryWrapper<Department>().in(Department::getId, integerList));
if (CollectionUtils.isNotEmpty(departments)) { if (CollectionUtils.isNotEmpty(departments)) {
//查询所有菜单 //查询所有菜单
List<DepartmentVo> allMenu = departments; List<DepartmentVo> allMenu = departments;
...@@ -135,6 +137,7 @@ public class DepartmentServiceImpl implements IDepartmentService { ...@@ -135,6 +137,7 @@ public class DepartmentServiceImpl implements IDepartmentService {
} }
return rootMenu; return rootMenu;
} }
}
return departments; return departments;
} }
......
...@@ -98,13 +98,10 @@ public class SysUserServiceImpl implements ISysUserService, UserService { ...@@ -98,13 +98,10 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
private Wrapper<SysUser> buildQueryWrapper(SysUser user) { private Wrapper<SysUser> buildQueryWrapper(SysUser user) {
Map<String, Object> params = user.getParams(); Map<String, Object> params = user.getParams();
QueryWrapper<SysUser> wrapper = Wrappers.query(); QueryWrapper<SysUser> wrapper = Wrappers.query();
List<Integer> u = new ArrayList<>();
u.add(1);
u.add(2);
wrapper.eq("u.del_flag", UserConstants.USER_NORMAL) wrapper.eq("u.del_flag", UserConstants.USER_NORMAL)
.eq(StringUtils.isNotBlank(user.getUserType()), "u.user_type", user.getUserType()) .eq(StringUtils.isNotBlank(user.getUserType()), "u.user_type", user.getUserType())
.eq(ObjectUtil.isNotNull(user.getUserId()), "u.user_id", user.getUserId()) .eq(ObjectUtil.isNotNull(user.getUserId()), "u.user_id", user.getUserId())
.notIn("u.user_id", u) .in("u.user_type", "xcx_user")
.like(StringUtils.isNotBlank(user.getUserName()), "u.user_name", user.getUserName()) .like(StringUtils.isNotBlank(user.getUserName()), "u.user_name", user.getUserName())
.eq(StringUtils.isNotBlank(user.getStatus()), "u.status", user.getStatus()) .eq(StringUtils.isNotBlank(user.getStatus()), "u.status", user.getStatus())
.like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber()) .like(StringUtils.isNotBlank(user.getPhonenumber()), "u.phonenumber", user.getPhonenumber())
...@@ -506,11 +503,6 @@ public class SysUserServiceImpl implements ISysUserService, UserService { ...@@ -506,11 +503,6 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
SysUser sysUser = baseMapper.selectById(userId); SysUser sysUser = baseMapper.selectById(userId);
return Optional.ofNullable(sysUser) return Optional.ofNullable(sysUser)
.map(user -> { .map(user -> {
//普通用户
if (user.getUserType().equals(UserType.XCX_USER.getUserType()) || user.getUserType().equals(UserType.SYS_USER.getUserType())) {
// TODO: 2023/9/19 user.getUserType().equals(UserType.SYS_USER.getUserType()用于目前测试,测试结束清数据时再修改
userIdentityVo.setUserType(1);
} else {
//陪诊员用户 //陪诊员用户
EmployeesVo employeesVo = employeesMapper.selectVoOne(Wrappers.<Employees>lambdaQuery().eq(Employees::getUid, userId)); EmployeesVo employeesVo = employeesMapper.selectVoOne(Wrappers.<Employees>lambdaQuery().eq(Employees::getUid, userId));
if (employeesVo != null) { if (employeesVo != null) {
...@@ -524,9 +516,15 @@ public class SysUserServiceImpl implements ISysUserService, UserService { ...@@ -524,9 +516,15 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
userIdentityVo.setUserType(3); userIdentityVo.setUserType(3);
userIdentityVo.setEmCmId(companyVo.getId()); userIdentityVo.setEmCmId(companyVo.getId());
userIdentityVo.setEmCmStatus(companyVo.getStatus()); userIdentityVo.setEmCmStatus(companyVo.getStatus());
}else {
userIdentityVo.setUserType(1);
} }
} }
} //普通用户
/*if (user.getUserType().equals(UserType.XCX_USER.getUserType()) || user.getUserType().equals(UserType.SYS_USER.getUserType())) {
// TODO: 2023/9/19 user.getUserType().equals(UserType.SYS_USER.getUserType()用于目前测试,测试结束清数据时再修改
userIdentityVo.setUserType(1);
} */
return userIdentityVo; return userIdentityVo;
}) })
.orElseGet(() -> userIdentityVo); .orElseGet(() -> userIdentityVo);
......
...@@ -146,7 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -146,7 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT count(employees.id) as dataSum SELECT count(employees.id) as dataSum
FROM employees FROM employees
left join company on company.id = employees.company_id left join company on company.id = employees.company_id
WHERE employees.`status` = 1 or employees.`status` = 2 WHERE (employees.`status` = 1 or employees.`status` = 2)
<if test="dataViewBo.userId != null"> <if test="dataViewBo.userId != null">
and company.uid = #{dataViewBo.userId} and company.uid = #{dataViewBo.userId}
</if> </if>
......
...@@ -105,13 +105,13 @@ ...@@ -105,13 +105,13 @@
and company.uid = #{dataViewBo.userId} and company.uid = #{dataViewBo.userId}
</if> </if>
<if test="dataViewBo.condition == 2"> <if test="dataViewBo.condition == 2">
and total_order.finish_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) -- 近7天 and total_order.create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) -- 近7天
</if> </if>
<if test="dataViewBo.condition == 3"> <if test="dataViewBo.condition == 3">
and total_order.finish_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) -- 近30天 and total_order.create_time >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) -- 近30天
</if> </if>
<if test="dataViewBo.condition == 1"> <if test="dataViewBo.condition == 1">
and DATE(total_order.finish_time) = CURDATE() and DATE(total_order.create_time) = CURDATE()
</if> </if>
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment