Commit aa523f78 by tangzhaoqian Committed by chenzg

员工导入模板-insert,添加员工-优化,审批、员工管理、企业中心代码整理

parent 66bb3ce0
...@@ -2,10 +2,8 @@ package cn.timer.api.bean.clazz; ...@@ -2,10 +2,8 @@ package cn.timer.api.bean.clazz;
import java.util.List; import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
......
...@@ -190,6 +190,9 @@ public class YgglMainEmp extends Model<YgglMainEmp> { ...@@ -190,6 +190,9 @@ public class YgglMainEmp extends Model<YgglMainEmp> {
@ApiModelProperty(value="是否企业中心管理员 ",example="0-否 1-主账号 2-子账号") @ApiModelProperty(value="是否企业中心管理员 ",example="0-否 1-主账号 2-子账号")
private Integer isManager; private Integer isManager;
@ApiModelProperty(value="离职前状态 1试用、2正式 ",example="1试用、2正式")
private Integer beforeLeavingSts;
@Transient @Transient
@TableField(exist = false) @TableField(exist = false)
private String workTime;//工龄 private String workTime;//工龄
......
...@@ -98,7 +98,7 @@ public interface SpmkEnumInterface { ...@@ -98,7 +98,7 @@ public interface SpmkEnumInterface {
*/ */
@Getter @Getter
enum ParticipatorType implements SpmkEnumInterface { enum ParticipatorType implements SpmkEnumInterface {
INITIATOR(0, "发起"), COPY(1, "抄送人"), APPROVER(2, "审批人"); INITIATOR(0, "发起申请"), COPY(1, "抄送人"), APPROVER(2, "审批人");
private Integer type; private Integer type;
private String name; private String name;
......
...@@ -64,7 +64,7 @@ public interface YgEnumInterface { ...@@ -64,7 +64,7 @@ public interface YgEnumInterface {
*/ */
@Getter @Getter
enum YgJobType implements YgEnumInterface { enum YgJobType implements YgEnumInterface {
QUANZHI(0, "全"), SHIXI(1, "实习"), JIANZHI(2, "兼"), LWPQ(3, "劳务派遣"), LAOWU(4, "劳务"), PAIQIAN(5, "派遣"), QUANZHI(0, "全职"), SHIXI(1, "实习"), JIANZHI(2, "兼职"), LWPQ(3, "劳务派遣"), LAOWU(4, "劳务"), PAIQIAN(5, "派遣"),
WAIBAO(6, "外包"), TUIXIU(7, "退休"); WAIBAO(6, "外包"), TUIXIU(7, "退休");
private Integer type; private Integer type;
......
...@@ -11,20 +11,22 @@ import lombok.Getter; ...@@ -11,20 +11,22 @@ import lombok.Getter;
@Getter @Getter
public enum CommonEnum { public enum CommonEnum {
NULL_STR(0,""),
/** /**
* 1 超管理员 * 1 超管理员
*/ */
U_TYPE_ADMIN(1, "超管理员"), U_TYPE_ADMIN(0, "超管理员"),
/** /**
* 2 子管理 * 2 子管理
*/ */
U_TYPE_C_ADMIN(2, "子管理"), U_TYPE_C_ADMIN(1, "子管理"),
/** /**
* 3 普通员工 * 3 普通员工
*/ */
U_TYPE_EMP(3, "普通员工"), U_TYPE_EMP(2, "普通员工"),
/** /**
* 0 关闭 * 0 关闭
......
package cn.timer.api.config.exception; package cn.timer.api.config.exception;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -64,6 +65,15 @@ public class GlobalExceptionHandler { ...@@ -64,6 +65,15 @@ public class GlobalExceptionHandler {
return ResultUtil.error(e.getCode(), e.getMessage()); return ResultUtil.error(e.getCode(), e.getMessage());
} }
/**
* io异常
*/
@ExceptionHandler(IOException.class)
public Result<Object> ioException(IOException e) {
log.error(e.getMessage(), e);
return ResultUtil.error(e.getMessage());
}
/** /**
* 自定义验证异常 * 自定义验证异常
*/ */
......
...@@ -38,6 +38,8 @@ import cn.timer.api.bean.zzgl.ZzglAuth; ...@@ -38,6 +38,8 @@ import cn.timer.api.bean.zzgl.ZzglAuth;
import cn.timer.api.bean.zzgl.ZzglBmgwM; import cn.timer.api.bean.zzgl.ZzglBmgwM;
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.config.enuminterface.YgEnumInterface;
import cn.timer.api.config.enuminterface.YgEnumInterface.YgJobType;
import cn.timer.api.config.enums.CommonEnum; import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.controller.spmk.service.SpmkServiceImpl; import cn.timer.api.controller.spmk.service.SpmkServiceImpl;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper; import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
...@@ -430,7 +432,7 @@ public class LoginController { ...@@ -430,7 +432,7 @@ public class LoginController {
@ApiOperation(value = "6.注册企业", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "6.注册企业", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
@Log(title = "企业注册", businessType = BusinessType.INSERT) @Log(title = "企业注册", businessType = BusinessType.INSERT)
public Result<String> register(@RequestBody EntRegisterDto entRegisterDto) { public Result<String> register(@RequestBody EntRegisterDto entRegisterDto) throws Exception{
// 事务回滚 // 事务回滚
/* /*
* DefaultTransactionDefinition def = new DefaultTransactionDefinition(); * DefaultTransactionDefinition def = new DefaultTransactionDefinition();
...@@ -473,12 +475,6 @@ public class LoginController { ...@@ -473,12 +475,6 @@ public class LoginController {
if (login == null) { if (login == null) {
// 员工信息 // 员工信息
/*
* QyzxEmpLogin qyzxEmpLogin =
* QyzxEmpLogin.builder().phone(phone).pw(Md5.md5(pw))
* .sts(CommonEnum.U_STS_ON.getType()).orgId(qyzxEntInfoM.getId()).regTime(
* DateUtil.date()) .endTime(DateUtil.nextMonth()).build();
*/
QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().phone(phone).pw(Md5.md5(pw)) QyzxEmpLogin qyzxEmpLogin = QyzxEmpLogin.builder().phone(phone).pw(Md5.md5(pw))
.sts(CommonEnum.U_STS_ON.getType()).orgId(qyzxEntInfoM.getId()).regTime(DateUtil.date()) .sts(CommonEnum.U_STS_ON.getType()).orgId(qyzxEntInfoM.getId()).regTime(DateUtil.date())
.build(); .build();
...@@ -489,8 +485,9 @@ public class LoginController { ...@@ -489,8 +485,9 @@ public class LoginController {
} }
} }
boolean b4 = YgglMainEmp.builder().orgCode(qyzxEntInfoM.getId()).empNum(login.getId()).rzTime(new Date()).isManager(1) boolean b4 = YgglMainEmp.builder().orgCode(qyzxEntInfoM.getId()).empNum(login.getId()).rzTime(new Date())
.name(username).jobStatus(1).build().insert(); .isManager(CommonEnum.U_TYPE_ADMIN.getType()).name(username).phone(phone).jobType(YgJobType.QUANZHI.getType()).jobStatus(YgEnumInterface.jobStatus.ZHENSHI.getType())
.build().insert();
if (!b4) { if (!b4) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultUtil.error("注册企业失败3"); return ResultUtil.error("注册企业失败3");
......
...@@ -142,25 +142,6 @@ public class QyzxController { ...@@ -142,25 +142,6 @@ public class QyzxController {
} }
/** /**
* 企业认证-审核-通过/未通过
*
* @param qyzxEntAuth
* @return
*/
/*
* @PostMapping(value = "/entauthcheck")
*
* @ApiOperation(value = "企业认证-审核-通过/未通过", httpMethod = "POST", notes =
* "接口发布说明") public Result<QyzxEntAuth> entauthcheck1(@CurrentUser UserBean
* userBean, @RequestBody QyzxEntAuth qyzxEntAuth) { Integer id =
* qyzxEntAuth.getId(); Integer authType = qyzxEntAuth.getAuthType(); if (id ==
* null || authType == null) { return ResultUtil.error("参数缺少/异常"); } QyzxEntAuth
* entAuth = QyzxEntAuth.builder().id(id).authType(authType).build(); boolean b
* = entAuth.updateById(); if (b) { return ResultUtil.data(qyzxEntAuth,
* "企业认证-审批成功"); } else { return ResultUtil.error("企业认证-审批失败"); } }
*/
/**
* 运营管理 企业认证-审核-通过/不通过(weng) * 运营管理 企业认证-审核-通过/不通过(weng)
* *
* @param qyzxEntAuth * @param qyzxEntAuth
...@@ -267,10 +248,10 @@ public class QyzxController { ...@@ -267,10 +248,10 @@ public class QyzxController {
@GetMapping(value = "/entlist") @GetMapping(value = "/entlist")
@ApiOperation(value = "企业列表", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "企业列表", httpMethod = "GET", notes = "接口发布说明")
public Result<List<QyzxEntInfoM>> entlist1(@CurrentUser UserBean userBean) { public Result<List<QyzxEntInfoM>> entlist1(@CurrentUser UserBean userBean) {
Integer empNum = userBean.getEmpNum();
QueryWrapper<QyzxEmpEntAsso> queryWrapper = new QueryWrapper<>(); List<Object> orgCodes = qyzxEmpEntAssoMapper.selectObjs(new QueryWrapper<QyzxEmpEntAsso>().lambda()
queryWrapper.select("org_code").eq("emp_num", empNum); .select(QyzxEmpEntAsso::getOrgCode)
List<Object> orgCodes = qyzxEmpEntAssoMapper.selectObjs(queryWrapper); .eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum()));
List<QyzxEntInfoM> qyzxEntInfoMs = new LambdaQueryChainWrapper<QyzxEntInfoM>(qyzxEntInfoMMapper) List<QyzxEntInfoM> qyzxEntInfoMs = new LambdaQueryChainWrapper<QyzxEntInfoM>(qyzxEntInfoMMapper)
.in(CollUtil.isNotEmpty(orgCodes), QyzxEntInfoM::getId, orgCodes).list(); .in(CollUtil.isNotEmpty(orgCodes), QyzxEntInfoM::getId, orgCodes).list();
return ResultUtil.data(qyzxEntInfoMs, "获取企业信息成功"); return ResultUtil.data(qyzxEntInfoMs, "获取企业信息成功");
...@@ -327,56 +308,6 @@ public class QyzxController { ...@@ -327,56 +308,6 @@ public class QyzxController {
} }
} }
// 下载系统使用手册 直接提供(OSS公共读权限文件)url地址到前端按钮
/**
* 意见反馈
*/
/*
* @PostMapping(value = "/feedback")
*
* @ApiOperation(value = "意见反馈", httpMethod = "POST", notes = "接口发布说明") public
* Result<QyzxSuggestionFeeback> feedback(@CurrentUser UserBean userBean,
*
* @RequestParam(required = false) String opinionText, @RequestParam(required =
* false) String moudle,
*
* @Param("files") List<MultipartFile> files) { String url = null; List<String>
* list = new ArrayList<String>(); if (files != null) { for (MultipartFile file
* : files) { String path = "8timer2.0/" + userBean.getOrgCode() + "/" + moudle
* + "/" + file.getOriginalFilename(); if (file == null || file.getSize() <= 0)
* { return ResultUtil.error("上传的文件为空,请重新选择!"); } else { try { url =
* oss.uploadFile(path, file.getInputStream()); list.add(url); } catch
* (IOException e) { e.printStackTrace(); } } } } QyzxSuggestionFeeback feeback
* = new QyzxSuggestionFeeback(); feeback.setEmpNum(userBean.getEmpNum());
* feeback.setOpinionText(opinionText); feeback.setCreateTime(new Date());
* feeback.setOrgCode(userBean.getOrgCode()); boolean a = feeback.insert(); if
* (a && list.size() > 0) { for (String opinionUrl : list) {
* QyzxFeebackAccessory.builder().feebackId(feeback.getId()).opinionUrl(
* opinionUrl).build().insert(); } } return ResultUtil.success("意见反馈成功!"); }
*/
// /**
// * 意见反馈2
// */
// @PostMapping(value = "/feedback")
// @ApiOperation(value = "意见反馈", httpMethod = "POST", notes = "接口发布说明")
// public Result<String> feedback(@CurrentUser UserBean userBean, @RequestBody FeebackDto feebackDto) {
// String opinionText = feebackDto.getOpinionText();
// List<String> urlList = feebackDto.getUrlList();
// QyzxSuggestionFeeback qs = QyzxSuggestionFeeback.builder().orgCode(userBean.getOrgCode()).empNum(userBean.getEmpNum()).opinionText(opinionText).bugType(1).createTime(new Date()).build();
//
// boolean tof = qs.insert();
// Integer feebackId = qs.getId();
// if (tof) {
// for (String str : urlList) {
// QyzxFeebackAccessory.builder().feebackId(feebackId).opinionUrl(str).build().insert();
// }
// return ResultUtil.data("意见反馈成功!");
// }
//
// return ResultUtil.data("意见反馈失败!");
// }
/** /**
* 意见反馈 * 意见反馈
*/ */
...@@ -438,8 +369,8 @@ public class QyzxController { ...@@ -438,8 +369,8 @@ public class QyzxController {
.build().insertOrUpdate(); .build().insertOrUpdate();
// 添加或修改服务计算表 // 添加或修改服务计算表
Integer number = qyzxPayServe.getNum(); Integer number = qyzxPayServe.getNum();
QueryWrapper<QyzxAttaFwjsb> queryWrapper = new QueryWrapper<>(); LambdaQueryWrapper<QyzxAttaFwjsb> queryWrapper = new QueryWrapper<QyzxAttaFwjsb>().lambda();
queryWrapper.eq("emp_num", userBean.getEmpNum()).eq("code", code); queryWrapper.eq(QyzxAttaFwjsb::getEmpNum, userBean.getEmpNum()).eq(QyzxAttaFwjsb::getCode, code);
Integer result = QyzxAttaFwjsb.builder().build().selectCount(queryWrapper); Integer result = QyzxAttaFwjsb.builder().build().selectCount(queryWrapper);
if (result != null && result > 0) { if (result != null && result > 0) {
QyzxAttaFwjsb fwjb = QyzxAttaFwjsb.builder().build().selectOne(queryWrapper); QyzxAttaFwjsb fwjb = QyzxAttaFwjsb.builder().build().selectOne(queryWrapper);
...@@ -465,7 +396,7 @@ public class QyzxController { ...@@ -465,7 +396,7 @@ public class QyzxController {
@ApiOperation(value = "查看服务计算", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "查看服务计算", httpMethod = "GET", notes = "接口发布说明")
public Result<List<QyzxAttaFwjsb>> fwjs(@CurrentUser UserBean userBean) { public Result<List<QyzxAttaFwjsb>> fwjs(@CurrentUser UserBean userBean) {
List<QyzxAttaFwjsb> qyzxAttaFpgl = QyzxAttaFwjsb.builder().build() List<QyzxAttaFwjsb> qyzxAttaFpgl = QyzxAttaFwjsb.builder().build()
.selectList(new QueryWrapper<QyzxAttaFwjsb>().eq("emp_num", userBean.getEmpNum())); .selectList(new QueryWrapper<QyzxAttaFwjsb>().lambda().eq(QyzxAttaFwjsb::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(qyzxAttaFpgl, "获取服务计算成功"); return ResultUtil.data(qyzxAttaFpgl, "获取服务计算成功");
} }
...@@ -479,7 +410,7 @@ public class QyzxController { ...@@ -479,7 +410,7 @@ public class QyzxController {
@ApiOperation(value = "获取购买记录", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "获取购买记录", httpMethod = "GET", notes = "接口发布说明")
public Result<List<QyzxLogBuy>> selectgmjl(@CurrentUser UserBean userBean) { public Result<List<QyzxLogBuy>> selectgmjl(@CurrentUser UserBean userBean) {
List<QyzxLogBuy> qyzxLogBuy = QyzxLogBuy.builder().build() List<QyzxLogBuy> qyzxLogBuy = QyzxLogBuy.builder().build()
.selectList(new QueryWrapper<QyzxLogBuy>().eq("emp_num", userBean.getEmpNum())); .selectList(new QueryWrapper<QyzxLogBuy>().lambda().eq(QyzxLogBuy::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(qyzxLogBuy, "获取购买记录成功"); return ResultUtil.data(qyzxLogBuy, "获取购买记录成功");
} }
......
...@@ -47,6 +47,7 @@ import cn.timer.api.config.annotation.UserBean; ...@@ -47,6 +47,7 @@ import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.config.enuminterface.SpmkEnumInterface; 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.enums.CommonEnum;
import cn.timer.api.config.exception.CustomException; import cn.timer.api.config.exception.CustomException;
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;
...@@ -88,6 +89,8 @@ produces = { "application/json","multipart/form-data" }) ...@@ -88,6 +89,8 @@ produces = { "application/json","multipart/form-data" })
public class SpmkController { public class SpmkController {
@Autowired @Autowired
SpmkServiceImpl spmkService;
@Autowired
private SpmkApprovalTemplateGMapper spmkApprovalTemplateGMapper; private SpmkApprovalTemplateGMapper spmkApprovalTemplateGMapper;
@Autowired @Autowired
private SpmkApprovalTemplateMapper spmkApprovalTemplateMapper; private SpmkApprovalTemplateMapper spmkApprovalTemplateMapper;
...@@ -375,8 +378,6 @@ public class SpmkController { ...@@ -375,8 +378,6 @@ public class SpmkController {
} }
// //
/** /**
* 注意: 为保证该api的原子性 要加 事务处理 回滚(方法注解-@Transactional(rollbackFor = Exception.class)) * 注意: 为保证该api的原子性 要加 事务处理 回滚(方法注解-@Transactional(rollbackFor = Exception.class))
...@@ -408,7 +409,6 @@ public class SpmkController { ...@@ -408,7 +409,6 @@ public class SpmkController {
} }
return ResultUtil.success("操作成功!"); return ResultUtil.success("操作成功!");
} }
/** /**
...@@ -462,7 +462,7 @@ public class SpmkController { ...@@ -462,7 +462,7 @@ public class SpmkController {
listRouter.add(spmkApproveSummaryDto.getRouter()); listRouter.add(spmkApproveSummaryDto.getRouter());
JSONObject jSONObject = spmkApproveSummaryDto.getRequestData() JSONObject jSONObject = spmkApproveSummaryDto.getRequestData()
.set("orgCode", FromData.builder().value(String.valueOf(userBean.getOrgCode())).build()) .set("orgCode", FromData.builder().value(String.valueOf(userBean.getOrgCode())).build())
.set("initiator", FromData.builder().value(spmkApproveSummaryDto.getInitiator()).build()) .set("initiator", FromData.builder().value(ygglMainEmp.getName()).build())
.set("headUrl", FromData.builder().value(ygglMainEmp.getHeadUrl()).build()) .set("headUrl", FromData.builder().value(ygglMainEmp.getHeadUrl()).build())
.set("id", FromData.builder().value(StrUtil.toString(userBean.getEmpNum())).build()); .set("id", FromData.builder().value(StrUtil.toString(userBean.getEmpNum())).build());
RouterUtils.NextNode(listRouter, jSONObject, ISFIRST); RouterUtils.NextNode(listRouter, jSONObject, ISFIRST);
...@@ -555,18 +555,7 @@ public class SpmkController { ...@@ -555,18 +555,7 @@ public class SpmkController {
@Log(title = "审批-审批详情", businessType = BusinessType.OTHER) @Log(title = "审批-审批详情", businessType = BusinessType.OTHER)
public Result<Object> selectAd(@PathVariable(required = true) Integer id) { public Result<Object> selectAd(@PathVariable(required = true) Integer id) {
SpmkApproveDetail ad = spmkApproveDetailMapper.selectOne(new QueryWrapper<SpmkApproveDetail>().lambda().eq(SpmkApproveDetail::getApproveSummaryId, id)); SpmkApproveDetailDto adD = spmkService.selectApproveDetailByAsId(id);
SpmkApproveDetailDto adD = SpmkApproveDetailDto.builder().build();
if (ad == null) {
return ResultUtil.data(adD, "操作成功!");
}
List<SpmkApproveExecuteRecord> listAer = spmkApproveExecuteRecordMapper.selectListByAsId(id);
BeanUtil.copyProperties(ad, adD, "requestData","froms","router","spmkApproveExecuteRecord");
adD.setRequestData(ObjectUtil.deserialize(ad.getRequestData()));
adD.setFroms(ObjectUtil.deserialize(ad.getFroms()));
adD.setRouter(ObjectUtil.deserialize(ad.getRouter()));
adD.setFlowChildren(ObjectUtil.deserialize(ad.getFlowChildren()));
adD.setApproveExecuteRecord(listAer);
return ResultUtil.data(adD, "操作成功!"); return ResultUtil.data(adD, "操作成功!");
} }
...@@ -620,6 +609,7 @@ public class SpmkController { ...@@ -620,6 +609,7 @@ public class SpmkController {
if (aSummary.getSts() == 0) { if (aSummary.getSts() == 0) {
List<FlowChildren> listFlowChildren = ObjectUtil.deserialize(ad.getFlowChildren()); List<FlowChildren> listFlowChildren = ObjectUtil.deserialize(ad.getFlowChildren());
// 审批逻辑
RouterUtils.approving( RouterUtils.approving(
listFlowChildren, listFlowChildren,
approvingDto.getAsId(), approvingDto.getAsId(),
...@@ -641,7 +631,7 @@ public class SpmkController { ...@@ -641,7 +631,7 @@ public class SpmkController {
.eq(SpmkApproveSummary::getId, approvingDto.getAsId())); .eq(SpmkApproveSummary::getId, approvingDto.getAsId()));
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(CommonEnum.NULL_STR.getDesc()).endTime(new Date()).sts(ApproveSummarySts.FINISH.ordinal()).build().updateById();
JSONObject jSONObject = ObjectUtil.deserialize(ad.getRequestData()); JSONObject jSONObject = ObjectUtil.deserialize(ad.getRequestData());
jSONObject.set("approveId", approvingDto.getAsId()); jSONObject.set("approveId", approvingDto.getAsId());
...@@ -754,16 +744,13 @@ public class SpmkController { ...@@ -754,16 +744,13 @@ public class SpmkController {
return ResultUtil.data(spmkIcons,"获取图标列表成功"); return ResultUtil.data(spmkIcons,"获取图标列表成功");
} }
@Autowired
SpmkServiceImpl SpmkService;
//TODO 测试-生成 审批组 和 自定义审批 //TODO 测试-生成 审批组 和 自定义审批
@GetMapping(value = "/test") @GetMapping(value = "/test")
@ApiOperation(value = "98.测试-生成 审批组 和 自定义审批", httpMethod = "GET", notes = "测试-生成 审批组 和 自定义审批") @ApiOperation(value = "98.测试-生成 审批组 和 自定义审批", httpMethod = "GET", notes = "测试-生成 审批组 和 自定义审批")
@ApiOperationSupport(order = 98) @ApiOperationSupport(order = 98)
public Result<List<SpmkIcon>> createCustomApproval(@RequestParam Integer orgCode){ public Result<List<SpmkIcon>> createCustomApproval(@RequestParam Integer orgCode){
SpmkService.createCustomApproval(orgCode); spmkService.createCustomApproval(orgCode);
List<SpmkIcon> spmkIcons = SpmkIcon.builder().build().selectAll(); List<SpmkIcon> spmkIcons = SpmkIcon.builder().build().selectAll();
......
package cn.timer.api.controller.spmk.service; package cn.timer.api.controller.spmk.service;
import cn.timer.api.dto.spmk.SpmkApproveDetailDto;
public interface SpmkService { public interface SpmkService {
boolean createCustomApproval(Integer orgCode); boolean createCustomApproval(Integer orgCode);
SpmkApproveDetailDto selectApproveDetailByAsId(Integer asId);
} }
...@@ -10,17 +10,29 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -10,17 +10,29 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.core.util.ObjectUtil;
import cn.timer.api.bean.spmk.SpmkApprovalG; import cn.timer.api.bean.spmk.SpmkApprovalG;
import cn.timer.api.bean.spmk.SpmkApprovalTemplate; import cn.timer.api.bean.spmk.SpmkApprovalTemplate;
import cn.timer.api.bean.spmk.SpmkApprovalTemplateG; import cn.timer.api.bean.spmk.SpmkApprovalTemplateG;
import cn.timer.api.bean.spmk.SpmkApproveDetail;
import cn.timer.api.bean.spmk.SpmkApproveExecuteRecord;
import cn.timer.api.bean.spmk.SpmkCustomApproval; import cn.timer.api.bean.spmk.SpmkCustomApproval;
import cn.timer.api.dao.spmk.SpmkApproveDetailMapper;
import cn.timer.api.dao.spmk.SpmkApproveExecuteRecordMapper;
import cn.timer.api.dao.spmk.SpmkCustomApprovalMapper; import cn.timer.api.dao.spmk.SpmkCustomApprovalMapper;
import cn.timer.api.dto.spmk.SpmkApproveDetailDto;
@Service @Service
public class SpmkServiceImpl implements SpmkService{ public class SpmkServiceImpl implements SpmkService{
@Autowired @Autowired
SpmkCustomApprovalMapper spmkCustomApprovalMapper; private SpmkCustomApprovalMapper spmkCustomApprovalMapper;
@Autowired
private SpmkApproveDetailMapper spmkApproveDetailMapper;
@Autowired
private SpmkApproveExecuteRecordMapper spmkApproveExecuteRecordMapper;
/** /**
* 根据orgCode查数据库 审批模板 生成 自定义模板 * 根据orgCode查数据库 审批模板 生成 自定义模板
...@@ -62,4 +74,26 @@ public class SpmkServiceImpl implements SpmkService{ ...@@ -62,4 +74,26 @@ public class SpmkServiceImpl implements SpmkService{
return true; return true;
} }
/**
* 根据审批汇总id 获取 审批详情
*/
@Override
public SpmkApproveDetailDto selectApproveDetailByAsId(Integer asId) {
// TODO Auto-generated method stub
SpmkApproveDetail ad = spmkApproveDetailMapper.selectOne(new QueryWrapper<SpmkApproveDetail>().lambda().eq(SpmkApproveDetail::getApproveSummaryId, asId));
SpmkApproveDetailDto adD = SpmkApproveDetailDto.builder().build();
if (ad == null) {
return null;
}
List<SpmkApproveExecuteRecord> listAer = spmkApproveExecuteRecordMapper.selectListByAsId(asId);
BeanUtil.copyProperties(ad, adD, "requestData","froms","router","spmkApproveExecuteRecord");
adD.setRequestData(ObjectUtil.deserialize(ad.getRequestData()));
adD.setFroms(ObjectUtil.deserialize(ad.getFroms()));
adD.setRouter(ObjectUtil.deserialize(ad.getRouter()));
adD.setFlowChildren(ObjectUtil.deserialize(ad.getFlowChildren()));
adD.setApproveExecuteRecord(listAer);
return adD;
}
} }
...@@ -67,7 +67,6 @@ public class AddygdaDto extends Page implements Serializable{ ...@@ -67,7 +67,6 @@ public class AddygdaDto extends Page implements Serializable{
@ApiModelProperty(value="性别 0:男;1:女",example="0") @ApiModelProperty(value="性别 0:男;1:女",example="0")
private Integer sex; private Integer sex;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="部门岗位id",example="0") @ApiModelProperty(value="部门岗位id",example="0")
private Integer bmgwId; private Integer bmgwId;
......
package cn.timer.api.dto.yggl;
import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import cn.timer.api.config.exception.Regular;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 员工导入模板
* @author Tang
*
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ImportEmpDto implements Serializable{
private static final long serialVersionUID = -1230023773946170942L;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value="员工姓名",example="华仔")
private String name;
@NotBlank(message = ValidationMsg.NOTBLANK)
@Pattern(regexp=Regular.PHONE,message = ValidationMsg.PATTERN)
@ApiModelProperty(value="手机号",example="101")
private String phone;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="证件类型 0:身份证;1:港澳居民来往内地通行证;2:台湾居民来往大陆通行证;3:外国护照;4:其他",example="0")
private Integer zjType;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value="证件号码 ",example="证件号码")
private String zjNum;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="工作性质 0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘",example="0")
private Integer jobType;
@ApiModelProperty(value="入职日期 ",example="客户注册后的时间为入职时间")
private String rzTime;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="试用期 0:无试用期;1:1个月;2:2个月;3:3个月;4:4个月;5:5个月;6:6个月(有试用期显示选项)",example="0")
private Integer syq;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value="性别 0:男;1:女",example="0")
private Integer sex;
}
...@@ -22,6 +22,7 @@ import cn.timer.api.bean.zzgl.ZzglBmgwM; ...@@ -22,6 +22,7 @@ import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.enuminterface.SpmkEnumInterface.ExecuteRecordSts; import cn.timer.api.config.enuminterface.SpmkEnumInterface.ExecuteRecordSts;
import cn.timer.api.config.enuminterface.SpmkEnumInterface.ExecutorSts; import cn.timer.api.config.enuminterface.SpmkEnumInterface.ExecutorSts;
import cn.timer.api.config.enuminterface.SpmkEnumInterface.ParticipatorType; import cn.timer.api.config.enuminterface.SpmkEnumInterface.ParticipatorType;
import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.dto.spmk.Condition; import cn.timer.api.dto.spmk.Condition;
import cn.timer.api.dto.spmk.FlowChildren; import cn.timer.api.dto.spmk.FlowChildren;
import cn.timer.api.dto.spmk.FromData; import cn.timer.api.dto.spmk.FromData;
...@@ -36,14 +37,37 @@ import cn.timer.api.dto.spmk.User; ...@@ -36,14 +37,37 @@ import cn.timer.api.dto.spmk.User;
* *
*/ */
public class RouterUtils { public class RouterUtils {
/**
* 0 未执行
*/
private final static String UNEXECUTED = "0"; private final static String UNEXECUTED = "0";
/**
* 1 执行中
*/
private final static String EXECUTING = "1"; private final static String EXECUTING = "1";
/**
* 2 已执行
*/
private final static String EXECUTED = "2"; private final static String EXECUTED = "2";
/**
* creator 抄送人
*/
private final static String CREATOR = "creator"; private final static String CREATOR = "creator";
/**
* audit 审批人
*/
private final static String AUDIT = "audit"; private final static String AUDIT = "audit";
/**
* copy 抄送人
*/
private final static String COPY = "copy"; private final static String COPY = "copy";
/**
* department 部门类型
*/
private final static String RELATION_TYPE_DEPARTMENT = "department"; private final static String RELATION_TYPE_DEPARTMENT = "department";
/**
* users 用户类型
*/
private final static String RELATION_TYPE_USERS = "users"; private final static String RELATION_TYPE_USERS = "users";
public static List<Router> NextNode(List<Router> listRouter,JSONObject obj, boolean isFirse) throws NumberFormatException, ConvertException, Exception { public static List<Router> NextNode(List<Router> listRouter,JSONObject obj, boolean isFirse) throws NumberFormatException, ConvertException, Exception {
...@@ -76,7 +100,7 @@ public class RouterUtils { ...@@ -76,7 +100,7 @@ public class RouterUtils {
.name(obj.get("initiator",FromData.class).getValue()) .name(obj.get("initiator",FromData.class).getValue())
.id(obj.get("id",FromData.class).getValue()) .id(obj.get("id",FromData.class).getValue())
.headUrl(obj.get("headUrl",FromData.class).getValue()) .headUrl(obj.get("headUrl",FromData.class).getValue())
.execute("0") .execute(UNEXECUTED)
.build(); .build();
users.add(userFirst); users.add(userFirst);
List<Relation> relations = new ArrayList<Relation>(); List<Relation> relations = new ArrayList<Relation>();
...@@ -238,9 +262,8 @@ public class RouterUtils { ...@@ -238,9 +262,8 @@ public class RouterUtils {
public static List<YgglMainEmp> selectOtherlistent(Integer orgCode, Integer id){ public static List<YgglMainEmp> selectOtherlistent(Integer orgCode, Integer id){
ArrayList<Integer> list = new ArrayList<Integer>(); ArrayList<Integer> list = new ArrayList<Integer>();
QueryWrapper<ZzglBmgwM> queryWrapper = new QueryWrapper<ZzglBmgwM>(); List<ZzglBmgwM> zzglBmgwMs = ZzglBmgwM.builder().build().selectList(new QueryWrapper<ZzglBmgwM>().lambda()
queryWrapper.eq("org_code", orgCode); .eq(ZzglBmgwM::getOrgCode, orgCode));
List<ZzglBmgwM> zzglBmgwMs = ZzglBmgwM.builder().build().selectList(queryWrapper);
list.add(id); list.add(id);
ZzglBmgwM.getDepts(list, id, zzglBmgwMs); ZzglBmgwM.getDepts(list, id, zzglBmgwMs);
...@@ -293,13 +316,14 @@ public class RouterUtils { ...@@ -293,13 +316,14 @@ public class RouterUtils {
continue; continue;
} }
// ClassName 区分参与审批流程人的角色 CREATOR(发起人)、AUDIT(审核人)、COPY(抄送人)
// 各个角色的逻辑不同
switch (listFlowChildren.get(i).getClassName()) { switch (listFlowChildren.get(i).getClassName()) {
case CREATOR: case CREATOR:
SpmkApproveExecuteRecord aer = SpmkApproveExecuteRecord SpmkApproveExecuteRecord aer = SpmkApproveExecuteRecord
.builder() .builder()
.approveSummaryId(asId) .approveSummaryId(asId)
.name("发起申请") .name(ParticipatorType.INITIATOR.getName())
.type(ParticipatorType.INITIATOR.ordinal()) .type(ParticipatorType.INITIATOR.ordinal())
.sts(ExecuteRecordSts.AGREE.ordinal()) .sts(ExecuteRecordSts.AGREE.ordinal())
.build(); .build();
...@@ -321,7 +345,7 @@ public class RouterUtils { ...@@ -321,7 +345,7 @@ public class RouterUtils {
SpmkApproveExecuteRecord aer2 = SpmkApproveExecuteRecord SpmkApproveExecuteRecord aer2 = SpmkApproveExecuteRecord
.builder() .builder()
.approveSummaryId(asId) .approveSummaryId(asId)
.name("审批人") .name(ParticipatorType.APPROVER.getName())
.type(ParticipatorType.APPROVER.ordinal()) .type(ParticipatorType.APPROVER.ordinal())
.sts(ExecuteRecordSts.IN_EXECUTION.ordinal()) .sts(ExecuteRecordSts.IN_EXECUTION.ordinal())
.build(); .build();
...@@ -354,7 +378,7 @@ public class RouterUtils { ...@@ -354,7 +378,7 @@ public class RouterUtils {
SpmkApproveExecuteRecord aer3 = SpmkApproveExecuteRecord SpmkApproveExecuteRecord aer3 = SpmkApproveExecuteRecord
.builder() .builder()
.approveSummaryId(asId) .approveSummaryId(asId)
.name("抄送人") .name(ParticipatorType.COPY.getName())
.type(ParticipatorType.COPY.ordinal()) .type(ParticipatorType.COPY.ordinal())
.sts(ExecuteRecordSts.AGREE.ordinal()) .sts(ExecuteRecordSts.AGREE.ordinal())
.build(); .build();
...@@ -423,7 +447,7 @@ public class RouterUtils { ...@@ -423,7 +447,7 @@ public class RouterUtils {
// 0未执行 1执行中 2同意 3拒绝 4 转派 // 0未执行 1执行中 2同意 3拒绝 4 转派
if (sts == ExecutorSts.REFUSE.ordinal()) { if (sts == ExecutorSts.REFUSE.ordinal()) {
// 更新 审批汇总 状态 // 更新 审批汇总 状态
SpmkApproveSummary.builder().id(asId).currentApprover("").endTime(new Date()).sts(sts).build().updateById(); SpmkApproveSummary.builder().id(asId).currentApprover(CommonEnum.NULL_STR.getDesc()).endTime(new Date()).sts(sts).build().updateById();
SpmkApproveExecuteRecord SpmkApproveExecuteRecord
.builder() .builder()
.id(executeRecordId) .id(executeRecordId)
...@@ -434,6 +458,7 @@ public class RouterUtils { ...@@ -434,6 +458,7 @@ public class RouterUtils {
listFlowChildren.get(i_user).setExecute(EXECUTED); listFlowChildren.get(i_user).setExecute(EXECUTED);
return; return;
//转派 处理 //转派 处理
//在 原审批人 列表中 插入 一个被转派人(审批人)
}else if (sts == ExecutorSts.REDEPLOY.ordinal()) { }else if (sts == ExecutorSts.REDEPLOY.ordinal()) {
List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1); List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1);
users1.add(redeployUser); users1.add(redeployUser);
...@@ -480,8 +505,8 @@ public class RouterUtils { ...@@ -480,8 +505,8 @@ public class RouterUtils {
SpmkApproveExecuteRecord aer = SpmkApproveExecuteRecord SpmkApproveExecuteRecord aer = SpmkApproveExecuteRecord
.builder() .builder()
.approveSummaryId(asId) .approveSummaryId(asId)
.name("发起申请") .name(ParticipatorType.INITIATOR.getName())
.type(0) .type(ParticipatorType.INITIATOR.ordinal())
.sts(ExecuteRecordSts.AGREE.ordinal()) .sts(ExecuteRecordSts.AGREE.ordinal())
.build(); .build();
// 新增 审批执行记录 // 新增 审批执行记录
...@@ -504,7 +529,7 @@ public class RouterUtils { ...@@ -504,7 +529,7 @@ public class RouterUtils {
SpmkApproveExecuteRecord aer2 = SpmkApproveExecuteRecord SpmkApproveExecuteRecord aer2 = SpmkApproveExecuteRecord
.builder() .builder()
.approveSummaryId(asId) .approveSummaryId(asId)
.name("审批人") .name(ParticipatorType.APPROVER.getName())
.type(ParticipatorType.APPROVER.ordinal()) .type(ParticipatorType.APPROVER.ordinal())
.sts(ExecuteRecordSts.IN_EXECUTION.ordinal()) .sts(ExecuteRecordSts.IN_EXECUTION.ordinal())
.build(); .build();
...@@ -530,7 +555,7 @@ public class RouterUtils { ...@@ -530,7 +555,7 @@ public class RouterUtils {
SpmkApproveExecuteRecord aer3 = SpmkApproveExecuteRecord SpmkApproveExecuteRecord aer3 = SpmkApproveExecuteRecord
.builder() .builder()
.approveSummaryId(asId) .approveSummaryId(asId)
.name("抄送人") .name(ParticipatorType.COPY.getName())
.type(ParticipatorType.COPY.ordinal()) .type(ParticipatorType.COPY.ordinal())
.sts(ExecuteRecordSts.AGREE.ordinal()) .sts(ExecuteRecordSts.AGREE.ordinal())
.build(); .build();
......
...@@ -53,7 +53,7 @@ public class EvectionBusiness extends SpmkAssoBusiness { ...@@ -53,7 +53,7 @@ public class EvectionBusiness extends SpmkAssoBusiness {
.evectiontype(1) .evectiontype(1)
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss")) .starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
.endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss")) .endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss"))
.duration(Convert.toDouble(longTime)*60D) .duration(Convert.toDouble(longTime))
.build(); .build();
// 调 考勤管理 业务-出差 // 调 考勤管理 业务-出差
......
...@@ -51,7 +51,7 @@ public class GoOutBusiness extends SpmkAssoBusiness { ...@@ -51,7 +51,7 @@ public class GoOutBusiness extends SpmkAssoBusiness {
.evectiontype(2) .evectiontype(2)
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss")) .starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
.endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss")) .endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss"))
.duration(Convert.toDouble(longTime)*60D) .duration(Convert.toDouble(longTime))
.build(); .build();
// 调 考勤管理 业务-外出 // 调 考勤管理 业务-外出
......
...@@ -58,7 +58,7 @@ public class LeaveBusiness extends SpmkAssoBusiness { ...@@ -58,7 +58,7 @@ public class LeaveBusiness extends SpmkAssoBusiness {
.leavetype(Convert.toInt(LeaveType)) .leavetype(Convert.toInt(LeaveType))
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss")) .starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
.endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss")) .endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss"))
.duration(Convert.toDouble(longTime)*60D) .duration(Convert.toDouble(longTime))
.build(); .build();
// 调 考勤管理 业务-请假 // 调 考勤管理 业务-请假
......
...@@ -42,7 +42,7 @@ public class ReissueACardBusiness extends SpmkAssoBusiness { ...@@ -42,7 +42,7 @@ public class ReissueACardBusiness extends SpmkAssoBusiness {
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 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();
...@@ -51,7 +51,7 @@ public class ReissueACardBusiness extends SpmkAssoBusiness { ...@@ -51,7 +51,7 @@ public class ReissueACardBusiness extends SpmkAssoBusiness {
.builder() .builder()
.repairid(Convert.toInt(approveId)) .repairid(Convert.toInt(approveId))
.cardrepltime(DateUtil.getStringTime(PatchCardTime, "yyyy-MM-dd HH:mm:ss")) .cardrepltime(DateUtil.getStringTime(PatchCardTime, "yyyy-MM-dd HH:mm:ss"))
// .cardreplperiod(Convert.toInt(cardreplperiod)) .cardreplperiod(Convert.toInt(cardreplperiod))
.build(); .build();
// 调 考勤管理 业务-补卡 // 调 考勤管理 业务-补卡
......
...@@ -58,7 +58,7 @@ public class WorkOvertimeBusiness extends SpmkAssoBusiness { ...@@ -58,7 +58,7 @@ public class WorkOvertimeBusiness extends SpmkAssoBusiness {
.overtimetype(Convert.toInt(overtimetype)) .overtimetype(Convert.toInt(overtimetype))
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss")) .starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
.endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss")) .endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss"))
.duration(Convert.toDouble(timeLong)*60D) .duration(Convert.toDouble(timeLong))
.compensate(Convert.toInt(compensate)) .compensate(Convert.toInt(compensate))
.build(); .build();
......
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