Commit 5256087f by lal Committed by chenzg

提交

parent 260d2472
......@@ -19,4 +19,5 @@ public class UserAttendanceRel implements Serializable{
private Integer qyid;
private String empnum;
private String empname;
}
\ No newline at end of file
......@@ -12,7 +12,6 @@ import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -32,19 +31,15 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.kqgl.AttCalendarAlarm;
import cn.timer.api.bean.kqgl.AttClockMethod;
import cn.timer.api.bean.kqgl.AttConditions;
......@@ -75,8 +70,6 @@ import cn.timer.api.bean.kqgl.ShiftDetails;
import cn.timer.api.bean.kqgl.ShiftManagement;
import cn.timer.api.bean.kqgl.SpecialDate;
import cn.timer.api.bean.kqgl.SystemShift;
import cn.timer.api.bean.kqgl.TBlFkcmdTrans;
import cn.timer.api.bean.kqgl.TBlFkcmdTransCmdParam;
import cn.timer.api.bean.kqgl.UserAttendanceRel;
import cn.timer.api.bean.kqgl.UserEquiRelation;
import cn.timer.api.bean.yggl.YgglMainEmp;
......@@ -88,7 +81,6 @@ import cn.timer.api.dao.kqgl.AttendanceGroupMapper;
import cn.timer.api.dao.kqgl.AttendanceMachineMapper;
import cn.timer.api.dao.kqgl.AttendanceWeeklySchMapper;
import cn.timer.api.dao.kqgl.CalendarAlarmMapper;
import cn.timer.api.dao.kqgl.KqglAssoKqjglyMapper;
import cn.timer.api.dao.kqgl.PunchCardAddressMapper;
import cn.timer.api.dao.kqgl.PunchCardDetailsMapper;
import cn.timer.api.dao.kqgl.PunchCardWiFiMapper;
......@@ -98,15 +90,11 @@ import cn.timer.api.dao.kqgl.ShiftManagementMapper;
import cn.timer.api.dao.kqgl.SpecialDateMapper;
import cn.timer.api.dao.kqgl.UserAttendanceRelMapper;
import cn.timer.api.dao.kqgl.UserEquiRelationMapper;
import cn.timer.api.dao.kqjg.KqjgRealtimeEnrollDataMapper;
import cn.timer.api.dao.kqmk.KqglMainKqzMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dto.kqgl.AttemacDto;
import cn.timer.api.dto.kqgl.MachinememberDto;
import cn.timer.api.dto.kqmk.AttqueryCriteriaDto;
import cn.timer.api.dto.kqmk.KqglMainKqzDto;
import cn.timer.api.utils.DateUtil;
import cn.timer.api.utils.ResponseResult;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
......@@ -156,16 +144,10 @@ public class AttController {
//打卡明细表
@Autowired
private PunchCardDetailsMapper punchcarddetailsservice;
//用户与设备关系表
@Autowired
private UserEquiRelationMapper userequirelationmapper;
@Autowired
private YgglMainEmpMapper ygglmainempmapper;
@Autowired
private SpecialDateMapper specialdateservice;
//日历提醒
......@@ -187,9 +169,7 @@ public class AttController {
@ApiOperationSupport(order = 1)
public Result<PageInfo<ShiftManagement>> getShiftDataList(@CurrentUser UserBean userBean,@ApiParam("当前页") @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
@ApiParam("每页条数") @RequestParam(value = "pageSize", required = false, defaultValue = "9999") Integer pageSize) {
int qyid = userBean.getOrgCode();//坏小孩【企业id】
PageHelper.startPage(pageNum, pageSize);
List<ShiftManagement> shiftList = shiftmanagementservice.selectByPrimaryByQyid(qyid);
PageInfo<ShiftManagement> pageInfo = new PageInfo<>(shiftList);
......@@ -203,7 +183,6 @@ public class AttController {
@ApiOperation(value = "新增班次信息", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 2)
public Result<ShiftManagement> ShiftInformation(@CurrentUser UserBean userBean,@RequestBody ShiftManagement shif) {
// int qyid = 2000021;//坏小孩123【企业id】
int qyid = userBean.getOrgCode();//坏小孩【企业id】
int userid = userBean.getEmpNum();//用户id
......@@ -1535,38 +1514,20 @@ public class AttController {
}
userequirelationmapper.insert(uskqj);
}
Integer orgCode = userBean.getOrgCode();
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code", orgCode).eq("emp_num", attser[u]);
YgglMainEmp yggluser = YgglMainEmp.builder().build().selectOne(queryWrapper);
user_id=attser[u];//
user_name=yggluser.getName();//
DevId=kqj.getCode();//考勤机--设备编码
if(user_id == null || DevId == null){
try {
throw new Exception("User_ID or DevId is null");
} catch (Exception e) {
e.printStackTrace();
}
}
if(user_name == null){
user_name = "";
}
JSONObject vResultJson = new JSONObject();
vResultJson.put("user_id", user_id);
vResultJson.put("user_name", user_name);
vResultJson.put("user_privilege", "USER");
String sFinal = vResultJson.toString();
String url = StaticVariable.mac_command;
YgglMainEmp yggluser = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getEmpNum, attser[u]));
String url = StaticVariable.mac_command+"/addUserName";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("cmd", "SET_USER_INFO");
params.add("devid", DevId);
params.add("json", sFinal);
params.add("devId", kqj.getCode());
params.add("userId", attser[u]);
params.add("userName", yggluser.getName());
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
System.out.println("|============修改(新增)=================== |");
System.err.print(request.getBody());
}
/*****************************************************************************/
}
......@@ -5022,53 +4983,53 @@ public class AttController {
/**
* 考勤机一键同步
*/
@GetMapping(value="/synchroni/{id}")
@ApiOperation(value = "考勤机一键同步", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 54)
public Result<AttemacDto> synchroni(@CurrentUser UserBean userBean,@PathVariable("id") Integer id) {
Integer orgCode = userBean.getOrgCode();
List<UserAttendanceRel> member = userattendancerelservice.selectAttNotMember(id,orgCode);
AttendanceMachine kqj = attendancemachineservice.selectByPrimaryKey(id);//查询考勤机“序列号”
for(UserAttendanceRel usmer:member) {
YgglMainEmp user = new LambdaQueryChainWrapper<YgglMainEmp>(ygglmainempmapper).eq(YgglMainEmp::getEmpNum, usmer.getUserid())
.eq(YgglMainEmp::getOrgCode, orgCode).one();
JSONObject vResultJson = new JSONObject();
vResultJson.put("user_id", usmer.getUserid());
vResultJson.put("user_name", user.getName());
vResultJson.put("user_privilege", "USER");
String sFinal = vResultJson.toString();
String url = StaticVariable.mac_command;
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("cmd", "SET_USER_INFO");
params.add("devid", kqj.getCode());
params.add("json", sFinal);
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
//用户与设备关系(考勤机id-->用户id)
UserEquiRelation uskqj = new UserEquiRelation();
uskqj.setUserId(usmer.getUserid());//用户id
uskqj.setKqjid(kqj.getId());//设备id
uskqj.setType(1);//类型(类型 1:考勤机)
uskqj.setIsGly(0);
userequirelationmapper.insert(uskqj);
}
return ResultUtil.success("成功");
}
// @GetMapping(value="/synchroni/{id}")
// @ApiOperation(value = "考勤机一键同步", httpMethod = "GET", notes = "接口发布说明")
// @ApiOperationSupport(order = 54)
// public Result<AttemacDto> synchroni(@CurrentUser UserBean userBean,@PathVariable("id") Integer id) {
// Integer orgCode = userBean.getOrgCode();
//
// List<UserAttendanceRel> member = userattendancerelservice.selectAttNotMember(id,orgCode);
//
// AttendanceMachine kqj = attendancemachineservice.selectByPrimaryKey(id);//查询考勤机“序列号”
//
// for(UserAttendanceRel usmer:member) {
//
// YgglMainEmp user = new LambdaQueryChainWrapper<YgglMainEmp>(ygglmainempmapper).eq(YgglMainEmp::getEmpNum, usmer.getUserid())
// .eq(YgglMainEmp::getOrgCode, orgCode).one();
//
// JSONObject vResultJson = new JSONObject();
// vResultJson.put("user_id", usmer.getUserid());
// vResultJson.put("user_name", user.getName());
// vResultJson.put("user_privilege", "USER");
// String sFinal = vResultJson.toString();
//
// String url = StaticVariable.mac_command;
// HttpHeaders headers = new HttpHeaders();
// MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
// params.add("cmd", "SET_USER_INFO");
// params.add("devid", kqj.getCode());
// params.add("json", sFinal);
// RestTemplate restTemplate = new RestTemplate();
// HttpEntity httpEntity = new HttpEntity(params, headers);
// ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
//
//
//
// //用户与设备关系(考勤机id-->用户id)
// UserEquiRelation uskqj = new UserEquiRelation();
// uskqj.setUserId(usmer.getUserid());//用户id
// uskqj.setKqjid(kqj.getId());//设备id
// uskqj.setType(1);//类型(类型 1:考勤机)
// uskqj.setIsGly(0);
//
// userequirelationmapper.insert(uskqj);
//
// }
//
// return ResultUtil.success("成功");
// }
//
/**
* 获取报表汇总
*/
......
......@@ -1005,6 +1005,7 @@ public class TimeCardController {
.isDqtx(attass.getAttRemind()).txry(String.join(",",attass.getAttRemindUserids())).txfs(attass.getAdvanceDays()).txxhts(attass.getRemCycleDays())
.txsjTime(attass.getReminderTime()).tsfs(String.join(",",attass.getPromptingMode())).isWpbsdk(attass.getAttRemind()).kqkssjTime(attass.getNewAttTime())
.zsgzsc(attass.getLeastworkTime()).zcgzsc(attass.getNormalWorkTime()).jbzdsc(attass.getMaxOvertimeTime()).overtimeRulesId(attass.getOvertimeRulesId()).build();
// if (!attgro.insertOrUpdate())
if (!attgro.insert())
return ResultUtil.error("操作失败--新增考勤组");
......@@ -1012,6 +1013,9 @@ public class TimeCardController {
Integer attid = attgro.getId();
Console.log("新增--考勤组id: " + attid);
//添加加班规则
KqglAssoOvertimeRange.builder().overtimeRulesId(attass.getOvertimeRulesId()).attgroupId(attid).build().insert();
List<KqglAssoKqzdkfs> kqzdkfslist = new ArrayList<KqglAssoKqzdkfs>();
String[] attmac = attass.getAttmachines();//考勤机
if(attmac.length>0){
......@@ -1885,6 +1889,19 @@ public class TimeCardController {
}
/**
* 获取考勤组所需加班规则
*/
@GetMapping(value="/attovertimerules")
@ApiOperation(value = "获取考勤组所需加班规则", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 15)
public Result<Object> getAttOvertimeRules(@CurrentUser UserBean userBean){
List<KqglAssoOvertimeRules> attoverrul = new LambdaQueryChainWrapper<KqglAssoOvertimeRules>(kqglassoovertimerulesmapper).eq(KqglAssoOvertimeRules::getOrgCode, userBean.getOrgCode()).list();
return ResultUtil.data(attoverrul,"操作成功!");
}
// @GetMapping(value = "/summary_report")
// @ApiOperation(value = "考勤汇总报表(暂时不用)", httpMethod = "GET", notes = "接口发布说明")
// public Result<Object> attendance_summary_report() {
......
......@@ -8,6 +8,7 @@
<result column="qyid" property="qyid" jdbcType="INTEGER" />
<result column="empnum" property="empnum" jdbcType="VARCHAR" />
<result column="empname" property="empname" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, kqzid, userid, qyid
......@@ -107,7 +108,8 @@
<select id="selectAttendanceOfficerByKqzid" resultMap="BaseResultMap">
select yhkqz.*,
us.emp_num as empnum
us.emp_num as empnum,
us.name as empname
from kqgl_asso_yhkqz yhkqz
LEFT JOIN yggl_main_emp as us on us.emp_num = yhkqz.userid and us.org_code = #{orgcode}
where yhkqz.kqzid = #{kqzid,jdbcType=INTEGER}
......
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