Commit 09d52492 authored by 赵啸非's avatar 赵啸非

添加申诉统计业务

parent d3f9ec47
......@@ -21,6 +21,11 @@ import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.base.system.valid.service.ValidCodeService;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.pdu.HomeStatInfo;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
......@@ -30,6 +35,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;
import java.util.Set;
......@@ -56,22 +62,15 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
@Autowired
private IAuthTokenService authTokenService;
@Autowired
private StaffService staffService;
@Autowired
private DeptService deptService;
@RequestMapping("login")
public String login(@RequestBody LoginForm loginForm) throws Exception {
/*
JSONObject ret = new JSONObject();
String loginName = loginForm.getLoginName();
String password = loginForm.getPassword();
UserPdu userPdu = new UserPdu();
userPdu.setLoginName(loginName);
userPdu.setPassword(password);
String resp = userFeign.portalLogin(userPdu);
return resp;
*/
JSONObject ret = new JSONObject();
String loginName = loginForm.getLoginName();
String password = loginForm.getPassword();
......@@ -149,8 +148,20 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
currUserName = "管理员";
}
JSONObject data = new JSONObject();
String token = authTokenService.getToken(request);
HomeStatInfo homeStatInfo = new HomeStatInfo();
int totalPersonNum = staffService.count(new StaffQuery(), this.getContext());
homeStatInfo.setTotalPersonNum(totalPersonNum);
int totalDeptNum = deptService.count(new DeptQuery(), getContext());
homeStatInfo.setTotalDeptNum(totalDeptNum);
//todo
homeStatInfo.setAttendRadio(new BigDecimal(91.00));
homeStatInfo.setLevealPersonNum(10);
data.put("homeStat", homeStatInfo);
data.put("token", token);
data.put("currUserName", currUserName);
data.put("barList", outlookBarList);
......
package com.mortals.xhx.common.pdu;
import lombok.Data;
import java.math.BigDecimal;
/**
* 首页统计
* @author:
* @date: 2023/7/13 15:09
*/
@Data
public class HomeStatInfo {
private Integer totalPersonNum;
private Integer totalDeptNum;
private Integer attendPersonNum;
private BigDecimal attendRadio;
//请假人数
private Integer levealPersonNum;
}
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