|
@@ -53,8 +53,6 @@ public class CompanyController {
|
|
@Resource
|
|
@Resource
|
|
private ExpenseMainTypeService expenseMainTypeService;
|
|
private ExpenseMainTypeService expenseMainTypeService;
|
|
|
|
|
|
- public static final HashMap<String, Long> syncLog = new HashMap();
|
|
|
|
-
|
|
|
|
@RequestMapping("/getStaffCountMax")
|
|
@RequestMapping("/getStaffCountMax")
|
|
public HttpRespMsg getStaffCountMax(Integer companyId){
|
|
public HttpRespMsg getStaffCountMax(Integer companyId){
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
@@ -84,35 +82,6 @@ public class CompanyController {
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
String token = request.getHeader("TOKEN");
|
|
String token = request.getHeader("TOKEN");
|
|
User user = userMapper.selectById(token);
|
|
User user = userMapper.selectById(token);
|
|
- /*//判断时间
|
|
|
|
- long now = System.currentTimeMillis();
|
|
|
|
- if (syncLog.get(token) == null) {
|
|
|
|
- syncLog.put(token, now);
|
|
|
|
- syncLog.put(user.getCompanyId()+"_status", 1L);
|
|
|
|
- } else {
|
|
|
|
- if (now - syncLog.get(token) < 30*1000) {
|
|
|
|
- //msg.setError("调用过于频繁,请稍后再试");
|
|
|
|
- msg.setError(MessageUtils.message("Company.callError"));
|
|
|
|
- return msg;
|
|
|
|
- } else {
|
|
|
|
- //检查是否当前公司有同步的正在进行
|
|
|
|
- if (syncLog.get(user.getCompanyId()+"_status") == null) {
|
|
|
|
- //没有进行中的任务,更新最近同步的时间
|
|
|
|
- syncLog.put(token, now);
|
|
|
|
- syncLog.put(user.getCompanyId()+"_status", 1L);
|
|
|
|
- } else {
|
|
|
|
- if (now - syncLog.get(token) > 0.5*3600*1000) {
|
|
|
|
- //更新最近同步的时间
|
|
|
|
- syncLog.put(token, now);
|
|
|
|
- } else {
|
|
|
|
- //msg.setError("同步正在进行中,请稍后再试");
|
|
|
|
- msg.setError(MessageUtils.message("Company.synError"));
|
|
|
|
- return msg;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }*/
|
|
|
|
-
|
|
|
|
Company company = companyMapper.selectOne(new QueryWrapper<Company>().eq("id", user.getCompanyId()));
|
|
Company company = companyMapper.selectOne(new QueryWrapper<Company>().eq("id", user.getCompanyId()));
|
|
Integer employeeCnt = userMapper.selectCount(new QueryWrapper<User>().eq("company_id", company.getId()).eq("is_active",1));
|
|
Integer employeeCnt = userMapper.selectCount(new QueryWrapper<User>().eq("company_id", company.getId()).eq("is_active",1));
|
|
if (employeeCnt > company.getStaffCountMax()){
|
|
if (employeeCnt > company.getStaffCountMax()){
|