Browse Source

Merge branch 'dev_grid_platform' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev

master
jianjun 4 years ago
parent
commit
867b6aebb4
  1. 82
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java

82
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.BaseDisputeProcessService;
import com.epmet.opendata.service.ExDeptService; import com.epmet.opendata.service.ExDeptService;
import com.epmet.opendata.service.ExUserService; import com.epmet.opendata.service.ExUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -47,6 +48,7 @@ import java.util.stream.Collectors;
* @author generator generator@elink-cn.com * @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-15 * @since v1.0.0 2021-10-15
*/ */
@Slf4j
@Service @Service
public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputeProcessDao, BaseDisputeProcessEntity> implements BaseDisputeProcessService { public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputeProcessDao, BaseDisputeProcessEntity> implements BaseDisputeProcessService {
@Resource @Resource
@ -90,44 +92,50 @@ public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputePr
} }
private void saveEvent(EventInfoFormDTO formDTO, Map<String, Integer> deptMap, Map<String, Integer> userMap, List<EventInfoResultDTO> list) { private void saveEvent(EventInfoFormDTO formDTO, Map<String, Integer> deptMap, Map<String, Integer> userMap, List<EventInfoResultDTO> list) {
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
log.warn("no event data to save table base_conflicts_resolve");
return;
}
List<BaseConflictsResolveEntity> resolveList = list.stream().map(item -> { List<BaseConflictsResolveEntity> resolveList = list.stream().map(item -> {
BaseConflictsResolveEntity entity = new BaseConflictsResolveEntity(); BaseConflictsResolveEntity entity = new BaseConflictsResolveEntity();
entity.setId(item.getId().concat("_PY")); entity.setId(item.getId().concat("_PY"));
entity.setCustomerId(item.getCustomerId()); entity.setCustomerId(item.getCustomerId());
entity.setGridId(deptMap.get(item.getOrgId())); entity.setGridId(deptMap.get(item.getOrgId()));
entity.setGridName(item.getOrgName()); entity.setGridName(item.getOrgName());
entity.setEventName(item.getEventName()); entity.setEventName(item.getEventName());
entity.setHappenDate(item.getHappenDate()); entity.setHappenDate(item.getHappenDate());
entity.setHappenPlace(item.getHappenPlace()); entity.setHappenPlace(item.getHappenPlace());
String eventDescription = item.getEventDescription(); String eventDescription = item.getEventDescription();
//如果不为空 长度控制1000以内 //如果不为空 长度控制1000以内
if (StringUtils.isNotBlank(eventDescription) && eventDescription.length() > NumConstant.ONE_THOUSAND){ if (StringUtils.isNotBlank(eventDescription) && eventDescription.length() > NumConstant.ONE_THOUSAND) {
eventDescription = eventDescription.substring(NumConstant.ZERO,NumConstant.ONE_THOUSAND); eventDescription = eventDescription.substring(NumConstant.ZERO, NumConstant.ONE_THOUSAND);
} }
entity.setEventDescription(eventDescription); entity.setEventDescription(eventDescription);
entity.setLng(null == item.getLng()?null:item.getLng().toPlainString()); entity.setLng(null == item.getLng() ? null : item.getLng().toPlainString());
entity.setLat(null == item.getLat()?null:item.getLat().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.setCreateBy(null == userMap.get(item.getReporterId()) ? null : String.valueOf(userMap.get(item.getReporterId())));
entity.setCreateDate(item.getReportTime()); entity.setCreateDate(item.getReportTime());
entity.setUpdateDate(new Date()); entity.setUpdateDate(new Date());
entity.setStatus(item.getStatus()); entity.setStatus(item.getStatus());
//业务不确定 //业务不确定
if (("03").equals(item.getStatus())) { if (("03").equals(item.getStatus())) {
entity.setSuccessfulOrNot("Y"); entity.setSuccessfulOrNot("Y");
} }
entity.setEventNo(("py_").concat(item.getId())); //业务不包含 一级分类里 如果是03 矛盾纠纷 则涉及人数写2(目前业务不支持 所以应产品需求 填2)
entity.setFirstEventCategory(item.getParentEventCategory()); if ("03".equals(item.getParentEventCategory())) {
entity.setSource("01"); entity.setNumberInvolved(NumConstant.TWO);
entity.setSecondEventCategory(item.getEventCategory()); }
entity.setResolveWay(item.getWaysOfResolving()); entity.setEventNo(("py_").concat(item.getId()));
entity.setResolveGridLevel(item.getCompleteLevel()); entity.setFirstEventCategory(item.getParentEventCategory());
entity.setResolveTime(item.getCompleteTime()); entity.setSource("01");
return entity; entity.setSecondEventCategory(item.getEventCategory());
}).collect(Collectors.toList()); 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());
}
} }
} }

Loading…
Cancel
Save