Commit fff843c4 by tangzhaoqian Committed by chenzg

审批考勤业务

parent a9a78e3f
......@@ -671,17 +671,18 @@ public class SpmkController {
SpmkApproveSummary.builder().id(asId).currentApprover(CommonEnum.NULL_STR.getDesc()).endTime(new Date()).sts(ApproveSummarySts.FINISH.ordinal()).build().updateById();
JSONObject jSONObject = ObjectUtil.deserialize(ad.getRequestData());
jSONObject.set("approveId", FromData.builder().value(String.valueOf(asId)));
jSONObject.set("approveId", FromData.builder().value(String.valueOf(asId)).build());
jSONObject.set("orgCode", userBean.getOrgCode());
System.out.println("0----------"+ FromData.builder().value(String.valueOf(asId)));
System.out.println("1----------"+ aSummary.getAssoType());
System.out.println("2----------"+ ApproveEnum.getEnums(aSummary.getAssoType()));
//审批完成后 业务
SpmkAssoBusiness sab = spmkAssoBusinessFactory.createSpmkService(ApproveEnum.getEnums(aSummary.getAssoType()));
if (sab != null)
System.out.println("3----------"+ sab);
System.out.println("4----------"+ jSONObject);
sab.handleApprove(jSONObject);
System.out.println("4----------"+ aSummary.getAssoType());
}
}
......
......@@ -454,7 +454,12 @@ public class YgglController {
break;
case 1:
String[] strs = IdcardUtil.isValidCard10(zjNum);
isvalid = "澳门/香港".contains(strs[0]) && "true".equals(strs[2]);
if (strs == null) {
isvalid = false;
break;
}
String str2 = strs != null && strs.length > 2 ? strs[2] : "false";
isvalid = "澳门/香港".contains(strs[0]) && "true".equals(str2);
break;
case 2:
isvalid = IdcardUtil.isValidTWCard(zjNum);
......@@ -1256,6 +1261,11 @@ public class YgglController {
YgglMainEmp ygglMainEmp = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, empNum)
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()));
if (ygglMainEmp.getJobStatus() == jobStatus.LIZHIZHONG.getType()) {
return ResultUtil.success("你已在离职中");
}
YgglMainLzb ygglMainLzb = YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).build();
// 移动员工表数据到离职表
BeanUtil.copyProperties(ygglMainEmp, ygglMainLzb, "before_leaving_sts");
......
......@@ -16,10 +16,12 @@ import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.yggl.YgglMainLzb;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.config.enuminterface.YgEnumInterface.jobStatus;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.dto.yggl.YgzzDto;
import cn.timer.api.utils.ResultUtil;
@Service
public class YgglServiceImpl implements YgglService {
......@@ -33,23 +35,36 @@ public class YgglServiceImpl implements YgglService {
@Override
public void applicationResignation(LzygQueryDto lzygQueryDto) {
// TODO Auto-generated method stub
Integer empNum = lzygQueryDto.getEmpNum();
Integer orgCode = lzygQueryDto.getOrgCode();
YgglMainEmp ygglMainEmp = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, empNum)
.eq(YgglMainEmp::getOrgCode, orgCode));
// if (ygglMainEmp.getJobStatus() == jobStatus.LIZHIZHONG.getType()) {
// return ResultUtil.success("你已在离职中");
// }
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<YgglMainEmp>();
queryWrapper.eq("emp_num", empNum).eq("org_code", lzygQueryDto.getOrgCode());
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(queryWrapper);
YgglMainLzb ygglMainLzb = YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).build();
// 移动员工表数据到离职表
BeanUtil.copyProperties(ygglMainEmp, ygglMainLzb);
BeanUtil.copyProperties(ygglMainEmp, ygglMainLzb, "before_leaving_sts");
ygglMainLzb.insert();
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.eq("emp_num", empNum);
UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>();
updateWrapper1.eq("emp_num", empNum);
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).build().update(updateWrapper);
YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime())
.lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build().update(updateWrapper1);
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(jobStatus.LIZHIZHONG.getType())
.beforeLeavingSts(ygglMainEmp.getJobStatus()).build()
.update(new UpdateWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, empNum)
.eq(YgglMainEmp::getOrgCode, orgCode));
YgglMainLzb.builder()
.jobStatus(jobStatus.LIZHIZHONG.getType())
.lzTime(lzygQueryDto.getLzTime())
.lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build()
.update(new UpdateWrapper<YgglMainLzb>().lambda()
.eq(YgglMainLzb::getEmpNum, empNum)
.eq(YgglMainLzb::getOrgCode, orgCode));
}
@Override
......
......@@ -31,7 +31,7 @@ public class EvectionBusiness extends SpmkAssoBusiness {
// 发起人企业id
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
String id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : jsonObj.get("id",FromData.class).getValue();
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",FromData.class).getValue();
......@@ -50,6 +50,8 @@ public class EvectionBusiness extends SpmkAssoBusiness {
AttEvectionApprovalDto eaD = AttEvectionApprovalDto
.builder()
.userid(id)
.orgcode(orgCode)
.evectionid(Convert.toInt(approveId))
.evectiontype(1)
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
......
......@@ -29,7 +29,7 @@ public class GoOutBusiness extends SpmkAssoBusiness {
// 发起人企业id
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
String id = jsonObj.get("id",FromData.class).getValue();
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
String initiator = jsonObj.get("initiator",FromData.class).getValue();
......@@ -48,6 +48,8 @@ public class GoOutBusiness extends SpmkAssoBusiness {
AttEvectionApprovalDto eaD = AttEvectionApprovalDto
.builder()
.userid(id)
.orgcode(orgCode)
.evectionid(Convert.toInt(approveId))
.evectiontype(2)
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
......
......@@ -33,14 +33,14 @@ public class LeaveBusiness extends SpmkAssoBusiness {
// 发起人企业id
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
String id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : jsonObj.get("id",FromData.class).getValue();
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",FromData.class).getValue();
// 审批汇总id
String approveId = ObjectUtil.isNull(jsonObj.get("approveId",FromData.class)) ? null : jsonObj.get("approveId",FromData.class).getValue();
// 请假类型
// 请假类型 - 前端传中文
String LeaveType = ObjectUtil.isNull(jsonObj.get("__LeaveType",FromData.class)) ? null : jsonObj.get("__LeaveType",FromData.class).getValue();
// 开始时间
String startTime = ObjectUtil.isNull(jsonObj.get("__startTime",FromData.class)) ? null : jsonObj.get("__startTime",FromData.class).getValue();
......@@ -55,8 +55,10 @@ public class LeaveBusiness extends SpmkAssoBusiness {
AttLeaveApprovalDto laD = AttLeaveApprovalDto
.builder()
.userid(id)
.orgcode(orgCode)
.leaveid(Convert.toInt(approveId))
.leavetype(Convert.toInt(LeaveType))
.leavetype(Convert.toInt(1))
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
.endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss"))
.duration(Convert.toDouble(longTime))
......
......@@ -23,7 +23,7 @@ public class RecruitBusiness extends SpmkAssoBusiness {
// 发起人企业id
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
String id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : jsonObj.get("id",FromData.class).getValue();
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",FromData.class).getValue();
......
......@@ -31,7 +31,7 @@ public class ReissueACardBusiness extends SpmkAssoBusiness {
// 发起人企业id
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
String id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : jsonObj.get("id",FromData.class).getValue();
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",FromData.class).getValue();
......@@ -50,6 +50,8 @@ public class ReissueACardBusiness extends SpmkAssoBusiness {
AttRepairApprovalDto raD = AttRepairApprovalDto
.builder()
.userid(id)
.orgcode(orgCode)
.repairid(Convert.toInt(approveId))
.cardrepltime(DateUtil.getStringTime(PatchCardTime, "yyyy-MM-dd HH:mm:ss"))
.cardreplperiod(Convert.toInt(cardreplperiod))
......
......@@ -32,7 +32,7 @@ public class ResignationBusiness extends SpmkAssoBusiness {
// 发起人企业id
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("",FromData.class).getValue());
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",FromData.class).getValue();
......
......@@ -6,6 +6,7 @@ import org.springframework.stereotype.Service;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
import cn.timer.api.config.exception.CustomException;
import cn.timer.api.controller.zzgl.service.ZzglBmgwMService;
import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.dto.zzgl.UpEmpDeptDto;
......@@ -38,9 +39,12 @@ public class TransferPositionBusiness extends SpmkAssoBusiness {
// 申请原因
String ReasonForApplication = ObjectUtil.isNull(jsonObj.get("__ReasonForApplication",FromData.class)) ? null : jsonObj.get("__ReasonForApplication",FromData.class).getValue();
// 调入部门
Integer TransferInDepartment = ObjectUtil.isNull(jsonObj.get("__TransferInDepartment",FromData.class)) ? null : Integer.parseInt(jsonObj.get("__TransferInDepartment",FromData.class).getValue());
Integer TransferInDepartment = ObjectUtil.isNull(jsonObj.get("__TransferInDepartment",FromData.class)) ? null : Convert.toInt(jsonObj.get("__TransferInDepartment",FromData.class).getValue());
// 调入岗位
String TransferInPosition = ObjectUtil.isNull(jsonObj.get("__TransferInPosition",FromData.class)) ? null : jsonObj.get("__TransferInPosition",FromData.class).getValue();
Integer TransferInPosition = ObjectUtil.isNull(jsonObj.get("__TransferInPosition",FromData.class)) ? null : Integer.parseInt(jsonObj.get("__TransferInPosition",FromData.class).getValue());
if (TransferInDepartment == null || TransferInPosition == null) {
throw new CustomException("部门或岗位 未填写,审批失败");
}
// 生效日期
String effectiveDate = ObjectUtil.isNull(jsonObj.get("__effectiveDate",FromData.class)) ? null : jsonObj.get("__effectiveDate",FromData.class).getValue();
// 备注
......
......@@ -30,7 +30,7 @@ public class WorkOvertimeBusiness extends SpmkAssoBusiness {
// 发起人企业id
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
String id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : jsonObj.get("id",FromData.class).getValue();
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",FromData.class).getValue();
......@@ -43,23 +43,25 @@ public class WorkOvertimeBusiness extends SpmkAssoBusiness {
String endTime = ObjectUtil.isNull(jsonObj.get("__endTime",FromData.class)) ? null : jsonObj.get("__endTime",FromData.class).getValue();
// 时长
String timeLong = ObjectUtil.isNull(jsonObj.get("__timeLong",FromData.class)) ? null : jsonObj.get("__timeLong",FromData.class).getValue();
// 加班补偿方式
// 加班补偿方式 -前端传中文
String compensate = ObjectUtil.isNull(jsonObj.get("__compensate",FromData.class)) ? null : jsonObj.get("__compensate",FromData.class).getValue();
// 加班原因
String OvertimeReason = ObjectUtil.isNull(jsonObj.get("__OvertimeReason",FromData.class)) ? null : jsonObj.get("__OvertimeReason",FromData.class).getValue();
// 加班类型-前端未给
String overtimetype = ObjectUtil.isNull(jsonObj.get("__overtimetype",FromData.class)) ? null : jsonObj.get("__overtimetype",FromData.class).getValue();
String workOvertimeType = ObjectUtil.isNull(jsonObj.get("__workOvertimeType",FromData.class)) ? null : jsonObj.get("__workOvertimeType",FromData.class).getValue();
// 上传文件
String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue();
AttOvertimeApprovalDto oaD = AttOvertimeApprovalDto
.builder()
.userid(id)
.orgcode(orgCode)
.overtimeid(Convert.toInt(approveId))
.overtimetype(Convert.toInt(overtimetype))
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
.endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss"))
.overtimetype(Convert.toInt(1))
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm"))
.endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm"))
.duration(Convert.toDouble(timeLong))
.compensate(Convert.toInt(compensate))
.compensate(Convert.toInt(1))
.build();
System.out.println("加班:"+oaD);
......
......@@ -211,6 +211,7 @@
FROM yggl_main_emp a
<where>
AND a.org_code = #{param.orgCode}
AND a.job_status IN (0,1,2)
<if test="param.jobType != null">
AND a.job_type = #{param.jobType}
</if>
......
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