Commit 4264478e authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents 525135db 94e601ef
......@@ -23,9 +23,10 @@ import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 法大大合同附属信息表
......@@ -56,25 +57,25 @@ public class FddContractAttachInfo extends BaseEntity {
* 合同试用期开始时间
*/
@Schema(description ="合同试用期开始时间")
private LocalDate periodStart;
private Date periodStart;
/**
* 合同试用期结束时间
*/
@Schema(description ="合同试用期结束时间")
private LocalDate periodEnd;
private Date periodEnd;
/**
* 合同起始时间
*/
@Schema(description ="合同起始时间")
private LocalDate contractStart;
private Date contractStart;
/**
* 合同到期时间
*/
@Schema(description ="合同到期时间")
private LocalDate contractEnd;
private Date contractEnd;
/**
* 试用期工资 元/月
......
......@@ -202,7 +202,7 @@ public class TEmployeeProject extends BaseEntity {
*/
@Schema(description ="合同类型(字典值)")
@NotNull(message = "合同类型不能为空")
@Size(max = 1, message = "合同类型不可超过1位")
@Size(max = 2, message = "合同类型不可超过2位")
private String contractType;
/**
......
......@@ -26,7 +26,7 @@ import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Date;
/**
* 员工合同-批量操作的VO
......@@ -122,16 +122,16 @@ public class EmployeeContractVO extends RowIndex implements Serializable {
*/
@NotBlank(message = "起始日期不能为空")
@DateTimeFormat("yyyy-MM-dd")
@ExcelAttribute(name = "起始日期", isNotEmpty = true, errorInfo = "起始日期不能为空")
@ExcelAttribute(name = "起始日期", isNotEmpty = true, errorInfo = "起始日期不能为空", isDate = true)
@Schema(description = "起始日期", name = "contractStart")
private LocalDate contractStart;
private Date contractStart;
/**
* 合同到期时间
*/
@ExcelAttribute(name = "截止日期", needExport = true)
@ExcelAttribute(name = "截止日期", needExport = true, isDate = true)
@DateTimeFormat("yyyy-MM-dd")
@Schema(description = "截止日期", name = "contractEnd")
private LocalDate contractEnd;
private Date contractEnd;
/**
* 合同岗位
......
......@@ -26,7 +26,8 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -55,8 +56,8 @@ public class TEmployeeContractAuditController {
* @return
*/
@Operation(summary = "获取list", description = "获取list")
@GetMapping("/getContractAuditList")
public R<List<TEmployeeContractAudit>> getContractAuditList(TEmployeeContractAudit tEmployeeContractAudit) {
@PostMapping("/getContractAuditList")
public R<List<TEmployeeContractAudit>> getContractAuditList(@RequestBody TEmployeeContractAudit tEmployeeContractAudit) {
return R.ok(tEmployeeContractAuditService.list(Wrappers.query(tEmployeeContractAudit)));
}
......
......@@ -40,7 +40,6 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.List;
import java.util.Map;
......@@ -121,7 +120,7 @@ public class TEmployeeProjectController {
@PutMapping
@PreAuthorize("@pms.hasPermission('archives_temployeeproject_edit')" )
public R updateById(@RequestBody TEmployeeProject tEmployeeProject) {
return R.ok(tEmployeeProjectService.updateById(tEmployeeProject));
return R.ok(tEmployeeProjectService.updateProject(tEmployeeProject));
}
/**
......
......@@ -48,6 +48,8 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
R saveEmp(TEmployeeProject tEmployeeProject);
R updateProject(TEmployeeProject tEmployeeProject);
/**
* @param tEmployeeProject
* @Description: 减项
......@@ -97,8 +99,7 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
List<TEmployeeProject> getListByEmpIdAndDeptNo(String empId, String deptNo);
/**
* @param excelVOList
* @param bindingResult
* @param inputStream
* @Description: 批量更新项目档案
* @Author: huyc
* @Date: 2022/6/21 10:30
......
......@@ -29,7 +29,10 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.NoUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.RequiredArgsConstructor;
......@@ -334,7 +337,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING));
if (employeeContractInfo != null) {
long count = this.count(Wrappers.<FddContractAttachInfo>query().lambda().eq(FddContractAttachInfo::getContractId, employeeContractInfo.getId()));
if (count > CommonConstants.ZERO_INT && attachInfo.getContractStart().isBefore(employeeContractInfo.getContractEnd())) {
if (count > CommonConstants.ZERO_INT && attachInfo.getContractStart().before(employeeContractInfo.getContractEnd())) {
errorList.add(new ErrorMessage(i, "已导入合同相关基础数据", CommonConstants.RED));
continue;
}
......
......@@ -71,9 +71,6 @@ import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.*;
import java.util.stream.Collectors;
......@@ -660,28 +657,28 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
if (Common.isNotNull(companyFieldMap.get("contractType"))){
//固定期限
paramter.put("contractType", "一");
paramter.put("fcontractStartY", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "yyyy"));
paramter.put("fcontractStartM", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "MM"));
paramter.put("fcontractStartD", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "dd"));
paramter.put("fcontractEndY", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "yyyy"));
paramter.put("fcontractEndM", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "MM"));
paramter.put("fcontractEndD", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "dd"));
paramter.put("fcontractStartY", DateUtil.format(attachInfo.getContractStart(), "yyyy"));
paramter.put("fcontractStartM", DateUtil.format(attachInfo.getContractStart(), "MM"));
paramter.put("fcontractStartD", DateUtil.format(attachInfo.getContractStart(), "dd"));
paramter.put("fcontractEndY", DateUtil.format(attachInfo.getContractEnd(), "yyyy"));
paramter.put("fcontractEndM", DateUtil.format(attachInfo.getContractEnd(), "MM"));
paramter.put("fcontractEndD", DateUtil.format(attachInfo.getContractEnd(), "dd"));
if (Common.isNotNull(companyFieldMap.get("fPeriodStartY"))){
//合同起止时间填充,新签需要判断是否有试用期,试用期工资
if (attachInfo.getPeriodStart() == null) {
return R.failed("新签试用期开始时间为空");
}
paramter.put("fPeriodStartY", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "yyyy"));
paramter.put("fPeriodStartM", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "MM"));
paramter.put("fPeriodStartD", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "dd"));
paramter.put("fPeriodStartY", DateUtil.format(attachInfo.getPeriodStart(), "yyyy"));
paramter.put("fPeriodStartM", DateUtil.format(attachInfo.getPeriodStart(), "MM"));
paramter.put("fPeriodStartD", DateUtil.format(attachInfo.getPeriodStart(), "dd"));
}
if (Common.isNotNull(companyFieldMap.get("fPeriodEndY"))){
if (attachInfo.getPeriodEnd() == null) {
return R.failed("新签试用期结束时间为空");
}
paramter.put("fPeriodEndY", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "yyyy"));
paramter.put("fPeriodEndM", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "MM"));
paramter.put("fPeriodEndD", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "dd"));
paramter.put("fPeriodEndY", DateUtil.format(attachInfo.getPeriodEnd(), "yyyy"));
paramter.put("fPeriodEndM", DateUtil.format(attachInfo.getPeriodEnd(), "MM"));
paramter.put("fPeriodEndD", DateUtil.format(attachInfo.getPeriodEnd(), "dd"));
}
if (Common.isNotNull(companyFieldMap.get("periodSalaryPerMonth"))){
if (attachInfo.getPeriodSalaryPerMonth() == null) {
......@@ -799,26 +796,26 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
//固定期限
paramter.put("contractType", "一");
paramter.put("fcontractStartY", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "yyyy"));
paramter.put("fcontractStartM", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "MM"));
paramter.put("fcontractStartD", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "dd"));
paramter.put("fcontractEndY", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "yyyy"));
paramter.put("fcontractEndM", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "MM"));
paramter.put("fcontractEndD", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "dd"));
paramter.put("fcontractStartY", DateUtil.format(attachInfo.getContractStart(), "yyyy"));
paramter.put("fcontractStartM", DateUtil.format(attachInfo.getContractStart(), "MM"));
paramter.put("fcontractStartD", DateUtil.format(attachInfo.getContractStart(), "dd"));
paramter.put("fcontractEndY", DateUtil.format(attachInfo.getContractEnd(), "yyyy"));
paramter.put("fcontractEndM", DateUtil.format(attachInfo.getContractEnd(), "MM"));
paramter.put("fcontractEndD", DateUtil.format(attachInfo.getContractEnd(), "dd"));
//合同起止时间填充,新签需要判断是否有试用期,试用期工资
if (!signFlag) {
if (attachInfo.getPeriodStart() == null) {
return R.failed("新签试用期开始时间为空");
}
paramter.put("fPeriodStartY", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "yyyy"));
paramter.put("fPeriodStartM", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "MM"));
paramter.put("fPeriodStartD", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "dd"));
paramter.put("fPeriodStartY", DateUtil.format(attachInfo.getPeriodStart(), "yyyy"));
paramter.put("fPeriodStartM", DateUtil.format(attachInfo.getPeriodStart(), "MM"));
paramter.put("fPeriodStartD", DateUtil.format(attachInfo.getPeriodStart(), "dd"));
if (attachInfo.getPeriodEnd() == null) {
return R.failed("新签试用期结束时间为空");
}
paramter.put("fPeriodEndY", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "yyyy"));
paramter.put("fPeriodEndM", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "MM"));
paramter.put("fPeriodEndD", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "dd"));
paramter.put("fPeriodEndY", DateUtil.format(attachInfo.getPeriodEnd(), "yyyy"));
paramter.put("fPeriodEndM", DateUtil.format(attachInfo.getPeriodEnd(), "MM"));
paramter.put("fPeriodEndD", DateUtil.format(attachInfo.getPeriodEnd(), "dd"));
if (attachInfo.getPeriodSalaryPerMonth() == null) {
return R.failed("新签试用期工资为空");
}
......@@ -862,14 +859,6 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
return new R<>(paramter.toJSONString());
}
public static Date localDate2Date(LocalDate localDate) {
if (null == localDate) {
return null;
}
ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
return Date.from(zonedDateTime.toInstant());
}
/**
* @param entity
* @Author: huyc
......
......@@ -28,15 +28,16 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.constants.ArchivesConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContractAlert;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpFamily;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpContractAlertMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmpContractAlertService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.ContractAlertSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.FamilySearchVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
......@@ -45,7 +46,6 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
......@@ -218,10 +218,9 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
.eq(TEmployeeContractInfo::getDeleteFlag,CommonConstants.ZERO_STRING));
Map<String,TEmpContractAlert> alertMap = new HashMap<>();
if (Common.isNotNull(alertList)){
LocalDate now = LocalDate.now();
Date nowDate = new Date();
for (TEmployeeContractInfo contract:alertList){
extracted(now, nowDate, contract,alertMap);
extracted(nowDate, contract,alertMap);
}
}
if (Common.isNotNull(notAccessList) && Common.isNotNull(alertMap)){
......@@ -241,13 +240,13 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
return R.ok();
}
private void extracted(LocalDate now, Date nowDate,
private void extracted(Date nowDate,
TEmployeeContractInfo contract,
Map<String,TEmpContractAlert> alertMap) {
TEmpContractAlert alert = alertMap.get(contract.getEmpIdcard());
// 存在多个审核通过的数据 用最新的审核通过的合同覆盖已有的
if (Common.isNotNull(alert) &&
alert.getContractEnd().after(LocalDateTimeUtils.convertLDToDate(contract.getContractEnd()))){
alert.getContractEnd().after(contract.getContractEnd())){
return;
}
alert = new TEmpContractAlert();
......@@ -257,8 +256,8 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
alert.setProject(contract.getSubjectDepart());
alert.setProjectNo(contract.getDeptNo());
alert.setEmpIdcard(contract.getEmpIdcard());
alert.setContractStart(LocalDateTimeUtils.convertLDToDate(contract.getContractStart()));
alert.setContractEnd(LocalDateTimeUtils.convertLDToDate(contract.getContractEnd()));
alert.setContractStart(contract.getContractStart());
alert.setContractEnd(contract.getContractEnd());
if (Common.isNotNull(contract.getFileProvince())){
alert.setFileProvince(Integer.toString(contract.getFileProvince()));
}
......@@ -272,7 +271,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
alert.setContractTerm(contract.getContractType());
alert.setContractTerm(contract.getContractTerm());
if (Common.isNotNull(alert.getContractEnd())){
if (Common.isNotNull(contract.getContractEnd()) && contract.getContractEnd().isBefore(now)){
if (Common.isNotNull(contract.getContractEnd()) && contract.getContractEnd().before(nowDate)){
alert.setDueFlag(CommonConstants.ONE_STRING);
alert.setDaysOver(DateUtil.daysBetween(nowDate,alert.getContractEnd()));
}else {
......
......@@ -167,6 +167,14 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return R.failed("未在人员档案中查到身份信息");
}
@Override
public R updateProject(TEmployeeProject tEmployeeProject) {
TEmployeeProject compareProject = this.getById(tEmployeeProject.getId());
boolean flag = this.updateById(tEmployeeProject);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1],"",tEmployeeProject.getId(),compareProject,tEmployeeProject);
return R.ok(flag);
}
@Override
public R reEmpInfo(JSONObject jsonObject) {
if (Common.isNotNull(jsonObject)) {
......
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