Commit 2c59ea0b by leialin

Merge branch 'lal' into 'develop'

提交

See merge request 8timerv2/8timerapiv200!130
parents af517ab0 1be86c52
...@@ -64,6 +64,7 @@ public class KqglAssoLeaveRules extends Model<KqglAssoLeaveRules> { ...@@ -64,6 +64,7 @@ public class KqglAssoLeaveRules extends Model<KqglAssoLeaveRules> {
@ApiModelProperty(value = "假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)", example = "101") @ApiModelProperty(value = "假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)", example = "101")
private Integer leaveBalance; private Integer leaveBalance;
@ApiModelProperty(value = "规则类型(1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假)", example = "101")
private Integer rulesType;
} }
\ No newline at end of file
...@@ -93,6 +93,7 @@ import cn.timer.api.dto.kqmk.IndividualOvertimeRuleDto; ...@@ -93,6 +93,7 @@ import cn.timer.api.dto.kqmk.IndividualOvertimeRuleDto;
import cn.timer.api.dto.kqmk.KqglAssoLeaveRulesDto; import cn.timer.api.dto.kqmk.KqglAssoLeaveRulesDto;
import cn.timer.api.dto.kqmk.KqglAssoOvertimeRulesDto; import cn.timer.api.dto.kqmk.KqglAssoOvertimeRulesDto;
import cn.timer.api.dto.kqmk.KqglAssoPbmxDto; import cn.timer.api.dto.kqmk.KqglAssoPbmxDto;
import cn.timer.api.dto.kqmk.KqglAssoRulesViceDto;
import cn.timer.api.dto.kqmk.KqglMainKqzDto; import cn.timer.api.dto.kqmk.KqglMainKqzDto;
import cn.timer.api.dto.kqmk.KqzAttendanceGroupSearchDto; import cn.timer.api.dto.kqmk.KqzAttendanceGroupSearchDto;
import cn.timer.api.dto.kqmk.LeaveTypeDto; import cn.timer.api.dto.kqmk.LeaveTypeDto;
...@@ -352,7 +353,7 @@ public class TimeCardController { ...@@ -352,7 +353,7 @@ public class TimeCardController {
for(KqglAssoLeaveRules rul : ruless){ for(KqglAssoLeaveRules rul : ruless){
KqglAssoLeaveRules vice = KqglAssoLeaveRules.builder().name(rul.getName()).company(rul.getCompany()).leaveType(rul.getLeaveType()) KqglAssoLeaveRules vice = KqglAssoLeaveRules.builder().name(rul.getName()).company(rul.getCompany()).leaveType(rul.getLeaveType())
.apply(rul.getApply()).createTime(new Date().getTime()).createUserid(userBean.getEmpNum()).orgCode(userBean.getOrgCode()) .apply(rul.getApply()).createTime(new Date().getTime()).createUserid(userBean.getEmpNum()).orgCode(userBean.getOrgCode())
.isOpen(rul.getIsOpen()).leaveBalance(rul.getLeaveBalance()).build(); .isOpen(rul.getIsOpen()).leaveBalance(rul.getLeaveBalance()).rulesType(rul.getRulesType()).build();
rullist.add(vice); rullist.add(vice);
} }
if(rullist.size() > 0) { if(rullist.size() > 0) {
...@@ -388,13 +389,18 @@ public class TimeCardController { ...@@ -388,13 +389,18 @@ public class TimeCardController {
KqglAssoLeaveBalance.builder().build().delete(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getLeaveRulesId, id) KqglAssoLeaveBalance.builder().build().delete(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getLeaveRulesId, id)
.eq(KqglAssoLeaveBalance :: getOrgCode, userBean.getOrgCode())); .eq(KqglAssoLeaveBalance :: getOrgCode, userBean.getOrgCode()));
List<YgglMainEmp> yggl = YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
if(leaverules.getLeaveBalance() == 1) {//假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”) if(leaverules.getLeaveBalance() == 1) {//假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)
//该项公司员工余额为“0” //该项公司员工余额为“0”
List<YgglMainEmp> yggl = YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
for(YgglMainEmp ye:yggl) { for(YgglMainEmp ye:yggl) {
KqglAssoLeaveBalance.builder().leaveRulesId(id).userid(ye.getEmpNum()).modifyAction(1).balanceDays("+0") KqglAssoLeaveBalance.builder().leaveRulesId(id).userid(ye.getEmpNum()).modifyAction(1).balanceDays("+0")
.reason("系统按照规则自动").modifyUserid(userBean.getEmpNum()).modifyTimer(new Date().getTime()).orgCode(userBean.getOrgCode()).isAutomatic(1).modifyNumber(1).build().insert();//员工假期余额 .reason("系统按照规则自动").modifyUserid(userBean.getEmpNum()).modifyTimer(new Date().getTime()).orgCode(userBean.getOrgCode()).isAutomatic(1).modifyNumber(1).build().insert();//员工假期余额
} }
}else {
for(YgglMainEmp ye:yggl) {
KqglAssoLeaveBalance.builder().leaveRulesId(id).userid(ye.getEmpNum()).modifyAction(1).balanceDays("1-1")
.reason("不限制余额").modifyUserid(userBean.getEmpNum()).modifyTimer(new Date().getTime()).orgCode(userBean.getOrgCode()).isAutomatic(1).modifyNumber(1).build().insert();//员工假期余额
}
} }
List<KqglAssoRulesVice> vices = new ArrayList<KqglAssoRulesVice>(); List<KqglAssoRulesVice> vices = new ArrayList<KqglAssoRulesVice>();
String[] rest = leaverules.getRange(); String[] rest = leaverules.getRange();
...@@ -441,7 +447,8 @@ public class TimeCardController { ...@@ -441,7 +447,8 @@ public class TimeCardController {
VacationInformationDto overrule = VacationInformationDto.builder().build(); VacationInformationDto overrule = VacationInformationDto.builder().build();
KqglAssoLeaveRules rules = KqglAssoLeaveRules.builder().id(id).build().selectById(); KqglAssoLeaveRules rules = KqglAssoLeaveRules.builder().id(id).build().selectById();
overrule.setRules(rules); overrule.setRules(rules);
List<KqglAssoRulesVice> vice = new LambdaQueryChainWrapper<KqglAssoRulesVice>(kqglassorulesvicemapper).eq(KqglAssoRulesVice::getLeaveRulesId, id).list(); List<KqglAssoRulesViceDto> vice = kqglassorulesvicemapper.leaveRulesIdload(id);
overrule.setRange(vice); overrule.setRange(vice);
return ResultUtil.data(overrule,"操作成功!"); return ResultUtil.data(overrule,"操作成功!");
} }
......
...@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service; ...@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance; import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance;
import cn.timer.api.bean.kqmk.KqglAssoLeaveRules;
import cn.timer.api.bean.kqmk.KqglAssoRelationSummary; import cn.timer.api.bean.kqmk.KqglAssoRelationSummary;
import cn.timer.api.bean.yggl.YgglMainEmp; import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.controller.kqgl.ClockInTool; import cn.timer.api.controller.kqgl.ClockInTool;
...@@ -43,6 +44,7 @@ public class KqglServiceImpl implements KqglService { ...@@ -43,6 +44,7 @@ public class KqglServiceImpl implements KqglService {
.endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(leaveappr.getEndtime())).build().insert(); .endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(leaveappr.getEndtime())).build().insert();
} }
YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, leaveappr.getUserid())); YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, leaveappr.getUserid()));
int modifynumber = 1; int modifynumber = 1;
KqglAssoLeaveBalance balan = kqglassoleavebalancemapper.selectOne(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getUserid, leaveappr.getUserid()) KqglAssoLeaveBalance balan = kqglassoleavebalancemapper.selectOne(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getUserid, leaveappr.getUserid())
.orderByDesc(KqglAssoLeaveBalance :: getModifyNumber).last("LIMIT 1")); .orderByDesc(KqglAssoLeaveBalance :: getModifyNumber).last("LIMIT 1"));
...@@ -69,6 +71,25 @@ public class KqglServiceImpl implements KqglService { ...@@ -69,6 +71,25 @@ public class KqglServiceImpl implements KqglService {
.overtimeTypeId(overappr.getOvertimetype()).compensateId(overappr.getCompensate()).startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(overappr.getStarttime())) .overtimeTypeId(overappr.getOvertimetype()).compensateId(overappr.getCompensate()).startTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(overappr.getStarttime()))
.endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(overappr.getEndtime())).build().insert(); .endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(overappr.getEndtime())).build().insert();
} }
YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, overappr.getUserid()));
//查询当前公司调休的id
KqglAssoLeaveRules learul = KqglAssoLeaveRules.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, emp.getOrgCode()).eq(KqglAssoLeaveRules::getRulesType, 2));
if(overappr.getCompensate() == 1) {
int modifynumber = 1;
KqglAssoLeaveBalance balan = kqglassoleavebalancemapper.selectOne(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getUserid, overappr.getUserid())
.orderByDesc(KqglAssoLeaveBalance :: getModifyNumber).last("LIMIT 1"));
if(balan != null) {
modifynumber = balan.getModifyNumber()+1;
}
KqglAssoLeaveBalance.builder().leaveRulesId(learul.getId()).userid(overappr.getUserid()).modifyAction(2).balanceDays("+"+overappr.getDuration())
.reason("系统按照规则自动(加班)").modifyUserid(emp.getEmpNum()).modifyTimer(new Date().getTime()).orgCode(emp.getOrgCode()).isAutomatic(1).modifyNumber(modifynumber).build().insert();//员工假期余额
}
return true; return true;
} }
......
...@@ -6,6 +6,7 @@ import org.springframework.stereotype.Repository; ...@@ -6,6 +6,7 @@ import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.kqmk.KqglAssoRulesVice; import cn.timer.api.bean.kqmk.KqglAssoRulesVice;
import cn.timer.api.dto.kqmk.KqglAssoRulesViceDto;
/** /**
...@@ -17,4 +18,6 @@ public interface KqglAssoRulesViceMapper extends BaseMapper<KqglAssoRulesVice> { ...@@ -17,4 +18,6 @@ public interface KqglAssoRulesViceMapper extends BaseMapper<KqglAssoRulesVice> {
int insertrulesviceList(List<KqglAssoRulesVice> kqglassorulesvice); int insertrulesviceList(List<KqglAssoRulesVice> kqglassorulesvice);
List<KqglAssoRulesViceDto> leaveRulesIdload(int leaverulesid);
} }
...@@ -45,6 +45,9 @@ public class KqglAssoLeaveRulesDto { ...@@ -45,6 +45,9 @@ public class KqglAssoLeaveRulesDto {
@ApiModelProperty(value = "假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)", example = "101") @ApiModelProperty(value = "假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)", example = "101")
private Integer leaveBalance; private Integer leaveBalance;
@ApiModelProperty(value = "规则类型(1:事假;2:调休;3:病假;4:年假;5:产假;6:陪产假;7:婚假;8:例假;9:丧假;10:哺乳假)", example = "101")
private Integer rulesType;
@ApiModelProperty(value = "适用范围集合", example = "101") @ApiModelProperty(value = "适用范围集合", example = "101")
private String[] range; private String[] range;
......
package cn.timer.api.dto.kqmk;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class KqglAssoRulesViceDto {
@ApiModelProperty(value = "假期规则id 假期规则id", example = "101")
private Integer leaveRulesId;
}
...@@ -20,6 +20,6 @@ public class VacationInformationDto { ...@@ -20,6 +20,6 @@ public class VacationInformationDto {
KqglAssoLeaveRules rules; KqglAssoLeaveRules rules;
@ApiModelProperty(value = "假期规则-适用范围 ", example = "字段说明") @ApiModelProperty(value = "假期规则-适用范围 ", example = "字段说明")
List<KqglAssoRulesVice> range; List<KqglAssoRulesViceDto> range;
} }
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<result column="org_code" property="orgCode" /> <result column="org_code" property="orgCode" />
<result column="is_open" property="isOpen" /> <result column="is_open" property="isOpen" />
<result column="leave_balance" property="leaveBalance" /> <result column="leave_balance" property="leaveBalance" />
<result column="rules_type" property="rulesType" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -26,7 +27,8 @@ ...@@ -26,7 +27,8 @@
create_userid, create_userid,
org_code, org_code,
is_open, is_open,
leave_balance leave_balance,
rules_type
</sql> </sql>
<sql id="Base_Column_List_Alias"> <sql id="Base_Column_List_Alias">
...@@ -50,7 +52,7 @@ ...@@ -50,7 +52,7 @@
</select> </select>
<insert id="insertleaverulesList" parameterType="java.util.List" > <insert id="insertleaverulesList" parameterType="java.util.List" >
insert into kqgl_asso_leave_rules (name,company,leave_type,apply,create_time,create_userid,org_code,is_open,leave_balance) insert into kqgl_asso_leave_rules (name,company,leave_type,apply,create_time,create_userid,org_code,is_open,leave_balance,rules_type)
<foreach collection="list" item="item" index="index" open="values " close="" separator=","> <foreach collection="list" item="item" index="index" open="values " close="" separator=",">
( (
<if test="item.name != null" > <if test="item.name != null" >
...@@ -78,7 +80,10 @@ ...@@ -78,7 +80,10 @@
#{item.isOpen,jdbcType=INTEGER}, #{item.isOpen,jdbcType=INTEGER},
</if> </if>
<if test="item.leaveBalance != null" > <if test="item.leaveBalance != null" >
#{item.leaveBalance,jdbcType=INTEGER} #{item.leaveBalance,jdbcType=INTEGER},
</if>
<if test="item.rulesType != null" >
#{item.rulesType,jdbcType=INTEGER}
</if> </if>
) )
</foreach> </foreach>
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
<result column="attgroup_id" property="attgroupId" /> <result column="attgroup_id" property="attgroupId" />
</resultMap> </resultMap>
<resultMap id="RulesViceDtoMap" type="cn.timer.api.dto.kqmk.KqglAssoRulesViceDto" >
<result column="leave_rules_id" property="leaveRulesId" />
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, id,
leave_rules_id, leave_rules_id,
...@@ -34,6 +38,13 @@ ...@@ -34,6 +38,13 @@
) )
</foreach> </foreach>
</insert> </insert>
<select id="leaveRulesIdload" resultMap="RulesViceDtoMap">
SELECT <include refid="Base_Column_List" />
FROM kqgl_asso_rules_vice
WHERE leaveRulesId = #{leaverulesid}
</select>
<!-- <!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoRulesVice"> <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.kqmk.KqglAssoRulesVice">
......
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