Commit 6896cb94 by tangzhaoqian

员工导出、导入,审批请假、补卡、加班、出差、外出对接,审批逻辑优化

parent 7f508266
...@@ -57,6 +57,10 @@ public class SpmkApproveExecuteRecord extends Model<SpmkApproveExecuteRecord> { ...@@ -57,6 +57,10 @@ public class SpmkApproveExecuteRecord extends Model<SpmkApproveExecuteRecord> {
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间 ", example = "创建时间") @ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date createTime; private Date createTime;
@TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "操作时间 ", example = "操作时间")
private Date updateTime;
private List<SpmkExecutor> spmkExecutors; private List<SpmkExecutor> spmkExecutors;
......
...@@ -64,5 +64,9 @@ public class SpmkExecutor extends Model<SpmkExecutor> { ...@@ -64,5 +64,9 @@ public class SpmkExecutor extends Model<SpmkExecutor> {
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间 ", example = "创建时间") @ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date createTime; private Date createTime;
@TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "创建时间 ", example = "创建时间")
private Date updateTime;
} }
\ No newline at end of file
...@@ -18,10 +18,8 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -18,10 +18,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.alibaba.druid.sql.visitor.functions.Nil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
...@@ -50,7 +48,6 @@ import cn.timer.api.config.enuminterface.SpmkEnumInterface; ...@@ -50,7 +48,6 @@ import cn.timer.api.config.enuminterface.SpmkEnumInterface;
import cn.timer.api.config.enuminterface.SpmkEnumInterface.ApproveSummarySts; import cn.timer.api.config.enuminterface.SpmkEnumInterface.ApproveSummarySts;
import cn.timer.api.config.enuminterface.SpmkEnumInterface.ExecutorSts; import cn.timer.api.config.enuminterface.SpmkEnumInterface.ExecutorSts;
import cn.timer.api.config.exception.CustomException; import cn.timer.api.config.exception.CustomException;
import cn.timer.api.config.validation.Insert;
import cn.timer.api.config.validation.Ranks; import cn.timer.api.config.validation.Ranks;
import cn.timer.api.config.validation.ValidList; import cn.timer.api.config.validation.ValidList;
import cn.timer.api.controller.spmk.service.SpmkServiceImpl; import cn.timer.api.controller.spmk.service.SpmkServiceImpl;
...@@ -88,10 +85,8 @@ import io.swagger.annotations.ApiOperation; ...@@ -88,10 +85,8 @@ import io.swagger.annotations.ApiOperation;
@Transactional @Transactional
@RequestMapping(value = "/spmk", @RequestMapping(value = "/spmk",
produces = { "application/json","multipart/form-data" }) produces = { "application/json","multipart/form-data" })
//@BindingResultCtrol(title = "发起审批")
public class SpmkController { public class SpmkController {
@Autowired @Autowired
private SpmkApprovalTemplateGMapper spmkApprovalTemplateGMapper; private SpmkApprovalTemplateGMapper spmkApprovalTemplateGMapper;
@Autowired @Autowired
...@@ -127,7 +122,7 @@ public class SpmkController { ...@@ -127,7 +122,7 @@ public class SpmkController {
public Result<Object> saveAtg(@RequestBody SpmkApprovalTemplateG spmkApprovalTemplateG){ public Result<Object> saveAtg(@RequestBody SpmkApprovalTemplateG spmkApprovalTemplateG){
if (spmkApprovalTemplateG.selectCount(new QueryWrapper<SpmkApprovalTemplateG>().lambda() if (spmkApprovalTemplateG.selectCount(new QueryWrapper<SpmkApprovalTemplateG>().lambda()
.ne(SpmkApprovalTemplateG::getId, spmkApprovalTemplateG.getId()) .ne(spmkApprovalTemplateG.getId() != null,SpmkApprovalTemplateG::getId, spmkApprovalTemplateG.getId())
.eq(SpmkApprovalTemplateG::getName, spmkApprovalTemplateG.getName())) > 0) { .eq(SpmkApprovalTemplateG::getName, spmkApprovalTemplateG.getName())) > 0) {
return ResultUtil.error("审批模板组名重复!"); return ResultUtil.error("审批模板组名重复!");
} }
...@@ -198,7 +193,7 @@ public class SpmkController { ...@@ -198,7 +193,7 @@ public class SpmkController {
at.setRouter(ObjectUtil.serialize(spmkApprovalTemplateDto.getRouter())); at.setRouter(ObjectUtil.serialize(spmkApprovalTemplateDto.getRouter()));
if (at.selectCount(new QueryWrapper<SpmkApprovalTemplate>().lambda() if (at.selectCount(new QueryWrapper<SpmkApprovalTemplate>().lambda()
.ne(SpmkApprovalTemplate::getId, at.getId()) .ne(at.getId() != null, SpmkApprovalTemplate::getId, at.getId())
.eq(SpmkApprovalTemplate::getName, at.getName())) > 0) { .eq(SpmkApprovalTemplate::getName, at.getName())) > 0) {
return ResultUtil.error("审批模板名重复!"); return ResultUtil.error("审批模板名重复!");
} }
...@@ -266,7 +261,7 @@ public class SpmkController { ...@@ -266,7 +261,7 @@ public class SpmkController {
public Result<Object> saveAg(@CurrentUser UserBean userBean, @RequestBody SpmkApprovalG spmkApprovalG){ public Result<Object> saveAg(@CurrentUser UserBean userBean, @RequestBody SpmkApprovalG spmkApprovalG){
if (spmkApprovalG.selectCount(new QueryWrapper<SpmkApprovalG>().lambda() if (spmkApprovalG.selectCount(new QueryWrapper<SpmkApprovalG>().lambda()
.ne(SpmkApprovalG::getId, spmkApprovalG.getId()) .ne(spmkApprovalG.getId() != null, SpmkApprovalG::getId, spmkApprovalG.getId())
.eq(SpmkApprovalG::getName, spmkApprovalG.getName()) .eq(SpmkApprovalG::getName, spmkApprovalG.getName())
.eq(SpmkApprovalG::getOrgCode, userBean.getOrgCode())) > 0) { .eq(SpmkApprovalG::getOrgCode, userBean.getOrgCode())) > 0) {
return ResultUtil.error("审批组名重复!"); return ResultUtil.error("审批组名重复!");
...@@ -315,7 +310,6 @@ public class SpmkController { ...@@ -315,7 +310,6 @@ public class SpmkController {
public Result<Object> selectListAg(@CurrentUser UserBean userBean){ public Result<Object> selectListAg(@CurrentUser UserBean userBean){
List<Integer> depts = zzglBmgwMService.empNumupGetDepts(userBean.getOrgCode(), userBean.getEmpNum()); List<Integer> depts = zzglBmgwMService.empNumupGetDepts(userBean.getOrgCode(), userBean.getEmpNum());
System.out.println(depts);
return ResultUtil.data(spmkApprovalGMapper.selectListAgInCa(userBean.getOrgCode(), userBean.getEmpNum(), depts),"操作成功!"); return ResultUtil.data(spmkApprovalGMapper.selectListAgInCa(userBean.getOrgCode(), userBean.getEmpNum(), depts),"操作成功!");
} }
...@@ -349,7 +343,7 @@ public class SpmkController { ...@@ -349,7 +343,7 @@ public class SpmkController {
BeanUtil.copyProperties(spmkCustomApprovalDto, ca , "froms","router","initiatorConfigs"); BeanUtil.copyProperties(spmkCustomApprovalDto, ca , "froms","router","initiatorConfigs");
if (ca.selectCount(new QueryWrapper<SpmkCustomApproval>().lambda() if (ca.selectCount(new QueryWrapper<SpmkCustomApproval>().lambda()
.ne(SpmkCustomApproval::getId, ca.getId()) .ne(ca.getId() != null, SpmkCustomApproval::getId, ca.getId())
.eq(SpmkCustomApproval::getName, ca.getName()) .eq(SpmkCustomApproval::getName, ca.getName())
.eq(SpmkCustomApproval::getOrgCode, userBean.getOrgCode())) > 0) { .eq(SpmkCustomApproval::getOrgCode, userBean.getOrgCode())) > 0) {
return ResultUtil.error("自定义审批名重复!"); return ResultUtil.error("自定义审批名重复!");
...@@ -649,10 +643,12 @@ public class SpmkController { ...@@ -649,10 +643,12 @@ public class SpmkController {
if (aSummary.getSts() != SpmkEnumInterface.ApproveSummarySts.REFUSE.ordinal()) { if (aSummary.getSts() != SpmkEnumInterface.ApproveSummarySts.REFUSE.ordinal()) {
SpmkApproveSummary.builder().id(approvingDto.getAsId()).currentApprover("").endTime(new Date()).sts(ApproveSummarySts.FINISH.ordinal()).build().updateById(); SpmkApproveSummary.builder().id(approvingDto.getAsId()).currentApprover("").endTime(new Date()).sts(ApproveSummarySts.FINISH.ordinal()).build().updateById();
JSONObject jSONObject = ObjectUtil.deserialize(ad.getRequestData());
jSONObject.set("approveId", approvingDto.getAsId());
//审批完成后 业务 //审批完成后 业务
SpmkAssoBusiness sab = SpmkAssoBusinessFactory.createSpmkAssoType(ApproveEnum.getEnums(aSummary.getAssoType())); SpmkAssoBusiness sab = SpmkAssoBusinessFactory.createSpmkAssoType(ApproveEnum.getEnums(aSummary.getAssoType()));
if (sab != null) if (sab != null)
sab.handleApprove(ObjectUtil.deserialize(ad.getRequestData())); sab.handleApprove(jSONObject);
} }
} }
......
...@@ -55,7 +55,7 @@ public class AddygdaDto extends Page implements Serializable{ ...@@ -55,7 +55,7 @@ public class AddygdaDto extends Page implements Serializable{
@ApiModelProperty(value="工作性质 0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘",example="0") @ApiModelProperty(value="工作性质 0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘",example="0")
private Integer jobType; private Integer jobType;
@NotNull(message = ValidationMsg.NOTNULL) // @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="入职日期 ",example="客户注册后的时间为入职时间") @ApiModelProperty(value="入职日期 ",example="客户注册后的时间为入职时间")
private Date rzTime; private Date rzTime;
......
...@@ -541,17 +541,18 @@ public class RouterUtils { ...@@ -541,17 +541,18 @@ public class RouterUtils {
for (Relation relation : listRelation) { for (Relation relation : listRelation) {
List<User> listUser2 = relation.getUsers(); List<User> listUser2 = relation.getUsers();
if (listUser2 != null) {
// 新增 执行人 // 新增 执行人
for (User user2 : listUser2) { for (User user2 : listUser2) {
SpmkExecutor executor = SpmkExecutor.builder() SpmkExecutor executor = SpmkExecutor.builder()
.approveExecuteRecordId(aer3.getId()) .approveExecuteRecordId(aer3.getId())
.empNum(Integer.parseInt(user2.getId())) .empNum(Integer.parseInt(user2.getId()))
.executorName(user2.getName()) .executorName(user2.getName())
.operatorHeaderUrl(user2.getHeadUrl()) .operatorHeaderUrl(user2.getHeadUrl())
.sts(ExecutorSts.AGREE.ordinal()) .sts(ExecutorSts.AGREE.ordinal())
.build(); .build();
executor.insert(); executor.insert();
}
} }
} }
......
package cn.timer.api.utils.router.business; package cn.timer.api.utils.router.business;
import java.text.ParseException;
import org.springframework.beans.factory.annotation.Autowired;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.controller.kqgl.service.KqglService;
import cn.timer.api.dto.kqmk.AttEvectionApprovalDto;
import cn.timer.api.dto.spmk.FromData; import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.utils.DateUtil;
import lombok.Builder; import lombok.Builder;
/** /**
...@@ -14,8 +21,11 @@ import lombok.Builder; ...@@ -14,8 +21,11 @@ import lombok.Builder;
@Builder @Builder
public class EvectionBusiness extends SpmkAssoBusiness { public class EvectionBusiness extends SpmkAssoBusiness {
@Autowired
private KqglService kqglService;
@Override @Override
public void handleApprove(JSONObject jsonObj) { public void handleApprove(JSONObject jsonObj) throws ParseException {
// TODO Auto-generated method stub // TODO Auto-generated method stub
// 发起人企业id // 发起人企业id
String orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : jsonObj.get("orgCode",FromData.class).getValue(); String orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : jsonObj.get("orgCode",FromData.class).getValue();
...@@ -23,6 +33,9 @@ public class EvectionBusiness extends SpmkAssoBusiness { ...@@ -23,6 +33,9 @@ public class EvectionBusiness extends SpmkAssoBusiness {
String id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : jsonObj.get("id",FromData.class).getValue(); String id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : jsonObj.get("id",FromData.class).getValue();
// 发起人名称 // 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",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 startTime = ObjectUtil.isNull(jsonObj.get("__startTime",FromData.class)) ? null : jsonObj.get("__startTime",FromData.class).getValue(); String startTime = ObjectUtil.isNull(jsonObj.get("__startTime",FromData.class)) ? null : jsonObj.get("__startTime",FromData.class).getValue();
// 结束时间 // 结束时间
...@@ -34,8 +47,17 @@ public class EvectionBusiness extends SpmkAssoBusiness { ...@@ -34,8 +47,17 @@ public class EvectionBusiness extends SpmkAssoBusiness {
// 上传文件 // 上传文件
String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue(); String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue();
// 调 考勤管理 业务 AttEvectionApprovalDto eaD = AttEvectionApprovalDto
.builder()
.evectionid(Convert.toInt(approveId))
.evectiontype(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)*60D)
.build();
// 调 考勤管理 业务-出差
kqglService.attevectionapproval(eaD);
} }
} }
package cn.timer.api.utils.router.business; package cn.timer.api.utils.router.business;
import org.springframework.beans.factory.annotation.Autowired;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.controller.kqgl.service.KqglService;
import cn.timer.api.dto.kqmk.AttEvectionApprovalDto;
import cn.timer.api.dto.spmk.FromData; import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.utils.DateUtil;
import lombok.Builder;
/** /**
* 外出 * 外出-业务
* @author Tang * @author Tang
* *
*/ */
@Builder
public class GoOutBusiness extends SpmkAssoBusiness { public class GoOutBusiness extends SpmkAssoBusiness {
@Autowired
private KqglService kqglService;
@Override @Override
public void handleApprove(JSONObject jsonObj) throws Exception { public void handleApprove(JSONObject jsonObj) throws Exception {
// TODO Auto-generated method stub // TODO Auto-generated method stub
...@@ -19,6 +31,9 @@ public class GoOutBusiness extends SpmkAssoBusiness { ...@@ -19,6 +31,9 @@ public class GoOutBusiness extends SpmkAssoBusiness {
String id = jsonObj.get("id",FromData.class).getValue(); String id = jsonObj.get("id",FromData.class).getValue();
// 发起人名称 // 发起人名称
String initiator = jsonObj.get("initiator",FromData.class).getValue(); String initiator = jsonObj.get("initiator",FromData.class).getValue();
// 审批汇总id
String approveId = ObjectUtil.isNull(jsonObj.get("approveId",FromData.class)) ? null : jsonObj.get("approveId",FromData.class).getValue();
// 开始时间 // 开始时间
String startTime = jsonObj.get("__startTime",FromData.class).getValue(); String startTime = jsonObj.get("__startTime",FromData.class).getValue();
// 结束时间 // 结束时间
...@@ -30,8 +45,17 @@ public class GoOutBusiness extends SpmkAssoBusiness { ...@@ -30,8 +45,17 @@ public class GoOutBusiness extends SpmkAssoBusiness {
// 上传文件 // 上传文件
String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue(); String UploadAttachment = jsonObj.get("UploadAttachment",FromData.class).getValue();
// 调 考勤管理 业务 AttEvectionApprovalDto eaD = AttEvectionApprovalDto
.builder()
.evectionid(Convert.toInt(approveId))
.evectiontype(2)
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
.endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss"))
.duration(Convert.toDouble(longTime)*60D)
.build();
// 调 考勤管理 业务-外出
kqglService.attevectionapproval(eaD);
} }
} }
package cn.timer.api.utils.router.business; package cn.timer.api.utils.router.business;
import java.text.ParseException;
import org.springframework.beans.factory.annotation.Autowired;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.controller.kqgl.service.KqglService;
import cn.timer.api.dto.kqmk.AttEvectionApprovalDto;
import cn.timer.api.dto.kqmk.AttLeaveApprovalDto;
import cn.timer.api.dto.spmk.FromData; import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.utils.DateUtil;
import lombok.Builder; import lombok.Builder;
/** /**
...@@ -14,8 +23,11 @@ import lombok.Builder; ...@@ -14,8 +23,11 @@ import lombok.Builder;
@Builder @Builder
public class LeaveBusiness extends SpmkAssoBusiness { public class LeaveBusiness extends SpmkAssoBusiness {
@Autowired
private KqglService kqglService;
@Override @Override
public void handleApprove(JSONObject jsonObj) { public void handleApprove(JSONObject jsonObj) throws ParseException {
// TODO Auto-generated method stub // TODO Auto-generated method stub
// 发起人企业id // 发起人企业id
String orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : jsonObj.get("orgCode",FromData.class).getValue(); String orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : jsonObj.get("orgCode",FromData.class).getValue();
...@@ -24,6 +36,9 @@ public class LeaveBusiness extends SpmkAssoBusiness { ...@@ -24,6 +36,9 @@ public class LeaveBusiness extends SpmkAssoBusiness {
// 发起人名称 // 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",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 LeaveType = ObjectUtil.isNull(jsonObj.get("__LeaveType",FromData.class)) ? null : jsonObj.get("__LeaveType",FromData.class).getValue();
// 开始时间 // 开始时间
...@@ -37,7 +52,17 @@ public class LeaveBusiness extends SpmkAssoBusiness { ...@@ -37,7 +52,17 @@ public class LeaveBusiness extends SpmkAssoBusiness {
// 上传文件 // 上传文件
String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue(); String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue();
// 调 考勤管理 业务 AttLeaveApprovalDto laD = AttLeaveApprovalDto
.builder()
.leaveid(Convert.toInt(approveId))
.leavetype(Convert.toInt(LeaveType))
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
.endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss"))
.duration(Convert.toDouble(longTime)*60D)
.build();
// 调 考勤管理 业务-请假
kqglService.attleaveapproval(laD);
} }
} }
package cn.timer.api.utils.router.business; package cn.timer.api.utils.router.business;
import java.text.ParseException;
import org.springframework.beans.factory.annotation.Autowired;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.controller.kqgl.service.KqglService;
import cn.timer.api.dto.kqmk.AttRepairApprovalDto;
import cn.timer.api.dto.spmk.FromData; import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.utils.DateUtil;
import lombok.Builder; import lombok.Builder;
/** /**
...@@ -13,8 +21,11 @@ import lombok.Builder; ...@@ -13,8 +21,11 @@ import lombok.Builder;
@Builder @Builder
public class ReissueACardBusiness extends SpmkAssoBusiness { public class ReissueACardBusiness extends SpmkAssoBusiness {
@Autowired
private KqglService kqglService;
@Override @Override
public void handleApprove(JSONObject jsonObj) { public void handleApprove(JSONObject jsonObj) throws ParseException {
// TODO Auto-generated method stub // TODO Auto-generated method stub
// 发起人企业id // 发起人企业id
String orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : jsonObj.get("orgCode",FromData.class).getValue(); String orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : jsonObj.get("orgCode",FromData.class).getValue();
...@@ -23,14 +34,28 @@ public class ReissueACardBusiness extends SpmkAssoBusiness { ...@@ -23,14 +34,28 @@ public class ReissueACardBusiness extends SpmkAssoBusiness {
// 发起人名称 // 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",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 PatchCardTime = ObjectUtil.isNull(jsonObj.get("__PatchCardTime",FromData.class)) ? null : jsonObj.get("__PatchCardTime",FromData.class).getValue(); String PatchCardTime = ObjectUtil.isNull(jsonObj.get("__PatchCardTime",FromData.class)) ? null : jsonObj.get("__PatchCardTime",FromData.class).getValue();
// 缺卡原因 // 缺卡原因
String cardShortage = ObjectUtil.isNull(jsonObj.get("cardShortage",FromData.class)) ? null : jsonObj.get("cardShortage",FromData.class).getValue(); String cardShortage = ObjectUtil.isNull(jsonObj.get("cardShortage",FromData.class)) ? null : jsonObj.get("cardShortage",FromData.class).getValue();
// 缺卡时段-上班、下班-前端未改
// String cardreplperiod = ObjectUtil.isNull(jsonObj.get("cardreplperiod",FromData.class)) ? null : jsonObj.get("cardreplperiod",FromData.class).getValue();
// 上传文件 // 上传文件
String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue(); String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue();
// 调 考勤管理 业务 AttRepairApprovalDto raD = AttRepairApprovalDto
.builder()
.repairid(Convert.toInt(approveId))
.cardrepltime(DateUtil.getStringTime(PatchCardTime, "yyyy-MM-dd HH:mm:ss"))
// .cardreplperiod(Convert.toInt(cardreplperiod))
.build();
// 调 考勤管理 业务-补卡
kqglService.attrepairapproval(raD);
} }
} }
...@@ -35,6 +35,9 @@ public class SpmkAssoBusinessFactory { ...@@ -35,6 +35,9 @@ public class SpmkAssoBusinessFactory {
case EVECTION: case EVECTION:
sat = EvectionBusiness.builder().build(); sat = EvectionBusiness.builder().build();
break; break;
case GO_OUT:
sat = GoOutBusiness.builder().build();
break;
case REISSUE_A_CARD: case REISSUE_A_CARD:
sat = ReissueACardBusiness.builder().build(); sat = ReissueACardBusiness.builder().build();
break; break;
......
package cn.timer.api.utils.router.business; package cn.timer.api.utils.router.business;
import java.text.ParseException;
import org.springframework.beans.factory.annotation.Autowired;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.controller.kqgl.service.KqglService;
import cn.timer.api.dto.kqmk.AttOvertimeApprovalDto;
import cn.timer.api.dto.spmk.FromData; import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.utils.DateUtil;
import lombok.Builder; import lombok.Builder;
/** /**
...@@ -13,8 +21,11 @@ import lombok.Builder; ...@@ -13,8 +21,11 @@ import lombok.Builder;
@Builder @Builder
public class WorkOvertimeBusiness extends SpmkAssoBusiness { public class WorkOvertimeBusiness extends SpmkAssoBusiness {
@Autowired
private KqglService kqglService;
@Override @Override
public void handleApprove(JSONObject jsonObj) { public void handleApprove(JSONObject jsonObj) throws ParseException {
// TODO Auto-generated method stub // TODO Auto-generated method stub
// 发起人企业id // 发起人企业id
String orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : jsonObj.get("orgCode",FromData.class).getValue(); String orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : jsonObj.get("orgCode",FromData.class).getValue();
...@@ -23,6 +34,9 @@ public class WorkOvertimeBusiness extends SpmkAssoBusiness { ...@@ -23,6 +34,9 @@ public class WorkOvertimeBusiness extends SpmkAssoBusiness {
// 发起人名称 // 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",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 startTime = ObjectUtil.isNull(jsonObj.get("__startTime",FromData.class)) ? null : jsonObj.get("__startTime",FromData.class).getValue(); String startTime = ObjectUtil.isNull(jsonObj.get("__startTime",FromData.class)) ? null : jsonObj.get("__startTime",FromData.class).getValue();
// 结束时间 // 结束时间
...@@ -33,10 +47,24 @@ public class WorkOvertimeBusiness extends SpmkAssoBusiness { ...@@ -33,10 +47,24 @@ public class WorkOvertimeBusiness extends SpmkAssoBusiness {
String compensate = ObjectUtil.isNull(jsonObj.get("__compensate",FromData.class)) ? null : jsonObj.get("__compensate",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 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 UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue(); String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue();
// 调 考勤管理 业务 AttOvertimeApprovalDto oaD = AttOvertimeApprovalDto
.builder()
.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"))
.duration(Convert.toDouble(timeLong)*60D)
.compensate(Convert.toInt(compensate))
.build();
// 调 考勤管理 业务-加班
kqglService.attovertimeapproval(oaD);
} }
} }
...@@ -2,9 +2,9 @@ package cn.timer.api.utils.router.enums; ...@@ -2,9 +2,9 @@ package cn.timer.api.utils.router.enums;
public enum ApproveEnum { public enum ApproveEnum {
DEFAULT(0, "默认", 1), REGULARIZATION(1, "转正", 1), RESIGNATION(2, "离职", 1), TRANSFER_POSITION(3, "调岗", 1), DEFAULT(0, "默认", 1), REGULARIZATION(1, "转正", 1), RESIGNATION(2, "离职", 1), TRANSFER_POSITION(3, "调岗", 1),RECRUIT(4, "招聘", 1),
RECRUIT(4, "招聘", 1), WORK_OVERTIME(5, "加班", 2), LEAVE(6, "请假", 2), EVECTION(7, "出差", 2), REISSUE_A_CARD(8, "补卡", 2), WORK_OVERTIME(5, "加班", 2), LEAVE(6, "请假", 2), EVECTION(7, "出差", 2), GO_OUT(8, "外出", 2),REISSUE_A_CARD(9, "补卡", 2),
WAGE_ADJUSTMENT(9, "调薪", 3),; WAGE_ADJUSTMENT(10, "调薪", 3);
private Integer type; private Integer type;
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<result column="type" property="type" /> <result column="type" property="type" />
<result column="sts" property="sts" /> <result column="sts" property="sts" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap> </resultMap>
<resultMap id="BaseResultMapDto" type="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord" > <resultMap id="BaseResultMapDto" type="cn.timer.api.bean.spmk.SpmkApproveExecuteRecord" >
...@@ -19,6 +20,7 @@ ...@@ -19,6 +20,7 @@
<result column="type" property="type" /> <result column="type" property="type" />
<result column="sts" property="sts" /> <result column="sts" property="sts" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<collection column="SpmkExecutor_id" property="spmkExecutors" ofType="cn.timer.api.bean.spmk.SpmkExecutor" <collection column="SpmkExecutor_id" property="spmkExecutors" ofType="cn.timer.api.bean.spmk.SpmkExecutor"
resultMap="cn.timer.api.dao.spmk.SpmkExecutorMapper.BaseResultMap" columnPrefix="SpmkExecutor_"> resultMap="cn.timer.api.dao.spmk.SpmkExecutorMapper.BaseResultMap" columnPrefix="SpmkExecutor_">
</collection> </collection>
...@@ -30,7 +32,8 @@ ...@@ -30,7 +32,8 @@
name, name,
type, type,
sts, sts,
create_time create_time,
update_time
</sql> </sql>
<sql id="Base_Column_List_a"> <sql id="Base_Column_List_a">
...@@ -39,7 +42,8 @@ ...@@ -39,7 +42,8 @@
a.name, a.name,
a.type, a.type,
a.sts, a.sts,
a.create_time a.create_time,
a.update_time
</sql> </sql>
<sql id="Base_Column_List_Alias_b"> <sql id="Base_Column_List_Alias_b">
...@@ -50,7 +54,8 @@ ...@@ -50,7 +54,8 @@
b.operator_header_url SpmkExecutor_operator_header_url, b.operator_header_url SpmkExecutor_operator_header_url,
b.opinion SpmkExecutor_opinion, b.opinion SpmkExecutor_opinion,
b.sts SpmkExecutor_sts, b.sts SpmkExecutor_sts,
b.create_time SpmkExecutor_create_time b.create_time SpmkExecutor_create_time,
b.update_time SpmkExecutor_update_time
</sql> </sql>
<sql id="Base_Column_List_Alias"> <sql id="Base_Column_List_Alias">
...@@ -59,7 +64,8 @@ ...@@ -59,7 +64,8 @@
name SpmkApproveExecuteRecord_name, name SpmkApproveExecuteRecord_name,
type SpmkApproveExecuteRecord_type, type SpmkApproveExecuteRecord_type,
sts SpmkApproveExecuteRecord_sts, sts SpmkApproveExecuteRecord_sts,
create_time SpmkApproveExecuteRecord_create_time create_time SpmkApproveExecuteRecord_create_time,
update_time SpmkApproveExecuteRecord_update_time
</sql> </sql>
...@@ -93,7 +99,10 @@ ...@@ -93,7 +99,10 @@
sts, sts,
</if> </if>
<if test ='null != createTime'> <if test ='null != createTime'>
create_time create_time,
</if>
<if test ='null != updateTime'>
update_time
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
...@@ -111,6 +120,9 @@ ...@@ -111,6 +120,9 @@
</if> </if>
<if test ='null != createTime'> <if test ='null != createTime'>
#{createTime} #{createTime}
</if>,
<if test ='null != updateTime'>
#{updateTime}
</if> </if>
</trim> </trim>
</insert> </insert>
...@@ -127,7 +139,8 @@ ...@@ -127,7 +139,8 @@
<if test ='null != name'>name = #{name},</if> <if test ='null != name'>name = #{name},</if>
<if test ='null != type'>type = #{type},</if> <if test ='null != type'>type = #{type},</if>
<if test ='null != sts'>sts = #{sts},</if> <if test ='null != sts'>sts = #{sts},</if>
<if test ='null != createTime'>create_time = #{createTime}</if> <if test ='null != createTime'>create_time = #{createTime},</if>
<if test ='null != updateTime'>update_time = #{updateTime}</if>
</set> </set>
WHERE id = #{id} WHERE id = #{id}
</update> </update>
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<result column="opinion" property="opinion" /> <result column="opinion" property="opinion" />
<result column="sts" property="sts" /> <result column="sts" property="sts" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -22,7 +23,8 @@ ...@@ -22,7 +23,8 @@
operator_header_url, operator_header_url,
opinion, opinion,
sts, sts,
create_time create_time,
update_time
</sql> </sql>
<sql id="Base_Column_List_Alias"> <sql id="Base_Column_List_Alias">
...@@ -33,7 +35,8 @@ ...@@ -33,7 +35,8 @@
operator_header_url SpmkExecutor_operator_header_url, operator_header_url SpmkExecutor_operator_header_url,
opinion SpmkExecutor_opinion, opinion SpmkExecutor_opinion,
sts SpmkExecutor_sts, sts SpmkExecutor_sts,
create_time SpmkExecutor_create_time create_time SpmkExecutor_create_time,
update_time SpmkExecutor_update_time
</sql> </sql>
<!-- <!--
...@@ -60,7 +63,10 @@ ...@@ -60,7 +63,10 @@
sts, sts,
</if> </if>
<if test ='null != createTime'> <if test ='null != createTime'>
create_time create_time,
</if>
<if test ='null != updateTime'>
update_time
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
...@@ -83,7 +89,10 @@ ...@@ -83,7 +89,10 @@
#{sts}, #{sts},
</if> </if>
<if test ='null != createTime'> <if test ='null != createTime'>
#{createTime} #{createTime},
</if>
<if test ='null != updateTime'>
#{updateTime}
</if> </if>
</trim> </trim>
</insert> </insert>
...@@ -102,7 +111,8 @@ ...@@ -102,7 +111,8 @@
<if test ='null != operatorHeaderUrl'>operator_header_url = #{operatorHeaderUrl},</if> <if test ='null != operatorHeaderUrl'>operator_header_url = #{operatorHeaderUrl},</if>
<if test ='null != opinion'>opinion = #{opinion},</if> <if test ='null != opinion'>opinion = #{opinion},</if>
<if test ='null != sts'>sts = #{sts},</if> <if test ='null != sts'>sts = #{sts},</if>
<if test ='null != createTime'>create_time = #{createTime}</if> <if test ='null != createTime'>create_time = #{createTime},</if>
<if test ='null != updateTime'>update_time = #{updateTime}</if>
</set> </set>
WHERE id = #{id} WHERE id = #{id}
</update> </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