Commit 6d552d65 by Your Name Committed by chenzg

更新了考勤设置数据不全的问题

parent 9beaa760
package cn.timer.api.controller.kqgl; package cn.timer.api.controller.kqgl;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -11,8 +10,8 @@ import java.util.Comparator; ...@@ -11,8 +10,8 @@ import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Set; import java.util.Set;
import java.util.concurrent.locks.ReentrantLock;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -166,6 +165,7 @@ public class AttController { ...@@ -166,6 +165,7 @@ public class AttController {
@Autowired @Autowired
private CalendarAlarmMapper calendaralarmservice; private CalendarAlarmMapper calendaralarmservice;
SimpleDateFormat mat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat mat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat famt = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat famt = new SimpleDateFormat("yyyy-MM-dd");
...@@ -173,6 +173,8 @@ public class AttController { ...@@ -173,6 +173,8 @@ public class AttController {
SimpleDateFormat sdf2 = new SimpleDateFormat("EEE"); SimpleDateFormat sdf2 = new SimpleDateFormat("EEE");
private static ReentrantLock lock= new ReentrantLock();//出现一个页面多次访问一个接口
/*********考勤机***********/ /*********考勤机***********/
...@@ -1237,10 +1239,10 @@ public class AttController { ...@@ -1237,10 +1239,10 @@ public class AttController {
@ApiOperation(value = "", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 33) @ApiOperationSupport(order = 33)
public Result<List<UserAttendanceRel>> getAttUserGroupList(@CurrentUser UserBean userBean,@PathVariable("id") Integer id) { public Result<List<UserAttendanceRel>> getAttUserGroupList(@CurrentUser UserBean userBean,@PathVariable("id") Integer id) {
lock.lock();
int qyid = userBean.getOrgCode();//坏小孩【企业id】 int qyid = userBean.getOrgCode();//坏小孩【企业id】
List<UserAttendanceRel> userattgor = userattendancerelservice.selectAttendanceOfficerByKqzid(id,qyid); List<UserAttendanceRel> userattgor = userattendancerelservice.selectAttendanceOfficerByKqzid(id,qyid);
lock.unlock();
return ResultUtil.data(userattgor); return ResultUtil.data(userattgor);
} }
...@@ -1251,7 +1253,7 @@ public class AttController { ...@@ -1251,7 +1253,7 @@ public class AttController {
@ApiOperation(value = "提醒人员", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "提醒人员", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 34) @ApiOperationSupport(order = 34)
public Result<List<YgglMainEmp>> getAttReminderStaff(@PathVariable("id") Integer id,@CurrentUser UserBean userBean) { public Result<List<YgglMainEmp>> getAttReminderStaff(@PathVariable("id") Integer id,@CurrentUser UserBean userBean) {
lock.lock();
List<YgglMainEmp> yggl = new ArrayList<YgglMainEmp>(); List<YgglMainEmp> yggl = new ArrayList<YgglMainEmp>();
AttendanceGroup attgro = attendancegroupservice.selectByPrimaryKey(id); AttendanceGroup attgro = attendancegroupservice.selectByPrimaryKey(id);
String launchsstr = null; String launchsstr = null;
...@@ -1272,6 +1274,7 @@ public class AttController { ...@@ -1272,6 +1274,7 @@ public class AttController {
yggl.add(txyy); yggl.add(txyy);
} }
} }
lock.unlock();
return ResultUtil.data(yggl); return ResultUtil.data(yggl);
} }
......
...@@ -8,6 +8,7 @@ import java.util.Calendar; ...@@ -8,6 +8,7 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -148,6 +149,7 @@ public class TimeCardController { ...@@ -148,6 +149,7 @@ public class TimeCardController {
@Value("${config-8timer.machine8timerUrl}") @Value("${config-8timer.machine8timerUrl}")
public String mac_command; // 回调地址 public String mac_command; // 回调地址
@Autowired @Autowired
private KqglAssoBcszMapper kqglassobcszmapper; private KqglAssoBcszMapper kqglassobcszmapper;
@Autowired @Autowired
...@@ -159,6 +161,7 @@ public class TimeCardController { ...@@ -159,6 +161,7 @@ public class TimeCardController {
@Autowired @Autowired
private UserAttendanceRelMapper userattendancerelmapper; private UserAttendanceRelMapper userattendancerelmapper;
private static ReentrantLock lock= new ReentrantLock();
/** /**
* 查询列表-获取班次数据-分页 * 查询列表-获取班次数据-分页
*/ */
...@@ -1203,19 +1206,14 @@ public class TimeCardController { ...@@ -1203,19 +1206,14 @@ public class TimeCardController {
@ApiOperation(value = "38:获取员工数据-根据 组织机构代码", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "38:获取员工数据-根据 组织机构代码", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 38) @ApiOperationSupport(order = 38)
public Result<Object> getEmployeeData(@CurrentUser UserBean userBean) { public Result<Object> getEmployeeData(@CurrentUser UserBean userBean) {
lock.lock();
List<YgglMainEmp> yggl = YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).ne(YgglMainEmp::getJobStatus, "3")); List<YgglMainEmp> yggl = YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).ne(YgglMainEmp::getJobStatus, "3"));
lock.unlock();
return ResultUtil.data(yggl); return ResultUtil.data(yggl);
} }
/**
* 成员设置数据
*/
@GetMapping(value="/EmployeeNum")
@ApiOperation(value = "38.1:成员设置数据-根据 组织机构代码", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 38)
public Result<Object> getEmployeeNum(@CurrentUser UserBean userBean) {
List<YgglMainEmp> yggl = YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).ne(YgglMainEmp::getJobStatus, "3"));
return ResultUtil.data(yggl);
}
//用户与设备关系表 //用户与设备关系表
@Autowired @Autowired
...@@ -1510,7 +1508,7 @@ public class TimeCardController { ...@@ -1510,7 +1508,7 @@ public class TimeCardController {
return ResultUtil.data(usatt); return ResultUtil.data(usatt);
} }
// @SuppressWarnings("all") // @SuppressWarnings("all")
@PostMapping(value = "/setmembers") @PostMapping(value = "/setmembers")
@ApiOperation(value = "考勤设置成员", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "考勤设置成员", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> Attsetmembers(@CurrentUser UserBean userBean,@RequestBody AttMemberSettings attsetuser) { public Result<Object> Attsetmembers(@CurrentUser UserBean userBean,@RequestBody AttMemberSettings attsetuser) {
......
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