Commit 7eaeaad6 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.7.15' into MVP1.7.15

parents 3b301715 97cb8b41
...@@ -680,4 +680,8 @@ public interface CommonConstants { ...@@ -680,4 +680,8 @@ public interface CommonConstants {
// 瓜子推送成功标识 // 瓜子推送成功标识
String GZ_SUCCESS_CODE = "S00000"; String GZ_SUCCESS_CODE = "S00000";
// 税友、花名册、模板里的要签名的字体
String QIAN_MING = "qian_ming";
// 税友、花名册、模板里的固定文字
String GU_DING = "gu_ding";
} }
...@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty; ...@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -131,4 +132,36 @@ public class SociaFriendYgsAddVo implements Serializable { ...@@ -131,4 +132,36 @@ public class SociaFriendYgsAddVo implements Serializable {
@ExcelProperty("派单ID") @ExcelProperty("派单ID")
private String dispatchId; private String dispatchId;
// 适应花名册模板
// 性别
private String empSex;
// 对√
private String dui;
// 错×
private String cuo;
// 审核时间年-月-日
private String auditDay;
// 审核人——户配置的
private String auditUserName;
// 办理人——户配置的
private String handleUserName;
//@ExcelProperty("社保停缴日期" )-年-月
private String socialReduceDate;
//出生日期-年-月
private String birthMonth;
// 补缴备注:需条件判断:当起缴月为大于审核月时为空,否则为"补缴+年月"(如"补缴2023-05"
private String buJiaoRemark;
// 参加工作时间(合同起止YYYYMMDD-YYYYMMDD
private String workDate;
// 补缴保险属期(合同起止YYYYMM-YYYYMM
private String workMonth;
// 创建年月-停止缴费时间(派单create_time:YYYYMM
private String yearMonth;
// 当前时间(2025年8月28日)
private String nowDay;
// 医保的“申报工资(元)”——单位医疗基数
private String unitMedicalCardinal;
// 户ID,用来查章
private String huId;
} }
...@@ -53,5 +53,7 @@ public interface TAttaInfoMapper extends BaseMapper<TAttaInfo> { ...@@ -53,5 +53,7 @@ public interface TAttaInfoMapper extends BaseMapper<TAttaInfo> {
// 获取离职证明模板 // 获取离职证明模板
String getLeaveDocTemplate(); String getLeaveDocTemplate();
// 税友花名册模板ID:11、12、13、14 (社保增减,医保增减)
String getTemplateSrcById(@Param("id") String id);
} }
...@@ -43,15 +43,20 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.*; ...@@ -43,15 +43,20 @@ import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.poi.ss.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.io.*; import java.io.*;
import java.lang.reflect.Field;
import java.net.URL; import java.net.URL;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/** /**
* 税友-推送 * 税友-推送
...@@ -134,13 +139,13 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -134,13 +139,13 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
// 养工失新增列表 // 养工失新增列表
List<SociaFriendYgsAddVo> ygsAddlist = baseMapper.getSocialSoldierYgsAddVoList(dispatchIdList); List<SociaFriendYgsAddVo> ygsAddlist = baseMapper.getSocialSoldierYgsAddVoList(dispatchIdList);
if (ygsAddlist != null && !ygsAddlist.isEmpty()) { if (ygsAddlist != null && !ygsAddlist.isEmpty()) {
this.doPushSocialAndLogYgs(socialSetMap, ygsAddlist, 1, reduceYgsMap, zhangMap, templateUrl); return this.doPushSocialAndLogYgs(socialSetMap, ygsAddlist, 1, reduceYgsMap, zhangMap, templateUrl);
} }
// 养工失减少列表 // 养工失减少列表
List<SociaFriendYgsAddVo> ygsReducelist = baseMapper.getSocialSoldierYgsReduceVoList(dispatchIdList); List<SociaFriendYgsAddVo> ygsReducelist = baseMapper.getSocialSoldierYgsReduceVoList(dispatchIdList);
if (ygsReducelist != null && !ygsReducelist.isEmpty()) { if (ygsReducelist != null && !ygsReducelist.isEmpty()) {
this.doPushSocialAndLogYgs(socialSetMap, ygsReducelist, 2, reduceYgsMap, zhangMap, templateUrl); return this.doPushSocialAndLogYgs(socialSetMap, ygsReducelist, 2, reduceYgsMap, zhangMap, templateUrl);
} }
// 医生大新增列表 // 医生大新增列表
List<SociaFriendYgsAddVo> ysdAddlist = baseMapper.getSocialSoldierYsdAddVoList(dispatchIdList); List<SociaFriendYgsAddVo> ysdAddlist = baseMapper.getSocialSoldierYsdAddVoList(dispatchIdList);
...@@ -176,7 +181,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -176,7 +181,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
* @Date: 2024/9/2 17:21 * @Date: 2024/9/2 17:21
* @return: void * @return: void
**/ **/
private void doPushSocialAndLogYgs(Map<String, TSocialDeadlineInfo> socialSetMap private R<String> doPushSocialAndLogYgs(Map<String, TSocialDeadlineInfo> socialSetMap
, List<SociaFriendYgsAddVo> ygsAddlist, int type, Map<String, TSocialFriendReduceSet> reduceMap , List<SociaFriendYgsAddVo> ygsAddlist, int type, Map<String, TSocialFriendReduceSet> reduceMap
, Map<String, URL> zhangMap, URL templateUrl) { , Map<String, URL> zhangMap, URL templateUrl) {
int canPushType; int canPushType;
...@@ -249,8 +254,10 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -249,8 +254,10 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
isAutoLeaveDoc = templateUrl != null && type == 2 && Common.isNotNull(vo.getIsAutoLeaveDoc()) isAutoLeaveDoc = templateUrl != null && type == 2 && Common.isNotNull(vo.getIsAutoLeaveDoc())
&& CommonConstants.ONE_STRING.equals(vo.getIsAutoLeaveDoc()); && CommonConstants.ONE_STRING.equals(vo.getIsAutoLeaveDoc());
if (isAutoLeaveDoc || isSingle || nextFlag || i % 10 == 0 || index >= ygsAddlist.size()-1) { if (isAutoLeaveDoc || isSingle || nextFlag || i % 10 == 0 || index >= ygsAddlist.size()-1) {
urlR = doExportRosterNew(vo, type, listVo);
// 房工接口,获取 企业职工社会保险增员花名册 url // 房工接口,获取 企业职工社会保险增员花名册 url
urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode(), listVo); // urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode(), listVo)
if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) { if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) {
vo.setQyzgshbxzyhmc(urlR.getData()); vo.setQyzgshbxzyhmc(urlR.getData());
} }
...@@ -320,6 +327,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -320,6 +327,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
if (!logList.isEmpty()) { if (!logList.isEmpty()) {
tSocialSoldierLogService.saveBatch(logList); tSocialSoldierLogService.saveBatch(logList);
} }
// 临时return
return R.ok();
} }
/** /**
...@@ -462,7 +471,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -462,7 +471,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
vo = ysdAddlist.get(index); vo = ysdAddlist.get(index);
// 0:未到时间不动; 1:推送; 2:转人工 // 0:未到时间不动; 1:推送; 2:转人工
if ("16".equals(vo.getTbyy())) { // 1.7.15去掉死亡拦截,税友说能办理
/*if ("16".equals(vo.getTbyy())) {
remark = "劳动者死亡,转人工!"; remark = "劳动者死亡,转人工!";
socialInfo = new TSocialInfo(); socialInfo = new TSocialInfo();
socialInfo.setId(vo.getSocialId()); socialInfo.setId(vo.getSocialId());
...@@ -472,7 +482,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -472,7 +482,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
if (socialLog != null) { if (socialLog != null) {
logList.add(socialLog); logList.add(socialLog);
} }
} else { } else {*/
// 派减离职原因转化: // 派减离职原因转化:
if (type == 4 && Common.isNotNull(vo.getTbyy())) { if (type == 4 && Common.isNotNull(vo.getTbyy())) {
reduceSet = reduceMap.get(vo.getTbyy()); reduceSet = reduceMap.get(vo.getTbyy());
...@@ -515,8 +525,11 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -515,8 +525,11 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
isAutoLeaveDoc = templateUrl != null && type == 4 && Common.isNotNull(vo.getIsAutoLeaveDoc()) isAutoLeaveDoc = templateUrl != null && type == 4 && Common.isNotNull(vo.getIsAutoLeaveDoc())
&& CommonConstants.ONE_STRING.equals(vo.getIsAutoLeaveDoc()); && CommonConstants.ONE_STRING.equals(vo.getIsAutoLeaveDoc());
if (isAutoLeaveDoc || isSingle || nextFlag || i % 10 == 0 || index >= ysdAddlist.size()-1) { if (isAutoLeaveDoc || isSingle || nextFlag || i % 10 == 0 || index >= ysdAddlist.size()-1) {
urlR = doExportRosterNew(vo, type, listVo);
// 房工接口,获取 企业职工基本医疗保险参保登记表 url // 房工接口,获取 企业职工基本医疗保险参保登记表 url
urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode(), listVo); //urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode(), listVo);
if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) { if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) {
vo.setQyzgjbylbxcbdjb(urlR.getData()); vo.setQyzgjbylbxcbdjb(urlR.getData());
} }
...@@ -571,7 +584,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -571,7 +584,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
logList.add(socialLog); logList.add(socialLog);
} }
} }
} //}
} }
if (!backLogList.isEmpty()) { if (!backLogList.isEmpty()) {
tSocialFriendBackLogService.saveBatch(backLogList); tSocialFriendBackLogService.saveBatch(backLogList);
...@@ -701,6 +714,31 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -701,6 +714,31 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
return canPushType; return canPushType;
} }
/**
* @return
* @Author fxj
* @Description 查询当月已经审核通过的未办理完成的社保或医保 增减信息
* @Date 15:58 2024/12/10
* @Param socialId:社保明细ID type: 1 社保增 2社保减 3 医保增 4 医保减 unitCreditCode:单位统一信用代码
**/
private R<String> doExportRosterNew(SociaFriendYgsAddVo vo, int type, List<SociaFriendYgsAddVo> listVo) {
if (vo == null || Common.isEmpty(listVo)) {
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
TAttaInfo att = attaInfoMapper.selectOne(Wrappers.<TAttaInfo>query().lambda()
.eq(TAttaInfo::getDomainId, vo.getHuId()).last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(att)) {
return R.failed("获取电子印章信息失败");
}
String fileName = DispatchConstants.SOCIAL_MEDICAL_EXPORT + vo.getSocialHouseholdName() + "_" + vo.getSocialId() + CommonConstants.XLS;
String projectRoot = System.getProperty(CommonConstants.USER_DIR);
String filePath = projectRoot + CommonConstants.DOUBLE_LINE + fileName;
//社保增减
return doExportRosterSocialNew(vo, type, listVo, fileName, projectRoot, filePath, att.getAttaSrc());
}
/** /**
* @return * @return
* @Author fxj * @Author fxj
...@@ -978,7 +1016,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -978,7 +1016,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
if (tempFile.exists()) { if (tempFile.exists()) {
tempFile.delete(); tempFile.delete();
} }
if (outFile.exists()) { if (outFile != null && outFile.exists()) {
outFile.delete(); outFile.delete();
} }
if (null != inputStream) { if (null != inputStream) {
...@@ -995,6 +1033,309 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe ...@@ -995,6 +1033,309 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
} }
} }
/**
* @Author hgw
* @Description 社保增减花名册
* @Date 2025-9-3 16:20:32
**/
public R<String> doExportRosterSocialNew(SociaFriendYgsAddVo vo, int type, List<SociaFriendYgsAddVo> listVo,
String fileName,
String projectRoot,
String filePath,
String src) {
//获取要导出的列表
List<TDispatchSocialPersionExportVo> list = new ArrayList<>();
ExcelWriter excelWriter = null;
File createFile = null;
try {
String templateId = "11";
if (type == CommonConstants.TWO_INT) {
templateId = "12";
} else if (type == CommonConstants.THREE_INT) {
templateId = "13";
} else if (type == CommonConstants.FOUR_INT) {
templateId = "14";
}
String templateSrc = attaInfoMapper.getTemplateSrcById(templateId);
URL templateUrl = ossUtil.getObjectUrl(null, templateSrc);
if (Common.isEmpty(templateUrl)) {
return R.failed(CommonConstants.RESULT_DATA_FAIL + ":花名册模板OSS获取URL异常");
}
InputStream templateInStream = templateUrl.openStream();
if (Common.isEmpty(templateInStream)) {
return R.failed(CommonConstants.RESULT_DATA_FAIL + ":花名册模板OSS获取流异常");
}
try (Workbook workbook = WorkbookFactory.create(templateInStream)) {
Sheet sheet = workbook.getSheetAt(0);
// 1. 填充主表数据
fillMainData(sheet, vo);
// 2. 填充明细表数据
fillDetailData(sheet, listVo);
// 保存文件
try (FileOutputStream fos = new FileOutputStream(filePath)) {
workbook.write(fos);
}
} catch (Exception e) {
throw new RuntimeException("填充Excel模板失败", e);
}
File inputFile = null;
File tempFile = null;
File outFile = null;
FileInputStream inputStream = null;
FileOutputStream fileOUt = null;
InputStream inStream = null;
FileInputStream inputStreamOut = null;
try {
//读取文件 生成电子章
inputFile = new File(filePath);
inputStream = new FileInputStream(inputFile);
String tempPath = projectRoot + "//temp_" + fileName;
tempFile = new File(tempPath);
fileOUt = new FileOutputStream(tempFile);
URL url = ossUtil.getObjectUrl(null, src);
if (Common.isEmpty(url)) {
return R.failed(CommonConstants.RESULT_DATA_FAIL + ":电子印章OSS获取URL异常");
}
inStream = url.openStream();
if (Common.isEmpty(inStream)) {
return R.failed(CommonConstants.RESULT_DATA_FAIL + ":电子印章OSS获取流异常");
}
// 添加电子章 完成后关闭所有流
excelMergeImage.addPictureToExcel(inputStream, inStream, fileOUt, CommonConstants.ZERO_INT, String.valueOf(type));
outFile = new File(tempPath);
inputStreamOut = new FileInputStream(outFile);
// 转换成图片 完成后清理流
TSocialFriendBackLog backLog = new TSocialFriendBackLog();
backLog.setSocialId(vo.getSocialId());
backLog.setType(CommonConstants.SIX_INT);
backLog.setCreateTime(LocalDateTime.now());
R<String> ulrR = excelToImage.excelToImg(inputStreamOut, socialFriendConfig, restTemplate, backLog);
tSocialFriendBackLogService.save(backLog);
return ulrR;
} catch (Exception e) {
return R.failed("税友附件生成异常:" + e.getMessage());
} finally {
// 清理文件
finallyClose(inputFile, tempFile, outFile, inputStream, fileOUt, inStream, inputStreamOut);
}
} catch (Exception e) {
if (excelWriter != null) {
excelWriter.finish();
}
log.error("税友附件生成异常", e);
return R.failed("税友附件生成异常:" + e.getMessage());
} finally {
finallyClear(list, createFile);
}
}
/**
* 填充主表数据
*/
private static void fillMainData(Sheet sheet, SociaFriendYgsAddVo vo) {
String cellValue;
String key;
String newValue;
for (Row row : sheet) {
for (Cell cell : row) {
if (cell.getCellType() == CellType.STRING) {
cellValue = cell.getStringCellValue();
if (cellValue.startsWith("${") && cellValue.endsWith("}")) {
// 正常的主表的单元格的占位,类似"${empName}"
key = cellValue.substring(2, cellValue.length() - 1);
newValue = getFieldValue(vo, key);
if (!CommonConstants.QIAN_MING.equals(key)) {
cell.setCellValue(newValue);
} else {
setQianMingStyle(cell, newValue);
}
} else if (containsPlaceholder(cellValue)) {
// 非正常的主表的单元格的占位,类似"经办人:${empName} 单位名称${unitName}"
newValue = replaceMixedPlaceholders(cellValue, vo);
cell.setCellValue(newValue);
}
}
}
}
}
public static String getFieldValue(Object obj, String fieldName) {
try {
if (obj != null) {
Field field = ReflectionUtils.findField(obj.getClass(), fieldName);
if (field != null) {
field.setAccessible(true);
Object value = ReflectionUtils.getField(field, obj);
if (Common.isNotNull(value)) {
return String.valueOf(value);
}
}
}
} catch (Exception e) {
return "";
}
return "";
}
/**
* @Description: 签名样式
* @Author: hgw
* @Date: 2025/9/2 9:51
* @return: void
**/
private static void setQianMingStyle(Cell cell, String value) {
if (cell != null && Common.isNotNull(value)) {
// 加签名样式
cell.setCellValue(value);
}
}
/**
* 检查字符串是否包含占位符
*/
private static boolean containsPlaceholder(String text) {
return text != null && text.contains("${");
}
/**
* 替换混合文本中的占位符
*/
private static String replaceMixedPlaceholders(String cellValue, SociaFriendYgsAddVo vo) {
if (cellValue == null) {
return cellValue;
}
// 使用正则表达式匹配 ${xxx} 格式的占位符
Pattern pattern = Pattern.compile("\\$\\{([^}]+)\\}");
Matcher matcher = pattern.matcher(cellValue);
StringBuffer result = new StringBuffer();
String key;
String oldKey;
String newValue;
String[] qianMingArr;
while (matcher.find()) {
key = matcher.group(1); // 获取占位符名称(去掉${})
if (Common.isNotNull(key)) {
oldKey = key;
if (key.contains(CommonConstants.QIAN_MING)) {
qianMingArr = key.split("&");
if (qianMingArr.length>1) {
key = qianMingArr[1];
} else {
key = "empName";
}
}
newValue = getFieldValue(vo, key);
if (Common.isEmpty(newValue)) {
// 如果找不到,保留原占位符
newValue = "${" + oldKey + "}";
}
matcher.appendReplacement(result, newValue.replace("\\", "\\\\").replace("$", "\\$"));
}
}
matcher.appendTail(result);
return result.toString();
}
/**
* 填充明细表数据
*/
private static void fillDetailData(Sheet sheet, List<SociaFriendYgsAddVo> listVo) {
if (listVo == null || listVo.isEmpty()) return;
// 查找明细区域开始和结束位置
int startRow = -1;
int endRow = -1;
Map<String, Integer> columnMapping = new java.util.HashMap<>();
Row row;
Cell cell;
String value;
String key;
// 查找表头行和模板行
for (int i = 0; i <= sheet.getLastRowNum(); i++) {
row = sheet.getRow(i);
if (row == null) continue;
for (int j = 0; j < row.getLastCellNum(); j++) {
cell = row.getCell(j);
if (cell != null && cell.getCellType() == CellType.STRING) {
value = cell.getStringCellValue();
if (Common.isNotNull(value)) {
// 查找表头
if (value.startsWith("#{") && !value.equals("#{end}")) {
key = value.substring(2, value.length() - 1);
columnMapping.put(key+CommonConstants.DUNHAO_STRING+j, j);
if (startRow == -1) {
startRow = i;
}
}
// 查找结束标记
else if (value.equals("#{end}")) {
endRow = i;
cell.setCellValue("");
break;
}
}
}
}
if (endRow != -1) break;
}
if (startRow == -1 || endRow == -1) return;
// 插入数据行
SociaFriendYgsAddVo vo;
Row newRow;
int columnIndex;
String newValue;
String[] qianMingArr;
for (int i = 0; i < listVo.size(); i++) {
vo = listVo.get(i);
newRow = sheet.getRow(startRow + i);
// 填充数据
for (Map.Entry<String, Integer> entry : columnMapping.entrySet()) {
key = entry.getKey();
if (Common.isNotNull(key)) {
qianMingArr = key.split(CommonConstants.DUNHAO_STRING);
key = qianMingArr[0];
columnIndex = entry.getValue();
cell = newRow.getCell(columnIndex);
if (cell == null) {
cell = newRow.createCell(columnIndex);
}
if (key.contains(CommonConstants.QIAN_MING)) {
// 签名样式
qianMingArr = key.split("&");
if (qianMingArr.length>1) {
key = qianMingArr[1];
} else {
key = "empName";
}
newValue = getFieldValue(vo, key);
setQianMingStyle(cell, newValue);
} else if (key.contains(CommonConstants.GU_DING)) {
// 固定文字
qianMingArr = key.split("&");
if (qianMingArr.length>1) {
key = qianMingArr[1];
cell.setCellValue(key);
}
} else {
newValue = getFieldValue(vo, key);
cell.setCellValue(newValue);
}
}
}
}
}
/** /**
* @return * @return
* @Author fxj * @Author fxj
......
...@@ -136,10 +136,18 @@ ...@@ -136,10 +136,18 @@
delete from t_atta_info where domain_id=#{domainId} and relation_type not in ('0','2','26','27') delete from t_atta_info where domain_id=#{domainId} and relation_type not in ('0','2','26','27')
</delete> </delete>
<!-- 离职证明模板 -->
<select id="getLeaveDocTemplate" resultType="java.lang.String"> <select id="getLeaveDocTemplate" resultType="java.lang.String">
SELECT SELECT
a.atta_src a.atta_src
FROM t_atta_info a where a.id = "1"; FROM t_atta_info a where a.id = "1"
</select>
<!-- 税友花名册模板ID:11、12、13、14 (社保增减,医保增减)-->
<select id="getTemplateSrcById" resultType="java.lang.String">
SELECT
a.atta_src
FROM t_atta_info a where a.id = #{id}
</select> </select>
</mapper> </mapper>
...@@ -85,7 +85,19 @@ ...@@ -85,7 +85,19 @@
DATE_FORMAT(a.LEAVE_DATE,'%Y年%m月%d日') leaveDate, DATE_FORMAT(a.LEAVE_DATE,'%Y年%m月%d日') leaveDate,
DATE_FORMAT(a.create_time,'%Y年%m月%d日') dispatchDate, DATE_FORMAT(a.create_time,'%Y年%m月%d日') dispatchDate,
a.settle_domain deptId, a.settle_domain deptId,
a.ID dispatchId a.ID dispatchId,
if(LENGTH(s.EMP_IDCARD) NOT IN (15, 18),'-',
if( MOD(SUBSTRING(s.EMP_IDCARD,if(LENGTH(s.EMP_IDCARD) = 18,17,15),1),2)=0,'女','男')
) empSex,'√' dui,'×' cuo,DATE_FORMAT(a.AUDIT_TIME,'%Y-%m-%d') auditDay
,shh.AUDIT_USER_NAME auditUserName,shh.HANDLE_USER_NAME handleUserName
,DATE_FORMAT(s.SOCIAL_REDUCE_DATE,'%Y-%m') socialReduceDate
,if( LENGTH(s.EMP_IDCARD) NOT IN (15, 18),'-',if(LENGTH(s.EMP_IDCARD) = 18,CONCAT(SUBSTRING(s.EMP_IDCARD,7,4),'-',SUBSTRING(s.EMP_IDCARD,11,2))
,CONCAT('19',SUBSTRING(s.EMP_IDCARD,7,2),'-',SUBSTRING(s.EMP_IDCARD,9,2)))) birthMonth
,concat(ifnull(DATE_FORMAT(a.CONTRACT_START,"%Y%m%d"),''),'-',ifnull(DATE_FORMAT(a.CONTRACT_END,"%Y%m%d"),'')) workDate
,concat(ifnull(DATE_FORMAT(a.CONTRACT_START,"%Y%m"),''),'-',ifnull(DATE_FORMAT(a.CONTRACT_END,"%Y%m"),'')) workMonth
,DATE_FORMAT(a.CREATE_TIME,"%Y%m") yearMonth
,DATE_FORMAT(now(),"%Y年%m月%d日") nowDay
,s.SOCIAL_HOUSEHOLD huId
</sql> </sql>
...@@ -107,6 +119,11 @@ ...@@ -107,6 +119,11 @@
<include refid="getSocialSoldierBaseOne"/> <include refid="getSocialSoldierBaseOne"/>
,if(YGS_SOCIAL_START_DATE_NEXT is not null,DATE_FORMAT(s.YGS_SOCIAL_START_DATE_NEXT,"%Y-%m-%d"), if(s.PENSION_START is not null,DATE_FORMAT(s.PENSION_START,"%Y-%m-%d"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y-%m-%d"))) socialStartDate ,if(YGS_SOCIAL_START_DATE_NEXT is not null,DATE_FORMAT(s.YGS_SOCIAL_START_DATE_NEXT,"%Y-%m-%d"), if(s.PENSION_START is not null,DATE_FORMAT(s.PENSION_START,"%Y-%m-%d"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y-%m-%d"))) socialStartDate
,if(YGS_SOCIAL_START_DATE_NEXT is not null,DATE_FORMAT(s.YGS_SOCIAL_START_DATE_NEXT,"%Y%m"), if(s.PENSION_START is not null,DATE_FORMAT(s.PENSION_START,"%Y%m"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y%m"))) socialStartMonth ,if(YGS_SOCIAL_START_DATE_NEXT is not null,DATE_FORMAT(s.YGS_SOCIAL_START_DATE_NEXT,"%Y%m"), if(s.PENSION_START is not null,DATE_FORMAT(s.PENSION_START,"%Y%m"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y%m"))) socialStartMonth
,if(DATE_FORMAT(if(YGS_SOCIAL_START_DATE_NEXT is not null,YGS_SOCIAL_START_DATE_NEXT,if(s.PENSION_START is not null,s.PENSION_START,s.SOCIAL_START_DATE)),'%Y-%m')>DATE_FORMAT(s.AUDIT_TIME,"%Y-%m")
,''
,CONCAT('补缴',DATE_FORMAT(if(YGS_SOCIAL_START_DATE_NEXT is not null,YGS_SOCIAL_START_DATE_NEXT,if(s.PENSION_START is not null,s.PENSION_START,s.SOCIAL_START_DATE)),'%Y-%m'))) buJiaoRemark
<include refid="getSocialSoldierBaseTwo"/> <include refid="getSocialSoldierBaseTwo"/>
and a.type = '0' and s.YGS_HANDLE_STATUS in ('0','1','3') and a.type = '0' and s.YGS_HANDLE_STATUS in ('0','1','3')
and ( and (
...@@ -142,6 +159,12 @@ ...@@ -142,6 +159,12 @@
<include refid="getSocialSoldierBaseOne"/> <include refid="getSocialSoldierBaseOne"/>
,if(s.PENSION_START is not null,DATE_FORMAT(s.PENSION_START,"%Y-%m-%d"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y-%m-%d")) socialStartDate ,if(s.PENSION_START is not null,DATE_FORMAT(s.PENSION_START,"%Y-%m-%d"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y-%m-%d")) socialStartDate
,if(s.PENSION_START is not null,DATE_FORMAT(s.PENSION_START,"%Y%m"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y%m")) socialStartMonth ,if(s.PENSION_START is not null,DATE_FORMAT(s.PENSION_START,"%Y%m"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y%m")) socialStartMonth
,if(DATE_FORMAT(if(YGS_SOCIAL_START_DATE_NEXT is not null,YGS_SOCIAL_START_DATE_NEXT,if(s.PENSION_START is not null,s.PENSION_START,s.SOCIAL_START_DATE)),'%Y-%m')>DATE_FORMAT(s.AUDIT_TIME,"%Y-%m")
,''
,CONCAT('补缴',DATE_FORMAT(if(YGS_SOCIAL_START_DATE_NEXT is not null,YGS_SOCIAL_START_DATE_NEXT,if(s.PENSION_START is not null,s.PENSION_START,s.SOCIAL_START_DATE)),'%Y-%m'))) buJiaoRemark
<include refid="getSocialSoldierBaseTwo"/> <include refid="getSocialSoldierBaseTwo"/>
and a.type = '1' and s.YGS_HANDLE_STATUS in ('0','1','3') and a.type = '1' and s.YGS_HANDLE_STATUS in ('0','1','3')
and ( and (
...@@ -159,6 +182,11 @@ ...@@ -159,6 +182,11 @@
,if(YSD_SOCIAL_START_DATE_NEXT is not null,DATE_FORMAT(s.YSD_SOCIAL_START_DATE_NEXT,"%Y-%m-%d"), if(s.MEDICAL_START is not null,DATE_FORMAT(s.MEDICAL_START,"%Y-%m-%d"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y-%m-%d"))) socialStartDate ,if(YSD_SOCIAL_START_DATE_NEXT is not null,DATE_FORMAT(s.YSD_SOCIAL_START_DATE_NEXT,"%Y-%m-%d"), if(s.MEDICAL_START is not null,DATE_FORMAT(s.MEDICAL_START,"%Y-%m-%d"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y-%m-%d"))) socialStartDate
,if(YSD_SOCIAL_START_DATE_NEXT is not null,DATE_FORMAT(s.YSD_SOCIAL_START_DATE_NEXT,"%Y%m"), if(s.MEDICAL_START is not null,DATE_FORMAT(s.MEDICAL_START,"%Y%m"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y%m"))) socialStartMonth ,if(YSD_SOCIAL_START_DATE_NEXT is not null,DATE_FORMAT(s.YSD_SOCIAL_START_DATE_NEXT,"%Y%m"), if(s.MEDICAL_START is not null,DATE_FORMAT(s.MEDICAL_START,"%Y%m"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y%m"))) socialStartMonth
,if(s.UNIT_MEDICAL_MONEY != 0,1,0) unitMedicalMoney,if(s.UNIT_BIRTH_MONEY != 0,1,0) unitBirthMoney,if(s.UNIT_BIGAILMENT_MONEY != 0,1,0) unitBigailmentMoney ,if(s.UNIT_MEDICAL_MONEY != 0,1,0) unitMedicalMoney,if(s.UNIT_BIRTH_MONEY != 0,1,0) unitBirthMoney,if(s.UNIT_BIGAILMENT_MONEY != 0,1,0) unitBigailmentMoney
,if(DATE_FORMAT(if(YSD_SOCIAL_START_DATE_NEXT is not null,YSD_SOCIAL_START_DATE_NEXT,if(s.MEDICAL_START is not null,s.MEDICAL_START,s.SOCIAL_START_DATE)),'%Y-%m')>DATE_FORMAT(s.AUDIT_TIME,"%Y-%m")
,''
,CONCAT('补缴',DATE_FORMAT(if(YSD_SOCIAL_START_DATE_NEXT is not null,YSD_SOCIAL_START_DATE_NEXT,if(s.MEDICAL_START is not null,s.MEDICAL_START,s.SOCIAL_START_DATE)),'%Y-%m'))) buJiaoRemark
,s.UNIT_MEDICAL_CARDINAL unitMedicalCardinal
<include refid="getSocialSoldierBaseTwo"/> <include refid="getSocialSoldierBaseTwo"/>
and a.type = '0' and s.YSD_HANDLE_STATUS in ('0','1','3') and a.type = '0' and s.YSD_HANDLE_STATUS in ('0','1','3')
and ( and (
...@@ -234,6 +262,24 @@ ...@@ -234,6 +262,24 @@
DATE_FORMAT(a.create_time,'%Y年%m月%d日') dispatchDate, DATE_FORMAT(a.create_time,'%Y年%m月%d日') dispatchDate,
a.settle_domain deptId, a.settle_domain deptId,
a.ID dispatchId a.ID dispatchId
,
if(LENGTH(s.EMP_IDCARD) NOT IN (15, 18),'-',
if( MOD(SUBSTRING(s.EMP_IDCARD,if(LENGTH(s.EMP_IDCARD) = 18,17,15),1),2)=0,'女','男')
) empSex,'√' dui,'×' cuo,DATE_FORMAT(a.AUDIT_TIME,'%Y-%m-%d') auditDay
,shh.AUDIT_USER_NAME auditUserName,shh.HANDLE_USER_NAME handleUserName
,DATE_FORMAT(s.SOCIAL_REDUCE_DATE,'%Y-%m') socialReduceDate
,if( LENGTH(s.EMP_IDCARD) NOT IN (15, 18),'-',if(LENGTH(s.EMP_IDCARD) = 18,CONCAT(SUBSTRING(s.EMP_IDCARD,7,4),'-',SUBSTRING(s.EMP_IDCARD,11,2))
,CONCAT('19',SUBSTRING(s.EMP_IDCARD,7,2),'-',SUBSTRING(s.EMP_IDCARD,9,2)))) birthMonth
,if(DATE_FORMAT(if(YSD_SOCIAL_START_DATE_NEXT is not null,YSD_SOCIAL_START_DATE_NEXT,if(s.MEDICAL_START is not null,s.MEDICAL_START,s.SOCIAL_START_DATE)),'%Y-%m')>DATE_FORMAT(s.AUDIT_TIME,"%Y-%m")
,''
,CONCAT('补缴',DATE_FORMAT(if(YSD_SOCIAL_START_DATE_NEXT is not null,YSD_SOCIAL_START_DATE_NEXT,if(s.MEDICAL_START is not null,s.MEDICAL_START,s.SOCIAL_START_DATE)),'%Y-%m'))) buJiaoRemark
,concat(ifnull(DATE_FORMAT(a.CONTRACT_START,"%Y%m%d"),''),'-',ifnull(DATE_FORMAT(a.CONTRACT_END,"%Y%m%d"),'')) workDate
,concat(ifnull(DATE_FORMAT(a.CONTRACT_START,"%Y%m"),''),'-',ifnull(DATE_FORMAT(a.CONTRACT_END,"%Y%m"),'')) workMonth
,DATE_FORMAT(a.CREATE_TIME,"%Y%m") yearMonth
,DATE_FORMAT(now(),"%Y年%m月%d日") nowDay
,s.UNIT_MEDICAL_CARDINAL unitMedicalCardinal
,s.SOCIAL_HOUSEHOLD huId
<include refid="getSocialSoldierBaseTwo"/> <include refid="getSocialSoldierBaseTwo"/>
and a.type = '1' and s.YSD_HANDLE_STATUS in ('0','1','3') and a.type = '1' and s.YSD_HANDLE_STATUS in ('0','1','3')
and ( and (
......
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