合并分支 'dev_20230216' 到 'master'

Dev 20230216

查看合并请求 laws-foton-slrs/foton-slrs-system-rest!99
This commit is contained in:
高嵩
2023-06-06 16:58:49 +08:00
10 changed files with 86 additions and 7 deletions
@@ -242,7 +242,7 @@ public class SendConvertMQService {
convertMqEO.setId(convertId); convertMqEO.setId(convertId);
convertMqEO.setMqState(2); convertMqEO.setMqState(2);
convertMqEOService.updateById(convertMqEO); convertMqEOService.updateById(convertMqEO);
this.restartUploadConvert(convertMqEO); // this.restartUploadConvert(convertMqEO);
return Result.error("r0072", "文件转换失败,请重试"); return Result.error("r0072", "文件转换失败,请重试");
} }
} }
@@ -2,6 +2,7 @@ package com.adc.da.slrs.sarBussStandSn.dao;
import com.adc.da.slrs.sarBussStandSn.entity.SarBussStandSn; import com.adc.da.slrs.sarBussStandSn.entity.SarBussStandSn;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
/** /**
* <p> * <p>
@@ -14,4 +15,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface SarBussStandSnDao extends BaseMapper<SarBussStandSn> { public interface SarBussStandSnDao extends BaseMapper<SarBussStandSn> {
String selectMaxStandnSn(); String selectMaxStandnSn();
String selectMaxStandSn(String standSort);
String selectStandSort(String standSort);
} }
@@ -19,4 +19,7 @@ public interface ISarBussStandSnService extends IService<SarBussStandSn> {
String selectMaxStandnSn(); String selectMaxStandnSn();
String selectMaxStandSn(String standSort);
String selectStandSort(String standSort);
} }
@@ -65,4 +65,14 @@ public class SarBussStandSnServiceImpl extends ServiceImpl<SarBussStandSnDao, Sa
public String selectMaxStandnSn() { public String selectMaxStandnSn() {
return baseMapper.selectMaxStandnSn(); return baseMapper.selectMaxStandnSn();
} }
@Override
public String selectMaxStandSn(String standSort) {
return baseMapper.selectMaxStandSn(standSort);
}
@Override
public String selectStandSort(String standSort) {
return baseMapper.selectStandSort(standSort);
}
} }
@@ -136,5 +136,7 @@ public interface SarBussionessStandDao extends BaseMapper<SarBussionessStand> {
@Select("select * from sar_bussioness_stand where TEXT_STATUS_BUSS is not null") @Select("select * from sar_bussioness_stand where TEXT_STATUS_BUSS is not null")
List<SarBussionessStand> selectAllStandStatus(); List<SarBussionessStand> selectAllStandStatus();
String selectMaxStandSn(String standSort);
} }
@@ -70,5 +70,7 @@ public interface ISarBussionessStandService extends IService<SarBussionessStand>
ResponseMessage cleaningDataReview(); ResponseMessage cleaningDataReview();
ResponseMessage repeal(String id, String type); ResponseMessage repeal(String id, String type);
String selectMaxStandSn(String standSort);
} }
@@ -220,11 +220,14 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
@Override @Override
public SarBussionessStand getStandInfoByReviseStatus(String reviseStatus,String standSort,String taskId){ public SarBussionessStand getStandInfoByReviseStatus(String reviseStatus,String standSort,String taskId){
SarBussionessStand bussionessStand = new SarBussionessStand(); SarBussionessStand bussionessStand = new SarBussionessStand();
String snStandSort = iSarBussStandSnService.selectStandSort(standSort);
QueryWrapper queryWrapper = new QueryWrapper(); QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("REPLACE(STAND_SORT,' ','')",standSort.replace(" ","")); queryWrapper.eq("REPLACE(STAND_SORT,' ','')",standSort.replace(" ",""));
int count = iSarBussStandSnService.count(queryWrapper); int count = iSarBussStandSnService.count(queryWrapper);
String MaxSn = iSarBussStandSnService.selectMaxStandSn(standSort);
String standMaxSn = iSarBussionessStandService.selectMaxStandSn(standSort);
// 1 先验证 当前企标类别 是否存在顺序号 // 1 先验证 当前企标类别 是否存在顺序号
if(count > 0){ if(count > 0 && MaxSn.equals(standMaxSn)){
QueryWrapper qw = new QueryWrapper(); QueryWrapper qw = new QueryWrapper();
qw.eq("REPLACE(STAND_SORT,' ','')",standSort.replace(" ","")); qw.eq("REPLACE(STAND_SORT,' ','')",standSort.replace(" ",""));
qw.eq("TASK_ID",taskId); qw.eq("TASK_ID",taskId);
@@ -248,24 +251,29 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
}else { }else {
QueryWrapper wrapper1 = new QueryWrapper(); QueryWrapper wrapper1 = new QueryWrapper();
wrapper1.select("MAX(DISTINCT CAST(STAND_SN AS decimal(9)))+1 AS STAND_SN"); //wrapper1.select("MAX(DISTINCT CAST(STAND_SN AS decimal(9)))+1 AS STAND_SN");
wrapper1.select("MAX(DISTINCT CAST(STAND_SN AS decimal(9))) AS STAND_SN");
wrapper1.eq("REPLACE(STAND_SORT,' ','')",standSort.replace(" ","")); wrapper1.eq("REPLACE(STAND_SORT,' ','')",standSort.replace(" ",""));
SarBussStandSn one = iSarBussStandSnService.getOne(wrapper1); SarBussStandSn one = iSarBussStandSnService.getOne(wrapper1);
// 1.1.2.2 返回顺序号 // 1.1.2.2 返回顺序号
bussionessStand.setNewStandSn(one.getStandSn()); bussionessStand.setNewStandSn(one.getStandSn());
// 1.1.2.3 获取新的顺序号 存入顺序号表中 // 1.1.2.3 获取新的顺序号 存入顺序号表中
saveBussStandSn(reviseStatus, standSort, one.getStandSn(),taskId); if (StringUtils.isBlank(MaxSn) && (StringUtils.isBlank(snStandSort) || snStandSort.equals(standSort))){
saveBussStandSn(reviseStatus, standSort, one.getStandSn(),taskId);
}
} }
} }
}else { }else {
// 2 获取企标库中 当前类别 最新 顺序号 前提必须顺序号为正规数据 // 2 获取企标库中 当前类别 最新 顺序号 前提必须顺序号为正规数据
bussionessStand = sarBussionessStandEODao.getStandInfoByReviseStatus(reviseStatus,standSort); bussionessStand = sarBussionessStandEODao.getStandInfoByReviseStatus(reviseStatus,standSort);
String sn = "1"; String sn = "001";
if(ObjectUtils.isNotEmpty(bussionessStand)){ if(ObjectUtils.isNotEmpty(bussionessStand)){
sn = bussionessStand.getNewStandSn(); sn = bussionessStand.getNewStandSn();
} }
saveBussStandSn(reviseStatus, standSort, sn, taskId); if (StringUtils.isBlank(MaxSn) && (StringUtils.isBlank(snStandSort) || snStandSort.equals(standSort))){
saveBussStandSn(reviseStatus, standSort, sn, taskId);
}
bussionessStand.setStandSn(sn); bussionessStand.setStandSn(sn);
} }
@@ -4674,6 +4682,11 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
return Result.success(); return Result.success();
} }
@Override
public String selectMaxStandSn(String standSort) {
return baseMapper.selectMaxStandSn(standSort);
}
public String updateInfo(List<String> asList,String standId,String attfId) { public String updateInfo(List<String> asList,String standId,String attfId) {
//重复的集合 //重复的集合
List<AttFileEO> chongfu = new ArrayList<>(); List<AttFileEO> chongfu = new ArrayList<>();
@@ -5,5 +5,11 @@
<select id="selectMaxStandnSn" resultType="java.lang.String"> <select id="selectMaxStandnSn" resultType="java.lang.String">
select Max(STAND_SN) from sar_buss_stand_sn select Max(STAND_SN) from sar_buss_stand_sn
</select> </select>
<select id="selectMaxStandSn" resultType="java.lang.String">
select Max(STAND_SN) from sar_buss_stand_sn where STAND_SORT = #{standSort} and VALID_FLAG = '0'
</select>
<select id="selectStandSort" resultType="java.lang.String">
select STAND_SORT from sar_buss_stand_sn where STAND_SORT = #{standSort} and VALID_FLAG = '0' limit 1
</select>
</mapper> </mapper>
@@ -351,7 +351,7 @@
</select> </select>
<select id="getStandInfoByReviseStatus" resultMap="BaseResultMap" parameterType="java.lang.String"> <select id="getStandInfoByReviseStatus" resultMap="BaseResultMap" parameterType="java.lang.String">
select MAX(DISTINCT CAST(stand_number AS decimal(9)))+1 AS newStandSn from sar_bussioness_stand select MAX(DISTINCT CAST(stand_number AS decimal(9))) AS newStandSn from sar_bussioness_stand
where REPLACE(STAND_SORT,' ','') = REPLACE(#{standSort},' ','') and valid_flag=0 where REPLACE(STAND_SORT,' ','') = REPLACE(#{standSort},' ','') and valid_flag=0
</select> </select>
@@ -1257,6 +1257,9 @@
resultType="com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand"> resultType="com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand">
select * from sar_bussioness_stand where stand_code = #{standCode} and VALID_FLAG = 0 limit 1 select * from sar_bussioness_stand where stand_code = #{standCode} and VALID_FLAG = 0 limit 1
</select> </select>
<select id="selectMaxStandSn" resultType="java.lang.String">
select max(STAND_NUMBER) from sar_bussioness_stand where STAND_SORT =#{standSort} and VALID_FLAG = 0
</select>
<update id="updateByIdInfo" > <update id="updateByIdInfo" >
update sar_buss_stand_attr_info ss set ss.FBGBUSS = #{strFile} update sar_buss_stand_attr_info ss set ss.FBGBUSS = #{strFile}
@@ -10,6 +10,7 @@ import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.WordUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.docx4j.Docx4J; import org.docx4j.Docx4J;
@@ -621,6 +622,40 @@ public class AttFileEOServiceImpl extends ServiceImpl<AttFileEODao, AttFileEO> i
fontMapper.put("Calibri", font); fontMapper.put("Calibri", font);
wordMLPackage.setFontMapper(fontMapper); wordMLPackage.setFontMapper(fontMapper);
OutputStream os = new java.io.FileOutputStream(src+fileInfo.getFilePath()+filePdfName); OutputStream os = new java.io.FileOutputStream(src+fileInfo.getFilePath()+filePdfName);
//加载字体文件(解决linux环境下无中文字体问题)
if (PhysicalFonts.get("SimSun") == null) {
PhysicalFonts.addPhysicalFonts("SimSun", WordUtils.class.getResource("/simsun.ttc"));
}
fontMapper.put("隶书", PhysicalFonts.get("LiSu"));
fontMapper.put("宋体", PhysicalFonts.get("SimSun"));
fontMapper.put("微软雅黑", PhysicalFonts.get("Microsoft Yahei"));
fontMapper.put("黑体", PhysicalFonts.get("SimHei"));
fontMapper.put("楷体", PhysicalFonts.get("KaiTi"));
fontMapper.put("新宋体", PhysicalFonts.get("NSimSun"));
fontMapper.put("华文行楷", PhysicalFonts.get("STXingkai"));
fontMapper.put("华文仿宋", PhysicalFonts.get("STFangsong"));
fontMapper.put("仿宋", PhysicalFonts.get("FangSong"));
fontMapper.put("幼圆", PhysicalFonts.get("YouYuan"));
fontMapper.put("华文宋体", PhysicalFonts.get("STSong"));
fontMapper.put("华文中宋", PhysicalFonts.get("STZhongsong"));
fontMapper.put("等线", PhysicalFonts.get("SimSun"));
fontMapper.put("等线 Light", PhysicalFonts.get("SimSun"));
fontMapper.put("华文琥珀", PhysicalFonts.get("STHupo"));
fontMapper.put("华文隶书", PhysicalFonts.get("STLiti"));
fontMapper.put("华文新魏", PhysicalFonts.get("STXinwei"));
fontMapper.put("华文彩云", PhysicalFonts.get("STCaiyun"));
fontMapper.put("方正姚体", PhysicalFonts.get("FZYaoti"));
fontMapper.put("方正舒体", PhysicalFonts.get("FZShuTi"));
fontMapper.put("华文细黑", PhysicalFonts.get("STXihei"));
fontMapper.put("宋体扩展", PhysicalFonts.get("simsun-extB"));
fontMapper.put("仿宋_GB2312", PhysicalFonts.get("FangSong_GB2312"));
fontMapper.put("新細明體", PhysicalFonts.get("SimSun"));
//解决宋体(正文)和宋体(标题)的乱码问题
PhysicalFonts.put("PMingLiU", PhysicalFonts.get("SimSun"));
PhysicalFonts.put("新細明體", PhysicalFonts.get("SimSun"));
//宋体&新宋体
PhysicalFont simsunFont = PhysicalFonts.get("SimSun");
fontMapper.put("SimSun", simsunFont);
FOSettings foSettings = Docx4J.createFOSettings(); FOSettings foSettings = Docx4J.createFOSettings();
foSettings.setWmlPackage(wordMLPackage); foSettings.setWmlPackage(wordMLPackage);
Docx4J.toFO(foSettings, os, Docx4J.FLAG_EXPORT_PREFER_XSL); Docx4J.toFO(foSettings, os, Docx4J.FLAG_EXPORT_PREFER_XSL);