Commit 40d3442a by ilal Committed by chenzg

提價

parent fc2fcb83
......@@ -40,8 +40,8 @@ public class KqglAssoOvertimeRules extends Model<KqglAssoOvertimeRules> {
@ApiModelProperty(value = "规则名称 ", example = "以审批时间计算加班")
private String name;
@ApiModelProperty(value = "应用范围", example = "1")
private String appliedScope;
@ApiModelProperty(value = "应用范围", example = "(0:全公司 >0:考勤组id)")
private Integer appliedScope;
@ApiModelProperty(value = "工作日是否允许加班 0:否;1:是", example = "1")
private Integer isWorkovertime;
......
......@@ -93,5 +93,8 @@ public class KqglMainKqz extends Model<KqglMainKqz> {
@ApiModelProperty(value = "外勤 外勤", example = "101")
private Integer isWq;
@ApiModelProperty(value="加班规则 加班规则",example="101")
private Integer overtimeRulesId;
}
\ No newline at end of file
......@@ -5,12 +5,9 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -28,9 +25,6 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Console;
import cn.timer.api.bean.kqgl.PunchCardAddress;
import cn.timer.api.bean.kqgl.PunchCardWiFi;
import cn.timer.api.bean.kqgl.ShiftManagement;
import cn.timer.api.bean.kqmk.KqglAssOvertimeVice;
import cn.timer.api.bean.kqmk.KqglAssoBcsz;
import cn.timer.api.bean.kqmk.KqglAssoDkdz;
......@@ -40,6 +34,7 @@ import cn.timer.api.bean.kqmk.KqglAssoKqzdkfs;
import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance;
import cn.timer.api.bean.kqmk.KqglAssoLeaveRules;
import cn.timer.api.bean.kqmk.KqglAssoOvertimeBasics;
import cn.timer.api.bean.kqmk.KqglAssoOvertimeRange;
import cn.timer.api.bean.kqmk.KqglAssoOvertimeRules;
import cn.timer.api.bean.kqmk.KqglAssoPbmx;
import cn.timer.api.bean.kqmk.KqglAssoRulesVice;
......@@ -47,7 +42,6 @@ import cn.timer.api.bean.kqmk.KqglAssoTeshu;
import cn.timer.api.bean.kqmk.KqglAssoYhkqz;
import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban;
import cn.timer.api.bean.kqmk.KqglMainKqz;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
......@@ -58,6 +52,7 @@ import cn.timer.api.dao.kqmk.KqglAssoDkwxMapper;
import cn.timer.api.dao.kqmk.KqglAssoKqjMapper;
import cn.timer.api.dao.kqmk.KqglAssoLeaveBalanceMapper;
import cn.timer.api.dao.kqmk.KqglAssoLeaveRulesMapper;
import cn.timer.api.dao.kqmk.KqglAssoOvertimeRangeMapper;
import cn.timer.api.dao.kqmk.KqglAssoOvertimeRulesMapper;
import cn.timer.api.dao.kqmk.KqglAssoRulesViceMapper;
import cn.timer.api.dao.kqmk.KqglAssoYhsbMapper;
......@@ -72,7 +67,6 @@ import cn.timer.api.dto.kqmk.LeaveTypeDto;
import cn.timer.api.dto.kqmk.MachinememberDto;
import cn.timer.api.dto.kqmk.StartTimeRestDto;
import cn.timer.api.dto.kqmk.VacationInformationDto;
import cn.timer.api.dto.spmk.MySummaryQueryDto;
import cn.timer.api.utils.ResponseResult;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
......@@ -103,7 +97,6 @@ public class TimeCardController {
attquerycriteriadto.getTotalPage() == null ? 10 : attquerycriteriadto.getTotalPage());
attquerycriteriadto.setOrgCode(userBean.getOrgCode());
attquerycriteriadto.setEmpNum(userBean.getEmpNum());
// IPage<KqglAssoBcsz> pageAs = kqglassobcszmapper.selectPage(page, attquerycriteriadto);//用于SQL语句
IPage<KqglAssoBcsz> pageAs = kqglassobcszmapper.selectPage(page, new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getQyid, userBean.getOrgCode()));
List<KqglAssoBcsz> listAs = pageAs.getRecords();
return ResultUtil.data(pageAs, listAs, "操作成功!");
......@@ -143,7 +136,6 @@ public class TimeCardController {
@ApiOperation(value = "4:获取班次信息-根据班次id", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 4)
public Result<Object> getShiftCenter(@PathVariable("id") Integer id) {
return ResultUtil.data(KqglAssoBcsz.builder().id(id).build().selectById(),"操作成功!");
}
......@@ -179,11 +171,17 @@ public class TimeCardController {
List<KqglAssoOvertimeRules> listAs = pageAs.getRecords();
List<KqglAssoOvertimeRulesDto> rulesdto = new ArrayList<KqglAssoOvertimeRulesDto>();
for (int i = 0, n = listAs.size(); i < n; i++) {
String[] arr = listAs.get(i).getAppliedScope().split(","); // 用,分割
String[] nary= new String[arr.length];//用户名
for(int y=0;y<arr.length;y++){
KqglMainKqz kqzmc = kqglmainkqzmapper.selectOne(new QueryWrapper<KqglMainKqz>().lambda().eq(KqglMainKqz::getId, arr[y]));
nary[y] = kqzmc.getName();
String[] nary = null;
if(listAs.get(i).getAppliedScope() == 0) {//全公司
nary = new String[1];//用户名
nary[0] = "全公司";
}else {
List<KqglAssoOvertimeRange> overtim = kqglassoovertimerangemapper.selectList(new QueryWrapper<KqglAssoOvertimeRange>().lambda().eq(KqglAssoOvertimeRange::getOvertimeRulesId, listAs.get(i).getId()));
nary = new String[overtim.size()];//用户名
for(int y = 0,l = overtim.size(); y < l ; y++) {
KqglMainKqz kqzmc = kqglmainkqzmapper.selectOne(new QueryWrapper<KqglMainKqz>().lambda().eq(KqglMainKqz::getId, overtim.get(y).getAttgroupId()));
nary[y] = kqzmc.getName();
}
}
KqglAssoOvertimeRulesDto ruldto = KqglAssoOvertimeRulesDto.builder().build();
ruldto.setApplyrange(nary);
......@@ -193,6 +191,9 @@ public class TimeCardController {
return ResultUtil.data(pageAs, rulesdto, "操作成功!");
}
@Autowired
private KqglAssoOvertimeRangeMapper kqglassoovertimerangemapper;
/**
* 新增/修改--加班规则
*/
......@@ -203,21 +204,28 @@ public class TimeCardController {
overrules.setCreateTime(new Date().getTime());
overrules.setOrgCode(userBean.getOrgCode());
overrules.setCreateUserid(userBean.getEmpNum());
String[] launchs = overrules.getApplyrange();
String appliedscope = StringUtils.join(launchs, ",");
// rul.setAppliedScope(appliedscope);//应用范围
overrules.setAppliedScope(appliedscope);
KqglAssoOvertimeRules rul = KqglAssoOvertimeRules.builder().build();
// 克隆 KqglAssoOvertimeRulesDto对象 到 KqglAssoOvertimeRules对象
BeanUtil.copyProperties(overrules, rul , "starttime","applyrange");
if (!rul.insertOrUpdate())
return ResultUtil.error("操作失败");
Integer id = rul.getId();
Console.log("新增/修改加班规则id: " + id);
List<KqglAssoOvertimeRange> overatts=new ArrayList<KqglAssoOvertimeRange>();
String[] launchs = overrules.getApplyrange();
if(launchs.length == 0) {
KqglAssoOvertimeRange.builder().build().delete(new QueryWrapper<KqglAssoOvertimeRange>().lambda().eq(KqglAssoOvertimeRange::getOvertimeRulesId, id));
}else if(launchs != null && launchs.length>0){
for(int p=0;p<launchs.length;p++){
KqglAssoOvertimeRange.builder().build().delete(new QueryWrapper<KqglAssoOvertimeRange>().lambda().eq(KqglAssoOvertimeRange::getOvertimeRulesId, id));
KqglAssoOvertimeRange vice = KqglAssoOvertimeRange.builder().build();
vice.setOvertimeRulesId(id);
vice.setAttgroupId(Integer.valueOf(launchs[p]));
overatts.add(vice);
}
}
if(overatts.size() > 0) {
kqglassoovertimerangemapper.insertovertimerangelist(overatts);
}
List<KqglAssOvertimeVice> overtimes=new ArrayList<KqglAssOvertimeVice>();
StartTimeRestDto[] rest = overrules.getStarttime();
if(rest != null && rest.length>0){
......@@ -245,16 +253,16 @@ public class TimeCardController {
@ApiOperationSupport(order = 8)
public Result<IndividualOvertimeRuleDto> getOvertimeRules(@PathVariable("id") Integer id) {
IndividualOvertimeRuleDto overrule = IndividualOvertimeRuleDto.builder().build();
KqglAssoOvertimeRules rules = KqglAssoOvertimeRules.builder().id(id).build().selectById();
String str = rules.getAppliedScope();
String[] arr = str.split(","); // 用,分割
List<KqglAssoOvertimeRange> overtim = kqglassoovertimerangemapper.selectList(new QueryWrapper<KqglAssoOvertimeRange>().lambda().eq(KqglAssoOvertimeRange::getOvertimeRulesId, rules.getId()));
String[] arr = new String[overtim.size()];//用户名
for (int i = 0, n = overtim.size(); i < n; i++) {
arr[i] = overtim.get(i).getAttgroupId().toString();
}
KqglAssoOvertimeRulesDto ruldto = KqglAssoOvertimeRulesDto.builder().build();
ruldto.setApplyrange(arr);
BeanUtil.copyProperties(rules, ruldto , "starttime","applyrange");
overrule.setRules(ruldto);
List<KqglAssOvertimeVice> vice = new LambdaQueryChainWrapper<KqglAssOvertimeVice>(kqglassovertimevicemapper).eq(KqglAssOvertimeVice::getOvertimeRulesId, id).list();
overrule.setStarttime(vice);
return ResultUtil.data(overrule,"操作成功!");
......@@ -339,15 +347,12 @@ public class TimeCardController {
BeanUtil.copyProperties(leaverules, learul , "starttime");
if (!learul.insertOrUpdate())
return ResultUtil.error("操作失败");
Integer id = learul.getId();
Console.log("新增/修改--假期规则id: " + id);
if(leaverules.getLeaveBalance() == 0) {//假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)
KqglAssoLeaveBalance.builder().build().delete(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getLeaveRulesId, id)
.eq(KqglAssoLeaveBalance :: getOrgCode, userBean.getOrgCode()));
}
List<KqglAssoRulesVice> vices = new ArrayList<KqglAssoRulesVice>();
String[] rest = leaverules.getRange();
if(rest.length == 0) {
......@@ -635,7 +640,6 @@ public class TimeCardController {
public Result<Object> BalanceHeader(@CurrentUser UserBean userBean) {
List<KqglAssoLeaveRules> balheas = new LambdaQueryChainWrapper<KqglAssoLeaveRules>(kqglassoleaverulesmapper).eq(KqglAssoLeaveRules :: getOrgCode,userBean.getOrgCode())
.eq(KqglAssoLeaveRules :: getLeaveType, 2).or().eq(KqglAssoLeaveRules :: getIsOpen, 1).list();
return ResultUtil.data(balheas, "操作成功!");
}
......@@ -646,10 +650,8 @@ public class TimeCardController {
@ApiOperation(value = "30: 查询列表-假期规则", httpMethod = "GET", notes = " 查询列表-假期规则")
@ApiOperationSupport(order = 30)
public Result<Object> selectListLeaveRules(@CurrentUser UserBean userBean) {
List<KqglAssoLeaveRules> balheas = new LambdaQueryChainWrapper<KqglAssoLeaveRules>(kqglassoleaverulesmapper).eq(KqglAssoLeaveRules :: getOrgCode,userBean.getOrgCode())
.eq(KqglAssoLeaveRules :: getLeaveType, 2).or().eq(KqglAssoLeaveRules :: getIsOpen, 1).list();
List<LeaveTypeDto> leas = new ArrayList<LeaveTypeDto>();
for(KqglAssoLeaveRules rul : balheas) {
LeaveTypeDto lea = LeaveTypeDto.builder().build();
......@@ -667,9 +669,7 @@ public class TimeCardController {
@ApiOperation(value = "31:根据组织机构代码 获取考勤组", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 31)
public Result<Object> CheckWorkatt(@CurrentUser UserBean userBean) {
List<KqglMainKqz> kqzs = KqglMainKqz.builder().build().selectList(new QueryWrapper<KqglMainKqz>().lambda().eq(KqglMainKqz::getQyid, userBean.getOrgCode()));
List<LeaveTypeDto> leas = new ArrayList<LeaveTypeDto>();
for(KqglMainKqz rul : kqzs) {
LeaveTypeDto lea = LeaveTypeDto.builder().build();
......@@ -677,7 +677,6 @@ public class TimeCardController {
lea.setValue(rul.getName());
leas.add(lea);
}
return ResultUtil.data(leas, "操作成功!");
}
......@@ -688,9 +687,7 @@ public class TimeCardController {
@ApiOperation(value = "32:根据组织机构代码 获取加班基础设置信息", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 32)
public Result<Object> overtimebasicinformation(@CurrentUser UserBean userBean) {
KqglAssoOvertimeBasics kqjdev = KqglAssoOvertimeBasics.builder().build().selectOne(new QueryWrapper<KqglAssoOvertimeBasics>().lambda().eq(KqglAssoOvertimeBasics::getOrgCode, userBean.getOrgCode()));
return ResultUtil.data(kqjdev, "操作成功!");
}
......@@ -701,7 +698,6 @@ public class TimeCardController {
@ApiOperation(value = "33:获取假期规则数据-分页", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 33)
public Result<Object> selectleaverules(@CurrentUser UserBean userBean, @RequestBody AttqueryCriteriaDto attquerycriteriadto) {
IPage<KqglAssoLeaveRules> page = new Page<KqglAssoLeaveRules>(
attquerycriteriadto.getCurrentPage() == null ? 1 : attquerycriteriadto.getCurrentPage(),
attquerycriteriadto.getTotalPage() == null ? 10 : attquerycriteriadto.getTotalPage());
......@@ -709,7 +705,6 @@ public class TimeCardController {
attquerycriteriadto.setEmpNum(userBean.getEmpNum());
IPage<KqglAssoLeaveRules> pageAs = kqglassoleaverulesmapper.selectPage(page, new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, userBean.getOrgCode()));
List<KqglAssoLeaveRules> listAs = pageAs.getRecords();
List<KqglAssoLeaveRulesDto> leadto = new ArrayList<KqglAssoLeaveRulesDto>();
for (int i = 0, n = listAs.size(); i < n; i++) {
String[] nary = null;
......@@ -724,15 +719,11 @@ public class TimeCardController {
nary[y] = kqzmc.getName();
}
}
KqglAssoLeaveRulesDto learul = KqglAssoLeaveRulesDto.builder().build();
learul.setApplyrange(nary);
BeanUtil.copyProperties(listAs.get(i), learul , "range","applyrange");
leadto.add(learul);
}
return ResultUtil.data(pageAs, leadto, "操作成功!");
}
......@@ -744,7 +735,6 @@ public class TimeCardController {
@ApiOperation(value = "34:查询列表-我审批的/抄送我的-分页", httpMethod = "POST", notes = "查询列表-我审批的-关键字、审批状态、发起时间-分页")
@ApiOperationSupport(order = 34)
public Result<Object> AttendanceGroup(@CurrentUser UserBean userBean, @Validated @RequestBody AttqueryCriteriaDto attquerycriteriadto){
IPage<KqglMainKqzDto> page = new Page<KqglMainKqzDto>(
attquerycriteriadto.getCurrentPage() == null ? 1 : attquerycriteriadto.getCurrentPage(),
attquerycriteriadto.getTotalPage() == null ? 10 : attquerycriteriadto.getTotalPage());
......@@ -752,7 +742,6 @@ public class TimeCardController {
attquerycriteriadto.setEmpNum(userBean.getEmpNum());
// 缺-部门id 搜索
IPage<KqglMainKqzDto> pageAs = kqglmainkqzmapper.selectPageByQueryKqglMain(page, attquerycriteriadto);
List<KqglMainKqzDto> listAs = pageAs.getRecords();
return ResultUtil.data(pageAs, listAs, "操作成功!");
}
......@@ -799,7 +788,6 @@ public class TimeCardController {
public Result<Object> getEmployeeData(@CurrentUser UserBean userBean) {
List<YgglMainEmp> yggl = YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
return ResultUtil.data(yggl);
}
/**
......@@ -809,33 +797,23 @@ public class TimeCardController {
@ApiOperation(value = "39:删除考勤组", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 39)
public Result<Integer> DelAttendanceGroup(@PathVariable("id") Integer id) {
//删除组
if(KqglMainKqz.builder().id(id).build().deleteById()) {
//删除考勤组绑定的打卡方式
KqglAssoKqzdkfs.builder().build().delete(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, id));
//删除用户和考勤组关系表
KqglAssoYhkqz.builder().build().delete(new QueryWrapper<KqglAssoYhkqz>().lambda().eq(KqglAssoYhkqz::getKqzid, id));
//删除特殊日期表
KqglAssoTeshu.builder().build().delete(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, id));
//删除排班明细表(自由排班)
KqglAssoPbmx.builder().build().delete(new QueryWrapper<KqglAssoPbmx>().lambda().eq(KqglAssoPbmx::getKqzid, id));
//删除考勤周排班
KqglAssoZhoupaiban.builder().build().delete(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, id));
return ResultUtil.data(id,"删除成功");
}
return ResultUtil.error("删除失败");
}
/**************************/
/**
* 查询列表-加班补偿方式
*/
......
......@@ -20,8 +20,8 @@ public class KqglAssoOvertimeRulesDto {
@ApiModelProperty(value = "规则名称 ", example = "以审批时间计算加班")
private String name;
@ApiModelProperty(value = "应用范围", example = "1")
private String appliedScope;
@ApiModelProperty(value = "应用范围", example = "(0:全公司 >0:考勤组id)")
private Integer appliedScope;
@ApiModelProperty(value = "工作日是否允许加班 0:否;1:是", example = "1")
private Integer isWorkovertime;
......
......@@ -74,6 +74,9 @@ public class KqglMainKqzDto {
@ApiModelProperty(value = "外勤 外勤", example = "101")
private Integer isWq;
@ApiModelProperty(value="加班规则 加班规则",example="101")
private Integer overtimeRulesId;
@ApiModelProperty(value = "考勤组人员数", example = "100")
......
......@@ -24,6 +24,7 @@
<result column="sybc" property="sybc" />
<result column="is_xzbcdk" property="isXzbcdk" />
<result column="is_wq" property="isWq" />
<result column="overtime_rules_id" property="overtimeRulesId" />
</resultMap>
<resultMap id="AuxiliaryMap" type="cn.timer.api.dto.kqmk.KqglMainKqzDto" >
......@@ -47,6 +48,7 @@
<result column="sybc" property="sybc" />
<result column="is_xzbcdk" property="isXzbcdk" />
<result column="is_wq" property="isWq" />
<result column="overtime_rules_id" property="overtimeRulesId" />
<result column="kqznum" property="kqznum" />
<result column="pbfsnm" property="pbfsnm" />
......@@ -74,7 +76,8 @@
is_wpbsdk,
sybc,
is_xzbcdk,
is_wq
is_wq,
overtime_rules_id
</sql>
<sql id="Base_Column_List_Alias">
......@@ -97,7 +100,8 @@
is_wpbsdk KqglMainKqz_is_wpbsdk,
sybc KqglMainKqz_sybc,
is_xzbcdk KqglMainKqz_is_xzbcdk,
is_wq KqglMainKqz_is_wq
is_wq KqglMainKqz_is_wq,
overtime_rules_id KqglMainKqz_overtime_rules_id
</sql>
<sql id="Base_Column_List_a">
......@@ -120,7 +124,8 @@
a.is_wpbsdk,
a.sybc,
a.is_xzbcdk,
a.is_wq
a.is_wq,
a.overtime_rules_id
</sql>
<select id="selectAttGroupMachineByQyid" resultMap="AuxiliaryMap">
......@@ -223,7 +228,10 @@
is_xzbcdk,
</if>
<if test ='null != isWq'>
is_wq
is_wq,
</if>
<if test ='null != overtimeRulesId'>
overtime_rules_id
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
......@@ -282,7 +290,10 @@
#{isXzbcdk},
</if>
<if test ='null != isWq'>
#{isWq}
#{isWq},
</if>
<if test ='null != overtimeRulesId'>
#{overtimeRulesId}
</if>
</trim>
</insert>
......@@ -313,7 +324,8 @@
<if test ='null != isWpbsdk'>is_wpbsdk = #{isWpbsdk},</if>
<if test ='null != sybc'>sybc = #{sybc},</if>
<if test ='null != isXzbcdk'>is_xzbcdk = #{isXzbcdk},</if>
<if test ='null != isWq'>is_wq = #{isWq}</if>
<if test ='null != isWq'>is_wq = #{isWq},</if>
<if test ='null != overtimeRulesId'>overtime_rules_id = #{overtimeRulesId}</if>
</set>
WHERE id = #{id}
</update>
......
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