Commit e702a93d by ilal Committed by chenzg

提交

parent d87bf527
......@@ -60,8 +60,11 @@ public class KqglAssoLeaveBalance extends Model<KqglAssoLeaveBalance> {
@ApiModelProperty(value = "修改序号 修改序号", example = "101")
private Integer modifyNumber;
@ApiModelProperty(value="企业组织代码 企业组织代码",example="101")
private Integer orgCode;
@ApiModelProperty(value = "企业组织代码 企业组织代码", example = "101")
private Integer orgCode;
@ApiModelProperty(value = "是否为系统自动 0:否;1:是", example = "101")
private Integer isAutomatic;
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -34,8 +35,11 @@ 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.AttGroupBinPunchMode;
import cn.timer.api.bean.kqgl.AttendanceMachine;
import cn.timer.api.bean.kqgl.PunchCardDetails;
import cn.timer.api.bean.kqgl.PunchRecord;
import cn.timer.api.bean.kqgl.UserAttendanceRel;
import cn.timer.api.bean.kqmk.KqglAssOvertimeVice;
import cn.timer.api.bean.kqmk.KqglAssoBcsz;
import cn.timer.api.bean.kqmk.KqglAssoDkdz;
......@@ -62,6 +66,8 @@ import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dao.kqgl.PunchCardDetailsMapper;
import cn.timer.api.dao.kqgl.PunchRecordMapper;
import cn.timer.api.dao.kqgl.UserAttendanceRelMapper;
import cn.timer.api.dao.kqgl.UserEquiRelationMapper;
import cn.timer.api.dao.kqmk.KqglAssOvertimeViceMapper;
import cn.timer.api.dao.kqmk.KqglAssoBcszMapper;
import cn.timer.api.dao.kqmk.KqglAssoDkdzMapper;
......@@ -84,6 +90,7 @@ import cn.timer.api.dto.kqmk.AttSchedulingDto;
import cn.timer.api.dto.kqmk.AttendanceAssistantDto;
import cn.timer.api.dto.kqmk.AttqueryCriteriaDto;
import cn.timer.api.dto.kqmk.CompensateDto;
import cn.timer.api.dto.kqmk.EmployeeLeaveBalanceDto;
import cn.timer.api.dto.kqmk.IndividualOvertimeRuleDto;
import cn.timer.api.dto.kqmk.KqglAssoLeaveRulesDto;
import cn.timer.api.dto.kqmk.KqglAssoOvertimeRulesDto;
......@@ -118,7 +125,7 @@ public class TimeCardController {
/**
* 查询列表-获取班次数据-分页
*/
@PostMapping(value = "/select_shifts")
@PostMapping(value = "/ShiftDataList")
@ApiOperation(value = "1.获取班次数据-根据 组织机构代码-分页", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 1)
public Result<Object> selectShifts(@CurrentUser UserBean userBean, @RequestBody AttqueryCriteriaDto attquerycriteriadto) {
......@@ -379,9 +386,16 @@ public class TimeCardController {
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()));
KqglAssoLeaveBalance.builder().build().delete(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getLeaveRulesId, id)
.eq(KqglAssoLeaveBalance :: getOrgCode, userBean.getOrgCode()));
if(leaverules.getLeaveBalance() == 1) {//假期余额 0:关(该项余额为“不限余额”);1:开(该项余额为“0”)
//该项公司员工余额为“0”
List<YgglMainEmp> yggl = YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
for(YgglMainEmp ye:yggl) {
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();//员工假期余额
}
}
List<KqglAssoRulesVice> vices = new ArrayList<KqglAssoRulesVice>();
String[] rest = leaverules.getRange();
......@@ -451,6 +465,30 @@ public class TimeCardController {
return ResultUtil.data(attendanList,"操作成功!");
}
@GetMapping(value="/synchrotime/{code}")
@ApiOperation(value = "考勤机一键同步", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 54)
public Result<Object> SynchronizationTime(@CurrentUser UserBean userBean,@PathVariable("code") String code) {
JSONObject vResultJson = new JSONObject();
vResultJson.put("devId", code);
String sFinal = vResultJson.toString();
String url = StaticVariable.mac_command+"/setTime";
HttpHeaders headers = new HttpHeaders();
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
params.add("json", sFinal);
RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers);
try {
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
} catch (RestClientException e) {
System.err.println("提示:考勤机服务出错");
return ResultUtil.success("失败");
}
return ResultUtil.success("成功");
}
/**
* 新增考勤机
*/
......@@ -553,21 +591,6 @@ public class TimeCardController {
return KqglAssoDkdz.builder().id(id).build().deleteById() ? ResultUtil.success("删除成功!") : ResultUtil.error("没有找到该对象");
}
/**
* 获取打卡地址所在考勤组数据*********
*/
// @GetMapping(value="/PunchAddressGroup/{id}")
// @ApiOperation(value = "获取打卡地址所在考勤组数据", httpMethod = "GET", notes = "接口发布说明")
// @ApiOperationSupport(order = 14)
// public Result<List<AttendanceGroup>> getPunchAddressGroup(@CurrentUser UserBean userBean,@PathVariable("id") Integer id) {
//
// int qyid = userBean.getOrgCode();//坏小孩【企业id】
// int userid = userBean.getEmpNum();//用户id
//
// List<AttendanceGroup> attaddressownlist = attendancegroupservice.selectByPrimaryAttAddressOwn(qyid,id);
// return ResultUtil.data(attaddressownlist);
// }
/*********打卡WIFI***********/
/**
* 获取打卡WIFI数据
......@@ -626,19 +649,6 @@ public class TimeCardController {
return KqglAssoDkwx.builder().id(id).build().deleteById() ? ResultUtil.success("删除成功!") : ResultUtil.error("没有找到该对象");
}
/**
* 获取打卡WIFI所在考勤组数据*****
*/
// @GetMapping(value="/PunchWIFIGroup/{id}")
// @ApiOperation(value = "获取打卡WIFI所在考勤组数据", httpMethod = "GET", notes = "接口发布说明")
// @ApiOperationSupport(order = 20)
// public Result<List<AttendanceGroup>> getPunchWIFIGroup(@CurrentUser UserBean userBean,@PathVariable("id") Integer id) {
// int qyid = userBean.getOrgCode();//坏小孩【企业id】
//
// List<AttendanceGroup> attwifiownlist = attendancegroupservice.selectByPrimaryAttWIFIOwn(qyid,id);
// return ResultUtil.data(attwifiownlist);
// }
@Autowired
private KqglAssoLeaveBalanceMapper kqglassoleavebalancemapper;
/**
......@@ -757,7 +767,7 @@ public class TimeCardController {
return ResultUtil.data(pageAs, leadto, "操作成功!");
}
/*****************考勤组***********************/
/**
* 查询列表-考勤组-分页
*/
......@@ -820,14 +830,44 @@ public class TimeCardController {
return ResultUtil.data(yggl);
}
//用户和考勤组关系
@Autowired
private UserAttendanceRelMapper userattendancerelservice;
//用户与设备关系表
@Autowired
private UserEquiRelationMapper userequirelationmapper;
/**
* 删除考勤组
*/
@DeleteMapping(value = "/AttendanceGroup/{id}")
@ApiOperation(value = "39:删除考勤组", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 39)
public Result<Integer> DelAttendanceGroup(@PathVariable("id") Integer id) {
public Result<Integer> DelAttendanceGroup(@CurrentUser UserBean userBean,@PathVariable("id") Integer id) {
if(KqglMainKqz.builder().id(id).build().deleteById()) {
// List<UserAttendanceRel> attusers = userattendancerelservice.selectAttendanceOfficerByKqzid(id, userBean.getOrgCode());//该考勤组人数
// //该考勤组所绑定的考勤机
// List<KqglAssoKqzdkfs> kqjs = kqglassokqzdkfsmapper.selectList(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, id).eq(KqglAssoKqzdkfs::getType, 1));
// String DevId = "";
// for(KqglAssoKqzdkfs abp:kqjs) {
// KqglAssoKqj kqj = KqglAssoKqj.builder().id(abp.getDkfsid()).build().selectById();//查询考勤机“序列号”
// DevId = kqj.getCode();
// for(UserAttendanceRel user:attusers) {
// String user_id = user.getEmpnum();//"1692";//要删除的考勤组里面用户ID
// JSONObject vResultJson = new JSONObject();
// vResultJson.put("devId", DevId);
// vResultJson.put("userId", user_id);
// String sFinal = vResultJson.toString();
// String url = StaticVariable.mac_command+"/deleteUser";
// HttpHeaders headers = new HttpHeaders();
// MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
// params.add("json", sFinal);
// RestTemplate restTemplate = new RestTemplate();
// HttpEntity httpEntity = new HttpEntity(params, headers);
// ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
// }
// }
// userequirelationmapper.deleteBykqzid(id);
//删除考勤组绑定的打卡方式
KqglAssoKqzdkfs.builder().build().delete(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, id));
//删除用户和考勤组关系表
......@@ -1698,6 +1738,23 @@ public class TimeCardController {
}
}
@PostMapping(value = "/leave_balance_list")
@ApiOperation(value = "45:获取修改的排班明细", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 45)
public Result<Object> LeaveBalanceList(@CurrentUser UserBean userBean, @Validated @RequestBody AttqueryCriteriaDto attquerycriteriadto) {
IPage<EmployeeLeaveBalanceDto> page = new Page<EmployeeLeaveBalanceDto>(
attquerycriteriadto.getCurrentPage() == null ? 1 : attquerycriteriadto.getCurrentPage(),
attquerycriteriadto.getTotalPage() == null ? 10 : attquerycriteriadto.getTotalPage());
attquerycriteriadto.setOrgCode(userBean.getOrgCode());
attquerycriteriadto.setEmpNum(userBean.getEmpNum());
// 缺-部门id 搜索
IPage<EmployeeLeaveBalanceDto> pageAs = kqglassoleavebalancemapper.selectPageByQueryLeaveBalance(page, attquerycriteriadto);
List<EmployeeLeaveBalanceDto> listAs = pageAs.getRecords();
return ResultUtil.data(pageAs, listAs, "操作成功!");
}
/**************************/
/**
* 查询列表-加班补偿方式
......
package cn.timer.api.dao.kqmk;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance;
import cn.timer.api.dto.kqmk.AttqueryCriteriaDto;
import cn.timer.api.dto.kqmk.EmployeeLeaveBalanceDto;
/**
* 员工假期余额
......@@ -12,5 +17,6 @@ import cn.timer.api.bean.kqmk.KqglAssoLeaveBalance;
*/
@Repository
public interface KqglAssoLeaveBalanceMapper extends BaseMapper<KqglAssoLeaveBalance> {
IPage<EmployeeLeaveBalanceDto> selectPageByQueryLeaveBalance(IPage<EmployeeLeaveBalanceDto> page,@Param("param") AttqueryCriteriaDto attquerycriteriadto);
}
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 BalanceSheetDataDto {
@ApiModelProperty(value = "假期规则id", example = "字段说明")
private Integer leaverulesid;
@ApiModelProperty(value = "余额天数 ", example = "字段说明")
private Integer balancedays;
}
package cn.timer.api.dto.kqmk;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EmployeeLeaveBalanceDto {
@ApiModelProperty(value = "员工工号 ", example = "字段说明")
private Integer empnum;
@ApiModelProperty(value = "员工名称 ", example = "字段说明")
private String empname;
@ApiModelProperty(value = "部门 ", example = "字段说明")
private String department;
@ApiModelProperty(value = "入职日期 ", example = "字段说明")
private String rztime;
@ApiModelProperty(value = "表数据", example = "字段说明")
List<BalanceSheetDataDto> balanceTo;
}
......@@ -14,6 +14,18 @@
<result column="modify_timer" property="modifyTimer" />
<result column="modify_number" property="modifyNumber" />
<result column="org_code" property="orgCode" />
<result column="is_automatic" property="isAutomatic" />
</resultMap>
<resultMap id="LeaveBalanceMap" type="cn.timer.api.dto.kqmk.EmployeeLeaveBalanceDto" >
<result column="empnum" property="empnum" />
<result column="empname" property="empname" />
<result column="department" property="department" />
<result column="rztime" property="rztime" />
<collection property="balanceTo" ofType="cn.timer.api.dto.kqmk.BalanceSheetDataDto">
<result column="leaverulesid" property="leaverulesid"/>
<result column="balancedays" property="balancedays"/>
</collection>
</resultMap>
<sql id="Base_Column_List">
......@@ -26,7 +38,8 @@
modify_userid,
modify_timer,
modify_number,
org_code
org_code,
is_automatic
</sql>
<sql id="Base_Column_List_Alias">
......@@ -39,8 +52,32 @@
modify_userid KqglAssoLeaveBalance_modify_userid,
modify_timer KqglAssoLeaveBalance_modify_timer,
modify_number KqglAssoLeaveBalance_modify_number,
org_code KqglAssoLeaveBalance_org_code
org_code KqglAssoLeaveBalance_org_code,
is_automatic KqglAssoLeaveBalance_is_automatic
</sql>
<select id="selectPageByQueryLeaveBalance" resultMap="LeaveBalanceMap">
SELECT emp.emp_num as empnum,
emp.`name` as empname,
IFNULL(c.name,'') as department,
IFNULL(emp.rz_time,'') as rztime,
yz.leave_rules_id as leaverulesid,
yz.balancedays
from yggl_main_emp emp
LEFT JOIN zzgl_bmgw_m as gw on gw.id = emp.bmgw_id
LEFT JOIN zzgl_bmgw_m as c ON c.id = gw.up_id
LEFT JOIN (select bal.leave_rules_id,bal.userid,SUM(bal.balance_days) as balancedays
from kqgl_asso_leave_balance bal
where bal.org_code = #{param.orgCode}
GROUP BY bal.userid,bal.leave_rules_id) as yz on yz.userid = emp.emp_num
where emp.org_code = #{param.orgCode}
<if test="param.query != null and param.query != ''">
and ( emp.`name` like CONCAT('%',#{param.query},'%') or
emp.emp_num like CONCAT('%',#{param.query},'%') or
c.name like CONCAT('%',#{param.query},'%'))
</if>
ORDER BY emp.emp_num DESC
</select>
<!--
......@@ -72,7 +109,10 @@
modify_number,
</if>
<if test ='null != orgCode'>
org_code
org_code,
</if>
<if test ='null != isAutomatic'>
is_automatic
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
......@@ -101,7 +141,10 @@
#{modifyNumber},
</if>
<if test ='null != orgCode'>
#{orgCode}
#{orgCode},
</if>
<if test ='null != isAutomatic'>
#{isAutomatic}
</if>
</trim>
</insert>
......@@ -122,7 +165,8 @@
<if test ='null != modifyUserid'>modify_userid = #{modifyUserid},</if>
<if test ='null != modifyTimer'>modify_timer = #{modifyTimer},</if>
<if test ='null != modifyNumber'>modify_number = #{modifyNumber},</if>
<if test ='null != orgCode'>org_code = #{orgCode}</if>
<if test ='null != orgCode'>org_code = #{orgCode},</if>
<if test ='null != isAutomatic'>is_automatic = #{isAutomatic}</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