From 077f5381ccede7171dda29613128e74bebe69cd9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 8 Dec 2021 14:00:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E7=BA=A7=E5=88=86=E7=B1=BB=E9=87=8C?= =?UTF-8?q?=20=E5=A6=82=E6=9E=9C=E6=98=AF03=20=E7=9F=9B=E7=9B=BE=E7=BA=A0?= =?UTF-8?q?=E7=BA=B7=20=E5=88=99=E6=B6=89=E5=8F=8A=E4=BA=BA=E6=95=B0?= =?UTF-8?q?=E5=86=992=EF=BC=88=E7=9B=AE=E5=89=8D=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E4=B8=8D=E6=94=AF=E6=8C=81=20=E6=89=80=E4=BB=A5=E5=BA=94?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=9C=80=E6=B1=82=20=E5=A1=AB2=EF=BC=89?= =?UTF-8?q?=EF=BC=9B=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E5=8F=AF?= =?UTF-8?q?=E8=AF=BB=E6=80=A7=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/BaseDisputeProcessServiceImpl.java | 86 ++++++++++--------- 1 file changed, 45 insertions(+), 41 deletions(-) diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java index a7e00cf9b7..e51258fade 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java @@ -31,6 +31,7 @@ import com.epmet.opendata.service.BaseConflictsResolveService; import com.epmet.opendata.service.BaseDisputeProcessService; import com.epmet.opendata.service.ExDeptService; import com.epmet.opendata.service.ExUserService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -47,6 +48,7 @@ import java.util.stream.Collectors; * @author generator generator@elink-cn.com * @since v1.0.0 2021-10-15 */ +@Slf4j @Service public class BaseDisputeProcessServiceImpl extends BaseServiceImpl implements BaseDisputeProcessService { @Resource @@ -90,48 +92,50 @@ public class BaseDisputeProcessServiceImpl extends BaseServiceImpl deptMap, Map userMap, List list) { - if (CollectionUtils.isNotEmpty(list)) { + if (CollectionUtils.isEmpty(list)) { + log.warn("no event data to save table base_conflicts_resolve"); + return; + } - List resolveList = list.stream().map(item -> { - BaseConflictsResolveEntity entity = new BaseConflictsResolveEntity(); - entity.setId(item.getId().concat("_PY")); - entity.setCustomerId(item.getCustomerId()); - entity.setGridId(deptMap.get(item.getOrgId())); - entity.setGridName(item.getOrgName()); - entity.setEventName(item.getEventName()); - entity.setHappenDate(item.getHappenDate()); - entity.setHappenPlace(item.getHappenPlace()); - String eventDescription = item.getEventDescription(); - //如果不为空 长度控制1000以内 - if (StringUtils.isNotBlank(eventDescription) && eventDescription.length() > NumConstant.ONE_THOUSAND){ - eventDescription = eventDescription.substring(NumConstant.ZERO,NumConstant.ONE_THOUSAND); - } - entity.setEventDescription(eventDescription); - entity.setLng(null == item.getLng()?null:item.getLng().toPlainString()); - entity.setLat(null == item.getLat()?null:item.getLat().toPlainString()); - entity.setCreateBy(null == userMap.get(item.getReporterId())?null:String.valueOf(userMap.get(item.getReporterId()))); - entity.setCreateDate(item.getReportTime()); - entity.setUpdateDate(new Date()); - entity.setStatus(item.getStatus()); - //业务不确定 - if (("03").equals(item.getStatus())) { - entity.setSuccessfulOrNot("Y"); - } - //一级分类里 如果是03 矛盾纠纷 则涉及人数写2(目前业务不支持 所以应产品需求 填2) - if ("03".equals(item.getParentEventCategory())){ - entity.setNumberInvolved(NumConstant.TWO); - } - entity.setEventNo(("py_").concat(item.getId())); - entity.setFirstEventCategory(item.getParentEventCategory()); - entity.setSource("01"); - entity.setSecondEventCategory(item.getEventCategory()); - entity.setResolveWay(item.getWaysOfResolving()); - entity.setResolveGridLevel(item.getCompleteLevel()); - entity.setResolveTime(item.getCompleteTime()); - return entity; - }).collect(Collectors.toList()); + List resolveList = list.stream().map(item -> { + BaseConflictsResolveEntity entity = new BaseConflictsResolveEntity(); + entity.setId(item.getId().concat("_PY")); + entity.setCustomerId(item.getCustomerId()); + entity.setGridId(deptMap.get(item.getOrgId())); + entity.setGridName(item.getOrgName()); + entity.setEventName(item.getEventName()); + entity.setHappenDate(item.getHappenDate()); + entity.setHappenPlace(item.getHappenPlace()); + String eventDescription = item.getEventDescription(); + //如果不为空 长度控制1000以内 + if (StringUtils.isNotBlank(eventDescription) && eventDescription.length() > NumConstant.ONE_THOUSAND) { + eventDescription = eventDescription.substring(NumConstant.ZERO, NumConstant.ONE_THOUSAND); + } + entity.setEventDescription(eventDescription); + entity.setLng(null == item.getLng() ? null : item.getLng().toPlainString()); + entity.setLat(null == item.getLat() ? null : item.getLat().toPlainString()); + entity.setCreateBy(null == userMap.get(item.getReporterId()) ? null : String.valueOf(userMap.get(item.getReporterId()))); + entity.setCreateDate(item.getReportTime()); + entity.setUpdateDate(new Date()); + entity.setStatus(item.getStatus()); + //业务不确定 + if (("03").equals(item.getStatus())) { + entity.setSuccessfulOrNot("Y"); + } + //业务不包含 一级分类里 如果是03 矛盾纠纷 则涉及人数写2(目前业务不支持 所以应产品需求 填2) + if ("03".equals(item.getParentEventCategory())) { + entity.setNumberInvolved(NumConstant.TWO); + } + entity.setEventNo(("py_").concat(item.getId())); + entity.setFirstEventCategory(item.getParentEventCategory()); + entity.setSource("01"); + entity.setSecondEventCategory(item.getEventCategory()); + entity.setResolveWay(item.getWaysOfResolving()); + entity.setResolveGridLevel(item.getCompleteLevel()); + entity.setResolveTime(item.getCompleteTime()); + return entity; + }).collect(Collectors.toList()); - baseConflictsResolveService.saveOrUpdateBatch(resolveList, formDTO.getPageSize()); - } + baseConflictsResolveService.saveOrUpdateBatch(resolveList, formDTO.getPageSize()); } }