Commit 6d6f200a authored by 李灿灿's avatar 李灿灿

Merge branch 'develop' into feature-licancan

parents 2d7d3191 7cff9391
......@@ -82,7 +82,7 @@ public class FddContractAttachInfo extends BaseEntity {
* 合同到期时间
*/
@Schema(description ="合同到期时间")
@ExcelAttribute(name = "合同到期时间",needExport = true)
@ExcelAttribute(name = "合同到期时间", isNotEmpty = true, errorInfo = "合同到期时间不能为空")
private Date contractEnd;
/**
......@@ -125,8 +125,8 @@ public class FddContractAttachInfo extends BaseEntity {
* 岗位
*/
@Schema(description ="岗位")
@Length(max = 200, message = "岗位不能超过200个字符")
@ExcelAttribute(name = "岗位", isNotEmpty = true, errorInfo = "岗位不能为空", maxLength = 200, needExport = true)
@Length(max = 20, message = "岗位不能超过20个字符")
@ExcelAttribute(name = "岗位", isNotEmpty = true, errorInfo = "岗位不能为空", maxLength = 20, needExport = true)
private String post;
/**
......@@ -151,13 +151,14 @@ public class FddContractAttachInfo extends BaseEntity {
* 法大大模板id
*/
@Schema(description ="法大大模板id")
@ExcelAttribute(name = "法大大模板id")
private String fddTemplateId;
/**
* 员工姓名
*/
@Schema(description ="员工姓名")
@ExcelAttribute(name = "员工姓名", isNotEmpty = true, errorInfo = "员工合同id姓名不能为空", maxLength = 32, needExport = true)
@ExcelAttribute(name = "员工姓名", isNotEmpty = true, errorInfo = "员工姓名不能为空", maxLength = 32, needExport = true)
private String empName;
/**
......@@ -171,6 +172,7 @@ public class FddContractAttachInfo extends BaseEntity {
* 手机号码
*/
@Schema(description ="手机号码")
@ExcelAttribute(name = "手机号码", isNotEmpty = true, errorInfo = "手机号码不能为空", maxLength = 32, needExport = true)
private String empPhone;
/**
......@@ -184,7 +186,7 @@ public class FddContractAttachInfo extends BaseEntity {
* 员工类型
*/
@Schema(description ="员工类型")
@ExcelAttribute(name = "员工类型", isDataId = true, errorInfo = "员工类型不能为空", maxLength = 20)
@ExcelAttribute(name = "员工类型", isNotEmpty = true, errorInfo = "员工类型不能为空", isDataId = true, dataType = "emp_natrue",maxLength = 20, needExport = true)
private String empNatrue;
/**
......
......@@ -33,9 +33,9 @@ import lombok.EqualsAndHashCode;
*/
@Data
@TableName("fdd_template_field_info")
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode()
@Schema(description = "法大大字段对应信息表")
public class FddTemplateFieldInfo extends BaseEntity {
public class FddTemplateFieldInfo {
/**
* ID
......
......@@ -22,13 +22,10 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddContractAttachInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
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.ErrorMessage;
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.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
......@@ -41,9 +38,7 @@ import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.*;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
......@@ -143,21 +138,35 @@ public class FddContractAttachInfoController {
ExcelUtil<FddContractAttachInfo> util1 = null;
try {
// // 调用字典服务,渲染字典值
// res = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
// , "/dict/inner/getDictList", null, Map.class, SecurityConstants.FROM_IN);
//
// Map<String, String> dicMap = new HashMap<>();
// if (null != res.getData().get("data")) {
// for (SysDictItem dict : res.getData().get("data")) {
// dicMap.put(dict.getType() + CommonConstants.DOWN_LINE_STRING + dict.getLabel(), dict.getValue());
// }
// }
// 渲染字典值
Map<String, String> dicMap = new HashMap<>();
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue()
.get(CacheConstants.DICT_DETAILS
+ CommonConstants.COLON_STRING
+ "emp_natrue");
if (Common.isNotNull(dicObj)) {
for (Map.Entry<String, String> entry : dicObj.entrySet()) {
String key = entry.getKey();
String Label = entry.getValue();
dicMap.put("emp_natrue" + CommonConstants.DOWN_LINE_STRING + Label, key);
}
}
Map<String,String> dicObj1 = (Map<String, String>) RedisUtil.redis.opsForValue()
.get(CacheConstants.DICT_DETAILS
+ CommonConstants.COLON_STRING
+ "salary_type");
if (Common.isNotNull(dicObj1)) {
for (Map.Entry<String, String> entry : dicObj1.entrySet()) {
String key1 = entry.getKey();
String Label1 = entry.getValue();
dicMap.put("salary_type" + CommonConstants.DOWN_LINE_STRING + Label1, key1);
}
}
jsonString = URLDecoder.decode(jsonString, CommonConstants.UTF8).replace("=", "");
util1 = new ExcelUtil<>(FddContractAttachInfo.class);
//传参字典数据MAP具体见方法实现
util1.getJsonStringToList(jsonString, null);
util1.getJsonStringToList(jsonString, dicMap);
if (null != util1.getErrorInfo() && !util1.getErrorInfo().isEmpty()) {
return R.failed(util1.getErrorInfo(),"数据异常");
} else {
......@@ -165,7 +174,7 @@ public class FddContractAttachInfoController {
List<ErrorMessage> errorInfo = fddContractAttachInfoService.batchAdd(util1.getEntityList());
Map<String,Object> variableMap = new HashMap<>();
Map<Integer,Object> map = new HashMap<>();
boolean allExitContract = errorInfo.stream().allMatch(e-> e.getMessage().equals("存在“在用”的合同"));
boolean allExitContract = errorInfo.stream().allMatch(e-> checkInfo(e));
if (allExitContract) {
variableMap.put("allMatch","true");
for (ErrorMessage errorMessage :errorInfo){
......@@ -202,14 +211,28 @@ public class FddContractAttachInfoController {
ExcelUtil<FddContractAttachInfo> util1 = null;
try {
// 调用字典服务,渲染字典值
res = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/dict/inner/getDictList", null, Map.class, SecurityConstants.FROM_IN);
// 渲染字典值
Map<String, String> dicMap = new HashMap<>();
if (null != res.getData()) {
for (SysDictItem dict : res.getData()) {
dicMap.put(dict.getType() + CommonConstants.DOWN_LINE_STRING + dict.getLabel(), dict.getValue());
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue()
.get(CacheConstants.DICT_DETAILS
+ CommonConstants.COLON_STRING
+ "emp_natrue");
if (Common.isNotNull(dicObj)) {
for (Map.Entry<String, String> entry : dicObj.entrySet()) {
String key = entry.getKey();
String Label = entry.getValue();
dicMap.put("emp_natrue" + CommonConstants.DOWN_LINE_STRING + Label, key);
}
}
Map<String,String> dicObj1 = (Map<String, String>) RedisUtil.redis.opsForValue()
.get(CacheConstants.DICT_DETAILS
+ CommonConstants.COLON_STRING
+ "salary_type");
if (Common.isNotNull(dicObj1)) {
for (Map.Entry<String, String> entry : dicObj1.entrySet()) {
String key1 = entry.getKey();
String Label1 = entry.getValue();
dicMap.put("salary_type" + CommonConstants.DOWN_LINE_STRING + Label1, key1);
}
}
......@@ -250,4 +273,9 @@ public class FddContractAttachInfoController {
List<ErrorMessage> errorInfo = fddContractAttachInfoService.sendTask(entityList);
return R.ok(errorInfo);
}
public boolean checkInfo(ErrorMessage errorMessage) {
Set<String> set = errorMessage.getErrors();
return set.stream().allMatch(e-> e.equals("存在“在用”的合同"));
}
}
......@@ -136,7 +136,8 @@ public class FddContractInfoController {
@PostMapping("/send")
public R<String> send(FddContractInfo fddContractInfo) throws ApiException {
FddContractAttachInfo fddContractAttachInfo = fddContractAttachInfoService.getById(fddContractInfo.getId());
return fddContractInfoService.saveEmpContract(fddContractAttachInfo);
YifuUser user = SecurityUtils.getUser();
return fddContractInfoService.saveEmpContract(fddContractAttachInfo,user);
}
/**
......
......@@ -12,6 +12,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
......@@ -83,7 +85,7 @@ public class FddController {
fddPersonAccountService.updateById(fddPersonAccount);
}
}
return R.ok(null,"成功");
return R.ok(null,"success");
}
/**
......@@ -127,7 +129,7 @@ public class FddController {
fddPersonAccount.setCompanyInfoId(companyInfo.getId());
}
fddPersonAccountService.updateById(fddPersonAccount);
return R.ok(null,"成功");
return R.ok(null,"success");
}
}
}
......@@ -157,6 +159,7 @@ public class FddController {
if (StringUtils.equals(CommonConstants.TWO_STRING, jsonObject.getString("status"))) {
//成功
FddPersonAccount entity = fddPersonAccountService.getById(clientId);
YifuUser user = SecurityUtils.getUser();
if (entity != null) {
entity.setRealStatus(CommonConstants.ONE_STRING);
entity.setUnionid(unionId);
......@@ -172,7 +175,7 @@ public class FddController {
return;
}
FddContractAttachInfo fddContractAttachInfo = attachInfos.get(CommonConstants.ZERO_INT);
R<String> returnR = fddContractInfoService.saveEmpContract(fddContractAttachInfo);
R<String> returnR = fddContractInfoService.saveEmpContract(fddContractAttachInfo,user);
if (returnR != null) {
//记录返回信息
if(returnR.getCode()== CommonConstants.SUCCESS){
......@@ -186,7 +189,7 @@ public class FddController {
}
});
}
return R.ok(null,"成功");
return R.ok(null,"success");
}
}
} else if (StringUtils.equals(fddEvent, "reviseTask")) {
......@@ -218,7 +221,7 @@ public class FddController {
e.printStackTrace();
}
});
return R.ok(null,"成功");
return R.ok(null,"success");
}
}
} else if (StringUtils.equals(fddEvent, "sign")) {
......@@ -260,7 +263,7 @@ public class FddController {
employeeContractInfoService.updateById(ec);
}
}
return R.ok(null,"成功");
return R.ok(null,"success");
}else if (StringUtils.equals(fddEvent, "notifyUrlVerify")) {
return R.ok(null,"success");
}
......
......@@ -23,6 +23,7 @@ import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
......@@ -44,7 +45,7 @@ public interface FddContractInfoService extends IService<FddContractInfo> {
* @Date: 2022/6/30
* @return R
*/
R<String> saveEmpContract(FddContractAttachInfo fddContractInfo) throws ApiException;
R<String> saveEmpContract(FddContractAttachInfo fddContractInfo, YifuUser user) throws ApiException;
/**
* 作废重签
......
......@@ -16,6 +16,7 @@
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -32,8 +33,10 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
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.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.StringUtils;
......@@ -48,11 +51,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
......@@ -136,6 +135,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
public List<ErrorMessage> sendTask(List<FddContractAttachInfo> entityList) {
List<ErrorMessage> errorList = new ArrayList<>();
int i = 1;
YifuUser user = SecurityUtils.getUser();
for (FddContractAttachInfo attachInfo : entityList) {
//保存合同数据
attachInfo.setContractId(CommonConstants.EMPTY_STRING);
......@@ -175,7 +175,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
try {
//如果已经实名发送电子合同
FddContractAttachInfo fddContractAttachInfo = this.getById(attachInfo.getId());
R<String> returnR = fddContractInfoService.saveEmpContract(fddContractAttachInfo);
R<String> returnR = fddContractInfoService.saveEmpContract(fddContractAttachInfo,user);
if (returnR != null) {
//记录返回信息
if (returnR.getCode() == CommonConstants.SUCCESS) {
......@@ -333,26 +333,46 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
@Override
public List<ErrorMessage> batchAdd(List<FddContractAttachInfo> entityList) {
List<ErrorMessage> errorList = new ArrayList<>();
Set<String> errorMsg;
YifuUser user = SecurityUtils.getUser();
Map<String, Integer> sameCheck = new HashMap<>();
int i = 1;
try {
if (null != entityList && !entityList.isEmpty()) {
for (FddContractAttachInfo attachInfo : entityList) {
errorMsg = new HashSet<>();
i++;
String sameInfo = attachInfo.getEmpNatrue() + "_" + attachInfo.getDepartNo()
+ "_" + attachInfo.getFddTemplateId() + "_" + attachInfo.getContractStart()
+ "_" + attachInfo.getContractEnd();
if (sameCheck.get(sameInfo) != null) {
errorMsg.add("第" + (i) + "行与第" + sameCheck.get(sameInfo) + "行重复!");
} else {
sameCheck.put(sameInfo, i);
}
//判断计时计件工资必填
if (CommonConstants.ONE_STRING.equals(attachInfo.getSalaryType()) && Common.isEmpty(attachInfo.getSalaryStandardPerHour())) {
errorMsg.add("计时工资不能为空");
}
if (CommonConstants.TWO_STRING.equals(attachInfo.getSalaryType()) && Common.isEmpty(attachInfo.getSalaryStandardPerPiece())) {
errorMsg.add("计件工资不能为空");
}
//结算主体编码是否准确
TSettleDomain settleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda().eq(TSettleDomain::getDepartNo, attachInfo.getDepartNo()));
TSettleDomain settleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda().eq(TSettleDomain::getDepartNo, attachInfo.getDepartNo())
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING).eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING));
if (Common.isEmpty(settleDomain)) {
errorList.add(new ErrorMessage(i, "结算主体编码有误", CommonConstants.RED));
continue;
}
errorMsg.add("项目编码有误");
} else {
//查询员工合同
TEmployeeContractInfo employeeContractInfo = employeeContractInfoService.getOne(Wrappers.<TEmployeeContractInfo>query().lambda()
.eq(TEmployeeContractInfo::getEmpIdcard,attachInfo.getEmpIdcard()).eq(TEmployeeContractInfo::getSettleDomain,settleDomain.getId())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING));
.eq(TEmployeeContractInfo::getEmpIdcard, attachInfo.getEmpIdcard()).eq(TEmployeeContractInfo::getSettleDomain, settleDomain.getId())
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_STRING).eq(TEmployeeContractInfo::getDeleteFlag, 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().before(employeeContractInfo.getContractEnd())) {
errorList.add(new ErrorMessage(i, "已导入合同相关基础数据", CommonConstants.RED));
continue;
errorMsg.add("已导入合同相关基础数据");
}
List<FddContractTemplate> fddContractTemplateList = fddContractTemplateService.list(Wrappers.<FddContractTemplate>query().lambda()
......@@ -360,30 +380,32 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
.eq(FddContractTemplate::getModifyUploadStatus, CommonConstants.dingleDigitStrArray[1]));
//如果模板存在则生成法大大电子合同数据
if (fddContractTemplateList.size() == CommonConstants.ZERO_INT) {
errorList.add(new ErrorMessage(i, "未获取到有效的合同模板", CommonConstants.RED));
continue;
errorMsg.add("未获取到有效的合同模板");
}
if (fddContractTemplateList.size() != CommonConstants.ONE_INT) {
errorList.add(new ErrorMessage(i, "法大大合同有效合同模板存在多条", CommonConstants.RED));
continue;
}else {
errorList.add(new ErrorMessage(i, "存在“在用”的合同", CommonConstants.RED));
continue;
errorMsg.add("法大大合同有效合同模板存在多条");
} else {
errorMsg.add("存在“在用”的合同");
}
}
}
//保存合同数据
attachInfo.setContractId(CommonConstants.EMPTY_STRING);
attachInfo.setCreateTime(LocalDateTime.now());
//校验数据
R<String> employeeParamR;
//新签
employeeParamR = fddContractInfoService.generalEmployeeParam(attachInfo, false);
if (CommonConstants.FAIL == employeeParamR.getCode()) {
errorList.add(new ErrorMessage(i, employeeParamR.getMsg(), CommonConstants.RED));
continue;
errorMsg.add(employeeParamR.getMsg());
}
// 数据合法情况
if (!CollUtil.isEmpty(errorMsg)) {
// 数据不合法
errorList.add(new ErrorMessage(i, errorMsg));
} else {
//保存合同数据
attachInfo.setContractId(CommonConstants.EMPTY_STRING);
attachInfo.setCreateTime(LocalDateTime.now());
//保存数据
this.save(attachInfo);
attachInfo.setContractId(attachInfo.getId());
......@@ -404,7 +426,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
try {
fddPersonAccountService.sendAuthMessage(fddPersonAccount.getId());
} catch (Exception e) {
log.error("执行异常",e);
log.error("执行异常", e);
}
});
} else {
......@@ -412,12 +434,12 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
try {
//如果已经实名发送电子合同
FddContractAttachInfo fddContractAttachInfo = this.getById(attachInfo.getId());
R<String> returnR = fddContractInfoService.saveEmpContract(fddContractAttachInfo);
R<String> returnR = fddContractInfoService.saveEmpContract(fddContractAttachInfo, user);
if (returnR != null) {
//记录返回信息
if(returnR.getCode()==CommonConstants.SUCCESS){
if (returnR.getCode() == CommonConstants.SUCCESS) {
fddContractAttachInfo.setRemark("成功");
}else {
} else {
fddContractAttachInfo.setRemark(returnR.getMsg());
}
this.updateById(fddContractAttachInfo);
......@@ -429,12 +451,12 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
}
errorList.add(new ErrorMessage(i, "保存成功", CommonConstants.GREEN));
}
}
} else {
errorList.add(new ErrorMessage(i, "无数据保存"));
}
} catch (Exception e) {
log.error("合同数据批量新增异常" + e.getMessage());
errorList.add(new ErrorMessage(i, "合同数据批量新增异常:" + e.getMessage()));
return errorList;
}
return errorList;
......@@ -490,7 +512,6 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
}
} catch (Exception e) {
log.error("合同数据批量新增异常" + e.getMessage());
errorList.add(new ErrorMessage(i, "合同数据批量新增异常:" + e.getMessage()));
return errorList;
}
return errorList;
......@@ -577,7 +598,8 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
* @param settleDomain
* @param fddContractTemplate
* @param newEmployeeInfo
* @param tEmployeeProject
* @param tCustomerInfo
* @param newTEmpProject
* @Author: huyc
* @Date: 2022/06/01
* @Description: 新增项目档案
......
......@@ -69,7 +69,9 @@ import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.ZoneId;
......@@ -107,27 +109,18 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
private FddSealPersonAuthService fddSealPersonAuthService;
@Autowired
private FddContractAttachInfoMapper fddContractAttachInfoMapper;
// @Autowired
// private TEmployeeContractInfoService employeeContractInfoService;
// @Autowired
// private TEmployeeInfoService employeeInfoService;
@Autowired
private TEmployeeContractInfoService employeeContractInfoService;
@Autowired
private FddTemplateFieldInfoService fieldInfoService;
// 阿里云文件上传服务
@Autowired
private OSSUtil ossUtil;
// // 附件表
// @Autowired
// private TEmpAttaService empAttaService;
// // 附件-合同,关联表
// @Autowired
// private MEmpContractAttaService mempContractAttaService;
@Autowired
private TSettleDomainService tSettleDomainService;
@Override
public R<String> saveEmpContract(FddContractAttachInfo fddContractAttachInfo) throws ApiException {
YifuUser user = SecurityUtils.getUser();
public R<String> saveEmpContract(FddContractAttachInfo fddContractAttachInfo,YifuUser user) throws ApiException {
if (!user.getId().equals(fddContractAttachInfo.getCreateBy())) {
return R.failed("当前用户不是电子合同导入用户,不能操作");
}
......@@ -560,50 +553,50 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
**/
@Override
public R<String> moveFileToEmpConcat(FddContractInfo fddContractInfo, HttpServletResponse response) throws ApiException, IOException {
// FddContractInfo entity = this.getById(fddContractInfo.getId());
// if (entity == null || entity.getSignTaskId() == null) {
// throw new CheckedException("未获取到对应签署任务");
// }
// TEmployeeContractInfo employeeContractInfo = employeeContractInfoService.getById(entity.getContractId());
// if (employeeContractInfo != null) {
// //发送请求
// GetBySignFileIdReq req = new GetBySignFileIdReq();
// req.setToken(fddUtil.getToken());
// req.setTaskId(entity.getSignTaskId());
// DocumentClient client = new DocumentClient(fddUtil.getFadadaApiClient());
// BaseRsp<DownLoadFileRsp> rsp = client.getBySignFileId(req);
// //校验参数
// if (StringUtils.equals(rsp.getCode(), FddUtil.SUCCESS)) {
// DownLoadFileRsp rspData = rsp.getData();
// if (rspData != null) {
// InputStream bis = null;
// try {
// bis = new ByteArrayInputStream(rspData.getFileBytes());
// String name = System.currentTimeMillis() + "法大大电子签附件";
// String key = name + ".zip";
// ossUtil.uploadFileByStream(bis, key, null);
// // 1:保存为
//// TEmpAtta empAtta = BasicServiceUtil.initTEmpAttaForInsert(name, key, (long) rspData.getFileBytes().length);
//// empAttaService.save(empAtta);
//// MEmpContractAtta contractAtta = new MEmpContractAtta();
//// contractAtta.setAttaId(empAtta.getId());
//// contractAtta.setContractId(employeeContractInfo.getId());
//// mempContractAttaService.save(contractAtta);
// FddContractAttachInfo fddContractAttachInfo = fddContractAttachInfoService.getOne(Wrappers.<FddContractAttachInfo>query().lambda()
// .eq(FddContractAttachInfo::getContractId,entity.getContractId()).last(CommonConstants.LAST_ONE_SQL));
// if (fddContractAttachInfo != null) {
// fddContractAttachInfo.setIsMove(CommonConstants.ONE_INT);
// fddContractAttachInfoService.updateById(fddContractAttachInfo);
// }
// return R.ok();
// } finally {
// if (bis != null) {
// bis.close();
// }
// }
// }
// }
// }
FddContractInfo entity = this.getById(fddContractInfo.getId());
if (entity == null || entity.getSignTaskId() == null) {
throw new CheckedException("未获取到对应签署任务");
}
TEmployeeContractInfo employeeContractInfo = employeeContractInfoService.getById(entity.getContractId());
if (employeeContractInfo != null) {
//发送请求
GetBySignFileIdReq req = new GetBySignFileIdReq();
req.setToken(fddUtil.getToken());
req.setTaskId(entity.getSignTaskId());
DocumentClient client = new DocumentClient(fddUtil.getFadadaApiClient());
BaseRsp<DownLoadFileRsp> rsp = client.getBySignFileId(req);
//校验参数
if (StringUtils.equals(rsp.getCode(), FddUtil.SUCCESS)) {
DownLoadFileRsp rspData = rsp.getData();
if (rspData != null) {
InputStream bis = null;
try {
bis = new ByteArrayInputStream(rspData.getFileBytes());
String name = System.currentTimeMillis() + "法大大电子签附件";
String key = name + ".zip";
ossUtil.uploadFileByStream(bis, key, null);
// 1:保存为
// TEmpAtta empAtta = BasicServiceUtil.initTEmpAttaForInsert(name, key, (long) rspData.getFileBytes().length);
// empAttaService.save(empAtta);
// MEmpContractAtta contractAtta = new MEmpContractAtta();
// contractAtta.setAttaId(empAtta.getId());
// contractAtta.setContractId(employeeContractInfo.getId());
// mempContractAttaService.save(contractAtta);
FddContractAttachInfo fddContractAttachInfo = fddContractAttachInfoMapper.selectOne(Wrappers.<FddContractAttachInfo>query().lambda()
.eq(FddContractAttachInfo::getContractId,entity.getContractId()).last(CommonConstants.LAST_ONE_SQL));
if (fddContractAttachInfo != null) {
fddContractAttachInfo.setIsMove(CommonConstants.ONE_INT);
fddContractAttachInfoMapper.updateById(fddContractAttachInfo);
}
return R.ok();
} finally {
if (bis != null) {
bis.close();
}
}
}
}
}
return R.failed("转移失败");
}
......@@ -878,6 +871,7 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
private R<String> cancleReviSeTask(FddContractInfo entity) throws ApiException {
YifuUser user = SecurityUtils.getUser();
//定稿任务状态:0 待发起 、1定稿中、2已定稿、3已撤销、4已过期
R<Integer> reviseTaskDetailR = reviseTaskDetail(entity);
if (reviseTaskDetailR.getCode() != CommonConstants.SUCCESS) {
......@@ -897,9 +891,7 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
//.先复制一份合同、然后删除之前合同
entity.setDeleteFlag(CommonConstants.ONE_STRING);
this.updateById(entity);
// TEmployeeContractInfo employeeContractInfo = employeeContractInfoService.getById(entity.getContractId());
// TEmployeeInfo employeeInfo = employeeInfoService.getById(employeeContractInfo.getEmpId());
R<String> saveEmpContractR = saveEmpContract(attachInfo);
R<String> saveEmpContractR = saveEmpContract(attachInfo,user);
if (saveEmpContractR.getCode() != CommonConstants.SUCCESS) {
throw new CheckedException(saveEmpContractR.getMsg());
}
......
......@@ -327,5 +327,12 @@ public interface ErrorCodes {
* 该人员项目档案已减项,不允许划转
*/
String PROJECT_PERSON_DELETE_EXIT = "project.person.delete.exit";
/**
* 派单员工合同相关信息不可为空
*/
String EMP_DISPATCH_CONTRACT_NOT_EMPTY = "emp.dispatch.contract.not.empty";
/**
* 派单员工社保相关信息不可为空
*/
String EMP_DISPATCH_SOCIAL_NOT_EMPTY = "emp.dispatch.social.not.empty";
}
......@@ -3,6 +3,8 @@ package com.yifu.cloud.plus.v1.yifu.common.core.util;
import lombok.Data;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
/**
* @author fang
......@@ -16,6 +18,8 @@ public class ErrorMessage implements Serializable {
//默认红色 success green
private String color = "red";
private Set<String> errors = new HashSet();
/**
* @param 用于展示勾选的名称
* @Author: wangan
......@@ -42,4 +46,9 @@ public class ErrorMessage implements Serializable {
this.message = message;
this.name= name;
}
public ErrorMessage(Integer lineNum, Set<String> errors) {
this.lineNum = lineNum;
this.errors = errors;
}
}
......@@ -106,8 +106,15 @@ change.strat.month.exit=\u5212\u8F6C\u8D77\u59CB\u6708\u4E0D\u80FD\u4E3A\u7A7A
change.less.month.exit=\u5212\u8F6C\u8D77\u59CB\u6708\u8981\u5C0F\u4E8E\u7B49\u4E8E\u5F53\u524D\u6708
project.person.search.exit=\u672A\u627E\u5230\u8BE5\u4EBA\u5458\u7684\u9879\u76EE\u6863\u6848\uFF0C\u8BF7\u6838\u5B9E
project.person.delete.exit=\u8BE5\u4EBA\u5458\u9879\u76EE\u6863\u6848\u5DF2\u51CF\u9879\uFF0C\u4E0D\u5141\u8BB8\u5212\u8F6C
emp.dispatch.contract.not.empty=\u6D3E\u5355\u5458\u5DE5\u5408\u540C\u76F8\u5173\u4FE1\u606F\u4E0D\u53EF\u4E3A\u7A7A
emp.dispatch.social.not.empty=\u6D3E\u5355\u5458\u5DE5\u793E\u4FDD\u76F8\u5173\u4FE1\u606F\u4E0D\u53EF\u4E3A\u7A7A
......
dapr.upms.appUrl=http://localhost:3500/v1.0/invoke/
dapr.upms.appUrl=http://yifu-upms.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.upms.appId=yifu-upms
dapr.upms.appPort=4000
dapr.upms.httpPort=3500
......@@ -6,18 +6,11 @@ dapr.upms.grpcPort=52000
dapr.upms.metricsPort=9094
#\u6D4B\u8BD5\u73AF\u5883
#dapr.check.appUrl=http://yifu-check.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.check.appUrl=http://yifu-check.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
#\u672C\u5730
dapr.check.appUrl=http://localhost:3507/v1.0/invoke/
#dapr.check.appUrl=http://localhost:3502/v1.0/invoke/
dapr.check.appId=yifu-check
#dapr.check.appPort=5022
#dapr.check.httpPort=3502
#dapr.check.grpcPort=52002
#dapr.check.metricsPort=9092
dapr.social.appUrl=http://localhost:3509/v1.0/invoke/
dapr.social.appId\uFF1B
dapr.social.appPort=5002
dapr.social.httpPort=3509
dapr.social.grpcPort=52003
dapr.social.metricsPort=9093
\ No newline at end of file
dapr.check.appPort=5022
dapr.check.httpPort=3502
dapr.check.grpcPort=52002
dapr.check.metricsPort=9092
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceCompanyService;
import io.swagger.v3.oas.annotations.Operation;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @author zhaji
......@@ -18,4 +27,47 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(name = "保险公司相关")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TInsuranceCompanyController {
@Resource
private TInsuranceCompanyService insuranceCompanyService;
/**
* 分页查询
* @param page 分页对象
* @param insuranceCompany 保险公司
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
public R<IPage<TInsuranceCompany>> getTCertRecordPage(Page page, TInsuranceCompany insuranceCompany) {
return R.ok(insuranceCompanyService.pageDiy(page, insuranceCompany));
}
/**
* 通过id查询保险公司详情
* @param id id
* @return R
*/
@Operation(summary = "通过id查询保险公司详情", description = "通过id查询:hasPermission('demo_insuranceCompany_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_insuranceCompany_get')" )
public R<TInsuranceCompany> getById(@PathVariable("id" ) String id) {
return R.ok(insuranceCompanyService.getById(id));
}
/**
* 新增保险公司
* @param insuranceCompany 保险公司明细
* @return R
*/
@Operation(summary = "新增保险公司", description = "新增证明开具记录表:hasPermission('demo_insuranceCompany_add')")
@SysLog("新增保险公司" )
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_insuranceCompany_add')" )
public R<Boolean> save(@RequestBody TInsuranceCompany insuranceCompany) {
return R.ok(insuranceCompanyService.save(insuranceCompany));
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import io.swagger.v3.oas.annotations.Operation;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @author zhaji
......@@ -18,4 +28,44 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(name = "险种相关")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TInsuranceTypeController {
@Resource
private TInsuranceTypeService insuranceTypeService;
/**
* 分页查询
* @param page 分页对象
* @param insuranceType 险种
* @return
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
public R<IPage<TInsuranceType>> getTCertRecordPage(Page page, TInsuranceType insuranceType) {
return R.ok(insuranceTypeService.pageDiy(page, insuranceType));
}
/**
* 通过id查询险种详情
* @param id id
* @return R
*/
@Operation(summary = "通过id查询险种详情", description = "通过id查询:hasPermission('demo_insuranceType_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_insuranceType_get')" )
public R<TInsuranceType> getById(@PathVariable("id" ) String id) {
return R.ok(insuranceTypeService.getById(id));
}
/**
* 新增险种
* @param insuranceType 险种明细
* @return R
*/
@Operation(summary = "新增保险公司", description = "新增险种:hasPermission('demo_insuranceType_add')")
@SysLog("新增险种")
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_insuranceType_add')" )
public R<Boolean> save(@RequestBody TInsuranceType insuranceType) {
return R.ok(insuranceTypeService.save(insuranceType));
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeRateService;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -7,6 +8,8 @@ import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author zhaji
* @description 费率相关
......@@ -18,4 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(name = "费率相关")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TInsuranceTypeRateController {
@Resource
private TInsuranceTypeRateService insuranceTypeRateService;
}
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeStandardService;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -7,6 +8,8 @@ import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author zhaji
* @description 购买标准相关
......@@ -18,4 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
@Tag(name = "购买标准相关")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TInsuranceTypeStandardController {
@Resource
private TInsuranceTypeStandardService insuranceTypeStandardService;
}
package com.yifu.cloud.plus.v1.yifu.insurances.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
......@@ -10,4 +12,5 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
*/
public interface TInsuranceCompanyService extends IService<TInsuranceCompany> {
IPage<TInsuranceCompany> pageDiy(Page page, TInsuranceCompany insuranceCompany);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
/**
......@@ -11,4 +14,5 @@ import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
*/
public interface TInsuranceTypeService extends IService<TInsuranceType> {
IPage<TInsuranceType> pageDiy(Page page, TInsuranceType insuranceType);
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceCompanyMapper;
......@@ -14,4 +17,10 @@ import org.springframework.stereotype.Service;
@Service
public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyMapper, TInsuranceCompany> implements TInsuranceCompanyService {
@Override
public IPage<TInsuranceCompany> pageDiy(Page page, TInsuranceCompany insuranceCompany) {
LambdaQueryWrapper<TInsuranceCompany> wrapper = new LambdaQueryWrapper<>();
wrapper.orderByDesc(TInsuranceCompany::getCreateTime);
return this.baseMapper.selectPage(page,wrapper);
}
}
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeMapper;
......@@ -15,4 +18,10 @@ import org.springframework.stereotype.Service;
@Service
public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper, TInsuranceType> implements TInsuranceTypeService {
@Override
public IPage<TInsuranceType> pageDiy(Page page, TInsuranceType insuranceType) {
LambdaQueryWrapper<TInsuranceType> wrapper = new LambdaQueryWrapper<>();
wrapper.orderByDesc(TInsuranceType::getCreateTime);
return this.baseMapper.selectPage(page,wrapper);
}
}
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