Commit 7ef00a57 authored by zhaji's avatar zhaji

Merge branch 'develop' into feature-zhaji

parents 5369e292 4c82cca4
......@@ -235,6 +235,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
.lambda().eq(TEmployeeContractInfo::getAuditStatus,CommonConstants.TWO_STRING)
.isNotNull(TEmployeeContractInfo::getAuditTimeLast)
.eq(TEmployeeContractInfo::getIsObsolete,CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getContractType,CommonConstants.ONE_STRING)
.eq(TEmployeeContractInfo::getWorkFlag,CommonConstants.ZERO_STRING)
.ne(TEmployeeContractInfo::getSituation,"续签 ")
......
......@@ -61,7 +61,6 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*;
......@@ -2007,23 +2006,22 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeExportVO.class).includeColumnFieldNames(searchVo.getExportFields()).build();
ExcelUtil<EmployeeExportVO> util = new ExcelUtil<>(EmployeeExportVO.class);
// 获取所有字典type
Map<String,String> nameAndDicTypeMap = util.getConverterDicType();
// 获取所有字典对应的值
Map<String,String> redisLabelMap = (Map<String, String>) RedisUtil.redis.opsForValue().get(CacheConstants.REDIS_DICT_LABLE);
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeExportVO.class)
.registerConverter(new DictConverter(nameAndDicTypeMap,redisLabelMap))
.includeColumnFieldNames(searchVo.getExportFields()).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
Field[] allFields = EmployeeExportVO.class.getDeclaredFields();
WriteSheet writeSheet;
ExcelUtil<EmployeeExportVO> util;
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageDiy(searchVo);
if (Common.isNotNull(list)){
util = new ExcelUtil<>(EmployeeExportVO.class);
for (EmployeeExportVO vo:list){
util.convertEntityAsso(vo,null,null,null,allFields);
}
}
if (Common.isNotNull(list)){
writeSheet = EasyExcel.writerSheet("人员档案批量导出"+index).build();
excelWriter.write(list,writeSheet);
......@@ -2088,7 +2086,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeLeaveExportVO.class).includeColumnFieldNames(searchVo.getExportFields()).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
Field[] allFields = EmployeeLeaveExportVO.class.getDeclaredFields();
WriteSheet writeSheet;
ExcelUtil<EmployeeLeaveExportVO> util;
for (int i = 0; i <= count; ) {
......@@ -2096,12 +2093,6 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = noPageLeaveDiy(searchVo);
/*if (Common.isNotNull(list)){
util = new ExcelUtil<>(EmployeeLeaveExportVO.class);
for (EmployeeLeaveExportVO vo:list){
util.convertEntityAsso(vo,null,null,null,allFields);
}
}*/
if (Common.isNotNull(list)){
writeSheet = EasyExcel.writerSheet("离职档案批量导出"+index).build();
excelWriter.write(list,writeSheet);
......
......@@ -30,8 +30,6 @@ 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.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.check.entity.TCheckBankNo;
import com.yifu.cloud.plus.v1.check.vo.CheckBankNoVo;
import com.yifu.cloud.plus.v1.yifu.archives.constants.EmployeeConstants;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
......@@ -187,9 +185,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeProject.setUnitId(tSettleDomain.getCustomerId());
tEmployeeProject.setUnitNo(tSettleDomain.getCustomerNo());
tEmployeeProject.setUnitName(tSettleDomain.getCustomerName());
String empNO = getEmpNo(tEmployeeProject.getDeptNo());
tEmployeeProject.setEmpNo(empNO);
}
String empNO = getEmpNo(tEmployeeProject.getDeptNo());
tEmployeeProject.setEmpNo(empNO);
tEmployeeProject.setEmpId(tEmployeeInfo.getId());
tEmployeeProject.setProjectSource(CommonConstants.dingleDigitStrArray[5]);
this.save(tEmployeeProject);
......@@ -639,7 +637,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT1;
/**
*临时存储
*/
......@@ -705,9 +703,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
String idCard;
String deptNo;
TSettleDomain tSettleDomain;
TEmployeeInfo tEmployeeInfo;
TEmployeeProject tEmployeeProject;
EmployeeProjectVO excel;
// 执行数据插入操作 组装 PostDto
for (int i = 0; i < excelVOList.size(); i++) {
EmployeeProjectVO excel = excelVOList.get(i);
excel = excelVOList.get(i);
idCard = excel.getEmpIdcard();
deptNo = excel.getDeptNo();
......@@ -732,7 +734,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
//项目编码校验
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, excel.getDeptNo())
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING));
......@@ -741,18 +743,18 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
//根据身份证获取人员档案
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
tEmployeeInfo= tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, excel.getEmpIdcard())
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL));
//根据身份证和项目编码获取项目档案
TEmployeeProject tEmployeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda()
tEmployeeProject = baseMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard())
.eq(TEmployeeProject::getDeptNo, excel.getDeptNo())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL));
//状态为草稿、已审核
if (Common.isNotNull(tEmployeeProject) && (CommonConstants.dingleDigitIntArray[0] == tEmployeeProject.getStatus() ||
CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getStatus())) {
if (Common.isNotNull(tEmployeeProject) && (CommonConstants.ZERO_INT == tEmployeeProject.getStatus() ||
CommonConstants.ONE_INT == tEmployeeProject.getStatus())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.EXIT_PRIJECT_STATUS));
}
//不存在复档或复项的情况
......@@ -761,87 +763,47 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_EXIT_EMPPROJECT_ERROR)));
//档案有(在档人员),项目无
} else if (Common.isNotNull(tEmployeeInfo) && Common.isEmpty(tEmployeeProject)
&& CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()) {
/*if (Common.isNotNull(excel.getBankNo())) {
TCheckBankNo check = new TCheckBankNo();
check.setBankNo(excel.getBankNo());
check.setIdNum(excel.getEmpIdcard());
check.setName(excel.getEmpName());
R<CheckBankNoVo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckbankno/inner/checkBankNo", check, CheckBankNoVo.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
CheckBankNoVo vo = checkListR.getData();
check = (null == vo.getRes()) ? null : vo.getRes().getData();
if (Common.isEmpty(vo)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} else if (!CommonConstants.SUCCESS.equals(vo.getRes().getCode())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), vo.getRes().getMsg()));
} else if (null != check && !check.getResult().equals(CommonConstants.ZERO_ONE)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), check.getRemark()));
}
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
}
}*/
&& CommonConstants.ZERO_INT == tEmployeeInfo.getFileStatus()) {
updateExcelPost(updateList, tEmployeeInfo);
insertExcelPro(excel, proInsList, tEmployeeInfo);
insertExcelPro(excel, proInsList, tEmployeeInfo,tSettleDomain);
//档案有(在档人员),项目有(草稿/已审核);
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[0] == tEmployeeProject.getProjectStatus()) {
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.ZERO_INT == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.ZERO_INT == tEmployeeProject.getProjectStatus()) {
updateExcelPost(updateList, tEmployeeInfo);
updateExcelPro(excel, proupdateList, tEmployeeProject);
}
//存在复档或复项的情况,允许复档复项
if (CommonConstants.ONE_STRING.equals(idAdd)) {
//档案有(离职库),项目(已减档)
if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getProjectStatus()) {
updateExcelPro(excel, proupdateList, tEmployeeProject);
//档案有(离职库),项目无;
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus()
&& Common.isEmpty(tEmployeeProject)) {
/*if (Common.isNotNull(excel.getBankNo())) {
TCheckBankNo check = new TCheckBankNo();
check.setBankNo(excel.getBankNo());
check.setIdNum(excel.getEmpIdcard());
check.setName(excel.getEmpName());
R<CheckBankNoVo> checkListR = HttpDaprUtil.invokeMethodPost(daprCheckProperties.getAppUrl(), daprCheckProperties.getAppId()
, "/tcheckbankno/inner/checkBankNo", check, CheckBankNoVo.class, SecurityConstants.FROM_IN);
if (checkListR != null && checkListR.getData() != null) {
CheckBankNoVo vo = checkListR.getData();
check = (null == vo.getRes()) ? null : vo.getRes().getData();
if (Common.isEmpty(vo)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
} else if (!CommonConstants.SUCCESS.equals(vo.getRes().getCode())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), vo.getRes().getMsg()));
} else if (null != check && !check.getResult().equals(CommonConstants.ZERO_ONE)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), check.getRemark()));
}
} else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeConstants.CHECK_NO_RESPONSE));
}
}*/
insertExcelPro(excel, proInsList, tEmployeeInfo);
//档案有(在档人员),项目(已减档)
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getProjectStatus()) {
updateExcelPro(excel, proupdateList, tEmployeeProject);
}
updateExcelPost(updateList, tEmployeeInfo);
//不允许复档复项
} else {
//档案有(离职库),项目(已减档)
if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getProjectStatus()) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_EMP_PROJECT_ERROR)));
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[1] == tEmployeeInfo.getFileStatus()
&& Common.isEmpty(tEmployeeProject)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_REDUCE_EMP_ERROR)));
//档案有(在档人员),项目(已减档)
} else if (Common.isNotNull(tEmployeeInfo) && CommonConstants.dingleDigitIntArray[0] == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.dingleDigitIntArray[1] == tEmployeeProject.getProjectStatus()) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_REDUCE_PROJECT_ERROR)));
if (Common.isNotNull(tEmployeeInfo)) {
if (CommonConstants.ONE_STRING.equals(idAdd)) {
//档案有(离职库),项目(已减档)
if (CommonConstants.ONE_INT == tEmployeeInfo.getFileStatus() && Common.isNotNull(tEmployeeProject)
&& CommonConstants.ONE_INT == tEmployeeProject.getProjectStatus()) {
updateExcelPro(excel, proupdateList, tEmployeeProject);
//档案有(离职库),项目无;
} else if (CommonConstants.ONE_INT == tEmployeeInfo.getFileStatus()
&& Common.isEmpty(tEmployeeProject)) {
insertExcelPro(excel, proInsList, tEmployeeInfo, tSettleDomain);
//档案有(在档人员),项目(已减档)
} else if (CommonConstants.ZERO_INT == tEmployeeInfo.getFileStatus() && Common.isNotNull(
tEmployeeProject) && CommonConstants.ONE_INT == tEmployeeProject.getProjectStatus()) {
updateExcelPro(excel, proupdateList, tEmployeeProject);
}
updateExcelPost(updateList, tEmployeeInfo);
//不允许复档复项
} else {
//档案有(离职库),项目(已减档)
if (CommonConstants.ONE_INT == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.ONE_INT == tEmployeeProject.getProjectStatus()) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_EMP_PROJECT_ERROR)));
} else if (CommonConstants.ONE_INT == tEmployeeInfo.getFileStatus()
&& Common.isEmpty(tEmployeeProject)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_REDUCE_EMP_ERROR)));
//档案有(在档人员),项目(已减档)
} else if (CommonConstants.ZERO_INT == tEmployeeInfo.getFileStatus()
&& Common.isNotNull(tEmployeeProject) && CommonConstants.ONE_INT == tEmployeeProject.getProjectStatus()) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.CHECKS_REDUCE_PROJECT_ERROR)));
}
}
}
}
......@@ -853,7 +815,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
doJointTask.doUpdateEmployeeInfo(updateList, user);
}
if (!proInsList.isEmpty()) {
doJointTask.insertExcelEmpProject(proInsList);
baseMapper.insertExcelEmpProject(proInsList);
}
if (!proupdateList.isEmpty()) {
baseMapper.updateExcelEmpProject(proupdateList);
......@@ -1027,18 +989,16 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
/**
* 插入excel Pro
*/
private void insertExcelPro(EmployeeProjectVO excel, List<TEmployeeProject> proInsList, TEmployeeInfo tEmployeeInfo) {
private void insertExcelPro(EmployeeProjectVO excel, List<TEmployeeProject> proInsList, TEmployeeInfo tEmployeeInfo,
TSettleDomain tSettleDomain) {
TEmployeeProject insTEmployeePro = new TEmployeeProject();
BeanUtil.copyProperties(excel, insTEmployeePro);
insTEmployeePro.setId(String.valueOf(UUID.randomUUID()).replaceAll("-", ""));
insTEmployeePro.setDeleteFlag(CommonConstants.STATUS_NORMAL);
insTEmployeePro.setStatus(CommonConstants.dingleDigitIntArray[0]);
insTEmployeePro.setStatus(CommonConstants.ZERO_INT);
//获取项目和单位信息
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, insTEmployeePro.getDeptNo()).eq(TSettleDomain::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.eq(TSettleDomain::getStopFlag, CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(tSettleDomain)) {
insTEmployeePro.setDeptId(tSettleDomain.getId());
insTEmployeePro.setDeptName(tSettleDomain.getDepartName());
......@@ -1048,17 +1008,16 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
insTEmployeePro.setUnitId(tSettleDomain.getCustomerId());
insTEmployeePro.setUnitNo(tSettleDomain.getCustomerNo());
insTEmployeePro.setUnitName(tSettleDomain.getCustomerName());
String empNO = getEmpNo(insTEmployeePro.getDeptNo());
insTEmployeePro.setEmpNo(empNO);
}
String empNO = getEmpNo(insTEmployeePro.getDeptNo());
insTEmployeePro.setEmpNo(empNO);
//员工编码生成规则
insTEmployeePro.setEmpCode(tEmployeeInfo.getEmpCode());
YifuUser user = SecurityUtils.getUser();
insTEmployeePro.setCreateBy(user.getId());
insTEmployeePro.setEmpName(tEmployeeInfo.getEmpName());
insTEmployeePro.setCreateName(user.getNickname());
insTEmployeePro.setProjectSource(CommonConstants.dingleDigitStrArray[6]);
insTEmployeePro.setProjectSource(CommonConstants.SIX_STRING);
insTEmployeePro.setEmpId(tEmployeeInfo.getId());
proInsList.add(insTEmployeePro);
}
......
......@@ -235,10 +235,7 @@
</sql>
<sql id="Base_Export_List">
a
.
EMP_CODE
,
a.EMP_CODE,
a.EMP_NATRUE,
a.EMP_NAME,
a.EMP_IDCARD,
......@@ -951,12 +948,65 @@
<!--tEmployeeInfo人员档案导出查询改造 fxj 2022-11-02-->
<select id="noPageDiy" resultMap="tEmployeeExportMap">
select
<include refid="Base_Export_List"/>,
a.EMP_CODE,
a.EMP_NATRUE,
a.EMP_NAME,
a.EMP_IDCARD,
a.VALIDITY_START,
a.VALIDITY_END,
a.EMP_MARRI_STATUS,
a.EMP_NATIONAL,
a.POLITICAL_STATUS,
a.EMP_PHONE,
a.EMP_EMAIL,
a1.AREA_NAME as "ID_PROVINCE",
a2.AREA_NAME as "ID_CITY",
a3.AREA_NAME as "ID_TOWN",
a.EMP_REGIS_TYPE,
a4.AREA_NAME as "FILE_PROVINCE",
a5.AREA_NAME as "FILE_CITY",
a6.AREA_NAME as "FILE_TOWN",
CASE WHEN a.IS_COLLEGE=0 THEN "否"
WHEN a.IS_COLLEGE =1 THEN "是"
ELSE a.IS_COLLEGE END as "IS_COLLEGE",
a.HIGN_EDUCATION,
a.SCHOOL,
a.MAJOR,
a.ADMISSION_DATE,
a.GRADUTION_DATE,
a.REMARK,
CASE WHEN a.FILE_SOURCE=1 THEN "社保、公积金派单"
WHEN a.FILE_SOURCE =2 THEN "人员发薪"
WHEN a.FILE_SOURCE =3 THEN "商险派单"
WHEN a.FILE_SOURCE =4 THEN "档案新建"
WHEN a.FILE_SOURCE =5 THEN "批量导入"
ELSE a.FILE_SOURCE END as "FILE_SOURCE", # 1=社保、公积金派单,2=人员发薪,3=商险派单,4=档案新建,5=批量导入
a.PROJECT_NUM,
a.CONTRACT_STATUS,
a.INSURANCE_STATUS,
a.SOCIAL_STATUS,
a.FUND_STATUS,
CASE WHEN a.SALARY_STATUS=0 THEN "无"
WHEN a.SALARY_STATUS =1 THEN "是"
WHEN a.SALARY_STATUS =2 THEN "否"
ELSE a.SALARY_STATUS END as "SALARY_STATUS",# 0=无,1=是,2=否
a.CREATE_NAME,
a.CREATE_TIME,
CASE WHEN a.`STATUS`=0 THEN "草稿"
WHEN a.`STATUS` =1 THEN "已审核"
ELSE a.`STATUS` END as "STATUS", # 0=草稿,1=已审核
a.CONTACT_ADDRESS,
p.IS_PROJECTS ,
p.DEPT_NAME,
p.DEPT_NO,
P.PROJECT_NUM
from t_employee_info a
LEFT JOIN sys_area a1 on a1.id=a.ID_PROVINCE
LEFT JOIN sys_area a2 on a2.id=a.ID_CITY
LEFT JOIN sys_area a3 on a3.id=a.ID_TOWN
LEFT JOIN sys_area a4 on a4.id=a.FILE_PROVINCE
LEFT JOIN sys_area a5 on a5.id=a.FILE_CITY
LEFT JOIN sys_area a6 on a6.id=a.FILE_TOWN
LEFT JOIN view_project p on a.EMP_IDCARD=p.EMP_IDCARD
<where>
a.DELETE_FLAG = '0'
......
......@@ -769,22 +769,14 @@
FROM
t_employee_project
WHERE
id not like '%abc'
and
EMP_NO LIKE CONCAT(
(
SELECT
DEPART_NO
FROM
t_settle_domain
WHERE
DEPART_NO = #{deptNo}
),
'%'
)
EMP_NO LIKE CONCAT(#{deptNo},'%')
) AS 'empNo'
FROM
DUAL
select MAX(EMP_NO) from t_employee_project where
id not like '%abc' and
DEPT_NO = #{deptNo}
GROUP BY DEPT_NO
</select>
<update id="updateEmpIdById" parameterType="java.util.List">
......
......@@ -53,6 +53,10 @@ public interface CacheConstants {
* 字典信息缓存
*/
String DICT_DETAILS = "dict_details";
/**
* 字典转义信息缓存
*/
String REDIS_DICT_LABLE = "redis_dict_lable";
/**
* 字典项信息缓存
......
package com.yifu.cloud.plus.v1.yifu.common.core.util;
import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.converters.WriteConverterContext;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.ReadCellData;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import java.util.Map;
/**
* @Author fxj
* @Date 2022/11/24
* @Description
* @Version 1.0
*/
public class DictConverter implements Converter<String>{
public DictConverter(Map<String,String> nameAndDicTypeMap,Map<String,String> redisLabelMap){
this.nameAndDicTypeMap=nameAndDicTypeMap;
this.redisLabelMap=redisLabelMap;
}
private Map<String,String> nameAndDicTypeMap;
private Map<String,String> redisLabelMap;
@Override
public Class<String> supportJavaTypeKey() {
return String.class;
}
@Override
public CellDataTypeEnum supportExcelTypeKey() {
return CellDataTypeEnum.STRING;
}
/**
* @Author fxj
* @Description 转换成功java 导入用
* @Date 18:24 2022/11/24
**/
@Override
public String convertToJavaData(ReadCellData cellData, ExcelContentProperty contentProperty
, GlobalConfiguration globalConfiguration) {
return cellData.getStringValue();
}
/**
* @Author fxj
* @Description 装换成String 导出用
* @Date 18:25 2022/11/24
**/
@Override
public WriteCellData<String> convertToExcelData(String value, ExcelContentProperty contentProperty
, GlobalConfiguration globalConfiguration) {
if (null != nameAndDicTypeMap && nameAndDicTypeMap.size() > 0){
String dicType = nameAndDicTypeMap.get(contentProperty.getField().getName());
if (null != dicType){
String temp =redisLabelMap.get(dicType+CommonConstants.DOWN_LINE_STRING+value);
return new WriteCellData<>(null==temp?value:temp);
}
}
return new WriteCellData<>(String.valueOf(value));
}
@Override
public WriteCellData<?> convertToExcelData(WriteConverterContext<String> context) throws Exception {
return this.convertToExcelData(context.getValue(), context.getContentProperty(), context.getWriteContext().currentWriteHolder().globalConfiguration());
}
}
......@@ -1125,4 +1125,27 @@ public class ExcelUtil <T> implements Serializable {
}
}
}
public Map<String,String> getConverterDicType() {
// 得到所有定义字段
Field[] allFields = clazz.getDeclaredFields();
Map<String,String> nameDicMap = new HashMap<>();
List<Field> fields = new ArrayList<>();
// 将需要字典表头存起来备用,如果没传,则全部翻译
for (Field field : allFields) {
if (field.isAnnotationPresent(ExcelAttribute.class)) {
fields.add(field);
}
}
ExcelAttribute attr;
Field field;
for (int j = 0; j < fields.size(); j++) {
field = fields.get(j);
attr = field.getAnnotation(ExcelAttribute.class);
if (Common.isNotNull(field) && Common.isNotNull(attr)){
nameDicMap.put(field.getName(),attr.dataType());
}
}
return nameDicMap;
}
}
......@@ -42,8 +42,6 @@ import org.springframework.security.core.userdetails.UserDetails;
@RequiredArgsConstructor
public class YifuUserDetailsServiceImpl implements YifuUserDetailsService {
//private final RemoteUserService remoteUserService;
private final CacheManager cacheManager;
private final DaprUpmsProperties daprUpmsProperties;
......@@ -57,13 +55,11 @@ public class YifuUserDetailsServiceImpl implements YifuUserDetailsService {
@SneakyThrows
public UserDetails loadUserByUsername(String username) {
Cache cache = cacheManager.getCache(CacheConstants.USER_DETAILS);
Object o = cache.get(username);
if (cache != null && cache.get(username) != null) {
return (YifuUser) cache.get(username).get();
}
R<UserInfo> result;// = remoteUserService.info(username, SecurityConstants.FROM_IN);
result = HttpDaprUtil.invokeMethodGet(daprUpmsProperties.getAppUrl(),daprUpmsProperties.getAppId(), "/user/getInfoByUsername", "?username="+username, UserInfo.class);
R<UserInfo> result = HttpDaprUtil.invokeMethodGet(daprUpmsProperties.getAppUrl(),daprUpmsProperties.getAppId(), "/user/getInfoByUsername", "?username="+username, UserInfo.class);
UserDetails userDetails = getUserDetails(result);
if (cache != null) {
cache.put(username, userDetails);
......
......@@ -19,8 +19,8 @@ spring:
ekp:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: hroread
password: 123456
username: root
password: ekp!@#123
jdbc-url: jdbc:mysql://119.96.192.73:3306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari:
minimum-idle: 10 # 最小空闲连接数量
......
......@@ -6,8 +6,8 @@ spring:
activate:
on-profile: test
redis:
host: 192.168.1.65
port: 22379
host: 127.0.0.1
port: 6379
password: '@yf_2017'
datasource:
insurances:
......@@ -19,9 +19,9 @@ spring:
ekp:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: hroread
password: 123456
jdbc-url: jdbc:mysql://119.96.192.73:3306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
username: root
password: ekp!@#123
jdbc-url: jdbc:mysql://36.7.147.19:20023/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari:
minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
......
......@@ -166,7 +166,6 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
@Override
public void importDiy(HttpServletResponse response, List<TStatisticsBonusImportVo> list, String deptId){
String fileName = "全年一次性奖金测算导出" + DateUtil.getThisTime() + CommonConstants.XLSX;
ServletOutputStream out = null;
//本次纳税额
BigDecimal res;
//应发工资合计
......@@ -194,8 +193,7 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
BigDecimal twlSalaryTax;
//12月社保公积金扣费
BigDecimal socialFundTax;
try {
out = response.getOutputStream();
try(ServletOutputStream out = response.getOutputStream()) {
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
response.setCharacterEncoding("utf-8");
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName , "UTF-8"));
......@@ -352,9 +350,15 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
sumDeductSalary = BigDecimalUtils.safeAdd(isTax,infoVo.getDeductTaxSalary());
}
//最优解计算区间
BigDecimal oneBecimal = new BigDecimal("36000");
BigDecimal twoBecimal = new BigDecimal("144000");
BigDecimal subOneBecimal = BigDecimalUtils.safeSubtract(wSalary,oneBecimal);
BigDecimal subTwoBecimal1 = BigDecimalUtils.safeSubtract(wSalary,twoBecimal);
if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("36000")) <= 0) {
if (wSalary.compareTo(new BigDecimal("36000")) <= 0) {
compareTo(oneBecimal) <= 0) {
if (wSalary.compareTo(oneBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -362,12 +366,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
maxAnualSalary = new BigDecimal("36000");
if (isSend) {
minSalary = subOneBecimal;
} else {
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
}
maxAnualSalary = oneBecimal;
}
} else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("72000")) <= 0) {
if (wSalary.compareTo(new BigDecimal("36000")) <= 0) {
if (wSalary.compareTo(oneBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -375,12 +383,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
maxAnualSalary = new BigDecimal("36000");
if (isSend) {
minSalary = subOneBecimal;
} else {
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
}
maxAnualSalary = oneBecimal;
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("203100")) <= 0) {
if (wSalary.compareTo(new BigDecimal("36000")) <= 0) {
if (wSalary.compareTo(oneBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -388,12 +400,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
maxAnualSalary = new BigDecimal("36000");
if (isSend) {
minSalary = subOneBecimal;
} else {
minSalary = subOneBecimal.compareTo(socialFundTax) >0 ? subOneBecimal : socialFundTax;
}
maxAnualSalary = oneBecimal;
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("288000")) <= 0) {
if (wSalary.compareTo(new BigDecimal("144000")) <= 0) {
if (wSalary.compareTo(twoBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -401,12 +417,16 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("144000"));
maxAnualSalary = new BigDecimal("144000");
if (isSend) {
minSalary = subTwoBecimal1;
} else {
minSalary = subTwoBecimal1.compareTo(socialFundTax) >0 ? subTwoBecimal1 : socialFundTax;
}
maxAnualSalary = twoBecimal;
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("672000")) <= 0) {
if (wSalary.compareTo(new BigDecimal("144000")) <= 0) {
if (wSalary.compareTo(twoBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -414,12 +434,18 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("36000"));
maxAnualSalary = new BigDecimal("36000");
if (isSend) {
minSalary = subTwoBecimal1;
} else {
minSalary = subTwoBecimal1.compareTo(socialFundTax) >0 ? subTwoBecimal1 : socialFundTax;
}
maxAnualSalary = twoBecimal;
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("1277500")) <= 0) {
if (wSalary.compareTo(new BigDecimal("300000")) <= 0) {
BigDecimal threeBecimal = new BigDecimal("300000");
BigDecimal subThreeBecimal = BigDecimalUtils.safeSubtract(wSalary,threeBecimal);
if (wSalary.compareTo(threeBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -427,12 +453,18 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("300000"));
maxAnualSalary = new BigDecimal("300000");
if (isSend) {
minSalary = subThreeBecimal;
} else {
minSalary = subThreeBecimal.compareTo(socialFundTax) >0 ? subThreeBecimal : socialFundTax;
}
maxAnualSalary = threeBecimal;
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("1452500")) <= 0) {
if (wSalary.compareTo(new BigDecimal("420000")) <= 0) {
BigDecimal fourBecimal = new BigDecimal("420000");
BigDecimal subFourBecimal = BigDecimalUtils.safeSubtract(wSalary,fourBecimal);
if (wSalary.compareTo(fourBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -440,12 +472,18 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("420000"));
maxAnualSalary = new BigDecimal("420000");
if (isSend) {
minSalary = subFourBecimal;
} else {
minSalary = subFourBecimal.compareTo(socialFundTax) >0 ? subFourBecimal : socialFundTax;
}
maxAnualSalary = fourBecimal;
}
}else if (BigDecimalUtils.safeSubtract(BigDecimalUtils.safeAdd(ySalary, wSalary), sumDeductSalary).
compareTo(new BigDecimal("1452500")) > 0) {
if (wSalary.compareTo(new BigDecimal("660000")) <= 0) {
BigDecimal fiveBecimal = new BigDecimal("660000");
BigDecimal subFiveBecimal = BigDecimalUtils.safeSubtract(wSalary,fiveBecimal);
if (wSalary.compareTo(fiveBecimal) <= 0) {
if (isSend) {
maxAnualSalary = wSalary;
} else {
......@@ -453,8 +491,12 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
maxAnualSalary = BigDecimalUtils.safeSubtract(wSalary,socialFundTax);
}
}else {
minSalary = BigDecimalUtils.safeSubtract(wSalary,new BigDecimal("660000"));
maxAnualSalary = new BigDecimal("660000");
if (isSend) {
minSalary = subFiveBecimal;
} else {
minSalary = subFiveBecimal.compareTo(socialFundTax) >0 ? subFiveBecimal : socialFundTax;
}
maxAnualSalary = fiveBecimal;
}
}
......@@ -484,16 +526,8 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
out.flush();
excelWriter.finish();
}catch (Exception e){
log.error("执行异常" ,e);
}finally {
try {
if (null != out) {
out.close();
}
} catch (IOException e) {
log.error("执行异常", e);
}
}catch (Exception e) {
log.error("执行异常", e);
}
}
......
package com.yifu.cloud.plus.v1.yifu.admin.api.vo;
import lombok.Data;
/**
* @Author fxj
* @Date 2022/11/25
* @Description
* @Version 1.0
*/
@Data
public class DictRedisVo {
private String key;
private String value;
}
package com.yifu.cloud.plus.v1.yifu.admin.init;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysArea;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysAreaService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
......@@ -46,6 +47,16 @@ public class DictItemRedisInit {
}
}
log.info("字典数据加入缓存初始化结束...");
log.info("转义字典数据加入缓存初始化开始...");
List<DictRedisVo> lables = dictItemService.getDictRedisVo();
if (Common.isNotNull(lables)){
Map<String,String> lableMap = new HashMap<>();
for (DictRedisVo vo:lables){
lableMap.put(vo.getKey(),vo.getValue());
}
redisUtil.set(CacheConstants.REDIS_DICT_LABLE ,lableMap);
}
log.info("转义字典数据加入缓存初始化结束...");
log.info("区域数据加入缓存初始化开始...");
List<SysArea> allAreas = sysAreaService.getAllArea();
......
......@@ -18,9 +18,12 @@ package com.yifu.cloud.plus.v1.yifu.admin.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 字典表 Mapper 接口
......@@ -43,4 +46,6 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
* @Date 10:21 2022/6/21
**/
int selectChildDictItemCount(@Param("parentItemType")String parentItemType, @Param("parentId")String parentId);
List<DictRedisVo> getDictRedisVo();
}
......@@ -20,6 +20,7 @@ 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.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List;
......@@ -86,4 +87,6 @@ public interface SysDictItemService extends IService<SysDictItem> {
R<Boolean> saveDiy(SysDictItem sysDictItem);
R<String> getLableFronValue(String value,String type);
List<DictRedisVo> getDictRedisVo();
}
......@@ -19,6 +19,9 @@ 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.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo;
import java.util.List;
/**
* 字典表
......@@ -52,4 +55,6 @@ public interface SysDictService extends IService<SysDict> {
String getParentDicLabelById(String type, String value);
int selectChildDictItemCount(String parentItemType, String parentId);
List<DictRedisVo> getDictRedisVo();
}
......@@ -27,6 +27,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo;
import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDictItemMapper;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictService;
......@@ -138,6 +139,11 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
return R.ok(CommonConstants.EMPTY_STRING);
}
@Override
public List<DictRedisVo> getDictRedisVo() {
return dictService.getDictRedisVo();
}
private void updateDictItem(String type, Map<String,Object> resultMap){
List<SysDictItem> allList = baseMapper.selectList(Wrappers.<SysDictItem>query().lambda()
.in(SysDictItem::getType,type)
......
......@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo;
import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDictItemMapper;
import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDictMapper;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictService;
......@@ -37,6 +38,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import java.util.List;
/**
* 字典表
*
......@@ -117,6 +120,11 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
return baseMapper.selectChildDictItemCount(parentItemType,parentId);
}
@Override
public List<DictRedisVo> getDictRedisVo() {
return baseMapper.getDictRedisVo();
}
/**
* 构建查询的 wrapper
* @param sysDict 查询条件
......
......@@ -38,6 +38,11 @@
<result property="createName" column="create_name"/>
</resultMap>
<resultMap id="dictRedisMap" type="com.yifu.cloud.plus.v1.yifu.admin.api.vo.DictRedisVo">
<result property="key" column="key"/>
<result property="value" column="value"/>
</resultMap>
<select id="getParentDicLabelById" resultType="java.lang.String">
SELECT
i.label,
......@@ -71,4 +76,14 @@
and t.parent_id= #{parentId} and t.del_flag='0'
)
</select>
<select id="getDictRedisVo" resultMap="dictRedisMap">
SELECT
CONCAT(a.type,"_",a.`value`) as "key",
a.label as "value"
FROM
sys_dict_item a
WHERE
a.del_flag='0'
</select>
</mapper>
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