Browse Source

【服务项目】发起服务接口-第一次完善

feature/teamB_zz_wgh
wangxianzhang 3 years ago
parent
commit
a1e979db02
  1. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java
  2. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java
  3. 31
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java

@ -2,7 +2,6 @@ package com.epmet.dto.form;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.util.List; import java.util.List;
@Data @Data
@ -23,10 +22,10 @@ public class ServiceProjectFeedbackFormDTO {
private String longitude; private String longitude;
private String latitude; private String latitude;
private String address; private String address;
private List<Feedback> attachmentList; private List<Attachment> attachmentList;
@Data @Data
public static class Feedback { public static class Attachment {
private String attachmentName; private String attachmentName;
private String attachmentFormat; private String attachmentFormat;
private String attachmentType; private String attachmentType;

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java

@ -1,5 +1,7 @@
package com.epmet.entity; package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
@ -24,6 +26,7 @@ public class IcServiceProjectAttachmentEntity extends BaseEpmetEntity {
/** /**
* 客户ID * 客户ID
*/ */
@TableField(fill = FieldFill.INSERT)
private String customerId; private String customerId;
/** /**

31
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java

@ -36,7 +36,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* *
@ -200,7 +199,7 @@ public class IcServiceRecordServiceImpl extends BaseServiceImpl<IcServiceRecordD
}); });
// 3.反馈 // 3.反馈
if (input == null) { if (feedbackDto == null) {
return; return;
} }
@ -219,9 +218,11 @@ public class IcServiceRecordServiceImpl extends BaseServiceImpl<IcServiceRecordD
serviceFeedbackDao.insert(feedbackEntity); serviceFeedbackDao.insert(feedbackEntity);
// 4.反馈附件列表 // 4.反馈附件列表
List<ServiceProjectFeedbackFormDTO.Feedback> attachmentList = feedbackDto.getAttachmentList(); List<ServiceProjectFeedbackFormDTO.Attachment> attachmentList = feedbackDto.getAttachmentList();
if (CollectionUtils.isNotEmpty(attachmentList)) { if (CollectionUtils.isNotEmpty(attachmentList)) {
attachmentList.forEach(a -> { for (int i = 0; i < attachmentList.size(); i++) {
ServiceProjectFeedbackFormDTO.Attachment a = attachmentList.get(i);
IcServiceProjectAttachmentEntity at = new IcServiceProjectAttachmentEntity(); IcServiceProjectAttachmentEntity at = new IcServiceProjectAttachmentEntity();
at.setAttachmentFormat(a.getAttachmentFormat()); at.setAttachmentFormat(a.getAttachmentFormat());
at.setAttachmentName(a.getAttachmentName()); at.setAttachmentName(a.getAttachmentName());
@ -229,11 +230,12 @@ public class IcServiceRecordServiceImpl extends BaseServiceImpl<IcServiceRecordD
at.setAttachmentUrl(a.getAttachmentUrl()); at.setAttachmentUrl(a.getAttachmentUrl());
at.setDuration(0); at.setDuration(0);
at.setIcServiceId(input.getServiceProjectId()); at.setIcServiceId(input.getServiceProjectId());
// todo 需要审核吗 // 根本不需要审核,逗你玩
at.setReason(null); at.setReason(null);
at.setStatus(null); at.setStatus("auto_passed");
at.setSort(i);
serviceProjectAttachmentDao.insert(at); serviceProjectAttachmentDao.insert(at);
}); }
} }
} }
@ -254,9 +256,19 @@ public class IcServiceRecordServiceImpl extends BaseServiceImpl<IcServiceRecordD
EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getCode(),
msg, msg); msg, msg);
return new String[]{ neighborHoodDTO.getAgencyPids().concat(":").concat(neighborHoodDTO.getId()), GridInfoCache gridOfNeighborhood = CustomerOrgRedis.getGridInfo(neighborHoodDTO.getGridId());
String agencyPids = neighborHoodDTO.getAgencyPids();
String agencyId = neighborHoodDTO.getAgencyId();
String gridId = gridOfNeighborhood.getId();
return new String[]{ agencyPids.concat(":")
.concat(agencyId).concat(":")
.concat(gridId).concat(":")
.concat(neighborHoodDTO.getId()),
neighborHoodDTO.getNeighborHoodName() }; neighborHoodDTO.getNeighborHoodName() };
} else if ("agency".equals(scopeObjectType)) { } else if ("agency".equals(scopeObjectType)) {
// 组织的pids是到父级组织
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(scopeObjectId); AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(scopeObjectId);
if ("0".equals(agencyInfo.getPid())) { if ("0".equals(agencyInfo.getPid())) {
return new String[]{ agencyInfo.getId(), agencyInfo.getOrganizationName() }; return new String[]{ agencyInfo.getId(), agencyInfo.getOrganizationName() };
@ -264,7 +276,8 @@ public class IcServiceRecordServiceImpl extends BaseServiceImpl<IcServiceRecordD
return new String[]{ agencyInfo.getPids().concat(":").concat(agencyInfo.getPid()), agencyInfo.getOrganizationName() }; return new String[]{ agencyInfo.getPids().concat(":").concat(agencyInfo.getPid()), agencyInfo.getOrganizationName() };
} else if ("grid".equals(scopeObjectType)) { } else if ("grid".equals(scopeObjectType)) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(scopeObjectId); GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(scopeObjectId);
return new String[]{ gridInfo.getPids().concat(":").concat(gridInfo.getPid()), gridInfo.getGridName() }; // 网格的pids是到社区的
return new String[]{ gridInfo.getPids().concat(":").concat(gridInfo.getId()), gridInfo.getGridName() };
} else { } else {
String msg = String.format("【服务项目】-发起服务-范围type未知:scopeObjectType:%s,scopeObjectId:%s", scopeObjectType, scopeObjectId); String msg = String.format("【服务项目】-发起服务-范围type未知:scopeObjectType:%s,scopeObjectId:%s", scopeObjectType, scopeObjectId);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg);

Loading…
Cancel
Save