请假数据同步添加字段,修改同流流程

This commit is contained in:
fl 2025-02-20 16:09:50 +08:00
parent ffd9a5eae5
commit 5459f64093
6 changed files with 408 additions and 93 deletions

View File

@ -3,6 +3,7 @@ package com.bonus.boot.manager.dataPush.controller;
import com.bonus.boot.manager.dataPush.entity.AttFaceBean;
import com.bonus.boot.manager.dataPush.entity.AttSourceDataBean;
import com.bonus.boot.manager.dataPush.entity.SysUserBean;
import com.bonus.boot.manager.dataPush.entity.WorkReportBean;
import com.bonus.boot.manager.dataPush.service.WechatDataService;
import com.bonus.boot.manager.manager.entity.EvectionBean;
import com.bonus.boot.manager.manager.utils.AjaxRes;
@ -63,6 +64,12 @@ public class WechatDataController {
return wechatDataService.getWechatLeaveList(o);
}
@RequestMapping(value = "getWechatLeaveListById", method = RequestMethod.POST)
@ResponseBody
public AjaxRes getWechatLeaveListById(@RequestBody EvectionBean o) {
return wechatDataService.getWechatLeaveListById(o);
}
@RequestMapping(value = "updateWechatLeave", method = RequestMethod.POST)
@ResponseBody
public AjaxRes updateWechatLeave(@RequestBody EvectionBean o) {
@ -76,11 +83,11 @@ public class WechatDataController {
}
@RequestMapping(value = "deleteWechatLeave", method = RequestMethod.POST)
@ResponseBody
public AjaxRes deleteWechatLeave(@RequestBody EvectionBean o) {
return wechatDataService.deleteWechatLeave(o);
}
// @RequestMapping(value = "deleteWechatLeave", method = RequestMethod.POST)
// @ResponseBody
// public AjaxRes deleteWechatLeave(@RequestBody EvectionBean o) {
// return wechatDataService.deleteWechatLeave(o);
// }
@RequestMapping(value = "insertWechatLeave", method = RequestMethod.POST)
@ResponseBody
@ -118,4 +125,17 @@ public class WechatDataController {
return wechatDataService.checkWechatIsFace(o);
}
@RequestMapping(value = "updateWechatIsSync", method = RequestMethod.POST)
@ResponseBody
public AjaxRes updateWechatIsSync(@RequestBody EvectionBean o) {
return wechatDataService.updateWechatIsSync(o);
}
@RequestMapping(value = "replaceMonthCheckList", method = RequestMethod.POST)
@ResponseBody
public AjaxRes replaceMonthCheckList(@RequestBody List<WorkReportBean> list) {
return wechatDataService.replaceMonthCheckList(list);
}
}

View File

@ -3,6 +3,7 @@ package com.bonus.boot.manager.dataPush.dao;
import com.bonus.boot.manager.dataPush.entity.AttFaceBean;
import com.bonus.boot.manager.dataPush.entity.AttSourceDataBean;
import com.bonus.boot.manager.dataPush.entity.SysUserBean;
import com.bonus.boot.manager.dataPush.entity.WorkReportBean;
import com.bonus.boot.manager.manager.entity.EvectionBean;
import com.bonus.boot.manager.manager.model.SysUser;
import com.bonus.boot.manager.manager.utils.AjaxRes;
@ -30,8 +31,6 @@ public interface WechatDataDao {
int updateWechatLeave(EvectionBean o);
int deleteWechatLeave(EvectionBean o);
int insertWechatLeave(EvectionBean o);
List<AttSourceDataBean> getWechatAttList(AttSourceDataBean o);
@ -45,4 +44,12 @@ public interface WechatDataDao {
int checkWechatIsFace(SysUserBean o);
int updateWechatLeaveMsg(EvectionBean o);
List<EvectionBean> getWechatLeaveListById(EvectionBean o);
void updateWechatLeaveListSync(List<EvectionBean> weChatPersonList);
int updateWechatIsSync(EvectionBean o);
int replaceMonthCheckList(List<WorkReportBean> list);
}

View File

@ -0,0 +1,223 @@
package com.bonus.boot.manager.dataPush.entity;
import lombok.Data;
/**
* 工作安排统计报表
* @author hay
*/
@Data
public class WorkReportBean extends BaseEntity {
/**
* id
*/
private Long id;
/**
* 请假单的uuid
*/
private String uuId;
/**
* 用户id
*/
private Long userId;
/**
* 姓名
*/
private String userName;
/**
* 职位名称
*/
private String postName;
/**
* 月份
*/
private String month;
/**
* 部门id
*/
private String orgId;
private Long[] orgIds;
/**
* 部门名称
*/
private String orgName;
/**
* 轮休人数
*/
private String leaveNum;
/**
* 临时外出人数
*/
private String outNum;
/**
* 出差人数
*/
private String businessTripNum;
/**
* 休假人数
*/
private String holidayNum;
/**
* 开始时间
*/
private String startDate;
/**
* 结束时间
*/
private String endDate;
/**
* 类型
*/
private String type;
/**
* 请假时长
*/
private String leaveDuration;
/**
* 请假类型
*/
private String[] holidayType;
/**
* 考勤员id
*/
private String attCheckId;
/**
* 部门负责人id
*/
private String chargeCheckId;
/**
* 人资专员id
*/
private String wageCheckId;
/**
* 请假类型
*/
private String isCheck;
/**
* 下一步核对的人员id
*/
private String checkId;
/**
* 状态
*/
private String status;
/**
* 考勤员备注
*/
private String attCheckRemark;
/**
* 部门负责人备注
*/
private String chargeCheckRemark;
/**
* 人资专员备注
*/
private String wageCheckRemark;
/**
* 核对备注
*/
private String checkRemark;
/**
* 流程
*/
private String content;
/**
* 考勤员状态
*/
private String attCheckStatus;
/**
* 部门负责人状态
*/
private String chargeCheckStatus;
/**
* 人资专员状态
*/
private String wageCheckStatus;
/**
* 考勤员时间
*/
private String attCheckTime;
/**
* 部门负责人时间
*/
private String chargeCheckTime;
/**
* 人资专员时间
*/
private String wageCheckTime;
/**
* 位置
*/
private String location;
/**
* 请假类型
*/
private String leaveType;
/**
* 请假类型
*/
private String leaveTypes;
/**
* 是否同意
*/
private String isAgree;
/**
* 理由
*/
private String leaveReason;
/**
* 备注
*/
private String remark;
/**
* 主办人id
*/
private String hostUserId;
/**
* 审批状态
*/
private String examineStatus;
}

View File

@ -3,6 +3,7 @@ package com.bonus.boot.manager.dataPush.service;
import com.bonus.boot.manager.dataPush.entity.AttFaceBean;
import com.bonus.boot.manager.dataPush.entity.AttSourceDataBean;
import com.bonus.boot.manager.dataPush.entity.SysUserBean;
import com.bonus.boot.manager.dataPush.entity.WorkReportBean;
import com.bonus.boot.manager.manager.entity.EvectionBean;
import com.bonus.boot.manager.manager.model.SysUser;
import com.bonus.boot.manager.manager.utils.AjaxRes;
@ -26,8 +27,6 @@ public interface WechatDataService {
AjaxRes updateWechatLeave(EvectionBean o);
AjaxRes deleteWechatLeave(EvectionBean o);
AjaxRes insertWechatLeave(EvectionBean o);
AjaxRes getWechatAttList(AttSourceDataBean o);
@ -41,4 +40,10 @@ public interface WechatDataService {
AjaxRes checkWechatIsFace(SysUserBean o);
AjaxRes updateWechatLeaveMsg(EvectionBean o);
AjaxRes getWechatLeaveListById(EvectionBean o);
AjaxRes updateWechatIsSync(EvectionBean o);
AjaxRes replaceMonthCheckList(List<WorkReportBean> list);
}

View File

@ -4,6 +4,7 @@ import com.bonus.boot.manager.dataPush.dao.WechatDataDao;
import com.bonus.boot.manager.dataPush.entity.AttFaceBean;
import com.bonus.boot.manager.dataPush.entity.AttSourceDataBean;
import com.bonus.boot.manager.dataPush.entity.SysUserBean;
import com.bonus.boot.manager.dataPush.entity.WorkReportBean;
import com.bonus.boot.manager.dataPush.service.WechatDataService;
import com.bonus.boot.manager.manager.entity.EvectionBean;
import com.bonus.boot.manager.manager.model.SysUser;
@ -12,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
@ -116,19 +118,6 @@ public class WechatDataServiceImpl implements WechatDataService {
return ar;
}
/**
* 删除已经同步到考勤系统的出差请假数据后续将所有数据再推过来
* @param o
* @return
*/
@Override
public AjaxRes deleteWechatLeave(EvectionBean o) {
AjaxRes ar = new AjaxRes();
int i = wechatDataDao.deleteWechatLeave(o);
ar.setSucceedMsg("success");
return ar;
}
/**
* 从考勤系统同步出差请假数据到小程序
* @param o
@ -229,4 +218,33 @@ public class WechatDataServiceImpl implements WechatDataService {
return ar;
}
@Transactional
@Override
public AjaxRes getWechatLeaveListById(EvectionBean o) {
AjaxRes ar = new AjaxRes();
List<EvectionBean> weChatPersonList = wechatDataDao.getWechatLeaveListById(o);
//将推送过去的数据咱设为不可更改状态防止在推送过程中修改数据避免无法记录修改的情况
if(!weChatPersonList.isEmpty()){
wechatDataDao.updateWechatLeaveListSync(weChatPersonList);
}
ar.setSucceed(weChatPersonList);
return ar;
}
@Override
public AjaxRes updateWechatIsSync(EvectionBean o) {
AjaxRes ar = new AjaxRes();
int i = wechatDataDao.updateWechatIsSync(o);
ar.setRes(i);
return ar;
}
@Override
public AjaxRes replaceMonthCheckList(List<WorkReportBean> list) {
AjaxRes ar = new AjaxRes();
int i = wechatDataDao.replaceMonthCheckList(list);
ar.setRes(i);
return ar;
}
}

View File

@ -4,24 +4,24 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.boot.manager.dataPush.dao.WechatDataDao">
<insert id="insertWechatPerson">
insert into sys_user_wechat(user_id,user_name,phone,password,is_pd,is_face,update_time,is_cadre)
values(#{userId},#{userName},#{phone},#{password},#{isPd},#{isFace},#{updateTime},#{isCadre})
insert into sys_user_wechat(user_id, user_name, phone, password, is_pd, is_face, update_time, is_cadre)
values (#{userId}, #{userName}, #{phone}, #{password}, #{isPd}, #{isFace}, #{updateTime}, #{isCadre})
</insert>
<insert id="insertWechatLeave">
insert into leave_apply_wechat(id,uuid,leave_form_id,submit_id,user_id,user_name,org_id,org_name,`type`,
leave_type,leave_reason,
leave_start_date,
<if test="leaveStartInterval != null">
leave_start_interval,
</if>
leave_end_date,
<if test="leaveEndInterval != null">
leave_end_interval,
</if>
leave_duration,examine_user_id,examine_opinion,examine_time,examine_status,host_user_id,
host_user_name,is_agree,location,`source`,create_user_id,create_time,update_user_id,update_time,remark)
values(#{id},#{uuid},#{leaveFormId},#{submitId},#{userId},#{userName},#{orgId},#{orgName},#{type},
insert into leave_apply_wechat(id,uuid,leave_form_id,submit_id,user_id,user_name,org_id,`type`,
leave_type,leave_reason,
leave_start_date,
<if test="leaveStartInterval != null">
leave_start_interval,
</if>
leave_end_date,
<if test="leaveEndInterval != null">
leave_end_interval,
</if>
leave_duration,examine_user_id,examine_opinion,examine_time,examine_status,host_user_id,
host_user_name,is_agree,location,`source`,create_user_id,create_time,update_user_id,update_time,remark,is_plateau,plateau_subsidy)
values(#{id},#{uuid},#{leaveFormId},#{submitId},#{userId},#{userName},#{orgId},#{type},
#{leaveType},#{leaveReason},
#{leaveStartDate},
<if test="leaveStartInterval != null">
@ -33,111 +33,153 @@
</if>
#{leaveDuration},#{examineUserId},#{examineOpinion},#{examineTime},
#{examineStatus},#{hostUserId},#{hostUserName},#{isAgree},#{location},#{source},
#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{remark})
#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{remark},#{isPlateau},#{plateauSubsidy})
</insert>
<insert id="replaceMonthCheckList">
<foreach collection="list" item="it">
replace into
leave_check_wechat(id, `month`, org_id, leave_num, out_num, business_trip_num, holiday_num,
att_check_id, att_check_status, att_check_time, att_check_remark, charge_check_id,
charge_check_status, charge_check_time, charge_check_remark, wage_check_id, wage_check_status,
wage_check_time, wage_check_remark, create_time, is_active, status)
values(#{it.id}, #{it.month}, #{it.orgId}, #{it.leaveNum}, #{it.outNum}, #{it.businessTripNum},
#{it.holidayNum}, #{it.attCheckId}, #{it.attCheckStatus}, #{it.attCheckTime}, #{it.attCheckRemark},
#{it.chargeCheckId}, #{it.chargeCheckStatus}, #{it.chargeCheckTime}, #{it.chargeCheckRemark},
#{it.wageCheckId}, #{it.wageCheckStatus}, #{it.wageCheckTime}, #{it.wageCheckRemark}, #{it.createTime},
#{it.isActive}, #{it.status})
</foreach>
</insert>
<update id="updateWechatPerson">
update sys_user_wechat set user_name = #{userName},phone = #{phone},
password = #{password},update_time = #{updateTime},is_cadre = #{isCadre},is_face = #{isFace}
update sys_user_wechat
set user_name = #{userName},
phone = #{phone},
password = #{password},
update_time = #{updateTime},
is_cadre = #{isCadre},
is_face = #{isFace}
where user_id = #{userId}
</update>
<update id="updateWechatIsPd">
update sys_user_wechat set is_pd = #{isPd} where user_id = #{userId}
update sys_user_wechat
set is_pd = #{isPd}
where user_id = #{userId}
</update>
<update id="updateWechatIsFace">
update sys_user_wechat set is_face = #{isFace} where user_id = #{userId}
update sys_user_wechat
set is_face = #{isFace}
where user_id = #{userId}
</update>
<update id="checkWechatIsFace">
update sys_user_face_wechat
<set>
<if test='isCheck == 1'>
is_check = #{isCheck},is_push = 0,applied_face = new_face,applied_face_features = new_face_features
is_check = #{isCheck},is_push = 0,applied_face = new_face,applied_face_features = new_face_features
</if>
<if test='isCheck == 2'>
is_check = #{isCheck},new_face = null,new_face_features = null
is_check = #{isCheck},new_face = null,new_face_features = null
</if>
</set>
where user_id = #{userId};
</update>
<update id="updateWechatLeave">
update leave_apply_wechat set id = #{id} where uuid = #{uuid}
update leave_apply_wechat
set id = #{id},
org_id = #{orgId}
where uuid = #{uuid}
</update>
<update id="updateWechatLeaveMsg">
update leave_apply_wechat
SET
leave_form_id = #{leaveFormId},
submit_id = #{submitId},
user_id = #{userId},
user_name = #{userName},
org_id = #{orgId},
org_name = #{orgName},
leave_type = #{leaveType},
type = #{type},
leave_reason = #{leaveReason},
SET leave_form_id = #{leaveFormId},
submit_id = #{submitId},
user_id = #{userId},
user_name = #{userName},
org_id = #{orgId},
leave_type = #{leaveType},
type = #{type},
leave_reason = #{leaveReason},
leave_start_date = #{leaveStartDate},
leave_end_date = #{leaveEndDate},
leave_duration = #{leaveDuration},
examine_user_id = #{examineUserId},
examine_opinion = #{examineOpinion},
examine_time = #{examineTime},
examine_status = #{examineStatus},
host_user_id = #{hostUserId},
host_user_name = #{hostUserName},
is_agree = #{isAgree},
location = #{location},
source = #{source},
create_user_id = #{createUserId},
create_time = #{createTime},
update_user_id = #{updateUserId},
update_time = #{updateTime},
remark = #{remark}
leave_end_date = #{leaveEndDate},
leave_duration = #{leaveDuration},
examine_user_id = #{examineUserId},
examine_opinion = #{examineOpinion},
examine_time = #{examineTime},
examine_status = #{examineStatus},
host_user_id = #{hostUserId},
host_user_name = #{hostUserName},
is_agree = #{isAgree},
location = #{location},
source = #{source},
create_user_id = #{createUserId},
create_time = #{createTime},
update_user_id = #{updateUserId},
update_time = #{updateTime},
remark = #{remark},
is_plateau = #{isPlateau},
plateau_subsidy = #{plateauSubsidy}
WHERE id = #{id};
</update>
<update id="updateWechatAttList">
update att_source_data_wechat set is_outside_att = #{isOutsideAtt}
where name = #{name} and att_current_day = #{attCurrentDay}
and att_current_time = #{attCurrentTime}
update att_source_data_wechat
set is_outside_att = #{isOutsideAtt}
where name = #{name}
and att_current_day = #{attCurrentDay}
and att_current_time = #{attCurrentTime}
</update>
<update id="updateWechatLeaveListSync">
update leave_apply_wechat set is_sync = 1
where uuid in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item.uuid}
</foreach>
</update>
<update id="updateWechatIsSync">
update leave_apply_wechat
set is_sync = 0
where uuid = #{uuid}
</update>
<delete id="deleteWechatLeave">
delete from leave_apply_wechat where id is not null and uuid is not null
</delete>
<delete id="deleteWechatPerson">
delete from sys_user_wechat where user_id = #{userId}
delete
from sys_user_wechat
where user_id = #{userId}
</delete>
<select id="getWeChatPersonList" resultType="com.bonus.boot.manager.dataPush.entity.SysUserBean">
SELECT
*
FROM
sys_user_wechat
SELECT *
FROM sys_user_wechat
WHERE is_active = '1'
</select>
<select id="getWeChatFaceList" resultType="com.bonus.boot.manager.dataPush.entity.AttFaceBean">
SELECT
*
FROM
sys_user_face_wechat
SELECT *
FROM sys_user_face_wechat
</select>
<select id="getWechatLeaveList" resultType="com.bonus.boot.manager.manager.entity.EvectionBean">
select * from leave_apply_wechat where is_active = '1'
select *
from leave_apply_wechat
where is_active = '1'
</select>
<select id="getWechatAttList" resultType="com.bonus.boot.manager.dataPush.entity.AttSourceDataBean">
SELECT
*
from
att_source_data_wechat
where is_active = '1' and is_outside_att = '0'
SELECT *
from att_source_data_wechat
where is_active = '1'
and is_outside_att = '0'
</select>
<select id="getWechatLeaveListById" resultType="com.bonus.boot.manager.manager.entity.EvectionBean">
select *
from leave_apply_wechat
where is_active = '1'
and id = #{id}
and is_update = #{isUpdate}
</select>
</mapper>