fix(asms): 同步问题修复
This commit is contained in:
+14
@@ -437,4 +437,18 @@ public class DocumentSplitController {
|
||||
* documentSplitService.exportDocumentSplitDetail(parameter, request, response);
|
||||
* }
|
||||
*/
|
||||
|
||||
/**
|
||||
* 标准拆分详情-重新处理条文详情
|
||||
* @param isAsmsImport
|
||||
* @param serialNumber
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "标准拆分详情-重新处理条文详情")
|
||||
@ApiOperation(value = "标准拆分详情-重新处理条文详情")
|
||||
@GetMapping("/disposeItemVal")
|
||||
public Result<T> disposeItemVal(String isAsmsImport,String serialNumber) {
|
||||
documentSplitService.disposeItemVal(isAsmsImport, serialNumber);
|
||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
||||
}
|
||||
}
|
||||
|
||||
+7
@@ -216,4 +216,11 @@ public interface IDocumentSplitService {
|
||||
* @param jsonObject
|
||||
*/
|
||||
void batchSplit(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 重新处理条文详情
|
||||
* @param isAsmsImport
|
||||
* @param serialNumber
|
||||
*/
|
||||
void disposeItemVal(String isAsmsImport, String serialNumber);
|
||||
}
|
||||
|
||||
+70
-1
@@ -51,6 +51,7 @@ import com.jero.modules.split.enums.SplitFileTypeTypeEnum;
|
||||
import com.jero.modules.split.mapper.SarFileSplitItemsValEOMapper;
|
||||
import com.jero.modules.split.page.SarFileSplitMenuEOPage;
|
||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||
import com.jero.modules.split.service.ISarFileSplitItemsValEOService;
|
||||
import com.jero.modules.split.service.ISarFileSplitMenuEOService;
|
||||
import com.jero.modules.split.service.impl.FileSpiltService;
|
||||
import com.jero.modules.sys.entity.LawsEnterpriseStandardLevel;
|
||||
@@ -79,6 +80,10 @@ import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.select.Elements;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -127,6 +132,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
private final PartNameService partNameService;
|
||||
private final ILawsLabelDatabaseService lawsLabelDatabaseService;
|
||||
private final ISysBaseAPI sysBaseAPI;
|
||||
private final ISarFileSplitItemsValEOService sarFileSplitItemsValEOService;
|
||||
private static final String INFO_ID = "info_id";
|
||||
private static final String ID = "id";
|
||||
private static final String IDS = "ids";
|
||||
@@ -156,7 +162,8 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
ILawsGradeService lawsGradeService,
|
||||
PartNameService partNameService,
|
||||
ILawsLabelDatabaseService lawsLabelDatabaseService,
|
||||
ISysBaseAPI sysBaseAPI) {
|
||||
ISysBaseAPI sysBaseAPI,
|
||||
ISarFileSplitItemsValEOService sarFileSplitItemsValEOService) {
|
||||
this.documentSplitMapper = documentSplitMapper;
|
||||
this.sarFileSplitInfoService = sarFileSplitInfoService;
|
||||
this.lawsCommonMapper = lawsCommonMapper;
|
||||
@@ -176,6 +183,7 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
this.partNameService = partNameService;
|
||||
this.lawsLabelDatabaseService = lawsLabelDatabaseService;
|
||||
this.sysBaseAPI = sysBaseAPI;
|
||||
this.sarFileSplitItemsValEOService = sarFileSplitItemsValEOService;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
@@ -1361,6 +1369,67 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disposeItemVal(String isAsmsImport, String serialNumber) {
|
||||
LambdaQueryWrapper<SarFileSplitInfoEO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(StringUtils.isNotBlank(isAsmsImport), SarFileSplitInfoEO::getIsAsmsImport, isAsmsImport);
|
||||
queryWrapper.eq(StringUtils.isNotBlank(serialNumber), SarFileSplitInfoEO::getSerialNumber, serialNumber);
|
||||
List<SarFileSplitInfoEO> list = sarFileSplitInfoService.list(queryWrapper);
|
||||
|
||||
for (SarFileSplitInfoEO sarFileSplitInfoEO : list) {
|
||||
// 查询条文表
|
||||
List<LawsDocumentSplit> lawsDocumentSplits = lawsDocumentSplitMapper.selectList(
|
||||
new LambdaQueryWrapper<LawsDocumentSplit>()
|
||||
.in(LawsDocumentSplit::getInfoId, sarFileSplitInfoEO.getId()));
|
||||
for (LawsDocumentSplit lawsDocumentSplit : lawsDocumentSplits) {
|
||||
// 先删除旧条文详情
|
||||
sarFileSplitItemsValEOMapper.delete(
|
||||
new LambdaQueryWrapper<SarFileSplitItemsValEO>()
|
||||
.eq(SarFileSplitItemsValEO::getItemId, lawsDocumentSplit.getId()));
|
||||
|
||||
// 构建新条文详情
|
||||
if (StringUtils.isNotBlank(lawsDocumentSplit.getItemContent())){
|
||||
Document document = Jsoup.parse(lawsDocumentSplit.getItemContent());
|
||||
Elements elements = document.select("p:not(table p):not(:empty), img, table");
|
||||
if (elements.isEmpty() && StringUtils.isNotBlank(lawsDocumentSplit.getItemContent())){
|
||||
SarFileSplitItemsValEO sarFileSplitItemsValEO = new SarFileSplitItemsValEO();
|
||||
sarFileSplitItemsValEO.setId(UUIDUtils.randomUUID20());
|
||||
sarFileSplitItemsValEO.setItemId(lawsDocumentSplit.getId());
|
||||
sarFileSplitItemsValEO.setDisplaySeq(1);
|
||||
sarFileSplitItemsValEO.setValidFlag(0);
|
||||
sarFileSplitItemsValEO.setType("TEXT");
|
||||
sarFileSplitItemsValEO.setItemContent(lawsDocumentSplit.getItemContent());
|
||||
sarFileSplitItemsValEOService.insertSelective(sarFileSplitItemsValEO);
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < elements.size(); i++) {
|
||||
Element element = elements.get(i);
|
||||
if (StringUtils.isBlank(element.text()) && "p".equals(element.tagName())){
|
||||
continue;
|
||||
}
|
||||
SarFileSplitItemsValEO sarFileSplitItemsValEO = new SarFileSplitItemsValEO();
|
||||
if ("table".equals(element.tagName())){
|
||||
sarFileSplitItemsValEO.setType("TABLE");
|
||||
sarFileSplitItemsValEO.setItemContent(element.outerHtml());
|
||||
}else if ("img".equals(element.tagName())){
|
||||
sarFileSplitItemsValEO.setType("IMG");
|
||||
sarFileSplitItemsValEO.setItemContent(element.attr("src"));
|
||||
}else if ("p".equals(element.tagName())){
|
||||
sarFileSplitItemsValEO.setType("TEXT");
|
||||
sarFileSplitItemsValEO.setItemContent(element.text());
|
||||
}
|
||||
sarFileSplitItemsValEO.setId(UUIDUtils.randomUUID20());
|
||||
sarFileSplitItemsValEO.setItemId(lawsDocumentSplit.getId());
|
||||
sarFileSplitItemsValEO.setItemContent(element.outerHtml());
|
||||
sarFileSplitItemsValEO.setDisplaySeq(i + 1);
|
||||
sarFileSplitItemsValEO.setValidFlag(0);
|
||||
sarFileSplitItemsValEOService.insertSelective(sarFileSplitItemsValEO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void manageData(Map<String, Object> resultMap, StringBuilder fieldsBuilder, List<String> valuesList) {
|
||||
// 所有key(字段名)
|
||||
resultMap.forEach((k, v) -> {
|
||||
|
||||
Reference in New Issue
Block a user