Commit 8527ab5a authored by fangxinjiang's avatar fangxinjiang

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

# Conflicts:
#	yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TEmployeeProjectServiceImpl.java
parents 14318d30 ab8dbb4b
...@@ -381,4 +381,12 @@ public class TEmployeeInfo extends BaseEntity { ...@@ -381,4 +381,12 @@ public class TEmployeeInfo extends BaseEntity {
@Schema(description = "导出的表头的Set") @Schema(description = "导出的表头的Set")
private Set<String> exportFields; private Set<String> exportFields;
@Schema(description = "减档时间起")
@TableField(exist = false)
private String leaveTimeStart;
@Schema(description = "减档时间止")
@TableField(exist = false)
private String leaveTimeEnd;
} }
...@@ -575,7 +575,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt ...@@ -575,7 +575,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
jsonObject.put("value",fddContractTemplate.getType()); jsonObject.put("value",fddContractTemplate.getType());
jsonObject.put("type","personnel_type"); jsonObject.put("type","personnel_type");
R<String> res = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId() R<String> res = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/dict/inner/getLableFronValue", null, Map.class, SecurityConstants.FROM_IN); , "/dict/inner/getLableFronValue", jsonObject, Map.class, SecurityConstants.FROM_IN);
if (res != null) { if (res != null) {
//电子合同模板对应的“员工类型” //电子合同模板对应的“员工类型”
newEmployeeContractInfo.setContractName(res.getData()); newEmployeeContractInfo.setContractName(res.getData());
......
...@@ -30,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TElecEmployeeInfoService; ...@@ -30,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TElecEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; 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.constant.SecurityConstants;
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.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo; import com.yifu.cloud.plus.v1.yifu.common.core.vo.FileVo;
...@@ -41,6 +42,7 @@ import org.apache.commons.fileupload.FileItemFactory; ...@@ -41,6 +42,7 @@ import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile; import org.springframework.web.multipart.commons.CommonsMultipartFile;
...@@ -87,6 +89,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -87,6 +89,7 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
* @date: 2022/6/27 * @date: 2022/6/27
*/ */
@Override @Override
@Transactional
public R importZip(MultipartFile zipFile){ public R importZip(MultipartFile zipFile){
try { try {
String pathName = System.getProperty("java.io.tmpdir"); String pathName = System.getProperty("java.io.tmpdir");
...@@ -168,7 +171,33 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -168,7 +171,33 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
Enumeration<?> entries = zipFile.entries(); Enumeration<?> entries = zipFile.entries();
Map<String,String> insMap = new HashMap<>(); Map<String,String> insMap = new HashMap<>();
Map<String,String> map = new HashMap<>();
List<TElecEmployeeInfo> infolist = new ArrayList<>();
List<String> list = new ArrayList<>();
while (entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entries.nextElement();
//添加进filesName
String empInfo = entry.getName();
// 如果是文件夹,就创建个文件夹
if (!entry.isDirectory()) {
if (empInfo.length() > empInfo.lastIndexOf("/") + 1) {
String idCard = empInfo.substring(0, empInfo.indexOf("/"));
String dataType = empInfo.substring(empInfo.indexOf("/") + 1, empInfo.lastIndexOf("/"));
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, idCard)).eq(TEmployeeInfo::getFileStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TEmployeeInfo::getFileStatus, CommonConstants.ZERO_INT));
if (Common.isEmpty(tEmployeeInfo)) {
return R.failed("未找到身份证对应的档案信息,身份证号:" + idCard);
}
if (Common.isNotNull(elecTypeMap)) {
if (!Common.isNotNull(elecTypeMap.get(dataType))) {
return R.failed("资料类型错误:" + dataType);
}
}
}
}
}
while (entries.hasMoreElements()) { while (entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entries.nextElement(); ZipEntry entry = (ZipEntry) entries.nextElement();
//添加进filesName //添加进filesName
...@@ -197,7 +226,6 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -197,7 +226,6 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
} }
TElecEmployeeInfo tElecEmployeeInfo = new TElecEmployeeInfo(); TElecEmployeeInfo tElecEmployeeInfo = new TElecEmployeeInfo();
List<String> list = new ArrayList<>();
if (empInfo.length() > empInfo.lastIndexOf("/") + 1) { if (empInfo.length() > empInfo.lastIndexOf("/") + 1) {
String idCard = empInfo.substring(0,empInfo.indexOf("/")); String idCard = empInfo.substring(0,empInfo.indexOf("/"));
String dataType = empInfo.substring(empInfo.indexOf("/") +1,empInfo.lastIndexOf("/")); String dataType = empInfo.substring(empInfo.indexOf("/") +1,empInfo.lastIndexOf("/"));
...@@ -223,9 +251,11 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM ...@@ -223,9 +251,11 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
String id = insMap.get(idCard + CommonConstants.DOWN_LINE_STRING + dataType); String id = insMap.get(idCard + CommonConstants.DOWN_LINE_STRING + dataType);
//if (!elecTypeMap.get(dataType).equals(insMap.get(idCard))) { //if (!elecTypeMap.get(dataType).equals(insMap.get(idCard))) {
if (Common.isEmpty(id)) { if (Common.isEmpty(id)) {
infolist.add(tElecEmployeeInfo);
this.save(tElecEmployeeInfo); this.save(tElecEmployeeInfo);
insMap.put(idCard + CommonConstants.DOWN_LINE_STRING + dataType, tElecEmployeeInfo.getId()); insMap.put(idCard + CommonConstants.DOWN_LINE_STRING + dataType, tElecEmployeeInfo.getId());
} }
list.add(insMap.get(idCard + CommonConstants.DOWN_LINE_STRING + dataType));
fileUploadService.uploadImg(fileCovertMultipartFile(targetFile),"", CommonConstants.EIGHT_INT,insMap.get(idCard + CommonConstants.DOWN_LINE_STRING + dataType)); fileUploadService.uploadImg(fileCovertMultipartFile(targetFile),"", CommonConstants.EIGHT_INT,insMap.get(idCard + CommonConstants.DOWN_LINE_STRING + dataType));
} }
......
...@@ -47,16 +47,16 @@ public class TEmployeeLogServiceImpl extends ServiceImpl<TEmployeeLogMapper, TEm ...@@ -47,16 +47,16 @@ public class TEmployeeLogServiceImpl extends ServiceImpl<TEmployeeLogMapper, TEm
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo); String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
//如果有差异保存差异 //如果有差异保存差异
if(!Common.isEmpty(differenceKey)){ if(!Common.isEmpty(differenceKey)){
TEmployeeLog record = new TEmployeeLog(); TEmployeeLog employeeLog = new TEmployeeLog();
record.setProjectId(projectId); employeeLog.setProjectId(projectId);
record.setType(type); employeeLog.setType(type);
record.setEmpId(empId); employeeLog.setEmpId(empId);
record.setCreateTime(LocalDateTime.now()); employeeLog.setCreateTime(LocalDateTime.now());
record.setOldInfo(JSON.toJSONString(oldInfo,features)); employeeLog.setOldInfo(JSON.toJSONString(oldInfo,features));
record.setNewInfo(JSON.toJSONString(newInfo,features)); employeeLog.setNewInfo(JSON.toJSONString(newInfo,features));
record.setDifferenceInfo(differenceKey); employeeLog.setDifferenceInfo(differenceKey);
baseMapper.insert(record); baseMapper.insert(employeeLog);
return record; return employeeLog;
} }
}catch (Exception e){ }catch (Exception e){
log.error(JSON.toJSON(oldInfo)+"插入修改记录报错>>>",e); log.error(JSON.toJSON(oldInfo)+"插入修改记录报错>>>",e);
......
...@@ -30,6 +30,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -30,6 +30,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo; import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.vo.CheckBankNoVo; import com.yifu.cloud.plus.v1.check.vo.CheckBankNoVo;
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.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TCustomerInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
...@@ -49,6 +50,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes; ...@@ -49,6 +50,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*; 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.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
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.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -77,7 +79,7 @@ import java.util.stream.Collectors; ...@@ -77,7 +79,7 @@ import java.util.stream.Collectors;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@Log4j2 @Log4j2
@EnableConfigurationProperties(DaprCheckProperties.class) @EnableConfigurationProperties({DaprUpmsProperties.class, DaprCheckProperties.class})
public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMapper, TEmployeeProject> implements TEmployeeProjectService { public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMapper, TEmployeeProject> implements TEmployeeProjectService {
@Autowired @Autowired
...@@ -99,6 +101,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -99,6 +101,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Autowired @Autowired
private DaprCheckProperties daprCheckProperties; private DaprCheckProperties daprCheckProperties;
@Autowired
private DaprUpmsProperties daprUpmsProperties;
@Override @Override
public R addCheck(TEmployeeProject tEmployeeProject) { public R addCheck(TEmployeeProject tEmployeeProject) {
...@@ -520,13 +525,37 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -520,13 +525,37 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL) .eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)); .eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT));
// 调用字典服务,渲染字典值
R<Map<String, Map<String, Map<String, String>>>> dictR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/dict/inner/getDictToValue", null, Map.class, SecurityConstants.FROM_IN);
Map<String, Map<String, Map<String, String>>> dictDataMap;
Map<String, Map<String, String>> dictMap;
// 减项原因
Map<String, String> empReduceMap;
if (dictR == null || dictR.getData() == null) {
return R.failed("获取字典失败!");
} else {
dictDataMap = dictR.getData();
dictMap = dictDataMap.get("data");
if (dictMap == null) {
return R.failed("获取字典失败!!");
}
empReduceMap = dictMap.get("reduce_project_reason");
}
String leaveReason = "";
if (empReduceMap != null) {
leaveReason = empReduceMap.get(excel.getLeaveReason());
}
String errorMessage = ""; String errorMessage = "";
if (Common.isNotNull(excel.getEmpName())) { if (Common.isNotNull(excel.getEmpName())) {
errorMessage = errorMessage.concat(excel.getEmpName()).concat(";"); errorMessage = errorMessage.concat(excel.getEmpName()).concat(";");
}else { }else {
errorMessage = " ".concat(";"); errorMessage = " ".concat(";");
} }
errorMessage = errorMessage + excel.getEmpIdcard() + ";" + excel.getDeptNo() + ";" + excel.getLeaveReason() + ";"; errorMessage = errorMessage + excel.getEmpIdcard() + ";" + excel.getDeptNo() + ";" + leaveReason + ";";
if (Common.isNotNull(excel.getLeaveRemark())) { if (Common.isNotNull(excel.getLeaveRemark())) {
errorMessage = errorMessage.concat(excel.getLeaveRemark()).concat(";"); errorMessage = errorMessage.concat(excel.getLeaveRemark()).concat(";");
}else { }else {
...@@ -714,21 +743,23 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -714,21 +743,23 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//档案有(在档人员),项目无 //档案有(在档人员),项目无
} else if (Common.isNotNull(tEmployeeInfo) && Common.isEmpty(tEmployeeProject) } else if (Common.isNotNull(tEmployeeInfo) && Common.isEmpty(tEmployeeProject)
&& CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()) { && CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()) {
TCheckBankNo check = new TCheckBankNo(); if (Common.isNotNull(excel.getBankNo())) {
check.setBankNo(excel.getBankNo()); TCheckBankNo check = new TCheckBankNo();
check.setIdNum(excel.getEmpIdcard()); check.setBankNo(excel.getBankNo());
check.setName(excel.getEmpName()); check.setIdNum(excel.getEmpIdcard());
R<TCheckBankNo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId() check.setName(excel.getEmpName());
, "/tcheckbankno/inner/checkBankNo", check, TCheckBankNo.class, SecurityConstants.FROM_IN); R<TCheckBankNo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
if (checkListR != null && checkListR.getData() != null) { , "/tcheckbankno/inner/checkBankNo", check, TCheckBankNo.class, SecurityConstants.FROM_IN);
check = checkListR.getData(); if (checkListR != null && checkListR.getData() != null) {
if (check == null || Common.isEmpty(check.getResult())) { check = checkListR.getData();
if (check == null || Common.isEmpty(check.getResult())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} else if (check.getResult().equals(CommonConstants.ZERO_STRING)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), check.getMessage()));
}
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} else if (check.getResult().equals(CommonConstants.ZERO_STRING)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), check.getMessage()));
} }
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} }
updateExcelPost(excel, updateList, tEmployeeInfo); updateExcelPost(excel, updateList, tEmployeeInfo);
insertExcelPro(excel, proInsList,tEmployeeInfo); insertExcelPro(excel, proInsList,tEmployeeInfo);
...@@ -749,21 +780,23 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -749,21 +780,23 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//档案有(离职库),项目无; //档案有(离职库),项目无;
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus() } else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus()
&& Common.isEmpty(tEmployeeProject)) { && Common.isEmpty(tEmployeeProject)) {
TCheckBankNo check = new TCheckBankNo(); if (Common.isNotNull(excel.getBankNo())) {
check.setBankNo(excel.getBankNo()); TCheckBankNo check = new TCheckBankNo();
check.setIdNum(excel.getEmpIdcard()); check.setBankNo(excel.getBankNo());
check.setName(excel.getEmpName()); check.setIdNum(excel.getEmpIdcard());
R<TCheckBankNo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId() check.setName(excel.getEmpName());
, "/tcheckbankno/inner/checkBankNo", check, TCheckBankNo.class, SecurityConstants.FROM_IN); R<TCheckBankNo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
if (checkListR != null && checkListR.getData() != null) { , "/tcheckbankno/inner/checkBankNo", check, TCheckBankNo.class, SecurityConstants.FROM_IN);
check = checkListR.getData(); if (checkListR != null && checkListR.getData() != null) {
if (check == null || Common.isEmpty(check.getResult())) { check = checkListR.getData();
if (check == null || Common.isEmpty(check.getResult())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} else if (check.getResult().equals(CommonConstants.ZERO_STRING)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), check.getMessage()));
}
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} else if (check.getResult().equals(CommonConstants.ZERO_STRING)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), check.getMessage()));
} }
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} }
updateExcelPost(excel, updateList, tEmployeeInfo); updateExcelPost(excel, updateList, tEmployeeInfo);
insertExcelPro(excel, proInsList, tEmployeeInfo); insertExcelPro(excel, proInsList, tEmployeeInfo);
......
...@@ -64,18 +64,6 @@ ...@@ -64,18 +64,6 @@
<if test="tElecEmployeeInfo.empIdcard != null and tElecEmployeeInfo.empIdcard.trim() != ''"> <if test="tElecEmployeeInfo.empIdcard != null and tElecEmployeeInfo.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tElecEmployeeInfo.empIdcard} AND a.EMP_IDCARD = #{tElecEmployeeInfo.empIdcard}
</if> </if>
<if test="tElecEmployeeInfo.unitName != null and tElecEmployeeInfo.unitName.trim() != ''">
AND c.UNIT_NAME like concat('%',#{tElecEmployeeInfo.unitName},'%')
</if>
<if test="tElecEmployeeInfo.deptName != null and tElecEmployeeInfo.deptName.trim() != ''">
AND c.DEPT_NAME like concat('%',#{tElecEmployeeInfo.deptName},'%')
</if>
<if test="tElecEmployeeInfo.empNo != null and tElecEmployeeInfo.empNo.trim() != ''">
AND c.EMP_NO = #{tElecEmployeeInfo.empNo}
</if>
<if test="tElecEmployeeInfo.deptNo != null and tElecEmployeeInfo.deptNo.trim() != ''">
AND c.DEPT_NO like concat('%',#{tElecEmployeeInfo.deptNo},'%')
</if>
<if test="tElecEmployeeInfo.dataType != null and tElecEmployeeInfo.dataType.trim() != ''"> <if test="tElecEmployeeInfo.dataType != null and tElecEmployeeInfo.dataType.trim() != ''">
AND a.DATA_TYPE = #{tElecEmployeeInfo.dataType} AND a.DATA_TYPE = #{tElecEmployeeInfo.dataType}
</if> </if>
...@@ -99,16 +87,29 @@ ...@@ -99,16 +87,29 @@
<!--tElecEmployeeInfo简单分页查询--> <!--tElecEmployeeInfo简单分页查询-->
<select id="getTElecEmployeeInfoPage" resultMap="tElecEmployeeInfoMap"> <select id="getTElecEmployeeInfoPage" resultMap="tElecEmployeeInfoMap">
SELECT SELECT * from (
<include refid="Base_Column_List"/>,GROUP_CONCAT(distinct c.DEPT_NAME) as DEPT_NAME,GROUP_CONCAT(distinct c.UNIT_NAME) as UNIT_NAME,GROUP_CONCAT(distinct c.DEPT_NO) as DEPT_NO,GROUP_CONCAT(distinct c.EMP_NO) as EMP_NO SELECT
FROM t_elec_employee_info a <include refid="Base_Column_List"/>,GROUP_CONCAT(distinct c.DEPT_NAME) as DEPT_NAME,GROUP_CONCAT(distinct c.UNIT_NAME) as UNIT_NAME,GROUP_CONCAT(distinct c.DEPT_NO) as DEPT_NO,GROUP_CONCAT(distinct c.EMP_NO) as EMP_NO
left join t_employee_info b on a.EMP_IDCARD = b.EMP_IDCARD FROM t_elec_employee_info a
left join t_employee_project c on a.EMP_IDCARD = c.EMP_IDCARD AND c.DELETE_FLAG = '0' AND c.PROJECT_STATUS = '0' left join t_employee_info b on a.EMP_IDCARD = b.EMP_IDCARD
<where> left join t_employee_project c on a.EMP_IDCARD = c.EMP_IDCARD AND c.DELETE_FLAG = '0' AND c.PROJECT_STATUS = '0'
1=1 AND a.DELETE_FLAG = '0' WHERE a.DELETE_FLAG = '0'
<include refid="tElecEmployeeInfo_where"/> <include refid="tElecEmployeeInfo_where"/>
</where> GROUP BY a.EMP_IDCARD,a.CREATE_TIME,a.DATA_TYPE
GROUP BY a.EMP_IDCARD,a.CREATE_TIME,a.DATA_TYPE ORDER BY a.CREATE_TIME desc
ORDER BY a.CREATE_TIME desc ) b
where 1=1
<if test="tElecEmployeeInfo.unitName != null and tElecEmployeeInfo.unitName.trim() != ''">
AND b.UNIT_NAME like concat('%',#{tElecEmployeeInfo.unitName},'%')
</if>
<if test="tElecEmployeeInfo.deptName != null and tElecEmployeeInfo.deptName.trim() != ''">
AND b.DEPT_NAME like concat('%',#{tElecEmployeeInfo.deptName},'%')
</if>
<if test="tElecEmployeeInfo.deptNo != null and tElecEmployeeInfo.deptNo.trim() != ''">
AND b.DEPT_NO like concat('%',#{tElecEmployeeInfo.deptNo},'%')
</if>
<if test="tElecEmployeeInfo.empNo != null and tElecEmployeeInfo.empNo.trim() != ''">
AND b.EMP_NO like concat('%',#{tElecEmployeeInfo.empNo},'%')
</if>
</select> </select>
</mapper> </mapper>
...@@ -387,6 +387,12 @@ ...@@ -387,6 +387,12 @@
<if test="tEmployeeInfo.leaveTime != null"> <if test="tEmployeeInfo.leaveTime != null">
AND a.LEAVE_TIME = #{tEmployeeInfo.leaveTime} AND a.LEAVE_TIME = #{tEmployeeInfo.leaveTime}
</if> </if>
<if test="tEmployeeInfo.leaveTimeStart != null">
AND a.LEAVE_TIME >= #{tEmployeeInfo.leaveTimeStart}
</if>
<if test="tEmployeeInfo.leaveTimeEnd != null">
AND a.LEAVE_TIME <![CDATA[ <= ]]> #{tEmployeeInfo.leaveTimeEnd}
</if>
<if test="tEmployeeInfo.leaveReason != null and tEmployeeInfo.leaveReason.trim() != ''"> <if test="tEmployeeInfo.leaveReason != null and tEmployeeInfo.leaveReason.trim() != ''">
AND a.LEAVE_REASON = #{tEmployeeInfo.leaveReason} AND a.LEAVE_REASON = #{tEmployeeInfo.leaveReason}
</if> </if>
...@@ -396,15 +402,6 @@ ...@@ -396,15 +402,6 @@
<if test="tEmployeeInfo.contactAddress != null and tEmployeeInfo.contactAddress.trim() != ''"> <if test="tEmployeeInfo.contactAddress != null and tEmployeeInfo.contactAddress.trim() != ''">
AND a.CONTACT_ADDRESS = #{tEmployeeInfo.contactAddress} AND a.CONTACT_ADDRESS = #{tEmployeeInfo.contactAddress}
</if> </if>
<if test="tEmployeeInfo.unitName != null and tEmployeeInfo.unitName.trim() != ''">
AND b.UNIT_NAME like concat('%',#{tEmployeeInfo.unitName},'%')
</if>
<if test="tEmployeeInfo.deptName != null and tEmployeeInfo.deptName.trim() != ''">
AND b.DEPT_NAME like concat('%',#{tEmployeeInfo.deptName},'%')
</if>
<if test="tEmployeeInfo.deptNo != null and tEmployeeInfo.deptNo.trim() != ''">
AND b.DEPT_NO = #{tEmployeeInfo.deptNo}
</if>
</if> </if>
</if> </if>
</sql> </sql>
...@@ -414,30 +411,41 @@ ...@@ -414,30 +411,41 @@
select select
<include refid="baseParam"/> <include refid="baseParam"/>
from t_employee_info a from t_employee_info a
left join t_employee_project b on a.id = b.EMP_ID
where a.DELETE_FLAG = '0' where a.DELETE_FLAG = '0'
<include refid="employeeInfo_where"/> <include refid="employeeInfo_where"/>
${sql} ${sql}
group by a.id order by a.CREATE_TIME desc order by a.CREATE_TIME desc
</select> </select>
<!-- hgw 分页查询 --> <!-- hgw 分页查询 -->
<select id="getLeavePage" resultMap="tEmployeeExportMap"> <select id="getLeavePage" resultMap="tEmployeeExportMap">
SELECT SELECT * from (
a.ID, SELECT
<include refid="Base_Export_List"/> a.ID,
,GROUP_CONCAT(DISTINCT b.unit_name) UNIT_NAME <include refid="Base_Export_List"/>
,GROUP_CONCAT(DISTINCT b.unit_no) UNIT_NO ,GROUP_CONCAT(DISTINCT b.unit_name) UNIT_NAME
,a.LEAVE_TIME ,GROUP_CONCAT(DISTINCT b.unit_no) UNIT_NO
,a.LEAVE_USER_NAME ,a.LEAVE_TIME
,a.LEAVE_USER ,a.LEAVE_USER_NAME
,a.LEAVE_REASON ,a.LEAVE_USER
from t_employee_info a ,a.LEAVE_REASON
left join t_employee_project b on a.id = b.EMP_ID from t_employee_info a
where a.DELETE_FLAG = '0' left join t_employee_project b on a.id = b.EMP_ID
<include refid="employeeInfo_where"/> where a.DELETE_FLAG = '0' and b.DELETE_FLAG = '0'
${sql} <include refid="employeeInfo_where"/>
group by a.id order by a.CREATE_TIME desc ${sql}
group by a.id order by a.CREATE_TIME desc
) b
where 1=1
<if test="tEmployeeInfo.unitName != null and tEmployeeInfo.unitName.trim() != ''">
AND b.UNIT_NAME like concat('%',#{tEmployeeInfo.unitName},'%')
</if>
<if test="tEmployeeInfo.deptName != null and tEmployeeInfo.deptName.trim() != ''">
AND b.DEPT_NAME like concat('%',#{tEmployeeInfo.deptName},'%')
</if>
<if test="tEmployeeInfo.deptNo != null and tEmployeeInfo.deptNo.trim() != ''">
AND b.DEPT_NO like concat('%',#{tEmployeeInfo.deptNo},'%')
</if>
</select> </select>
<!-- hgw list查询 --> <!-- hgw list查询 -->
...@@ -445,10 +453,9 @@ ...@@ -445,10 +453,9 @@
select select
<include refid="baseParam"/> <include refid="baseParam"/>
from t_employee_info a from t_employee_info a
left join t_employee_project b on a.id = b.EMP_ID
where a.DELETE_FLAG = '0' where a.DELETE_FLAG = '0'
<include refid="employeeInfo_where"/> <include refid="employeeInfo_where"/>
group by a.id order by a.CREATE_TIME desc order by a.CREATE_TIME desc
</select> </select>
<!-- hgw 根据身份证查询 --> <!-- hgw 根据身份证查询 -->
...@@ -535,29 +542,41 @@ ...@@ -535,29 +542,41 @@
from t_employee_info a from t_employee_info a
left join t_employee_project b on a.id = b.EMP_ID left join t_employee_project b on a.id = b.EMP_ID
<where> <where>
a.DELETE_FLAG = '0' a.DELETE_FLAG = '0' and b.DELETE_FLAG = '0'
<include refid="employeeInfo_where"/> <include refid="employeeInfo_where"/>
</where> </where>
GROUP BY a.id GROUP BY a.id order by a.CREATE_TIME desc
</select> </select>
<!--tEmployeeInfo离职档案导出查询--> <!--tEmployeeInfo离职档案导出查询-->
<select id="getTEmployeeLeaveExportList" resultMap="tEmployeeExportMap"> <select id="getTEmployeeLeaveExportList" resultMap="tEmployeeExportMap">
select * from (
SELECT SELECT
<include refid="Base_Export_List"/> <include refid="Base_Export_List"/>,GROUP_CONCAT(DISTINCT b.unit_name) UNIT_NAME
,GROUP_CONCAT(DISTINCT b.unit_name) UNIT_NAME ,
,GROUP_CONCAT(DISTINCT b.unit_no) UNIT_NO GROUP_CONCAT(DISTINCT b.unit_no) UNIT_NO
,a.LEAVE_TIME ,a.LEAVE_TIME
,a.LEAVE_USER ,a.LEAVE_USER
,a.LEAVE_USER_NAME ,a.LEAVE_USER_NAME
,a.LEAVE_REASON ,a.LEAVE_REASON
from t_employee_info a from t_employee_info a
left join t_employee_project b on a.id = b.EMP_ID left join t_employee_project b on a.id = b.EMP_ID
<where> <where>
a.DELETE_FLAG = '0' a.DELETE_FLAG = '0' and b.DELETE_FLAG = '0'
<include refid="employeeInfo_where"/> <include refid="employeeInfo_where"/>
</where> </where>
GROUP BY a.id GROUP BY a.id order by a.CREATE_TIME desc
) b
where 1=1
<if test="tEmployeeInfo.unitName != null and tEmployeeInfo.unitName.trim() != ''">
AND b.UNIT_NAME like concat('%',#{tEmployeeInfo.unitName},'%')
</if>
<if test="tEmployeeInfo.deptName != null and tEmployeeInfo.deptName.trim() != ''">
AND b.DEPT_NAME like concat('%',#{tEmployeeInfo.deptName},'%')
</if>
<if test="tEmployeeInfo.deptNo != null and tEmployeeInfo.deptNo.trim() != ''">
AND b.DEPT_NO like concat('%',#{tEmployeeInfo.deptNo},'%')
</if>
</select> </select>
<!-- 获取当日最大的编码 --> <!-- 获取当日最大的编码 -->
......
dapr.upms.appUrl=http://yifu-upms.qas-mvp.svc.cluster.local:3500/v1.0/invoke/ dapr.upms.appUrl=http://localhost:3500/v1.0/invoke/
dapr.upms.appId=yifu-upms dapr.upms.appId=yifu-upms
dapr.upms.appPort=4000 dapr.upms.appPort=4000
dapr.upms.httpPort=3500 dapr.upms.httpPort=3500
......
...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.social.entity; ...@@ -18,6 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.social.entity;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
...@@ -28,6 +29,7 @@ import lombok.EqualsAndHashCode; ...@@ -28,6 +29,7 @@ import lombok.EqualsAndHashCode;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 社保、公积金基数配置 * 社保、公积金基数配置
...@@ -450,4 +452,8 @@ public class SysBaseSetInfo extends BaseEntity { ...@@ -450,4 +452,8 @@ public class SysBaseSetInfo extends BaseEntity {
@ExcelProperty("社保户名称") @ExcelProperty("社保户名称")
private String departName; private String departName;
@Schema(description = "公积金比例List(保存时前端传参用)")
@TableField(exist = false)
private List<SysPayProportion> fundProList;
} }
...@@ -20,17 +20,16 @@ package com.yifu.cloud.plus.v1.yifu.social.controller; ...@@ -20,17 +20,16 @@ package com.yifu.cloud.plus.v1.yifu.social.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; 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.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysPayProportion;
import com.yifu.cloud.plus.v1.yifu.social.service.SysBaseSetInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.SysBaseSetInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.SysPayProportionService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -50,6 +49,7 @@ import java.util.List; ...@@ -50,6 +49,7 @@ import java.util.List;
public class SysBaseSetInfoController { public class SysBaseSetInfoController {
private final SysBaseSetInfoService sysBaseSetInfoService; private final SysBaseSetInfoService sysBaseSetInfoService;
private final SysPayProportionService sysPayProportionService;
/** /**
...@@ -73,7 +73,6 @@ public class SysBaseSetInfoController { ...@@ -73,7 +73,6 @@ public class SysBaseSetInfoController {
*/ */
@Operation(summary = "不分页查询", description = "不分页查询") @Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage") @PostMapping("/noPage")
//@PreAuthorize("@pms.hasPermission('social_sysbasesetinfo_get')" )
public R<List<SysBaseSetInfo>> getSysBaseSetInfoNoPage(@RequestBody SysBaseSetInfo sysBaseSetInfo) { public R<List<SysBaseSetInfo>> getSysBaseSetInfoNoPage(@RequestBody SysBaseSetInfo sysBaseSetInfo) {
return R.ok(sysBaseSetInfoService.list(Wrappers.query(sysBaseSetInfo).orderByDesc(CommonConstants.CREATE_TIME))); return R.ok(sysBaseSetInfoService.list(Wrappers.query(sysBaseSetInfo).orderByDesc(CommonConstants.CREATE_TIME)));
} }
...@@ -84,11 +83,14 @@ public class SysBaseSetInfoController { ...@@ -84,11 +83,14 @@ public class SysBaseSetInfoController {
* @param id id * @param id id
* @return R * @return R
*/ */
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_sysbasesetinfo_get')") @Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}") @GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_sysbasesetinfo_get')")
public R<SysBaseSetInfo> getById(@PathVariable("id") String id) { public R<SysBaseSetInfo> getById(@PathVariable("id") String id) {
return R.ok(sysBaseSetInfoService.getById(id)); SysBaseSetInfo baseSetInfo = sysBaseSetInfoService.getById(id);
if (null != baseSetInfo && CommonConstants.ONE_STRING.equals(baseSetInfo.getBaseType())){
baseSetInfo.setFundProList(sysPayProportionService.list(Wrappers.<SysPayProportion>query().lambda().eq(SysPayProportion::getSysBaseSetId,id)));
}
return R.ok(baseSetInfo);
} }
/** /**
...@@ -133,4 +135,22 @@ public class SysBaseSetInfoController { ...@@ -133,4 +135,22 @@ public class SysBaseSetInfoController {
return R.ok(sysBaseSetInfoService.removeById(id)); return R.ok(sysBaseSetInfoService.removeById(id));
} }
/**
* 通过id禁用启用一条记录
* @param id
* @return R
*/
@Operation(summary = "启用禁用", description = "启用禁用:hasPermission('social_sysbasesetinfo_enable') 0.在用 1.终止 2.过期")
@SysLog("禁用启用基数设置表")
@PostMapping("/disableOrEnableById")
@PreAuthorize("@pms.hasPermission('wxhr:social_sysbasesetinfo_enable')")
public R disableOrEnableById(@RequestParam String id, @RequestParam Integer status) {
SysBaseSetInfo baseSetInfo = sysBaseSetInfoService.getById(id);
if (null == baseSetInfo){
return R.failed("无对应ID的数据!");
}
baseSetInfo.setStatus(status);
return new R<>(sysBaseSetInfoService.updateById(baseSetInfo));
}
} }
...@@ -22,14 +22,15 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; ...@@ -22,14 +22,15 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; 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.social.entity.TSocialLog; import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialLog;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService; import com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
...@@ -63,71 +64,16 @@ public class TSocialLogController { ...@@ -63,71 +64,16 @@ public class TSocialLogController {
} }
/** /**
* 不分页查询 * @Description: 通过EMP_ID查询人员档案变更日志
* * @Author: hgw
* @param tSocialLog 社保变更记录表 * @Date: 2022/6/28 16:45
* @return * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeLog>>
*/ **/
@Operation(summary = "不分页查询", description = "不分页查询") @Operation(summary = "通过mainId、type查询社保变更日志(type类型:1社保基数配置;2公积金基数配置;后续再追加)", description = "通过mainId查询社保变更日志")
@PostMapping("/noPage") @GetMapping("/getByEmpId")
//@PreAuthorize("@pms.hasPermission('social_tsociallog_get')" ) public R<List<TSocialLog>> getByEmpId(@RequestParam String mainId, @RequestParam Integer type) {
public R<List<TSocialLog>> getTSocialLogNoPage(@RequestBody TSocialLog tSocialLog) { return R.ok(tSocialLogService.list(Wrappers.<TSocialLog>query().eq("MAIN_ID", mainId)
return R.ok(tSocialLogService.list(Wrappers.query(tSocialLog).orderByDesc(CommonConstants.CREATE_TIME))); .eq("TYPE", type).orderByDesc(CommonConstants.CREATE_TIME)));
}
/**
* 通过id查询社保变更记录表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tsociallog_get')")
@GetMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tsociallog_get')")
public R<TSocialLog> getById(@PathVariable("id") String id) {
return R.ok(tSocialLogService.getById(id));
}
/**
* 新增社保变更记录表
*
* @param tSocialLog 社保变更记录表
* @return R
*/
@Operation(summary = "新增社保变更记录表", description = "新增社保变更记录表:hasPermission('social_tsociallog_add')")
@SysLog("新增社保变更记录表")
@PostMapping
@PreAuthorize("@pms.hasPermission('social_tsociallog_add')")
public R<Boolean> save(@RequestBody TSocialLog tSocialLog) {
return R.ok(tSocialLogService.save(tSocialLog));
}
/**
* 修改社保变更记录表
*
* @param tSocialLog 社保变更记录表
* @return R
*/
@Operation(summary = "修改社保变更记录表", description = "修改社保变更记录表:hasPermission('social_tsociallog_edit')")
@SysLog("修改社保变更记录表")
@PutMapping
@PreAuthorize("@pms.hasPermission('social_tsociallog_edit')")
public R<Boolean> updateById(@RequestBody TSocialLog tSocialLog) {
return R.ok(tSocialLogService.updateById(tSocialLog));
}
/**
* 通过id删除社保变更记录表
*
* @param id id
* @return R
*/
@Operation(summary = "通过id删除社保变更记录表", description = "通过id删除社保变更记录表:hasPermission('social_tsociallog_del')")
@SysLog("通过id删除社保变更记录表")
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('social_tsociallog_del')")
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tSocialLogService.removeById(id));
} }
} }
...@@ -17,19 +17,25 @@ ...@@ -17,19 +17,25 @@
package com.yifu.cloud.plus.v1.yifu.social.service.impl; package com.yifu.cloud.plus.v1.yifu.social.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; 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.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 com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.SysBaseSetInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysPayProportion;
import com.yifu.cloud.plus.v1.yifu.social.mapper.SysBaseSetInfoMapper; import com.yifu.cloud.plus.v1.yifu.social.mapper.SysBaseSetInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.service.SysBaseSetInfoService; import com.yifu.cloud.plus.v1.yifu.social.service.SysBaseSetInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.SysPayProportionService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService; import com.yifu.cloud.plus.v1.yifu.social.service.TSocialLogService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* 基数设置表 * 基数设置表
* *
...@@ -41,6 +47,9 @@ import org.springframework.stereotype.Service; ...@@ -41,6 +47,9 @@ import org.springframework.stereotype.Service;
public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, SysBaseSetInfo> implements SysBaseSetInfoService { public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, SysBaseSetInfo> implements SysBaseSetInfoService {
private final TSocialLogService tSocialLogService; private final TSocialLogService tSocialLogService;
private final SysPayProportionService sysPayProportionService;
/** /**
* 基数设置表简单分页查询 * 基数设置表简单分页查询
* *
...@@ -54,21 +63,129 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper, ...@@ -54,21 +63,129 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
@Override @Override
public R<String> saveSysBase(SysBaseSetInfo sysBaseSetInfo) { public R<String> saveSysBase(SysBaseSetInfo sysBaseSetInfo) {
YifuUser user = SecurityUtils.getUser();
if (null == user) {
return R.failed("获取用户登录信息失败!");
}
SysBaseSetInfo baseSetInfo = null;
if (null != sysBaseSetInfo.getTown()) {
baseSetInfo = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType())
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getTown, sysBaseSetInfo.getTown())
.le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate())
.last(CommonConstants.LAST_ONE_SQL));
}
if (null != sysBaseSetInfo.getCity() && null == sysBaseSetInfo.getTown()) {
baseSetInfo = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType())
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getCity, sysBaseSetInfo.getCity())
.isNull(SysBaseSetInfo::getTown)
.le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate())
.last(CommonConstants.LAST_ONE_SQL));
}
if (null != sysBaseSetInfo.getProvince() && null == sysBaseSetInfo.getCity()) {
baseSetInfo = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType())
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getProvince, sysBaseSetInfo.getProvince())
.isNull(SysBaseSetInfo::getCity)
.le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate())
.last(CommonConstants.LAST_ONE_SQL));
}
if (null != baseSetInfo) {
return R.failed("对应户、地市、有效期的基数配置已存在!");
}
this.saveOrUpdateBaseAndFundPro(sysBaseSetInfo);
this.save(sysBaseSetInfo);
return R.ok(); return R.ok();
} }
@Override @Override
public R<String> updateSysBase(SysBaseSetInfo sysBaseSetInfo) { public R<String> updateSysBase(SysBaseSetInfo sysBaseSetInfo) {
YifuUser user = SecurityUtils.getUser();
if (null == user) {
return R.failed("获取用户登录信息失败!");
}
SysBaseSetInfo old = this.getById(sysBaseSetInfo.getId()); SysBaseSetInfo old = this.getById(sysBaseSetInfo.getId());
if (old == null || Common.isEmpty(old.getId())) { if (old == null || Common.isEmpty(old.getId())) {
return R.failed("根据id未找到基数配置!" + sysBaseSetInfo.getId()); return R.failed("根据id未找到基数配置!" + sysBaseSetInfo.getId());
} }
this.updateById(sysBaseSetInfo); SysBaseSetInfo baseSetInfo = null;
if (null != sysBaseSetInfo.getTown()) {
baseSetInfo = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType())
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getTown, sysBaseSetInfo.getTown())
.le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate())
.ne(SysBaseSetInfo::getId, sysBaseSetInfo.getId())
.eq(SysBaseSetInfo::getStatus, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
}
if (null != sysBaseSetInfo.getCity() && null == sysBaseSetInfo.getTown()) {
baseSetInfo = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType())
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getCity, sysBaseSetInfo.getCity())
.isNull(SysBaseSetInfo::getTown)
.le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate())
.ne(SysBaseSetInfo::getId, sysBaseSetInfo.getId())
.eq(SysBaseSetInfo::getStatus, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
}
if (null != sysBaseSetInfo.getProvince() && null == sysBaseSetInfo.getCity()) {
baseSetInfo = this.getOne(Wrappers.<SysBaseSetInfo>query().lambda()
.eq(SysBaseSetInfo::getBaseType, sysBaseSetInfo.getBaseType())
.eq(SysBaseSetInfo::getDepartId, sysBaseSetInfo.getDepartId())
.eq(SysBaseSetInfo::getProvince, sysBaseSetInfo.getProvince())
.isNull(SysBaseSetInfo::getCity)
.le(SysBaseSetInfo::getApplyStartDate, sysBaseSetInfo.getApplyStartDate())
.ge(SysBaseSetInfo::getApplyEndDate, sysBaseSetInfo.getApplyStartDate())
.ne(SysBaseSetInfo::getId, sysBaseSetInfo.getId())
.eq(SysBaseSetInfo::getStatus, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
}
if (null != baseSetInfo) {
return R.failed("对应户、地市、有效期的基数配置已存在!");
}
this.saveOrUpdateBaseAndFundPro(sysBaseSetInfo);
// 记录变更日志 // 记录变更日志
tSocialLogService.saveModificationRecord(CommonConstants.ONE_INT, old.getId(), old, sysBaseSetInfo); tSocialLogService.saveModificationRecord(CommonConstants.ONE_INT, old.getId(), old, sysBaseSetInfo);
return R.ok(); return R.ok();
} }
/**
* @param sysBaseSetInfo
* @Description: 新增、编辑社保、公积金基数
* @Author: hgw
* @Date: 2022/7/12 14:33
* @return: void
**/
private void saveOrUpdateBaseAndFundPro(SysBaseSetInfo sysBaseSetInfo) {
if (Common.isNotNull(sysBaseSetInfo.getId())) {
baseMapper.updateById(sysBaseSetInfo);
} else {
sysBaseSetInfo.setStatus(CommonConstants.ZERO_INT);
sysBaseSetInfo.setDeleteFlag(CommonConstants.ZERO_STRING);
baseMapper.insert(sysBaseSetInfo);
}
List<SysPayProportion> payProportionList = sysBaseSetInfo.getFundProList();
if (Common.isNotNull(payProportionList)) {
for (SysPayProportion payProportion : payProportionList) {
if (Common.isNotNull(payProportion.getId())) {
sysPayProportionService.updateById(payProportion);
} else {
payProportion.setSysBaseSetId(sysBaseSetInfo.getId());
sysPayProportionService.save(payProportion);
}
}
}
}
} }
...@@ -67,15 +67,15 @@ public class TSocialLogServiceImpl extends ServiceImpl<TSocialLogMapper, TSocial ...@@ -67,15 +67,15 @@ public class TSocialLogServiceImpl extends ServiceImpl<TSocialLogMapper, TSocial
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo); String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
//如果有差异保存差异 //如果有差异保存差异
if (!Common.isEmpty(differenceKey)) { if (!Common.isEmpty(differenceKey)) {
TSocialLog record = new TSocialLog(); TSocialLog socialLog = new TSocialLog();
record.setType(type); socialLog.setType(type);
record.setMainId(mainId); socialLog.setMainId(mainId);
record.setCreateTime(LocalDateTime.now()); socialLog.setCreateTime(LocalDateTime.now());
record.setOldInfo(JSON.toJSONString(oldInfo, features)); socialLog.setOldInfo(JSON.toJSONString(oldInfo, features));
record.setNewInfo(JSON.toJSONString(newInfo, features)); socialLog.setNewInfo(JSON.toJSONString(newInfo, features));
record.setDifferenceInfo(differenceKey); socialLog.setDifferenceInfo(differenceKey);
baseMapper.insert(record); baseMapper.insert(socialLog);
return record; return socialLog;
} }
} catch (Exception e) { } catch (Exception e) {
log.error(JSON.toJSON(oldInfo) + "【新增社保变更记录】报错>>>", e); log.error(JSON.toJSON(oldInfo) + "【新增社保变更记录】报错>>>", e);
......
...@@ -318,7 +318,7 @@ public class DictController { ...@@ -318,7 +318,7 @@ public class DictController {
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.Map < java.lang.String, java.util.Map < java.lang.String, java.lang.String>>> * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.Map < java.lang.String, java.util.Map < java.lang.String, java.lang.String>>>
**/ **/
@Inner @Inner
@GetMapping("/inner/getDictToValue") @PostMapping("/inner/getDictToValue")
public R<Map<String, Map<String, String>>> getDictToValue() { public R<Map<String, Map<String, String>>> getDictToValue() {
return sysDictItemService.getDictToValue(); return sysDictItemService.getDictToValue();
} }
......
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