Commit 7949e275 by dengshichuan

Merge branch 'tzq' into 'develop'

Tzq

See merge request 8timerv2/8timerapiv200!246
parents e987f534 edb08915
...@@ -581,6 +581,7 @@ public class LoginController { ...@@ -581,6 +581,7 @@ public class LoginController {
System.out.println("重复初始化数据!"); System.out.println("重复初始化数据!");
} }
// 绩效设置初始化
JxglBasicSetting bS = jxglService.selectAT(qyId); JxglBasicSetting bS = jxglService.selectAT(qyId);
if (bS == null) { if (bS == null) {
boolean res = jxglService.initJxglBasicSetting(qyId); boolean res = jxglService.initJxglBasicSetting(qyId);
......
...@@ -40,6 +40,7 @@ public class JxglServiceImpl implements JxglService { ...@@ -40,6 +40,7 @@ public class JxglServiceImpl implements JxglService {
res = !performanceRating.insert() && res ? false : res; res = !performanceRating.insert() && res ? false : res;
performanceRating.setId(null);
performanceRating.setBasicSettingId(bC.getId()); performanceRating.setBasicSettingId(bC.getId());
performanceRating.setName("B"); performanceRating.setName("B");
performanceRating.setSectionMinScore(60); performanceRating.setSectionMinScore(60);
...@@ -47,6 +48,7 @@ public class JxglServiceImpl implements JxglService { ...@@ -47,6 +48,7 @@ public class JxglServiceImpl implements JxglService {
performanceRating.setRanks(0); performanceRating.setRanks(0);
res = !performanceRating.insert() && res ? false : res; res = !performanceRating.insert() && res ? false : res;
performanceRating.setId(null);
performanceRating.setBasicSettingId(bC.getId()); performanceRating.setBasicSettingId(bC.getId());
performanceRating.setName("A"); performanceRating.setName("A");
performanceRating.setSectionMinScore(80); performanceRating.setSectionMinScore(80);
......
...@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
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.extension.conditions.query.LambdaQueryChainWrapper;
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;
...@@ -34,6 +35,7 @@ import cn.hutool.core.util.StrUtil; ...@@ -34,6 +35,7 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.timer.api.aspect.lang.annotation.Log; import cn.timer.api.aspect.lang.annotation.Log;
import cn.timer.api.aspect.lang.enums.BusinessType; import cn.timer.api.aspect.lang.enums.BusinessType;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
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;
...@@ -52,6 +54,7 @@ import cn.timer.api.config.enuminterface.SpmkEnumInterface; ...@@ -52,6 +54,7 @@ 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.enums.CommonEnum;
import cn.timer.api.config.enums.SysRoleType;
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.Insert;
import cn.timer.api.config.validation.Ranks; import cn.timer.api.config.validation.Ranks;
...@@ -60,6 +63,7 @@ import cn.timer.api.config.validation.ValidList; ...@@ -60,6 +63,7 @@ import cn.timer.api.config.validation.ValidList;
import cn.timer.api.controller.spmk.service.SpmkService; import cn.timer.api.controller.spmk.service.SpmkService;
import cn.timer.api.controller.yggl.service.YgglService; import cn.timer.api.controller.yggl.service.YgglService;
import cn.timer.api.controller.zzgl.service.ZzglBmgwMService; import cn.timer.api.controller.zzgl.service.ZzglBmgwMService;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.spmk.SpmkApprovalGMapper; import cn.timer.api.dao.spmk.SpmkApprovalGMapper;
import cn.timer.api.dao.spmk.SpmkApprovalTemplateGMapper; import cn.timer.api.dao.spmk.SpmkApprovalTemplateGMapper;
import cn.timer.api.dao.spmk.SpmkApprovalTemplateMapper; import cn.timer.api.dao.spmk.SpmkApprovalTemplateMapper;
...@@ -103,6 +107,8 @@ public class SpmkController { ...@@ -103,6 +107,8 @@ public class SpmkController {
private ZzglBmgwMService zzglBmgwMService; private ZzglBmgwMService zzglBmgwMService;
@Autowired @Autowired
private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper;
@Autowired
private SpmkApprovalTemplateGMapper spmkApprovalTemplateGMapper; private SpmkApprovalTemplateGMapper spmkApprovalTemplateGMapper;
@Autowired @Autowired
private SpmkApprovalTemplateMapper spmkApprovalTemplateMapper; private SpmkApprovalTemplateMapper spmkApprovalTemplateMapper;
...@@ -691,7 +697,17 @@ public class SpmkController { ...@@ -691,7 +697,17 @@ public class SpmkController {
.eq(SpmkExecutor::getId, approvingDto.getExecutorId()) .eq(SpmkExecutor::getId, approvingDto.getExecutorId())
.eq(SpmkExecutor::getEmpNum, userBean.getEmpNum()) .eq(SpmkExecutor::getEmpNum, userBean.getEmpNum())
.eq(SpmkExecutor::getSts, SpmkEnumInterface.ExecutorSts.IN_EXECUTION.ordinal())) == 0) { .eq(SpmkExecutor::getSts, SpmkEnumInterface.ExecutorSts.IN_EXECUTION.ordinal())) == 0) {
return ResultUtil.error("非当前审批人,无法审批!");
Integer adminNum = new LambdaQueryChainWrapper<QyzxEmpEntAsso>(qyzxEmpEntAssoMapper)
.eq(QyzxEmpEntAsso::getEmpNum, userBean.getEmpNum())
.eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode())
.in(QyzxEmpEntAsso::getUserType, SysRoleType.U_TYPE_ADMIN,SysRoleType.U_TYPE_C_ADMIN)
.count();
if (adminNum <= 0) {
return ResultUtil.error("非当前审批人 或 管理员,无法操作!");
}
} }
if (aSummary.getSts() == 0) { if (aSummary.getSts() == 0) {
......
...@@ -1309,8 +1309,7 @@ public class YgglController { ...@@ -1309,8 +1309,7 @@ public class YgglController {
LambdaQueryWrapper<QyzxEmpEntAsso> queryWrapper = new QueryWrapper<QyzxEmpEntAsso>().lambda() LambdaQueryWrapper<QyzxEmpEntAsso> queryWrapper = new QueryWrapper<QyzxEmpEntAsso>().lambda()
.eq(QyzxEmpEntAsso::getEmpNum, empNum) .eq(QyzxEmpEntAsso::getEmpNum, empNum)
.eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode()) .eq(QyzxEmpEntAsso::getOrgCode, userBean.getOrgCode());
;
// 确认离职 删除员工关联表 // 确认离职 删除员工关联表
qyzxEmpEntAssoMapper.delete(queryWrapper); qyzxEmpEntAssoMapper.delete(queryWrapper);
...@@ -1322,7 +1321,8 @@ public class YgglController { ...@@ -1322,7 +1321,8 @@ public class YgglController {
.eq(ZzglBmgwM::getLeader, empNum)); .eq(ZzglBmgwM::getLeader, empNum));
// 更新当前企业 // 更新当前企业
List<QyzxEmpEntAsso> listEEA = qyzxEmpEntAssoMapper.selectList(queryWrapper); List<QyzxEmpEntAsso> listEEA = qyzxEmpEntAssoMapper.selectList(new QueryWrapper<QyzxEmpEntAsso>().lambda()
.eq(QyzxEmpEntAsso::getEmpNum, empNum));
if (listEEA != null && listEEA.size() > 0) { if (listEEA != null && listEEA.size() > 0) {
QyzxEmpLogin.builder().id(empNum).orgId(CollUtil.getFirst(listEEA).getOrgCode()).build().updateById(); QyzxEmpLogin.builder().id(empNum).orgId(CollUtil.getFirst(listEEA).getOrgCode()).build().updateById();
} }
......
...@@ -107,6 +107,48 @@ public class DateUtil { ...@@ -107,6 +107,48 @@ public class DateUtil {
* @return * @return
* @throws ParseException * @throws ParseException
*/ */
public static Date getFormatDate(String time) throws ParseException {
if (StrUtil.isNotBlank(time)) {
switch (time.length()) {
case 10:
return getStringDate(time, "yyyy-MM-dd");
case 16:
return getStringDate(time, "yyyy-MM-dd HH:mm");
case 19:
return getStringDate(time, "yyyy-MM-dd HH:mm:ss");
default:
break;
}
return null;
}
return null;
}
/**
* 将String时间转换为时间戳
*
* @param time
* @return
* @throws ParseException
*/
public static Date getStringDate(String time, String format)
throws ParseException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
return simpleDateFormat.parse(time);
}
/**
* 将String时间转换为 Date
*
* @param time
* @return
* @throws ParseException
*/
public static long getStringTime(String time, String format) public static long getStringTime(String time, String format)
throws ParseException { throws ParseException {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
......
...@@ -50,8 +50,8 @@ public class GoOutBusiness extends SpmkAssoBusiness { ...@@ -50,8 +50,8 @@ public class GoOutBusiness extends SpmkAssoBusiness {
.orgcode(orgCode) .orgcode(orgCode)
.evectionid(Convert.toInt(approveId)) .evectionid(Convert.toInt(approveId))
.evectiontype(2) .evectiontype(2)
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss")) .starttime(DateUtil.getFormat(startTime))
.endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss")) .endtime(DateUtil.getFormat(endTime))
.duration(Convert.toDouble(longTime)) .duration(Convert.toDouble(longTime))
.build(); .build();
......
...@@ -15,6 +15,7 @@ import cn.timer.api.controller.yggl.service.YgglService; ...@@ -15,6 +15,7 @@ import cn.timer.api.controller.yggl.service.YgglService;
import cn.timer.api.dto.spmk.FromData; import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.dto.yggl.YgzzDto; import cn.timer.api.dto.yggl.YgzzDto;
import cn.timer.api.utils.DateFormatUtils; import cn.timer.api.utils.DateFormatUtils;
import cn.timer.api.utils.DateUtil;
import lombok.Builder; import lombok.Builder;
/** /**
...@@ -60,8 +61,8 @@ public class RegularizationBusiness extends SpmkAssoBusiness { ...@@ -60,8 +61,8 @@ public class RegularizationBusiness extends SpmkAssoBusiness {
YgzzDto ygzzDto = YgzzDto.builder() YgzzDto ygzzDto = YgzzDto.builder()
.empNum(id) .empNum(id)
.orgCode(orgCode) .orgCode(orgCode)
.zzTime(DateFormatUtils.getDateByString(confirmationTime)) .zzTime(DateUtil.getFormatDate(confirmationTime))
.sjzzTime(DateFormatUtils.getDateByString(newConfirmationTime)) .sjzzTime(DateUtil.getFormatDate(newConfirmationTime))
.zzRemark(Remarks) .zzRemark(Remarks)
.build(); .build();
System.out.println("转正:"+ygzzDto); System.out.println("转正:"+ygzzDto);
......
...@@ -6,13 +6,13 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -6,13 +6,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
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.yggl.service.YgglService; import cn.timer.api.controller.yggl.service.YgglService;
import cn.timer.api.dto.spmk.FromData; import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.dto.yggl.LzygQueryDto; import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.utils.DateFormatUtils; import cn.timer.api.utils.DateFormatUtils;
import cn.timer.api.utils.DateUtil;
import lombok.Builder; import lombok.Builder;
/** /**
...@@ -46,7 +46,7 @@ public class ResignationBusiness extends SpmkAssoBusiness { ...@@ -46,7 +46,7 @@ public class ResignationBusiness extends SpmkAssoBusiness {
LzygQueryDto dtO = LzygQueryDto.builder() LzygQueryDto dtO = LzygQueryDto.builder()
.orgCode(orgCode) .orgCode(orgCode)
.empNum(id) .empNum(id)
.lzTime(DateFormatUtils.getDateByString(terminationDate)) .lzTime(DateUtil.getFormatDate(terminationDate))
.lzyy(ReasonForResignation) .lzyy(ReasonForResignation)
.lzbz(Remarks) .lzbz(Remarks)
.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