Commit de18710c by ilal Committed by chenzg

临时提交

parent 6187f27b
...@@ -47,7 +47,7 @@ public class KqglAssoLeaveRules extends Model<KqglAssoLeaveRules> { ...@@ -47,7 +47,7 @@ public class KqglAssoLeaveRules extends Model<KqglAssoLeaveRules> {
private Integer leaveType; private Integer leaveType;
@ApiModelProperty(value = "适用范围 ", example = "0:全公司 >0:考勤组id") @ApiModelProperty(value = "适用范围 ", example = "0:全公司 >0:考勤组id")
private String apply; private Integer apply;
@ApiModelProperty(value = "创建时间 创建时间", example = "101") @ApiModelProperty(value = "创建时间 创建时间", example = "101")
private Long createTime; private Long createTime;
...@@ -64,4 +64,6 @@ public class KqglAssoLeaveRules extends Model<KqglAssoLeaveRules> { ...@@ -64,4 +64,6 @@ 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;
} }
\ No newline at end of file
package cn.timer.api.controller.kqgl; package cn.timer.api.controller.kqgl;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -15,7 +16,6 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -15,7 +16,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; 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.bind.annotation.RestController;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -26,9 +26,6 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; ...@@ -26,9 +26,6 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Console; import cn.hutool.core.lang.Console;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.kqgl.AttConditions;
import cn.timer.api.bean.kqgl.AttendanceCardList;
import cn.timer.api.bean.kqmk.KqglAssOvertimeVice; import cn.timer.api.bean.kqmk.KqglAssOvertimeVice;
import cn.timer.api.bean.kqmk.KqglAssoBcsz; import cn.timer.api.bean.kqmk.KqglAssoBcsz;
import cn.timer.api.bean.kqmk.KqglAssoDkdz; import cn.timer.api.bean.kqmk.KqglAssoDkdz;
...@@ -40,7 +37,6 @@ import cn.timer.api.bean.kqmk.KqglAssoOvertimeBasics; ...@@ -40,7 +37,6 @@ import cn.timer.api.bean.kqmk.KqglAssoOvertimeBasics;
import cn.timer.api.bean.kqmk.KqglAssoOvertimeRules; import cn.timer.api.bean.kqmk.KqglAssoOvertimeRules;
import cn.timer.api.bean.kqmk.KqglAssoRulesVice; import cn.timer.api.bean.kqmk.KqglAssoRulesVice;
import cn.timer.api.bean.kqmk.KqglMainKqz; import cn.timer.api.bean.kqmk.KqglMainKqz;
import cn.timer.api.bean.spmk.SpmkInitiatorConfig;
import cn.timer.api.config.annotation.CurrentUser; import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dao.kqmk.KqglAssOvertimeViceMapper; import cn.timer.api.dao.kqmk.KqglAssOvertimeViceMapper;
...@@ -154,11 +150,13 @@ public class TimeCardController { ...@@ -154,11 +150,13 @@ public class TimeCardController {
/** /**
* 查询列表-获取加班规则数据-分页 * 查询列表-获取加班规则数据-分页
* @throws InvocationTargetException
* @throws IllegalAccessException
*/ */
@PostMapping(value = "/select_overtime_rules") @PostMapping(value = "/select_overtime_rules")
@ApiOperation(value = "6.获取加班规则数据-根据 组织机构代码-分页", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "6.获取加班规则数据-根据 组织机构代码-分页", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
public Result<Object> selectOvertimeRules(@CurrentUser UserBean userBean, @RequestBody AttqueryCriteriaDto attquerycriteriadto) { public Result<Object> selectOvertimeRules(@CurrentUser UserBean userBean, @RequestBody AttqueryCriteriaDto attquerycriteriadto) throws IllegalAccessException, InvocationTargetException {
IPage<KqglAssoOvertimeRules> page = new Page<KqglAssoOvertimeRules>( IPage<KqglAssoOvertimeRules> page = new Page<KqglAssoOvertimeRules>(
attquerycriteriadto.getCurrentPage() == null ? 1 : attquerycriteriadto.getCurrentPage(), attquerycriteriadto.getCurrentPage() == null ? 1 : attquerycriteriadto.getCurrentPage(),
attquerycriteriadto.getTotalPage() == null ? 10 : attquerycriteriadto.getTotalPage()); attquerycriteriadto.getTotalPage() == null ? 10 : attquerycriteriadto.getTotalPage());
...@@ -166,7 +164,20 @@ public class TimeCardController { ...@@ -166,7 +164,20 @@ public class TimeCardController {
attquerycriteriadto.setEmpNum(userBean.getEmpNum()); attquerycriteriadto.setEmpNum(userBean.getEmpNum());
IPage<KqglAssoOvertimeRules> pageAs = kqglassoovertimerulesmapper.selectPage(page, new QueryWrapper<KqglAssoOvertimeRules>().lambda().eq(KqglAssoOvertimeRules::getOrgCode, userBean.getOrgCode())); IPage<KqglAssoOvertimeRules> pageAs = kqglassoovertimerulesmapper.selectPage(page, new QueryWrapper<KqglAssoOvertimeRules>().lambda().eq(KqglAssoOvertimeRules::getOrgCode, userBean.getOrgCode()));
List<KqglAssoOvertimeRules> listAs = pageAs.getRecords(); List<KqglAssoOvertimeRules> listAs = pageAs.getRecords();
return ResultUtil.data(pageAs, listAs, "操作成功!"); 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();
}
KqglAssoOvertimeRulesDto ruldto = KqglAssoOvertimeRulesDto.builder().build();
ruldto.setApplyrange(nary);
BeanUtil.copyProperties(listAs.get(i), ruldto , "starttime","applyrange");
rulesdto.add(ruldto);
}
return ResultUtil.data(pageAs, rulesdto, "操作成功!");
} }
/** /**
...@@ -221,13 +232,16 @@ public class TimeCardController { ...@@ -221,13 +232,16 @@ public class TimeCardController {
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 8)
public Result<IndividualOvertimeRuleDto> getOvertimeRules(@PathVariable("id") Integer id) { public Result<IndividualOvertimeRuleDto> getOvertimeRules(@PathVariable("id") Integer id) {
IndividualOvertimeRuleDto overrule = IndividualOvertimeRuleDto.builder().build(); IndividualOvertimeRuleDto overrule = IndividualOvertimeRuleDto.builder().build();
KqglAssoOvertimeRules rules = KqglAssoOvertimeRules.builder().id(id).build().selectById(); KqglAssoOvertimeRules rules = KqglAssoOvertimeRules.builder().id(id).build().selectById();
String str = rules.getAppliedScope(); String str = rules.getAppliedScope();
String[] arr = str.split(","); // 用,分割 String[] arr = str.split(","); // 用,分割
KqglAssoOvertimeRulesDto ruldto = KqglAssoOvertimeRulesDto.builder().build(); KqglAssoOvertimeRulesDto ruldto = KqglAssoOvertimeRulesDto.builder().build();
ruldto.setApplyrange(arr); ruldto.setApplyrange(arr);
BeanUtil.copyProperties(rules, ruldto , "starttime","applyrange"); BeanUtil.copyProperties(rules, ruldto , "starttime","applyrange");
overrule.setRules(ruldto); overrule.setRules(ruldto);
List<KqglAssOvertimeVice> vice = new LambdaQueryChainWrapper<KqglAssOvertimeVice>(kqglassovertimevicemapper).eq(KqglAssOvertimeVice::getOvertimeRulesId, id).list(); List<KqglAssOvertimeVice> vice = new LambdaQueryChainWrapper<KqglAssOvertimeVice>(kqglassovertimevicemapper).eq(KqglAssOvertimeVice::getOvertimeRulesId, id).list();
overrule.setStarttime(vice); overrule.setStarttime(vice);
return ResultUtil.data(overrule,"操作成功!"); return ResultUtil.data(overrule,"操作成功!");
...@@ -680,7 +694,31 @@ public class TimeCardController { ...@@ -680,7 +694,31 @@ public class TimeCardController {
attquerycriteriadto.setEmpNum(userBean.getEmpNum()); attquerycriteriadto.setEmpNum(userBean.getEmpNum());
IPage<KqglAssoLeaveRules> pageAs = kqglassoleaverulesmapper.selectPage(page, new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, userBean.getOrgCode())); IPage<KqglAssoLeaveRules> pageAs = kqglassoleaverulesmapper.selectPage(page, new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, userBean.getOrgCode()));
List<KqglAssoLeaveRules> listAs = pageAs.getRecords(); List<KqglAssoLeaveRules> listAs = pageAs.getRecords();
return ResultUtil.data(pageAs, listAs, "操作成功!");
List<KqglAssoLeaveRulesDto> leadto = new ArrayList<KqglAssoLeaveRulesDto>();
for (int i = 0, n = listAs.size(); i < n; i++) {
String[] nary = null;
if(listAs.get(i).getApply() == 0) {//全公司
nary = new String[1];//用户名
nary[0] = "全公司";
}else {//考勤组
List<KqglAssoRulesVice> vice = kqglassorulesvicemapper.selectList(new QueryWrapper<KqglAssoRulesVice>().lambda().eq(KqglAssoRulesVice::getLeaveRulesId, listAs.get(i).getId()));
nary = new String[vice.size()];//用户名
for(int y = 0,l = vice.size(); y < l ; y++) {
KqglMainKqz kqzmc = kqglmainkqzmapper.selectOne(new QueryWrapper<KqglMainKqz>().lambda().eq(KqglMainKqz::getId, vice.get(y).getAttgroupId()));
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, "操作成功!");
} }
/** /**
......
...@@ -28,7 +28,7 @@ public class KqglAssoLeaveRulesDto { ...@@ -28,7 +28,7 @@ public class KqglAssoLeaveRulesDto {
private Integer leaveType; private Integer leaveType;
@ApiModelProperty(value = "适用范围 ", example = "0:全公司 -1:考勤组id") @ApiModelProperty(value = "适用范围 ", example = "0:全公司 -1:考勤组id")
private String apply; private Integer apply;
@ApiModelProperty(value = "创建时间 创建时间", example = "101") @ApiModelProperty(value = "创建时间 创建时间", example = "101")
private Long createTime; private Long createTime;
...@@ -48,4 +48,7 @@ public class KqglAssoLeaveRulesDto { ...@@ -48,4 +48,7 @@ public class KqglAssoLeaveRulesDto {
@ApiModelProperty(value = "适用范围集合", example = "101") @ApiModelProperty(value = "适用范围集合", example = "101")
private String[] range; private String[] range;
@ApiModelProperty(value = "适用范围名称", example = "101")
private String[] applyrange;
} }
\ No newline at end of file
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