From 2cb8f49b8b282e45ec2dbef8eabfeb69b9614a8a Mon Sep 17 00:00:00 2001 From: liao Date: Mon, 6 Nov 2023 11:29:17 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/LawsAsmsOpenApiServiceImpl.java | 6 ++-- .../impl/SynchronizationAsmsService.java | 29 ++++++++++++++----- .../fb/common/ProcessDefinitionKey.java | 2 +- .../impl/ProcessFbEntryChangeServiceImpl.java | 18 ++++++++++++ 4 files changed, 43 insertions(+), 12 deletions(-) diff --git a/laws-modules-docking/src/main/java/com/jero/modules/docking/asms/service/impl/LawsAsmsOpenApiServiceImpl.java b/laws-modules-docking/src/main/java/com/jero/modules/docking/asms/service/impl/LawsAsmsOpenApiServiceImpl.java index a4ad5963..e85299ae 100644 --- a/laws-modules-docking/src/main/java/com/jero/modules/docking/asms/service/impl/LawsAsmsOpenApiServiceImpl.java +++ b/laws-modules-docking/src/main/java/com/jero/modules/docking/asms/service/impl/LawsAsmsOpenApiServiceImpl.java @@ -460,9 +460,9 @@ public class LawsAsmsOpenApiServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.select(LawsDomesticStandard::getStandardNumber); + List lawsDomesticStandards = lawsDomesticStandardService.list(queryWrapper); + List dupCodeList; + if (CollectionUtils.isNotEmpty(lawsDomesticStandards)) { + dupCodeList = lawsDomesticStandards.stream().map(LawsDomesticStandard::getStandardNumber).collect(Collectors.toList()); + } else { + dupCodeList = new ArrayList<>(); + } + List lawsAsmsDomesticList = new ArrayList(); mapList.forEach(eMap -> { String createTimeString = eMap.get("createTime"); @@ -124,11 +135,13 @@ public class SynchronizationAsmsService { Date yesterday = DateUtil.getDateAddDays(new Date(), -1); // 创建时间为昨天的数据 if (createTime.after(DateUtil.getDayStart(yesterday)) && createTime.before(DateUtil.getDayEnd(yesterday))) { - LawsAsmsDomestic lawsAsmsDomestic = JSONObject.parseObject(JSONObject.toJSONString(eMap), LawsAsmsDomestic.class); - lawsAsmsDomestic.setCreateTimeString(createTimeString); - lawsAsmsDomestic.setUpdateTimeString(eMap.get("updateTime")); - lawsAsmsDomestic.setFocalPointName(eMap.get("focalPoint")); - lawsAsmsDomesticList.add(lawsAsmsDomestic); + if (!dupCodeList.contains((String) eMap.get("code"))) { + LawsAsmsDomestic lawsAsmsDomestic = JSONObject.parseObject(JSONObject.toJSONString(eMap), LawsAsmsDomestic.class); + lawsAsmsDomestic.setCreateTimeString(createTimeString); + lawsAsmsDomestic.setUpdateTimeString(eMap.get("updateTime")); + lawsAsmsDomestic.setFocalPointName(eMap.get("focalPoint")); + lawsAsmsDomesticList.add(lawsAsmsDomestic); + } } }); if (CollectionUtils.isEmpty(lawsAsmsDomesticList)) { @@ -205,9 +218,9 @@ public class SynchronizationAsmsService { // 代替标准号 lawsReplacedStandardService.addRelation(lawsAsmsDomestic.getReplaceCode(), lawsAsmsDomestic.getCode(), 1); // 标准性质 - itemValues = getItemValues(lawsAsmsDomestic.getStandardNature(), - "1695010513489833985", sysDictItemList); - lawsDomesticStandard.setStandardProperty(itemValues); + /*itemValues = getItemValues(lawsAsmsDomestic.getStandardNature(), + "1695010513489833985", sysDictItemList);*/ + lawsDomesticStandard.setStandardProperty("SN002"); // 标准状态 itemValues = getItemValues(lawsAsmsDomestic.getStandardStatus(), "1695991936599715842", sysDictItemList); diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/common/ProcessDefinitionKey.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/common/ProcessDefinitionKey.java index f5c3d5f2..bfd9645c 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/common/ProcessDefinitionKey.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/common/ProcessDefinitionKey.java @@ -9,6 +9,6 @@ public class ProcessDefinitionKey { private ProcessDefinitionKey() {} - public static final String FB_ENTRY_CHANGE = "fb-entry-change"; + public static final String FB_ENTRY_CHANGE = "fb-entry-change"; // 标准法规入库/变更流程 } diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/service/impl/ProcessFbEntryChangeServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/service/impl/ProcessFbEntryChangeServiceImpl.java index de59e3ac..82ddac4a 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/service/impl/ProcessFbEntryChangeServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/service/impl/ProcessFbEntryChangeServiceImpl.java @@ -7,7 +7,9 @@ import com.jero.modules.activiti.process.fb.mapper.ProcessFbEntryChangeMapper; import com.jero.modules.activiti.process.fb.service.IProcessFbEntryChangeService; import com.jero.modules.activiti.process.fb.service.IProcessHandleService; import com.jero.modules.activiti.process.fb.vo.ProcessInfoVO; +import com.jero.modules.laws.common.constant.FieldCommon; import com.jero.modules.laws.common.constant.ResultCommon; +import com.jero.modules.laws.common.service.ILawsCommonService; import com.jero.modules.laws.common.util.CurrentUserUtil; import com.jero.modules.laws.dataCenter.entity.LawsDataCenterFile; import lombok.extern.slf4j.Slf4j; @@ -18,6 +20,7 @@ import com.jero.common.exception.JeroBootException; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import javax.annotation.Resource; +import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -35,6 +38,8 @@ public class ProcessFbEntryChangeServiceImpl extends ServiceImpl parameterMap = new HashMap<>(); + parameterMap.put(FieldCommon.STANDARD_CLASS, processFbEntryChange.getStandardClass()); + parameterMap.put(FieldCommon.STANDARD_NUMBER_TEMP, processFbEntryChange.getStandardNumberTemp()); + parameterMap.put(FieldCommon.YEAR_NUMBER, processFbEntryChange.getYearNumber()); + lawsCommonService.setStandardNumber(parameterMap); + processFbEntryChange.setStandardNumber((String) parameterMap.get(FieldCommon.STANDARD_NUMBER)); + } + /** * @Author: liao * @Date: 2023/11/2 16:34