Commit 35995999 by ilal Committed by chenzg

提交考勤组 休息日打卡

parent ddedd908
......@@ -52,4 +52,6 @@ public class AttendanceAssistant implements Serializable{
int overtimeRulesId;//加班id
int fieldpersonnel;//外勤
int restdayclock;//休息日打卡
}
......@@ -46,6 +46,8 @@ public class AttendanceGroup implements Serializable{
private Integer overtimeRulesId;//加班规则id
private String overtimeRulesName;//加班规则名称
private Integer restdayclock;//休息日打卡
private Integer kqjid;
private List<AttGroupBinPunchMode> kqzdkfslist = new ArrayList<AttGroupBinPunchMode>();
......
......@@ -96,5 +96,8 @@ public class KqglMainKqz extends Model<KqglMainKqz> {
@ApiModelProperty(value="加班规则 加班规则",example="101")
private Integer overtimeRulesId;
@ApiModelProperty(value="休息日打卡开关 0:关 1:开",example="101")
private Integer restdayclock;
}
\ No newline at end of file
......@@ -1361,6 +1361,8 @@ public class AttController {
attgro.setIsWq(attass.getFieldpersonnel());//外勤:0-关 1-开
attgro.setRestdayclock(attass.getRestdayclock());//休息日打卡
if(attass.getAtttype() == 1){
attgro.setIsFdjjr(attass.getLegalholidays());//是否开启法定节假日休息(固定排班)
}
......
......@@ -2296,88 +2296,94 @@ public class ClockInController {
status_ = 2;
}
}else {
// msg = "当前是休息时间";
// sbyf = 0;
// status_ = 2;
KqglAssoDkmx zydkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
.ge(KqglAssoDkmx::getDksj, startDate).le(KqglAssoDkmx::getDksj, endDate));
if(zydkmc == null) {//新增
KqglAssoDkmx pcd = KqglAssoDkmx.builder().build();
//判断 考勤组是否开启休息日打卡
if(attgro.getRestdayclock().equals(0)) {
msg = "当前是休息时间";
sbyf = 0;
status_ = 2;
}else {
pcd = KqglAssoDkmx.builder().userid(userid).data(putime).sbdk1(time_).sbdk1jg(0).ydkcs(0).qyid(qyid).dksj(startDate).yzcdcs(0).yzcdsc(Double.valueOf(0)).kgcdfzs(0).build();
if (!pcd.insert()) {
throw new CustomException("打卡明细-新增异常-1");
}
dkmx = pcd.getId();
atttype = 1;
xiuxidaka = 1;
}else {//修改
dkmx = zydkmc.getId();
KqglAssoDkmx zypcd = KqglAssoDkmx.builder().build();
kskd = false;
if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() == null)){//下班1
zypcd.setId(zydkmc.getId());
zypcd.setXbdk1(time_);//下班1打卡时间
if(zydkmc.getSbdk1() != null){
Long time = (time_ - zydkmc.getSbdk1())/1000/60;
zypcd.setGzsc(Math.abs(Double.valueOf(time.toString())));//只打一次卡时计算工作时长
}
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 2;
xiuxidaka = 1;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() == null)){//上班2
zypcd.setId(zydkmc.getId());
zypcd.setSbdk2(time_);//上班1打卡时间
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 3;
xiuxidaka = 1;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() == null)){//下班2
KqglAssoDkmx zydkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
.ge(KqglAssoDkmx::getDksj, startDate).le(KqglAssoDkmx::getDksj, endDate));
if(zydkmc == null) {//新增
KqglAssoDkmx pcd = KqglAssoDkmx.builder().build();
zypcd.setId(zydkmc.getId());
zypcd.setXbdk2(time_);//下班1打卡时间
//班次为4次时,计算工作时长
if(zydkmc.getSbdk2() != null){
Long time = (time_ - zydkmc.getSbdk2())/1000/60;
BigDecimal om = new BigDecimal(zydkmc.getGzsc());
BigDecimal on = new BigDecimal(time);
double worktime = Math.abs(om.add(on).doubleValue());
zypcd.setGzsc(worktime);
}
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 4;
xiuxidaka = 1;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (!("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() != null)
&& (("").equals(zydkmc.getSbdk3()) || zydkmc.getSbdk3() == null)){//上班3
zypcd.setId(zydkmc.getId());
zypcd.setSbdk3(time_);//上班1打卡时间
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 5;
pcd = KqglAssoDkmx.builder().userid(userid).data(putime).sbdk1(time_).sbdk1jg(0).ydkcs(0).qyid(qyid).dksj(startDate).yzcdcs(0).yzcdsc(Double.valueOf(0)).kgcdfzs(0).build();
if (!pcd.insert()) {
throw new CustomException("打卡明细-新增异常-1");
}
dkmx = pcd.getId();
atttype = 1;
xiuxidaka = 1;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (!("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() != null)
&& (!("").equals(zydkmc.getSbdk3()) || zydkmc.getSbdk3() != null) && (("").equals(zydkmc.getXbdk3()) || zydkmc.getXbdk3() == null)){
}else {//修改
dkmx = zydkmc.getId();
KqglAssoDkmx zypcd = KqglAssoDkmx.builder().build();
kskd = false;
if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() == null)){//下班1
zypcd.setId(zydkmc.getId());
zypcd.setXbdk1(time_);//下班1打卡时间
if(zydkmc.getSbdk1() != null){
Long time = (time_ - zydkmc.getSbdk1())/1000/60;
zypcd.setGzsc(Math.abs(Double.valueOf(time.toString())));//只打一次卡时计算工作时长
}
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 2;
xiuxidaka = 1;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() == null)){//上班2
zypcd.setId(zydkmc.getId());
zypcd.setSbdk2(time_);//上班1打卡时间
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 3;
xiuxidaka = 1;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() == null)){//下班2
zypcd.setId(zydkmc.getId());
zypcd.setXbdk2(time_);//下班1打卡时间
//班次为4次时,计算工作时长
if(zydkmc.getSbdk2() != null){
Long time = (time_ - zydkmc.getSbdk2())/1000/60;
BigDecimal om = new BigDecimal(zydkmc.getGzsc());
BigDecimal on = new BigDecimal(time);
double worktime = Math.abs(om.add(on).doubleValue());
zypcd.setGzsc(worktime);
}
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 4;
xiuxidaka = 1;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (!("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() != null)
&& (("").equals(zydkmc.getSbdk3()) || zydkmc.getSbdk3() == null)){//上班3
zypcd.setId(zydkmc.getId());
zypcd.setSbdk3(time_);//上班1打卡时间
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 5;
xiuxidaka = 1;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (!("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() != null)
&& (!("").equals(zydkmc.getSbdk3()) || zydkmc.getSbdk3() != null) && (("").equals(zydkmc.getXbdk3()) || zydkmc.getXbdk3() == null)){
zypcd.setId(zydkmc.getId());
zypcd.setXbdk3(time_);//下班1打卡时间
//班次为6次时,计算工作时长
if(zydkmc.getSbdk3() != null){
Long time = (time_ - zydkmc.getSbdk3())/1000/60;
BigDecimal om = new BigDecimal(zydkmc.getGzsc());//第二次
BigDecimal on = new BigDecimal(time);
double worktime = Math.abs(om.add(on).doubleValue());
zypcd.setGzsc(worktime);
}
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 6;
xiuxidaka = 1;
}else {
atttype = 7;
xiuxidaka = 1;
}
zypcd.setId(zydkmc.getId());
zypcd.setXbdk3(time_);//下班1打卡时间
//班次为6次时,计算工作时长
if(zydkmc.getSbdk3() != null){
Long time = (time_ - zydkmc.getSbdk3())/1000/60;
BigDecimal om = new BigDecimal(zydkmc.getGzsc());//第二次
BigDecimal on = new BigDecimal(time);
double worktime = Math.abs(om.add(on).doubleValue());
zypcd.setGzsc(worktime);
}
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 6;
xiuxidaka = 1;
}else {
atttype = 7;
xiuxidaka = 1;
}
}
......
......@@ -1309,7 +1309,8 @@ public class TimeCardController {
.isWq(attass.getFieldpersonnel()).isFdjjr(attass.getLegalholidays()).isXzbcdk(attass.getOptscheduling()).sybc(String.join(",",attass.getAttShifts()))
.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();
.zsgzsc(attass.getLeastworkTime()).zcgzsc(attass.getNormalWorkTime()).jbzdsc(attass.getMaxOvertimeTime()).overtimeRulesId(attass.getOvertimeRulesId())
.restdayclock(attass.getRestdayclock()).build();
// if (!attgro.insertOrUpdate())
if (!attgro.insert())
......
......@@ -54,4 +54,6 @@ public class AttendanceAssistantDto implements Serializable{
int overtimeRulesId;//加班id
int fieldpersonnel;//外勤
int restdayclock;//休息日打卡
}
......@@ -80,6 +80,9 @@ public class KqglMainKqzDto {
@ApiModelProperty(value="加班规则 加班规则",example="101")
private Integer overtimeRulesId;
@ApiModelProperty(value="休息日打卡开关 0:关 1:开",example="101")
private Integer restdayclock;
@ApiModelProperty(value = "考勤组人员数", example = "100")
......
......@@ -33,6 +33,8 @@
<result column="overtimeRulesName" property="overtimeRulesName" />
<result column="restdayclock" property="restdayclock" />
<collection property="kqzdkfslist" ofType="cn.timer.api.bean.kqgl.AttGroupBinPunchMode">
<result column="kqzId" property="kqzId" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="INTEGER" />
......@@ -95,7 +97,7 @@
<sql id="Base_Column_List" >
id, name, kqbz, pbfs, qyid, is_fdjjr, kqkssj_time, zsgzsc, zcgzsc, jbzdsc, is_dqtx,
txry, txfs, txxhts, txsj_time, tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq,overtime_rules_id
txry, txfs, txxhts, txsj_time, tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq,overtime_rules_id,restdayclock
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select kqz.*,
......@@ -113,14 +115,14 @@
kqkssj_time, zsgzsc, zcgzsc,
jbzdsc, is_dqtx, txry,
txfs, txxhts, txsj_time,
tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq)
tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq,restdayclock)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{kqbz,jdbcType=VARCHAR},
#{pbfs,jdbcType=INTEGER}, #{qyid,jdbcType=INTEGER}, #{isFdjjr,jdbcType=INTEGER},
#{kqkssjTime,jdbcType=VARCHAR}, #{zsgzsc,jdbcType=VARCHAR}, #{zcgzsc,jdbcType=VARCHAR},
#{jbzdsc,jdbcType=VARCHAR}, #{isDqtx,jdbcType=INTEGER}, #{txry,jdbcType=VARCHAR},
#{txfs,jdbcType=INTEGER}, #{txxhts,jdbcType=INTEGER}, #{txsjTime,jdbcType=VARCHAR},
#{tsfs,jdbcType=VARCHAR}, #{isWpbsdk,jdbcType=INTEGER}, #{sybc,jdbcType=VARCHAR},
#{isXzbcdk,jdbcType=INTEGER},#{isWq,jdbcType=INTEGER})
#{isXzbcdk,jdbcType=INTEGER},#{isWq,jdbcType=INTEGER},#{restdayclock,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="cn.timer.api.bean.kqgl.AttendanceGroup" useGeneratedKeys="true" keyProperty="id">
insert into kqgl_main_kqz
......@@ -186,6 +188,9 @@
<if test="overtimeRulesId != null" >
overtime_rules_id,
</if>
<if test="restdayclock != null" >
restdayclock,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
......@@ -249,6 +254,9 @@
<if test="overtimeRulesId != null" >
#{overtimeRulesId,jdbcType=INTEGER},
</if>
<if test="restdayclock != null" >
#{restdayclock,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="cn.timer.api.bean.kqgl.AttendanceGroup" >
......@@ -314,6 +322,9 @@
<if test="overtimeRulesId != null" >
overtime_rules_id = #{overtimeRulesId,jdbcType=INTEGER},
</if>
<if test="restdayclock != null" >
restdayclock = #{restdayclock,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
......@@ -338,7 +349,8 @@
sybc = #{sybc,jdbcType=VARCHAR},
is_xzbcdk = #{isXzbcdk,jdbcType=INTEGER},
is_wq = #{isWq,jdbcType=INTEGER},
overtime_rules_id = #{overtimeRulesId,jdbcType=INTEGER}
overtime_rules_id = #{overtimeRulesId,jdbcType=INTEGER},
restdayclock = #{restdayclock,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
......
......@@ -25,6 +25,7 @@
<result column="is_xzbcdk" property="isXzbcdk" />
<result column="is_wq" property="isWq" />
<result column="overtime_rules_id" property="overtimeRulesId" />
<result column="restdayclock" property="restdayclock" />
</resultMap>
<resultMap id="AuxiliaryMap" type="cn.timer.api.dto.kqmk.KqglMainKqzDto" >
......@@ -82,7 +83,8 @@
sybc,
is_xzbcdk,
is_wq,
overtime_rules_id
overtime_rules_id,
restdayclock
</sql>
<sql id="Base_Column_List_Alias">
......@@ -106,7 +108,8 @@
sybc KqglMainKqz_sybc,
is_xzbcdk KqglMainKqz_is_xzbcdk,
is_wq KqglMainKqz_is_wq,
overtime_rules_id KqglMainKqz_overtime_rules_id
overtime_rules_id KqglMainKqz_overtime_rules_id,
restdayclock KqglMainKqz_restdayclock
</sql>
<sql id="Base_Column_List_a">
......@@ -130,7 +133,8 @@
a.sybc,
a.is_xzbcdk,
a.is_wq,
a.overtime_rules_id
a.overtime_rules_id,
a.restdayclock
</sql>
<select id="selectAttGroupMachineByQyid" resultMap="AuxiliaryMap">
......
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