Commit b5604af9 authored by nie'hong's avatar nie'hong

mapper参数注解

parent 88fb91cc
......@@ -44,7 +44,7 @@ public enum BASE_RESP_CODE_ENUM {
THE_USER_NOT_MANAGER_PLASE_MANAGER_LOGIN("623", "您不是管理员,请登录管理员账号"),
DEPT_NOT_HAVE_USER("624", "该部门下没有人员"),
PROJECT_NOT_HAVE_USER("624", "该部门下没有项目"),
USER_PHONE_IS_ERROR("625", "用户名/手机号不正确"),
USER_LOGIN_NAME_OR_PASSWORD_IS_ERROR("625", "用户名或密码不正确"),
DELETE_OLD_WORK_ORDER_FAIL("626","删除旧工单数据失败"),
WORK_DAY_THAN_DATE("627","填报的日期超过系统默认日期"),
DES_NOT_NULL("628","工作简述不能为空"),
......
......@@ -25,9 +25,8 @@
dept_name, create_time, modify_time
</sql>
<!-- 通用查询结果列 -->
<sql id="criteria">
<if test="id != null">AND id = #{id}</if>
<if test="deptName != null">AND dept_name = #{deptName}</if>
<if test="centreId != null">AND centre_id = #{centreId}</if>
<if test="managerId != null">AND manager_id = #{managerId}</if>
......@@ -35,7 +34,7 @@
<if test="modifyTime != null">AND modify_time = #{modifyTime}</if>
</sql>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, oa_dept_id, dept_name, create_time, modify_time
</sql>
......
......@@ -59,6 +59,7 @@
<if test="oaUserId != null">and oa_user_id = #{oaUserId}</if>
<if test="name != null">and name = #{name}</if>
<if test="loginName != null">and login_name = #{loginName}</if>
<if test="password != null">and password = #{password}</if>
<if test="phone != null">and phone =#{phone}</if>
<if test="deptId != null">and dept_id = #{deptId}</if>
<if test="email != null">and email = #{email}</if>
......
......@@ -177,7 +177,9 @@ public class StatisticsServiceImpl implements StatisticsService {
currentMonthWorkDays.removeAll(currentMonthFilledDays);
int notFilledCount = currentMonthWorkDays.size();
//本月被现存驳回数
map.clear();
map.put("status", 3);
map.put("userId", userId);
map.put("startDay", firstDayOfMonth);
Integer countByCondition = workTimeOrderMapper.getCountByCondition(map);
String currentDayOfMonth = DateUtil.convertDateToYMDStr(firstDayOfMonth);
......
......@@ -135,12 +135,10 @@ public class WorkProjectServiceImpl implements WorkProjectService {
//项目级别查询项目管理员为用户的项目
if (user.getLevel().equals(ManagerEnum.IS_PROJECT_DIRECTOR.getCode())) {
map.put("managerId", userId);
workProjects = workProjectMapper.getProjectsByCriteria(map);
}
//用户是部门级别,查询该部门下的所有项目
if (user.getLevel().equals(ManagerEnum.IS_DEPARTMENT_DIRECTOR.getCode())) {
map.put("deptId", user.getDeptId());
workProjects = workProjectMapper.getProjectsByCriteria(map);
}
//中心级别的用户查看中心下所有部门的所有项目
if (user.getLevel().equals(ManagerEnum.IS_CENTRE_DIRECTOR.getCode())) {
......@@ -159,9 +157,8 @@ public class WorkProjectServiceImpl implements WorkProjectService {
List<Integer> deptIds = workDepts.stream().map(WorkDept::getId).collect(Collectors.toList());
map.clear();
map.put("deptIds", deptIds);
workProjects = workProjectMapper.getProjectsByCriteria(map);
}
workProjects = workProjectMapper.getProjectsByCriteria(map);
return workProjects;
}
......
......@@ -103,7 +103,7 @@ public class WorkUserServiceImpl implements WorkUserService {
map.put("password", md5Password);
WorkUser user = workUserMapper.getUserInfo(map);
if (null == user) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.USER_PHONE_IS_ERROR);
throw new BaseCustomException(BASE_RESP_CODE_ENUM.USER_LOGIN_NAME_OR_PASSWORD_IS_ERROR);
}
//如果登录来源是PC,判断用户是不是管理员
if (LOGIN_SOURCE.equals(source)) {
......
......@@ -2,6 +2,7 @@ package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.common.utils.exception.BASE_RESP_CODE_ENUM;
import cn.wisenergy.common.utils.exception.BaseCustomException;
import cn.wisenergy.common.utils.exception.Result;
import cn.wisenergy.model.app.WorkDept;
import cn.wisenergy.model.dto.GetMonthlyCollectParam;
import cn.wisenergy.model.dto.WorkTimeAndCostCollect;
......@@ -65,4 +66,16 @@ public class StatisticsController extends BaseController {
return currentMonthWorkTimeCollect;
}
@ApiOperation(value = "获取本月工时统计和审核统计", notes = "获取本月",httpMethod = "GET")
@ApiImplicitParam(name = "userId", value = "用户主键",dataType = "int", required = true)
@GetMapping("/getMonthlyWorkingHours")
public Result<List<Object>> getMonthlyWorkingHours(Integer userId){
log.info("WorkOrderController[]getMonthlyWorkingHours[]input.param" + userId);
if (userId == null) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL);
}
List<Object> monthlyStatistics = statisticsService.getMonthlyStatistics(userId);
return getResult(monthlyStatistics);
}
}
......@@ -16,8 +16,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @description:
* @author: nh
......@@ -78,17 +76,5 @@ public class WorkUserController extends BaseController {
}
@ApiOperation(value = "获取本月工时统计和审核统计", notes = "获取本月",httpMethod = "GET")
@ApiImplicitParam(name = "userId", value = "用户主键",dataType = "int", required = true)
@GetMapping("/getMonthlyWorkingHours")
public Result<List<Object>> getMonthlyWorkingHours(Integer userId){
log.info("WorkOrderController[]getMonthlyWorkingHours[]input.param" + userId);
if (userId == null) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL);
}
List<Object> monthlyStatistics = statisticsService.getMonthlyStatistics(userId);
return getResult(monthlyStatistics);
}
}
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