Commit 9fb664f6 authored by fangxinjiang's avatar fangxinjiang

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

parents 21be7ae8 5da75ca0
......@@ -91,11 +91,18 @@ public class TDispatchInfoExportVo {
/**
* 社保自动化标识 0 是 1 否 2 无
*/
@ExcelAttribute(name = "是否自动化审核",isNotEmpty = false,readConverterExp = "0=是,1=否,2=无")
@Schema(description = "是否自动化审核:0 是 1 否2 无" )
@ExcelAttribute(name = "是否自动化社保",isNotEmpty = false,readConverterExp = "0=是,1=否,2=无")
@Schema(description = "是否自动化社保:0 是 1 否2 无" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="是否自动化审核")
private String autoFlag;
@ExcelProperty(value ="是否自动化社保")
private String autoFlag;/**
* 是否自动化医保 0 是 1 否 2 无
*/
@ExcelAttribute(name = "是否自动化医保",isNotEmpty = false,readConverterExp = "0=是,1=否,2=无")
@Schema(description = "是否自动化医保:0 是 1 否2 无" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="是否自动化医保")
private String autoFlagYsd;
/**
* 合同类型(字典值)
......
......@@ -160,26 +160,18 @@ public class SocialFriendConfig {
if (type == 2 || type == 4) {
// 职工社会保险减少花名册
fileName = "zgshbxjshmc";
}
if (Common.isNotNull(vo.getQyzgshbxzyhmc())) {
JSONArray qyzgshbxzyhmclbArr = new JSONArray();
qyzgshbxzyhmclbArr.add(vo.getQyzgshbxzyhmc());
if (type < 3 && vo.getImgListYgs() != null && !vo.getImgListYgs().isEmpty()) {
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr.addAll(vo.getImgListYgs());
}
if (type > 2 && vo.getImgListYsd() != null && !vo.getImgListYsd().isEmpty()) {
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr.addAll(vo.getImgListYsd());
}
if (type == 2 || type == 4) {
json.put(fileName, vo.getQyzgshbxzyhmc());
} else {
json.put(fileName, qyzgshbxzyhmclbArr);
}
} else if (Common.isNotNull(vo.getQyzgjbylbxcbdjb())) {
json.put(fileName, vo.getQyzgjbylbxcbdjb());
}
} else {
JSONArray qyzgshbxzyhmclbArr = new JSONArray();
if (Common.isNotNull(vo.getQyzgshbxzyhmc())) {
qyzgshbxzyhmclbArr.add(vo.getQyzgshbxzyhmc());
} else if (Common.isNotNull(vo.getQyzgjbylbxcbdjb())) {
qyzgshbxzyhmclbArr.add(vo.getQyzgjbylbxcbdjb());
}
if (type < 3 && vo.getImgListYgs() != null && !vo.getImgListYgs().isEmpty()) {
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr.addAll(vo.getImgListYgs());
......@@ -188,9 +180,7 @@ public class SocialFriendConfig {
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr.addAll(vo.getImgListYsd());
}
if (type == 2 || type == 4) {
json.put(fileName, vo.getQyzgjbylbxcbdjb());
} else {
if (!qyzgshbxzyhmclbArr.isEmpty()) {
json.put(fileName, qyzgshbxzyhmclbArr);
}
}
......
......@@ -1042,7 +1042,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
TSocialFriendBackLog backLog = new TSocialFriendBackLog();
backLog.setType(CommonConstants.SEVEN_INT);
backLog.setSocialId(searchVo.getSocialId());
R<String> ulrR = excelToImage.excelToImg(inputStreamOut, socialFriendConfig, restTemplate, backLog);
R<String> ulrR = excelToImage.excelToImg(searchVo.getSocialId(), ossUtil, tSocialFriendBackLogService
, inputStreamOut, socialFriendConfig, restTemplate, backLog);
tSocialFriendBackLogService.save(backLog);
return ulrR;
} catch (Exception e) {
......@@ -1313,9 +1314,9 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
backLog.setSocialId(vo.getSocialId());
backLog.setType(CommonConstants.SIX_INT);
backLog.setCreateTime(LocalDateTime.now());
// 上传花名册到阿里云
this.uploadHuaMingCeToOss(vo, fileName, inputStreamOut);
R<String> ulrR = excelToImage.excelToImg(inputStreamOut, socialFriendConfig, restTemplate, backLog);
R<String> ulrR = excelToImage.excelToImg(vo.getSocialId(), ossUtil, tSocialFriendBackLogService
, inputStreamOut, socialFriendConfig, restTemplate, backLog);
tSocialFriendBackLogService.save(backLog);
return ulrR;
} catch (Exception e) {
......@@ -1335,35 +1336,7 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
}
}
/**
* @param vo
* @param fileName
* @param inputStreamOut
* @Description: 上传花名册到阿里云
* @Author: hgw
* @Date: 2025/9/12 14:18
* @return: void
**/
private void uploadHuaMingCeToOss(SociaFriendYgsAddVo vo, String fileName, FileInputStream inputStreamOut) {
try {
String key = "socialFriend/" + vo.getSocialId() + "/" + System.currentTimeMillis() + fileName;
ossUtil.uploadFileByStream(inputStreamOut, key, null);
TSocialFriendBackLog backLogFile = new TSocialFriendBackLog();
backLogFile.setSocialId(vo.getSocialId());
backLogFile.setType(19);
backLogFile.setCreateTime(LocalDateTime.now());
if (Common.isNotNull(key)) {
URL fileUrl = ossUtil.getObjectUrl(null, key);
if (Common.isNotNull(fileUrl)) {
key += fileUrl.toString();
}
}
backLogFile.setLogInfo(key);
tSocialFriendBackLogService.save(backLogFile);
} catch (Exception e) {
log.info("花名册上传到阿里云失败,查看文件使用,没有找税友要也行");
}
}
/**
* 填充主表数据
......@@ -1777,7 +1750,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
backLog.setSocialId(searchVo.getSocialId());
backLog.setType(CommonConstants.SIX_INT);
backLog.setCreateTime(LocalDateTime.now());
R<String> ulrR = excelToImage.excelToImg(inputStreamOut, socialFriendConfig, restTemplate, backLog);
R<String> ulrR = excelToImage.excelToImg(searchVo.getSocialId(), ossUtil, tSocialFriendBackLogService
, inputStreamOut, socialFriendConfig, restTemplate, backLog);
tSocialFriendBackLogService.save(backLog);
return ulrR;
} catch (Exception e) {
......
......@@ -455,7 +455,7 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
for (Map.Entry<String, FailReasonConfig> config : errorMap.entrySet()) {
if (config.getKey().contains(CommonConstants.HU_CORE)
&& huId.equals(config.getKey().split(CommonConstants.HU_CORE)[0])
&& msg.contains(config.getKey())) {
&& msg.contains(config.getKey().split(CommonConstants.HU_CORE)[1])) {
configTemp = config.getValue();
break;
}
......
......@@ -9,16 +9,20 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.config.SocialFriendConfig;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendBackLog;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendBackLogService;
import com.yifu.cloud.plus.v1.yifu.social.vo.SociaFriendYgsAddVo;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.Files;
import java.time.LocalDateTime;
import java.util.Base64;
/**
......@@ -40,7 +44,8 @@ public class ExcelToImage {
private final static String toImagOSSError = ":ExcelToImage上传OSS异常";
public R<String> excelToImg(InputStream inputStream , SocialFriendConfig socialFriendConfig
public R<String> excelToImg(String socialId, OSSUtil ossUtil, TSocialFriendBackLogService tSocialFriendBackLogService
,InputStream inputStream , SocialFriendConfig socialFriendConfig
, RestTemplate restTemplate, TSocialFriendBackLog backLog){
backLog.setLogInfo("开始转换excel为图片");
if (null == inputStream || null == socialFriendConfig){
......@@ -72,6 +77,8 @@ public class ExcelToImage {
if (Common.isEmpty(url)){
return R.failed(CommonConstants.RESULT_DATA_FAIL+toImagOSSError);
}
// 上传花名册到阿里云
this.uploadHuaMingCeToOss(ossUtil, tSocialFriendBackLogService, socialId, file.getName(), file);
return R.ok(url);
}
} catch (Exception e) {
......@@ -91,6 +98,38 @@ public class ExcelToImage {
}
return R.failed(CommonConstants.RESULT_DATA_FAIL);
}
/**
* @param socialId
* @param fileName
* @param file
* @Description: 上传花名册到阿里云
* @Author: hgw
* @Date: 2025/9/12 14:18
* @return: void
**/
private void uploadHuaMingCeToOss(OSSUtil ossUtil, TSocialFriendBackLogService tSocialFriendBackLogService
, String socialId, String fileName, File file) {
try {
String key = "socialFriend/" + socialId + "/" + System.currentTimeMillis() + fileName;
ossUtil.uploadFileByFile(file, key, null);
TSocialFriendBackLog backLogFile = new TSocialFriendBackLog();
backLogFile.setSocialId(socialId);
backLogFile.setType(19);
backLogFile.setCreateTime(LocalDateTime.now());
if (Common.isNotNull(key)) {
URL fileUrl = ossUtil.getObjectUrl(null, key);
if (Common.isNotNull(fileUrl)) {
key += fileUrl.toString();
}
}
backLogFile.setLogInfo(key);
tSocialFriendBackLogService.save(backLogFile);
} catch (Exception e) {
// log.info("花名册上传到阿里云失败,查看文件使用,没有找税友要也行")
}
}
//压缩文件到指定大小
private File compressImage(File originalFile, String projectRoot) throws IOException {
BufferedImage image = ImageIO.read(originalFile);
......
......@@ -189,6 +189,7 @@
<result property="graduationTime" column="GRADUATION_TIME"/>
<result property="autoFlag" column="AUTO_FLAG"/>
<result property="autoFlagYsd" column="AUTO_FLAG_YSD"/>
<result property="unitProvidentPer" column="UNIT_PROVIDENT_PER"/>
<result property="personalProvidentPer" column="PERSONAL_PROVIDENT_PER"/>
......@@ -482,6 +483,9 @@
<if test="tDispatchInfo.autoFlag != null and tDispatchInfo.autoFlag.trim() != ''">
AND a.AUTO_FLAG = #{tDispatchInfo.autoFlag}
</if>
<if test="tDispatchInfo.autoFlagYsd != null and tDispatchInfo.autoFlagYsd.trim() != ''">
AND a.AUTO_FLAG_YSD = #{tDispatchInfo.autoFlagYsd}
</if>
<if test="tDispatchInfo.id != null and tDispatchInfo.id.trim() != ''">
AND a.ID = #{tDispatchInfo.id}
</if>
......@@ -1000,7 +1004,10 @@
a.GRADUATION_TIME,
case when a.AUTO_FLAG = 0 then "是"
when a.AUTO_FLAG = 1 then "否"
else "无" end as "AUTO_FLAG"
else "无" end as "AUTO_FLAG",
case when a.AUTO_FLAG_YSD = 0 then "是"
when a.AUTO_FLAG_YSD = 1 then "否"
else "无" end as "AUTO_FLAG_YSD"
from t_dispatch_info a
left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID
......@@ -1618,15 +1625,22 @@
a.SCHOOL_NAME,
a.MAJOR,
a.FIRST_PAY_TIME,
a.GRADUATION_TIME,a.AUTO_FLAG
a.GRADUATION_TIME
,a.SOCIAL_HOUSEHOLD_NAME,s.YGS_HANDLE_STATUS,s.YSD_HANDLE_STATUS
,s.YGS_REMARK,s.YSD_REMARK,s.YGS_REMARK_OLD,s.YSD_REMARK_OLD
,s.YGS_REQUEST_ID,s.YSD_REQUEST_ID
,if(a.type ='0',YGS_SOCIAL_START_DATE_NEXT,null) YGS_SOCIAL_START_DATE_NEXT
,if(a.type ='0',YSD_SOCIAL_START_DATE_NEXT,null) YSD_SOCIAL_START_DATE_NEXT
,a.BACK_FILE_FLAG
,a.IS_SINGLE
,a.IS_AUTO_LEAVE_DOC
,SUBSTRING_INDEX(GROUP_CONCAT(a.AUTO_FLAG ORDER BY a.CREATE_TIME desc),',',1) AUTO_FLAG
,SUBSTRING_INDEX(GROUP_CONCAT(a.AUTO_FLAG_YSD ORDER BY a.CREATE_TIME desc),',',1) AUTO_FLAG_YSD
,SUBSTRING_INDEX(GROUP_CONCAT(a.IS_SINGLE ORDER BY a.CREATE_TIME desc),',',1) IS_SINGLE
,SUBSTRING_INDEX(GROUP_CONCAT(a.IS_SINGLE_YSD ORDER BY a.CREATE_TIME desc),',',1) IS_SINGLE_YSD
,SUBSTRING_INDEX(GROUP_CONCAT(a.IS_AUTO_LEAVE_DOC ORDER BY a.CREATE_TIME desc),',',1) IS_AUTO_LEAVE_DOC
,SUBSTRING_INDEX(GROUP_CONCAT(a.ROSTER_AUTO_FLAG_YGS ORDER BY a.CREATE_TIME desc),',',1) ROSTER_AUTO_FLAG_YGS
,SUBSTRING_INDEX(GROUP_CONCAT(a.ROSTER_AUTO_FLAG_YSD ORDER BY a.CREATE_TIME desc),',',1) ROSTER_AUTO_FLAG_YSD
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID
......@@ -1715,7 +1729,7 @@
a.SCHOOL_NAME,
a.MAJOR,
a.FIRST_PAY_TIME,
a.GRADUATION_TIME,a.AUTO_FLAG
a.GRADUATION_TIME,a.AUTO_FLAG,a.AUTO_FLAG_YSD
,a.SOCIAL_HOUSEHOLD_NAME
,s.YGS_REMARK_OLD,s.YSD_REMARK_OLD
,if(a.type ='0' and s.add_ygs_Handle_Status != '0', s.add_ygs_Handle_Status, s.ygs_Handle_Status) ygs_Handle_Status
......@@ -2127,7 +2141,7 @@
AND a.STATUS = "2"
and (( a.type = '0' AND (s.HANDLE_STATUS = "0" or s.HANDLE_STATUS = "4") ) or ( a.type ='1' AND (if(ifnull(h.id,0) != '0',h.HANDLE_STATUS,s.HANDLE_STATUS) in ('1','5','6','3','7') or (s.HANDLE_STATUS in ('1','5','6','3','7') and s.REDUCE_CAN = '1')) ))
and a.SOCIAL_HANDLE_STATUS in ('0','4')
and (a.auto_flag='1' or s.YGS_HANDLE_STATUS ='5' or s.YSD_HANDLE_STATUS = '5' )
and (a.auto_flag='1' or a.auto_flag_ysd='1' or s.YGS_HANDLE_STATUS ='5' or s.YSD_HANDLE_STATUS = '5' )
<!--<if test="tDispatchInfo.status != null and tDispatchInfo.status.trim() != ''">
/*待办理组合判断*/
......@@ -2158,7 +2172,7 @@
<where>
a.DELETE_FLAG = '0'
AND a.social_id is not null
and a.AUTO_FLAG = '0'
and (a.AUTO_FLAG = '0' or a.AUTO_FLAG_YSD = '0')
<include refid="where_getSocialRecordRoster_base"/>
<if test="tDispatchInfo != null">
......@@ -2821,7 +2835,7 @@
</select>
<select id="getAutoFlag" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.AutoFlagVo">
select a.id as 'dispatchId',
b.AUTO_STATUS as 'autoFlag',
b.AUTO_STATUS as 'autoFlagYgs',
b.AUTO_STATUS_YSD as 'autoFlagYsd',
b.IS_SINGLE as 'isSingleYgs',
b.IS_SINGLE_YSD as 'isSingleYsd',
......@@ -2865,7 +2879,7 @@
<where>
a.DELETE_FLAG = '0'
AND a.social_id is not null
and a.AUTO_FLAG = '0'
and (a.AUTO_FLAG = '0' or a.AUTO_FLAG_YSD = '0')
and a.type = '0'
<!-- 税友反馈接口目前只支持社保附件下载,必须是办理成功的 -->
and s.ygs_Handle_Status = '6'
......
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