Commit 843613fd by Administrator

Merge branch 'develop' into 'master'

Develop

See merge request 8timerv2/8timerapiv200!451
parents 5153f7c0 a8161011
......@@ -107,5 +107,8 @@ public class KqglAssoDkjl extends Model<KqglAssoDkjl> {
@TableField(exist = false)
private Integer calendar_status_type;//0:无;1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假;11:加班;12:出差;13:外出
@TableField(exist = false)
private String calendar_status_name;
}
\ No newline at end of file
......@@ -890,14 +890,15 @@ public class TimeCardController {
public Result<Object> PunchCardWIFI(@CurrentUser UserBean userBean,@RequestBody KqglAssoDkwx kqglassodkwx) {
List<KqglAssoDkwx> cxwifi = KqglAssoDkwx.builder().build().selectList(new QueryWrapper<KqglAssoDkwx>().lambda().eq(KqglAssoDkwx::getQyid, userBean.getOrgCode()).eq(KqglAssoDkwx::getMac, kqglassodkwx.getMac()));
if(cxwifi.size() > 0) {
if(cxwifi.size() > 0 && kqglassodkwx.getId() == null) {
return ResultUtil.error("此WiFi已存在");
}else {
kqglassodkwx.setLuryid(userBean.getEmpNum());
kqglassodkwx.setLusjTime(new Date().getTime());
kqglassodkwx.setQyid(userBean.getOrgCode());
return kqglassodkwx.insertOrUpdate() ? ResultUtil.success("添加成功!") : ResultUtil.error("添加失败!");
}
kqglassodkwx.setLuryid(userBean.getEmpNum());
kqglassodkwx.setLusjTime(new Date().getTime());
kqglassodkwx.setQyid(userBean.getOrgCode());
return kqglassodkwx.insertOrUpdate() ? ResultUtil.success("添加成功!") : ResultUtil.error("添加失败!");
}
/**
......@@ -1886,6 +1887,8 @@ public class TimeCardController {
Long startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(data,"yyyy-MM-dd")).getTime();
String attdate_ = new SimpleDateFormat("yy-MM-dd").format(Double.valueOf(startDate));//转换打卡时间格式
String punchattdate = new SimpleDateFormat("yyyy-MM-dd").format(Double.valueOf(startDate));//转换打卡时间格式
String minutes = chpunchr.getMinutes();//更改分钟数
KqglAssoBcsz dkbc = kqglassobcszmapper.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, chpunchr.getBcszid()));
......@@ -2024,6 +2027,39 @@ public class TimeCardController {
dkmxid = pcd.getId();
}
double gzsc = 0;
long rest_time = 0;
if(dkbc.getStartTime() != null && dkbc.getEndTime() != null) {
long kaishixiuxi = Long.valueOf(ClockInTool.dateToStamp(punchattdate + " " +dkbc.getStartTime()+":00"));
long jieshuxiuxi = Long.valueOf(ClockInTool.dateToStamp(punchattdate + " " +dkbc.getEndTime()+":00"));
rest_time = (jieshuxiuxi - kaishixiuxi)/1000/60;//休息时间
}
//请假时长
KqglAssoRelationSummary qjsc = kqglassorelationsummarymapper.Businessdayclockin(userBean.getEmpNum(), 2, punchattdate, userBean.getOrgCode());
//计算工作时长
KqglAssoDkmx dkgzsc = KqglAssoDkmx.builder().id(dkmxid).build().selectById();
if(dkgzsc.getYdkcs() == 2 || dkgzsc.getYdkcs() == 4 || dkgzsc.getYdkcs() == 6) {
if(dkgzsc.getSbdk1() != null && dkgzsc.getXbdk1() != null) {
gzsc = gzsc + (dkgzsc.getXbdk1() - dkgzsc.getSbdk1())/1000/60;
}
}
if(dkgzsc.getYdkcs() == 4 || dkgzsc.getYdkcs() == 6) {
if(dkgzsc.getSbdk2() != null && dkgzsc.getXbdk2() != null) {
gzsc = gzsc + (dkgzsc.getXbdk2() - dkgzsc.getSbdk2())/1000/60;
}
}
if(dkgzsc.getYdkcs() == 6) {
if(dkgzsc.getSbdk3() != null && dkgzsc.getXbdk3() != null) {
gzsc = gzsc + (dkgzsc.getXbdk3() - dkgzsc.getSbdk3())/1000/60;
}
}
gzsc = gzsc - rest_time - qjsc.getDuration();
KqglAssoDkmx.builder().id(dkmxid).gzsc(gzsc).build().updateById();
//打卡记录表
clock_time_ = Long.valueOf(ClockInTool.dateToStamp(clock_time));
......@@ -3059,4 +3095,32 @@ public class TimeCardController {
return ResultUtil.data(null,"操作成功!");
}
/**
* 删除考勤机
*/
@DeleteMapping(value = "/attendance/{code}")
@ApiOperation(value = "删除考勤机", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 3)
public Result<Integer> DeleteAttendance(@PathVariable("code") String code) {
KqglAssoKqj kqj = KqglAssoKqj.builder().build().selectOne(new QueryWrapper<KqglAssoKqj>().lambda().eq(KqglAssoKqj::getCode, code));
int kqjid = kqj.getId();
if(KqglAssoKqj.builder().id(kqjid).build().deleteById()) {
KqglAssoYhsb.builder().build().delete(new QueryWrapper<KqglAssoYhsb>().lambda().eq(KqglAssoYhsb::getKqjid, kqjid));
KqglAssoKqjgly.builder().build().delete(new QueryWrapper<KqglAssoKqjgly>().lambda().eq(KqglAssoKqjgly::getKqjid, kqjid));
}
return ResultUtil.data(null,"操作成功!");
}
}
......@@ -32,6 +32,7 @@ import cn.timer.api.controller.kqgl.ClockInTool;
import cn.timer.api.controller.kqgl.EmptyUtil;
import cn.timer.api.dao.kqmk.KqglAssoLeaveBalanceMapper;
import cn.timer.api.dao.kqmk.KqglAssoPbmxMapper;
import cn.timer.api.dao.kqmk.KqglAssoRelationSummaryMapper;
import cn.timer.api.dao.kqmk.KqglMainKqzMapper;
import cn.timer.api.dto.kqmk.AttEvectionApprovalDto;
import cn.timer.api.dto.kqmk.AttLateLate;
......@@ -289,6 +290,9 @@ public class KqglServiceImpl implements KqglService {
@Autowired
private KqglMainKqzMapper kqglmainkqzmapper;
@Autowired
private KqglAssoRelationSummaryMapper kqglassorelationsummarymapper;
/**
* 考勤补卡审批
*/
......@@ -755,6 +759,41 @@ public class KqglServiceImpl implements KqglService {
//attime 应打卡时间
double gzsc = 0;
long rest_time = 0;
if(shif.getStartTime() != null && shif.getEndTime() != null) {
long kaishixiuxi = Long.valueOf(ClockInTool.dateToStamp(cardrepltime + " " +shif.getStartTime()+":00"));
long jieshuxiuxi = Long.valueOf(ClockInTool.dateToStamp(cardrepltime + " " +shif.getEndTime()+":00"));
rest_time = (jieshuxiuxi - kaishixiuxi)/1000/60;//休息时间
}
//请假时长
KqglAssoRelationSummary qjsc = kqglassorelationsummarymapper.Businessdayclockin(repaappr.getUserid(), 2, cardrepltime, repaappr.getOrgcode());
//计算工作时长
KqglAssoDkmx dkgzsc = KqglAssoDkmx.builder().id(dkmxid).build().selectById();
if(dkgzsc.getYdkcs() == 2 || dkgzsc.getYdkcs() == 4 || dkgzsc.getYdkcs() == 6) {
if(dkgzsc.getSbdk1() != null && dkgzsc.getXbdk1() != null) {
gzsc = gzsc + (dkgzsc.getXbdk1() - dkgzsc.getSbdk1())/1000/60;
}
}
if(dkgzsc.getYdkcs() == 4 || dkgzsc.getYdkcs() == 6) {
if(dkgzsc.getSbdk2() != null && dkgzsc.getXbdk2() != null) {
gzsc = gzsc + (dkgzsc.getXbdk2() - dkgzsc.getSbdk2())/1000/60;
}
}
if(dkgzsc.getYdkcs() == 6) {
if(dkgzsc.getSbdk3() != null && dkgzsc.getXbdk3() != null) {
gzsc = gzsc + (dkgzsc.getXbdk3() - dkgzsc.getSbdk3())/1000/60;
}
}
gzsc = gzsc - rest_time - qjsc.getDuration();
KqglAssoDkmx.builder().id(dkmxid).gzsc(gzsc).build().updateById();
KqglAssoDkjl pre = KqglAssoDkjl.builder().dktime(repaappr.getCardrepltime()).results(results).userId(repaappr.getUserid()).type(type).status(status).sort(atttype)
.cardType(0).qyid(repaappr.getOrgcode()).attdate(attdate_+" "+ClockInTool.dateToWeek2(cardrepltime)).attime(attime).dkmxid(dkmxid).bcid(shifid).remarks("审批补卡通过打卡").punchmode(0)
.punchequipment("").commentary("成功打卡").build();
......
......@@ -25,4 +25,7 @@ public interface KqglAssoRelationSummaryMapper extends BaseMapper<KqglAssoRelati
KqglAssoRelationSummary selectTabledata(int userid,int approvaltype,String apptime);
KqglAssoRelationSummary leaveinvesti(int userid,int approvaltype,String apptime,int orgcode);
KqglAssoRelationSummary Businessdayclockin(int userid,int approvaltype,String apptime,int orgcode);
}
......@@ -28,6 +28,8 @@ public class AttSchedule implements Serializable{
private Integer calendar_status_type;//0:无;1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假;11:加班;12:出差;13:外出
private Integer calendar_status_name;
private int isleave;//是否请假
private int isupdate;//是否跟新打卡
private int isdk;//0:当前打卡 1:已过打卡
......
......@@ -44,4 +44,6 @@ public class AttendanceCardListDto implements Serializable {
// private List<SystemShift> ssfh;// 无排班时获取的系统班次
private Integer attgrouptype;// 1:固定排班;2:自由排班;3:自由工时
private List<TransactionApprovalDto> tranappr;//事务审批单
}
package cn.timer.api.dto.kqmk;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Yl123
* 事务审批单
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TransactionApprovalDto {
private Integer calendar_status_type;//0:无;1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假;11:加班;12:出差;13:外出
private Integer approval_form;//审批单
private String calendar_status_name;
}
......@@ -76,7 +76,7 @@
and res.org_code = #{orgcode}
and res.approval_type = #{approvaltype}
and res.app_time = #{apptime}
GROUP BY res.start_time,res.end_time;
GROUP BY res.start_time,res.end_time DESC LIMIT 1
</select>
<select id="selectTabledata" resultMap="BaseResultMap">
......@@ -86,6 +86,15 @@
and res.approval_type = #{approvaltype}
and SUBSTR(res.app_time,1,7) = #{apptime}
</select>
<select id="Businessdayclockin" resultMap="BaseResultMap">
select IFNULL(SUM(res.duration),0) as duration
from kqgl_asso_relation_summary res
where res.user_id = #{userid}
and res.approval_type = #{approvaltype}
and res.app_time = #{apptime}
and res.org_code = #{orgcode}
</select>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoRelationSummary">
......
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