diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.19__add_dict.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.19__add_dict.sql new file mode 100644 index 0000000000..70705df799 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.19__add_dict.sql @@ -0,0 +1,11 @@ +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1000000000000000014', 'ic_service_type', '服务类别', '', '20', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); + +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000000', '1000000000000000014', '社区养老', '00', '0', '', '0', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000001', '1000000000000000014', '社会保障', '01', '0', '', '1', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000002', '1000000000000000014', '社区救助', '02', '0', '', '2', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000003', '1000000000000000014', '健康医疗', '03', '0', '', '3', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000004', '1000000000000000014', '社区安全', '04', '0', '', '4', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000005', '1000000000000000014', '社区卫生', '05', '0', '', '5', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000006', '1000000000000000014', '社区环境', '06', '0', '', '6', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000007', '1000000000000000014', '社区治安', '07', '0', '', '7', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('3100000000000000008', '1000000000000000014', '社区文化', '08', '0', '', '8', '0', '0', '', '2022-05-27 16:23:27', '', '2022-05-27 16:23:27'); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java index a813af8152..6c8f4271ce 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java @@ -25,6 +25,7 @@ public enum DictTypeEnum { ITEM_TYPE_QUERY("item_type_query","居民信息组件查询方式",14), SELF_ORG_CATEGORY("self_org_category","社区自组织分类",15), IC_EVENT_SOURCE_TYPE("ic_event_source_type","事件管理",19), + IC_SERVICE_TYPE("ic_service_type","服务类别",20), ; private final String code; diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index add7341a75..d4bdb13bb2 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -203,6 +203,7 @@ INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = u.CUSTOMER_ID AND org.DEPT_ID = u.ORG_ID AND org.DEL_FLAG = '0' + WHERE diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceOrgDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceOrgDTO.java new file mode 100644 index 0000000000..42d8fcf19b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceOrgDTO.java @@ -0,0 +1,115 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class IcServiceOrgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 所属组织机构Id + */ + private String agencyId; + + /** + * agencyId的所有上级,包含自己 + */ + private String agencyIdPath; + + /** + * 服务类别【字典表 ic_service_type】多个值逗号分隔 + */ + private String serviceType; + + /** + * 服务组织名称 + */ + private String orgName; + + /** + * 组织描述 + */ + private String orgDescribe; + + /** + * 负责人姓名 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalMobile; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * 备注 + */ + private String remark; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectAttachmentDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectAttachmentDTO.java new file mode 100644 index 0000000000..6919112fde --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectAttachmentDTO.java @@ -0,0 +1,116 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class IcServiceProjectAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 事件Id + */ + private String icServiceId; + + private String attachTo; + + /** + * 附件名 + */ + private String attachmentName; + private String name; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + private String format; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + private String type; + + /** + * 附件地址 + */ + private String attachmentUrl; + private String url; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectDTO.java new file mode 100644 index 0000000000..3d3a6c733f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcServiceProjectDTO.java @@ -0,0 +1,104 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 服务项目管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class IcServiceProjectDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织ID的上级 + */ + private String pid; + + /** + * 组织ID的所有上级[包括自己] + */ + private String agencyIdPath; + + /** + * 服务类别值 + */ + private String serviceCategoryKey; + + /** + * 服务名称 + */ + private String serviceName; + + /** + * 服务内容 + */ + private String serviceContent; + + /** + * 政策级别,0市级;1区级;2街道级 + */ + private String policyLevel; + + /** + * 政策依据 + */ + private String policyGround; + + /** + * 启用状态,0启用,1禁用 + */ + private Integer enabled; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceEditFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceEditFormDTO.java new file mode 100644 index 0000000000..140e8269c1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceEditFormDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.form; + + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + +/** + * 【服务项目记录】修改 + */ +@Data +public class IcServiceEditFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "", groups = AddUserInternalGroup.class) + private String serviceRecordId; + private String principalName; + private String principalContact; + /** + * 服务时间 + */ + @NotNull(message = "起始服务时间不能为空", groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceTimeStart; + + /** + * 服务截止时间 + */ + @NotNull(message = "截止服务时间不能为空", groups = AddUserShowGroup.class) + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceTimeEnd; + + /** + * 备注 + */ + private String remark; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgAddEditFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgAddEditFormDTO.java new file mode 100644 index 0000000000..3b95afef3f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgAddEditFormDTO.java @@ -0,0 +1,71 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 服务组织新增/修改 + * @Author sun + */ +@Data +public class IcServiceOrgAddEditFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + public interface Del extends CustomerClientShowGroup { + } + + /** + * 服务组织Id + */ + @NotBlank(message = "服务组织Id不能为空", groups = {UpdateGroup.class, Del.class}) + private String icServiceOrgId; + /** + * 服务类型,多个值逗号分隔,字典值,字典key:ic_service_type + */ + @NotBlank(message = "服务类型不能为空", groups = {AddGroup.class}) + private String serviceType; + /** + * 服务组织名称 + */ + @NotBlank(message = "服务组织名称不能为空", groups = {AddGroup.class}) + private String orgName; + /** + * 组织描述 + */ + private String orgDescribe; + /** + * 负责人姓名 + */ + @NotBlank(message = "负责人姓名不能为空", groups = {AddGroup.class}) + private String principalName; + /** + * 联系方式 + */ + @NotBlank(message = "联系方式不能为空", groups = {AddGroup.class}) + private String principalMobile; + /** + * 经度 + */ + private String longitude; + /** + * 维度 + */ + private String latitude; + /** + * 服务地址 + */ + private String address; + /** + * 备注信息 + */ + private String remark; + + private String customerId; + private String userId; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgListFormDTO.java new file mode 100644 index 0000000000..b0cceaeb79 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcServiceOrgListFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【组织】服务组织列表--接口入参 + * @Author sun + */ +@Data +public class IcServiceOrgListFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + /** + * 服务类型,字典值 + */ + private String serviceType; + /** + * 服务组织名称 + */ + private String orgName; + /** + * 服务地址 + */ + private String address; + /** + * 备注信息 + */ + private String remark; + /** + * 页码 + */ + private Integer pageNo = 1; + /** + * 每页显示数量 + */ + private Integer pageSize = 20; + + private Boolean isPage = true; + private String icServiceOrgId; + private String customerId; + private String staffId; + private String agencyId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java new file mode 100644 index 0000000000..231ab79b95 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFeedbackFormDTO.java @@ -0,0 +1,57 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import java.util.List; + +@Data +public class ServiceProjectFeedbackFormDTO { + + /** + * 反馈接口分组 + */ + public interface FeedbackGroup {} + + /** + * 发起服务接口分组 + */ + public interface InitiateGroup {} + + @NotBlank(message = "服务记录id不能为空", groups = { FeedbackGroup.class }) + private String serviceRecordId; + private String serviceProjectId; + private String serviceGoal; + private String serviceEffect; + private Integer servicePeopleNumber; + /** + * 服务状态。in_service服务中;completed:已完成 + */ + @NotBlank(message = "服务状态不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String serviceStatus; + /** + * 满意度。不满意:bad、基本满意:good、非常满意:perfect + * 按理说,服务完成的时候才可以选,不完成应该不能选,可是谁知道呢,原型也没写 + */ + private String satisfaction; + private String longitude; + private String latitude; + private String address; + + @Valid + private List attachmentList; + + @Data + public static class Attachment { + + @NotBlank(message = "附件名称不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String attachmentName; + @NotBlank(message = "附件格式不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String attachmentFormat; + @NotBlank(message = "附件类型不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String attachmentType; + @NotBlank(message = "附件url不能为空", groups = { FeedbackGroup.class, InitiateGroup.class }) + private String attachmentUrl; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFormDTO.java new file mode 100644 index 0000000000..524628e95c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectFormDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.form; + +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/5/27 15:53 + * @DESC + */ +@Data +public class ServiceProjectFormDTO implements Serializable { + + private static final long serialVersionUID = -4573264697450644498L; + + public interface ServiceProjectAddForm{} + public interface ServiceProjectUpdateForm{} + + @NotBlank(message = "服务类别不能为空",groups = {ServiceProjectAddForm.class}) + private String serviceCategoryKey; + + @NotBlank(message = "服务名称不能为空",groups = {ServiceProjectAddForm.class,ServiceProjectUpdateForm.class}) + private String serviceName; + + @NotBlank(message = "服务内容不能为空",groups = {ServiceProjectAddForm.class,ServiceProjectUpdateForm.class}) + private String serviceContent; + + /** + * 政策依据 + */ + private String policyGround; + + /** + * 政策级别,0市级;1区级;2街道级 + */ + private String policyLevel; + + private String customerId; + + private String userId; + + @NotBlank(message = "serviceProjectId不能为空",groups = {ServiceProjectUpdateForm.class}) + private String serviceProjectId; + + /** + * 附件集合 + */ + private List attachmentList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java new file mode 100644 index 0000000000..ff265a8a44 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectListFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/5/27 16:42 + * @DESC + */ +@Data +public class ServiceProjectListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -6508966695564469253L; + + public interface ServiceProjectDetail{} + + private String serviceCategoryKey; + private String serviceName; + private String serviceContent; + private String policyGround; + private String customerId; + private String userId; + private String agencyId; + + @NotBlank(message = "serviceProjectId不能为空",groups = ServiceProjectDetail.class) + private String serviceProjectId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectRecordFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectRecordFormDTO.java new file mode 100644 index 0000000000..59d86bfac5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/ServiceProjectRecordFormDTO.java @@ -0,0 +1,66 @@ +package com.epmet.dto.form; + +import com.epmet.dto.result.IcServiceScopeDTO; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.util.Date; +import java.util.List; + +@Data +public class ServiceProjectRecordFormDTO { + + /** + * 发起服务 + */ + public interface Initiate {} + + @NotBlank(message = "服务类别key不能为空", groups = { Initiate.class }) + private String serviceCategoryKey; + + @NotBlank(message = "服务项目Id不能为空", groups = { Initiate.class }) + private String serviceProjectId; + + private String serviceProjectName; + + @NotBlank(message = "服务组织Id不能为空", groups = { Initiate.class }) + private String serviceOrgId; + + private String serviceOrgName; + + @NotEmpty(message = "发布范围不能为空", groups = { Initiate.class }) + private List serviceScope; + + @NotNull(message = "服务起始时间不能为空", groups = { Initiate.class }) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date serviceTimeStart; + + @NotNull(message = "服务结束时间不能为空", groups = { Initiate.class }) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date serviceTimeEnd; + private String serviceStatus; + private String satisfaction; + + private String principalName; + + private String principalContact; + + /** + * 备注 + */ + private String remark; + + @Valid + private ServiceProjectFeedbackFormDTO feedback; + + private Integer pageNo = 1; + private Integer pageSize = 20; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceFeedbackResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceFeedbackResDTO.java new file mode 100644 index 0000000000..394b5b6b40 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceFeedbackResDTO.java @@ -0,0 +1,64 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 服务记录反馈 + */ +@Data +public class IcServiceFeedbackResDTO implements Serializable { + + /** + * 反馈记录id + */ + private String feedBackId; + + /** + * 服务目标 + */ + private String serviceGoal; + + /** + * 服务效果 + */ + private String serviceEffect; + + /** + * 服务人数 + */ + // private Integer servicePeopleNumber; + + /** + * 满意度。满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + + /** + * 地址经度 + */ + private String longitude; + + /** + * 地址纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + private List attachmentList; + + @Data + public static class Attachment { + private String attachmentName; + private String attachmentFormat; + private String attachmentType; + private String attachmentUrl; + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgListResultDTO.java new file mode 100644 index 0000000000..30164b69c4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgListResultDTO.java @@ -0,0 +1,81 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 【组织】服务组织列表--接口返参 + * @Author sun + */ +@Data +public class IcServiceOrgListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 服务组织Id + */ + private String icServiceOrgId; + /** + * 组织Id + */ + private String agencyId; + /** + * 服务类别 + */ + private List serviceTypeList; + /** + * 服务类别,多个值逗号分隔 + */ + private String serviceType; + /** + * 服务类别,多个值顿号分隔 + */ + private String serviceTypeName; + /** + * 服务组织名称 + */ + private String orgName; + /** + * 组织描述 + */ + private String orgDescribe; + /** + * 负责人名称 + */ + private String principalName; + /** + * 负责人电话 + */ + private String principalMobile; + /** + * 经度 + */ + private String longitude; + /** + * 纬度 + */ + private String latitude; + /** + * 地址 + */ + private String address; + /** + * 备注 + */ + private String remark; + + @Data + public static class ServiceType { + /** + * 服务类别值 + */ + private String value; + /** + * 服务类别名 + */ + private String name; + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgSelectListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgSelectListResultDTO.java new file mode 100644 index 0000000000..30f5ef457b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceOrgSelectListResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【组织】服务组织列表_下拉框使用--接口返参 + * @Author sun + */ +@Data +public class IcServiceOrgSelectListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 服务组织Id + */ + private String icServiceOrgId; + /** + * 服务组织名称 + */ + private String orgName; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceRecDetailRes.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceRecDetailRes.java new file mode 100644 index 0000000000..d1ef78ab5f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceRecDetailRes.java @@ -0,0 +1,90 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +@Data +public class IcServiceRecDetailRes implements Serializable { + + + /** + * 联系方式 + */ + private String principalContact; + + /** + * 经办人姓名 + */ + private String principalName; + + /** + * 备注 + */ + private String remark; + + /** + * 服务类别ID + */ + private String serviceCategoryKey; + + /** + * 服务类别ID + */ + private String serviceCategoryName; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 服务组织名称 + */ + private String serviceOrgName; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务项目名称 + */ + private String serviceProjectName; + + /** + * 服务时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceTimeStart; + + /** + * 服务截止时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date serviceTimeEnd; + + /** + * in_service服务中;completed:已完成 + */ + private String serviceStatus; + + /** + * 发布范围 + */ + private List serviceScope; + + /** + * 服务人数 + */ + private Integer servicePeopleNumber; + + /** + * 反馈详情 + */ + private IcServiceFeedbackResDTO feedBack; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceScopeDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceScopeDTO.java new file mode 100644 index 0000000000..1a2be3dca0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcServiceScopeDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result; + + +import lombok.Data; + +@Data +public class IcServiceScopeDTO { + private String objectId; + private String objectName; + private String objectType; + /** + * 发布范围的组织ID PATH + */ + private String objectIdPath; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectListResultDTO.java new file mode 100644 index 0000000000..eadf11a78a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectListResultDTO.java @@ -0,0 +1,63 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/5/27 16:42 + * @DESC + */ +@Data +public class ServiceProjectListResultDTO implements Serializable { + + private static final long serialVersionUID = -6508966695564469113L; + + /** + * 服务类别 + */ + private String serviceCategory; + private String serviceCategoryKey; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务名称 + */ + private String serviceName; + + /** + * 服务内容 + */ + private String serviceContent; + + /** + * 政策依据 + */ + private String policyGround; + + /** + * 政策级别 + */ + private String policyLevel; + private String policyLevelName; + + private List attachmentList; + + public ServiceProjectListResultDTO() { + this.serviceCategory = ""; + this.serviceProjectId = ""; + this.serviceName = ""; + this.serviceContent = ""; + this.policyGround = ""; + this.policyLevel = ""; + this.policyLevelName = ""; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectRecordResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectRecordResultDTO.java new file mode 100644 index 0000000000..940a8ae9f1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceProjectRecordResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result; + +import lombok.Data; + +@Data +public class ServiceProjectRecordResultDTO { + private String serviceRecordId; + private String serviceCategoryKey; + private String serviceCategoryName; + private String serviceProjectId; + private String serviceProjectName; + private String serviceOrgId; + private String serviceOrgName; + private String serviceTimeStart; + private String serviceTimeEnd; + private String serviceStatus; + private String servicePeopleNumber; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index bc2955d8b7..af7bb32c5d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -132,6 +132,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 8 + 8 + + ${project.basedir}/src/main/java diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceOrgController.java new file mode 100644 index 0000000000..2232830346 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceOrgController.java @@ -0,0 +1,91 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcServiceOrgDTO; +import com.epmet.dto.form.IcServiceOrgAddEditFormDTO; +import com.epmet.dto.form.IcServiceOrgListFormDTO; +import com.epmet.dto.result.IcServiceOrgListResultDTO; +import com.epmet.dto.result.IcServiceOrgSelectListResultDTO; +import com.epmet.service.IcServiceOrgService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@RestController +@RequestMapping("icServiceOrg") +public class IcServiceOrgController { + + @Autowired + private IcServiceOrgService icServiceOrgService; + + @RequestMapping("list") + public Result> list(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgListFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icServiceOrgService.list(formDTO)); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcServiceOrgDTO data = icServiceOrgService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("add") + public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgAddEditFormDTO dto) { + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + icServiceOrgService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("edit") + public Result edit(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgAddEditFormDTO dto){ + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + dto.setCustomerId(tokenDto.getCustomerId()); + dto.setUserId(tokenDto.getUserId()); + icServiceOrgService.update(dto); + return new Result(); + } + + @PostMapping("del") + public Result delete(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgAddEditFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, IcServiceOrgAddEditFormDTO.Del.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icServiceOrgService.delete(formDTO); + return new Result(); + } + + @RequestMapping("detail") + public Result detail(@RequestBody IcServiceOrgListFormDTO formDTO) { + return new Result().ok(icServiceOrgService.detail(formDTO)); + } + + @RequestMapping("selectlist") + public Result> selectList(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgListFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + return new Result>().ok(icServiceOrgService.selectList(formDTO)); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectAttachmentController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectAttachmentController.java new file mode 100644 index 0000000000..07e07b0d92 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectAttachmentController.java @@ -0,0 +1,72 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import com.epmet.service.IcServiceProjectAttachmentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@RestController +@RequestMapping("icServiceProjectAttachment") +public class IcServiceProjectAttachmentController { + + @Autowired + private IcServiceProjectAttachmentService icServiceProjectAttachmentService; + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icServiceProjectAttachmentService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcServiceProjectAttachmentDTO data = icServiceProjectAttachmentService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcServiceProjectAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icServiceProjectAttachmentService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcServiceProjectAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icServiceProjectAttachmentService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icServiceProjectAttachmentService.delete(ids); + return new Result(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectController.java new file mode 100644 index 0000000000..abcf757f89 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceProjectController.java @@ -0,0 +1,244 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.IcServiceProjectDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.IcServiceRecDetailRes; +import com.epmet.dto.result.ServiceProjectListResultDTO; +import com.epmet.dto.result.ServiceProjectRecordResultDTO; +import com.epmet.entity.IcServiceRecordEntity; +import com.epmet.service.IcServiceProjectService; +import com.epmet.service.IcServiceRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 服务项目管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@RestController +@RequestMapping("icServiceProject") +public class IcServiceProjectController { + + @Autowired + private IcServiceProjectService icServiceProjectService; + @Autowired + private IcServiceRecordService icServiceRecordService; + + + @RequestMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = icServiceProjectService.page(params); + return new Result>().ok(page); + } + + @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + public Result get(@PathVariable("id") String id){ + IcServiceProjectDTO data = icServiceProjectService.get(id); + return new Result().ok(data); + } + + @NoRepeatSubmit + @PostMapping("save") + public Result save(@RequestBody IcServiceProjectDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + icServiceProjectService.save(dto); + return new Result(); + } + + @NoRepeatSubmit + @PostMapping("update") + public Result update(@RequestBody IcServiceProjectDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + icServiceProjectService.update(dto); + return new Result(); + } + + @PostMapping("delete") + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + icServiceProjectService.delete(ids); + return new Result(); + } + + /** + * Desc: 服务项目新增 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2022/5/27 16:04 + */ + @PostMapping("serviceProjectAdd") + public Result serviceProjectAdd(@LoginUser TokenDto tokenDto,@RequestBody ServiceProjectFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ServiceProjectFormDTO.ServiceProjectAddForm.class); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + icServiceProjectService.serviceProjectAdd(formDTO); + return new Result(); + } + + /** + * Desc: 服务项目列表 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:46 + */ + @PostMapping("serviceProjectList") + public Result serviceProjectList(@LoginUser TokenDto tokenDto,@RequestBody ServiceProjectListFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result().ok(icServiceProjectService.serviceProjectList(formDTO)); + } + + /** + * Desc: 服务项目详情 + * @param formDTO + * @author zxc + * @date 2022/5/30 15:46 + */ + @PostMapping("serviceProjectDetail") + public Result serviceProjectDetail(@RequestBody ServiceProjectListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ServiceProjectListFormDTO.ServiceProjectDetail.class); + return new Result().ok(icServiceProjectService.serviceProjectDetail(formDTO)); + } + + /** + * Desc: 修改【服务项目】 + * @param formDTO + * @author zxc + * @date 2022/5/30 09:36 + */ + @PostMapping("serviceProjectEdit") + public Result serviceProjectEdit(@RequestBody ServiceProjectFormDTO formDTO,@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, ServiceProjectFormDTO.ServiceProjectUpdateForm.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + icServiceProjectService.serviceProjectEdit(formDTO); + return new Result(); + } + + /** + * Desc: 上下架【服务项目】 + * @param ids + * @author zxc + * @date 2022/5/30 10:17 + */ + @PostMapping("serviceProjectEnabled") + public Result serviceProjectEnabled(@RequestBody List ids){ + icServiceProjectService.serviceProjectEnabled(ids); + return new Result(); + } + + /** + * http://yapi.elinkservice.cn/project/245/interface/api/7820 + * + * @param serviceId + * @return 【服务项目记录】取消:进行中的项目可以取消。删除该记录 + */ + @PostMapping("service/cancel/{service-id}") + public Result cancelService(@PathVariable("service-id") String serviceId) { + icServiceRecordService.cancelService(serviceId, "yzm"); + return new Result(); + } + + /** + * http://yapi.elinkservice.cn/project/245/interface/api/7821 + * @param serviceId + * @return 【服务项目记录】详情 + */ + @PostMapping("service/detail/{service-id}") + public Result queryServiceDetail(@PathVariable("service-id") String serviceId) { + return new Result().ok(icServiceRecordService.queryServiceDetail(serviceId)); + } + + /** + * 【服务项目记录】修改 + * + * @param formDTO + * @return + */ + @PostMapping("service/update") + public Result updateServiceRecord(@RequestBody IcServiceEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcServiceEditFormDTO.AddUserShowGroup.class, IcServiceEditFormDTO.AddUserInternalGroup.class); + icServiceRecordService.updateServiceRecord(formDTO); + return new Result(); + } + + /** + * 服务列表 + * @param input + * @return + */ + @PostMapping("/service/recordList") + public Result listServiceRecords(@RequestBody ServiceProjectRecordFormDTO input) { + + PageData page = icServiceRecordService.listServiceRecords( + input.getServiceCategoryKey(), input.getServiceProjectName(), input.getServiceOrgName(), input.getServiceTimeStart(), + input.getServiceTimeEnd(), input.getServiceStatus(), input.getSatisfaction(), input.getPageNo(), input.getPageSize()); + + return new Result().ok(page); + } + + /** + * 发起服务 + * @param input + * @return + */ + @PostMapping("/service/initiate") + public Result initiateService(@RequestBody ServiceProjectRecordFormDTO input) { + + ValidatorUtils.validateEntity(input, ServiceProjectRecordFormDTO.Initiate.class, ServiceProjectFeedbackFormDTO.InitiateGroup.class); + icServiceRecordService.initiateService(input); + + return new Result(); + } + + /** + * 反馈 + * @param input + * @return + */ + @PostMapping("/service/feedback") + public Result serviceFeedback(@RequestBody ServiceProjectFeedbackFormDTO input) { + ValidatorUtils.validateEntity(input, ServiceProjectFeedbackFormDTO.FeedbackGroup.class); + String serviceRecordId = input.getServiceRecordId(); + + // 做状态检查,未反馈的,服务状态为服务中的才可以反馈 + IcServiceRecordEntity serviceRecord = icServiceRecordService.selectById(serviceRecordId); + if (serviceRecord == null) { + String msg = "未找到服务记录"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + + if ("completed".equals(serviceRecord.getServiceStatus())) { + String msg = "服务已完成,不能再次反馈"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + + icServiceRecordService.serviceFeedback(serviceRecord.getServiceCategoryKey(), + serviceRecord.getServiceOrgId(), + serviceRecord.getServiceProjectId(), + serviceRecord.getId(), + input); + return new Result(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackDao.java new file mode 100755 index 0000000000..301a261fb1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceFeedbackDao.java @@ -0,0 +1,33 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.IcServiceFeedbackResDTO; +import com.epmet.entity.IcServiceFeedbackEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Mapper +public interface IcServiceFeedbackDao extends BaseDao { + + /** + * 根据服务记录id,查询反馈记录 + * @param serviceRecordId + * @return + */ + IcServiceFeedbackResDTO selectByRecId(@Param("serviceRecordId") String serviceRecordId); + + /** + * 根据服务反馈id,查询附件列表 + * @param feedBackId + * @return + */ + List getAttachmentList(String feedBackId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceOrgDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceOrgDao.java new file mode 100644 index 0000000000..5407d8f10b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceOrgDao.java @@ -0,0 +1,34 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.IcServiceOrgListFormDTO; +import com.epmet.dto.result.IcServiceOrgListResultDTO; +import com.epmet.dto.result.IcServiceOrgSelectListResultDTO; +import com.epmet.entity.IcServiceOrgEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Mapper +public interface IcServiceOrgDao extends BaseDao { + + /** + * @Author sun + * @Description 服务组织-列表查询 + **/ + List selectServiceOrgList(IcServiceOrgListFormDTO formDTO); + + /** + * @Author sun + * @Description 服务组织列表_下拉框 + **/ + List selectServiceOrgSelectList(IcServiceOrgListFormDTO formDTO); + + void del(IcServiceOrgEntity entity); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectAttachmentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectAttachmentDao.java new file mode 100644 index 0000000000..17eddc6215 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectAttachmentDao.java @@ -0,0 +1,27 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IcServiceProjectAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Mapper +public interface IcServiceProjectAttachmentDao extends BaseDao { + + /** + * Desc: 根据服务项目ID删除附件 + * @param id + * @author zxc + * @date 2022/5/30 09:50 + */ + void delAttachmentByServiceProjectId(@Param("id")String id); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectDao.java new file mode 100644 index 0000000000..528e9a06a5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceProjectDao.java @@ -0,0 +1,37 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.ServiceProjectListFormDTO; +import com.epmet.dto.result.ServiceProjectListResultDTO; +import com.epmet.entity.IcServiceProjectEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 服务项目管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Mapper +public interface IcServiceProjectDao extends BaseDao { + + /** + * Desc: 查询服务项目列表 + * @param formDTO + * @author zxc + * @date 2022/5/27 17:13 + */ + List getServiceProjectList(ServiceProjectListFormDTO formDTO); + + /** + * Desc: 上下架【服务项目】 + * @param ids + * @author zxc + * @date 2022/5/30 10:17 + */ + void serviceProjectEnabled(@Param("ids") List ids); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordDao.java new file mode 100644 index 0000000000..5a51a14a76 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceRecordDao.java @@ -0,0 +1,29 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ServiceProjectRecordResultDTO; +import com.epmet.entity.IcServiceRecordEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Mapper +public interface IcServiceRecordDao extends BaseDao { + + List listServiceRecords( + @Param("serviceCategoryKey") String serviceCategoryKey, + @Param("serviceProjectName") String serviceProjectName, + @Param("serviceOrgName") String serviceOrgName, + @Param("serviceTimeStart") Date serviceTimeStart, + @Param("serviceTimeEnd") Date serviceTimeEnd, + @Param("serviceStatus") String serviceStatus, + @Param("satisfaction") String satisfaction); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java new file mode 100644 index 0000000000..c2fc96cfd9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcServiceScopeDao.java @@ -0,0 +1,23 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.IcServiceScopeDTO; +import com.epmet.entity.IcServiceScopeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Mapper +public interface IcServiceScopeDao extends BaseDao { + + int update(@Param("serviceId") String serviceId, @Param("userId") String userId); + + List selectList(String serviceRecordId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackEntity.java new file mode 100755 index 0000000000..df89735b5b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceFeedbackEntity.java @@ -0,0 +1,83 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_feedback") +public class IcServiceFeedbackEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + @TableField(fill = FieldFill.INSERT) + private String customerId; + /** + * 服务类别ID + */ + private String serviceCategoryKey; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 服务目标 + */ + private String serviceGoal; + + /** + * 服务效果 + */ + private String serviceEffect; + + /** + * 服务人数 + */ + //private Integer servicePeopleNumber; + + /** + * 满意度。满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + + /** + * 地址经度 + */ + private String longitude; + + /** + * 地址纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * + */ + private String serviceRecordId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceOrgEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceOrgEntity.java new file mode 100644 index 0000000000..9b9da6dd7c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceOrgEntity.java @@ -0,0 +1,81 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_org") +public class IcServiceOrgEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 所属组织机构Id + */ + private String agencyId; + + /** + * agencyId的所有上级,包含自己 + */ + private String agencyIdPath; + + /** + * 服务类别【字典表 ic_service_type】多个值逗号分隔 + */ + private String serviceType; + + /** + * 服务组织名称 + */ + private String orgName; + + /** + * 组织描述 + */ + private String orgDescribe; + + /** + * 负责人姓名 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalMobile; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 地址 + */ + private String address; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java new file mode 100644 index 0000000000..966b5a6d94 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectAttachmentEntity.java @@ -0,0 +1,88 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_project_attachment") +public class IcServiceProjectAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + @TableField(fill = FieldFill.INSERT) + private String customerId; + + /** + * 事件Id + */ + private String icServiceId; + + /** + * 隶属于。feedback:反馈;service:服务本身 + */ + private String attachTo; + + /** + * 附件名 + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectEntity.java new file mode 100644 index 0000000000..b8a09e67cf --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceProjectEntity.java @@ -0,0 +1,74 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 服务项目管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_project") +public class IcServiceProjectEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织ID的上级 + */ + private String pid; + + /** + * 组织ID的所有上级[包括自己] + */ + private String agencyIdPath; + + /** + * 服务类别值 + */ + private String serviceCategoryKey; + + /** + * 服务名称 + */ + private String serviceName; + + /** + * 服务内容 + */ + private String serviceContent; + + /** + * 政策级别,0市级;1区级;2街道级 + */ + private String policyLevel; + + /** + * 政策依据 + */ + private String policyGround; + + /** + * 启用状态,0启用,1禁用 + */ + private Integer enabled; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordEntity.java new file mode 100644 index 0000000000..4156c60604 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceRecordEntity.java @@ -0,0 +1,89 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_record") +public class IcServiceRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + @TableField(fill = FieldFill.INSERT) + private String customerId; + + /** + * 服务类别ID + */ + private String serviceCategoryKey; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务项目名称 + */ + private String serviceProjectName; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 服务组织名称 + */ + private String serviceOrgName; + + /** + * 经办人姓名 + */ + private String principalName; + + /** + * 联系方式 + */ + private String principalContact; + + /** + * 服务时间 + */ + private Date serviceTimeStart; + + /** + * 服务截止时间 + */ + private Date serviceTimeEnd; + + /** + * in_service服务中;completed:已完成 + */ + private String serviceStatus; + + /** + * 备注 + */ + private String remark; + + /** + * 服务人数 + */ + private Integer servicePeopleNumber; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeEntity.java new file mode 100644 index 0000000000..1826e26df1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcServiceScopeEntity.java @@ -0,0 +1,75 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_service_scope") +public class IcServiceScopeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + @TableField(fill = FieldFill.INSERT) + private String customerId; + + /** + * 服务类别ID + */ + private String serviceCategoryKey; + + /** + * 服务项目ID + */ + private String serviceProjectId; + + /** + * 服务组织ID + */ + private String serviceOrgId; + + /** + * 服务记录的ID + */ + private String serviceRecordId; + + /** + * agency单位;grid网格;neighborhood小区 + */ + private String objectType; + + /** + * 选中的组织的ID + */ + private String objectId; + + /** + * 发布范围的组织ID PATH + */ + private String objectIdPath; + + /** + * + */ + private String objectName; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcServiceOrgExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcServiceOrgExcel.java new file mode 100644 index 0000000000..79c052a9f8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcServiceOrgExcel.java @@ -0,0 +1,75 @@ +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Data +public class IcServiceOrgExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "所属组织机构Id") + private String agencyId; + + @Excel(name = "agencyId的所有上级,包含自己") + private String agencyIdPath; + + @Excel(name = "服务类别【字典表 ic_service_type】多个值逗号分隔") + private String serviceType; + + @Excel(name = "服务组织名称") + private String orgName; + + @Excel(name = "组织描述") + private String orgDescribe; + + @Excel(name = "负责人姓名") + private String principalName; + + @Excel(name = "负责人电话") + private String principalMobile; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "纬度") + private String latitude; + + @Excel(name = "地址") + private String address; + + @Excel(name = "备注") + private String remarks; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceOrgService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceOrgService.java new file mode 100644 index 0000000000..3115e08d8a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceOrgService.java @@ -0,0 +1,68 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcServiceOrgDTO; +import com.epmet.dto.form.IcServiceOrgAddEditFormDTO; +import com.epmet.dto.form.IcServiceOrgListFormDTO; +import com.epmet.dto.result.IcServiceOrgListResultDTO; +import com.epmet.dto.result.IcServiceOrgSelectListResultDTO; +import com.epmet.entity.IcServiceOrgEntity; + +import java.util.List; + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface IcServiceOrgService extends BaseService { + + /** + * 默认查询 + * + * @param formDTO + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + PageData list(IcServiceOrgListFormDTO formDTO); + + /** + * 单条查询 + * + * @param id + * @return IcServiceOrgDTO + * @author generator + * @date 2022-05-27 + */ + IcServiceOrgDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void save(IcServiceOrgAddEditFormDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void update(IcServiceOrgAddEditFormDTO dto); + + void delete(IcServiceOrgAddEditFormDTO formDTO); + + IcServiceOrgListResultDTO detail(IcServiceOrgListFormDTO formDTO); + + List selectList(IcServiceOrgListFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectAttachmentService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectAttachmentService.java new file mode 100644 index 0000000000..afc94ec748 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectAttachmentService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import com.epmet.entity.IcServiceProjectAttachmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface IcServiceProjectAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcServiceProjectAttachmentDTO + * @author generator + * @date 2022-05-27 + */ + IcServiceProjectAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void save(IcServiceProjectAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void update(IcServiceProjectAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-27 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectService.java new file mode 100644 index 0000000000..aa02487cab --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceProjectService.java @@ -0,0 +1,122 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IcServiceProjectDTO; +import com.epmet.dto.form.ServiceProjectFormDTO; +import com.epmet.dto.form.ServiceProjectListFormDTO; +import com.epmet.dto.result.ServiceProjectListResultDTO; +import com.epmet.entity.IcServiceProjectEntity; + +import java.util.List; +import java.util.Map; + +/** + * 服务项目管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +public interface IcServiceProjectService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-05-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-05-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IcServiceProjectDTO + * @author generator + * @date 2022-05-27 + */ + IcServiceProjectDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void save(IcServiceProjectDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-05-27 + */ + void update(IcServiceProjectDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-05-27 + */ + void delete(String[] ids); + + /** + * Desc: 服务项目新增 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:04 + */ + void serviceProjectAdd(ServiceProjectFormDTO formDTO); + + /** + * Desc: 服务项目列表 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:46 + */ + PageData serviceProjectList(ServiceProjectListFormDTO formDTO); + + /** + * Desc: 服务项目详情 + * @param formDTO + * @author zxc + * @date 2022/5/30 15:46 + */ + ServiceProjectListResultDTO serviceProjectDetail(ServiceProjectListFormDTO formDTO); + + /** + * Desc: 修改【服务项目】 + * @param formDTO + * @author zxc + * @date 2022/5/30 09:36 + */ + void serviceProjectEdit(ServiceProjectFormDTO formDTO); + + /** + * Desc: 上下架【服务项目】 + * @param ids + * @author zxc + * @date 2022/5/30 10:17 + */ + void serviceProjectEnabled(List ids); + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordService.java new file mode 100644 index 0000000000..1fe7cb518a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceRecordService.java @@ -0,0 +1,56 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.IcServiceEditFormDTO; +import com.epmet.dto.form.ServiceProjectFeedbackFormDTO; +import com.epmet.dto.form.ServiceProjectRecordFormDTO; +import com.epmet.dto.result.IcServiceRecDetailRes; +import com.epmet.dto.result.ServiceProjectRecordResultDTO; +import com.epmet.entity.IcServiceRecordEntity; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +public interface IcServiceRecordService extends BaseService { + + /** + * http://yapi.elinkservice.cn/project/245/interface/api/7820 + * @param serviceId + * 【服务项目记录】取消:进行中的项目可以取消。删除该记录 + */ + void cancelService(String serviceId,String userId); + + /** + * 【服务项目记录】详情 + * @param serviceId + * @return + */ + IcServiceRecDetailRes queryServiceDetail(String serviceId); + + /** + * 【服务项目记录】修改 + * @param formDTO + */ + void updateServiceRecord(IcServiceEditFormDTO formDTO); + + PageData listServiceRecords(String serviceCategoryKey, String serviceProjectName, String serviceOrgName, + Date serviceTimeStart, Date serviceTimeEnd, String serviceStatus, + String satisfaction, Integer pageNo, Integer pageSize); + + /** + * 发起服务 + * @param input + */ + void initiateService(ServiceProjectRecordFormDTO input); + + /** + * 服务反馈 + */ + void serviceFeedback(String serviceCategoryKey, String serviceOrgId, String serviceProjectId, String serviceRecordId, ServiceProjectFeedbackFormDTO feedbackDto); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceScopeService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceScopeService.java new file mode 100644 index 0000000000..00603de5c3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceScopeService.java @@ -0,0 +1,14 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.IcServiceScopeEntity; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +public interface IcServiceScopeService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceOrgServiceImpl.java new file mode 100644 index 0000000000..6697510040 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceOrgServiceImpl.java @@ -0,0 +1,202 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcServiceOrgDao; +import com.epmet.dto.IcServiceOrgDTO; +import com.epmet.dto.form.IcServiceOrgAddEditFormDTO; +import com.epmet.dto.form.IcServiceOrgListFormDTO; +import com.epmet.dto.result.IcServiceOrgListResultDTO; +import com.epmet.dto.result.IcServiceOrgSelectListResultDTO; +import com.epmet.entity.IcServiceOrgEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcServiceOrgService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 服务组织表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Service +public class IcServiceOrgServiceImpl extends BaseServiceImpl implements IcServiceOrgService { + @Autowired + private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; + + + @Override + public PageData list(IcServiceOrgListFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo) { + throw new EpmetException("获取工作人员信息失败"); + } + //查询当前组织及下级数据 + formDTO.setAgencyId(staffInfo.getAgencyId()); + //列表/导出查询 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = baseDao.selectServiceOrgList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + + //封装服务类别数据 + if (!CollectionUtils.isEmpty(list)) { + //服务类别字典表数据 + Result> statusRes = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.IC_SERVICE_TYPE.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + List stList = null; + IcServiceOrgListResultDTO.ServiceType st = null; + StringBuffer buffer = null; + for (IcServiceOrgListResultDTO dto : list) { + stList = new ArrayList<>(); + buffer = new StringBuffer(""); + for (String str : dto.getServiceType().split(",")) { + st = new IcServiceOrgListResultDTO.ServiceType(); + st.setValue(str); + st.setName(null != statusMap.get(str) ? statusMap.get(str) : ""); + stList.add(st); + buffer.append(buffer.length() > NumConstant.ZERO ? "、" : "").append(st.getName()); + } + dto.setServiceTypeList(stList); + dto.setServiceTypeName(buffer.toString()); + } + } + + return new PageData<>(list, pageInfo.getTotal()); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcServiceOrgDTO get(String id) { + IcServiceOrgEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcServiceOrgDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcServiceOrgAddEditFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.校验同组织下服务组织名称不能重复 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcServiceOrgEntity::getAgencyId, staffInfo.getAgencyId()); + tWrapper.eq(IcServiceOrgEntity::getOrgName, formDTO.getOrgName()); + List entityList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的服务组织"); + } + //3.新增服务组织数据 + IcServiceOrgEntity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceOrgEntity.class); + entity.setAgencyId(staffInfo.getAgencyId()); + entity.setAgencyIdPath(StringUtils.isEmpty(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":" + staffInfo.getAgencyId()); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcServiceOrgAddEditFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); + } + //2.校验同组织下服务组织名称不能重复 + LambdaQueryWrapper tWrapper = new LambdaQueryWrapper<>(); + tWrapper.eq(IcServiceOrgEntity::getAgencyId, staffInfo.getAgencyId()); + tWrapper.ne(IcServiceOrgEntity::getId, formDTO.getIcServiceOrgId()); + tWrapper.eq(IcServiceOrgEntity::getOrgName, formDTO.getOrgName()); + List entityList = baseDao.selectList(tWrapper); + if (!CollectionUtils.isEmpty(entityList)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前组织下已存在相同名称的服务组织"); + } + //3.更新服务组织数据 + IcServiceOrgEntity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceOrgEntity.class); + entity.setId(formDTO.getIcServiceOrgId()); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(IcServiceOrgAddEditFormDTO formDTO) { + IcServiceOrgEntity entity = new IcServiceOrgEntity(); + entity.setId(formDTO.getIcServiceOrgId()); + entity.setUpdatedBy(formDTO.getUserId()); + baseDao.del(entity); + } + + @Override + public IcServiceOrgListResultDTO detail(IcServiceOrgListFormDTO formDTO) { + IcServiceOrgListResultDTO resultDTO = new IcServiceOrgListResultDTO(); + //1.查询服务组织信息 + List list = baseDao.selectServiceOrgList(formDTO); + + //封装服务类别数据 + if (!CollectionUtils.isEmpty(list)) { + resultDTO = list.get(NumConstant.ZERO); + //服务类别字典表数据 + Result> statusRes = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.IC_SERVICE_TYPE.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + List stList = new ArrayList<>(); + IcServiceOrgListResultDTO.ServiceType st = null; + StringBuffer buffer = new StringBuffer(""); + for (String str : resultDTO.getServiceType().split(",")) { + st = new IcServiceOrgListResultDTO.ServiceType(); + st.setValue(str); + st.setName(null != statusMap.get(str) ? statusMap.get(str) : ""); + stList.add(st); + buffer.append(buffer.length() > NumConstant.ZERO ? "、" : "").append(st.getName()); + } + resultDTO.setServiceTypeList(stList); + resultDTO.setServiceTypeName(buffer.toString()); + } + + return resultDTO; + } + + @Override + public List selectList(IcServiceOrgListFormDTO formDTO) { + //1.获取当前工作人员缓存信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo) { + throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getStaffId())); + } + //2.按条件查询当前组织及下级服务组织数据 + List resultList = baseDao.selectServiceOrgSelectList(formDTO); + + return resultList; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectAttachmentServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectAttachmentServiceImpl.java new file mode 100644 index 0000000000..13610ad374 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectAttachmentServiceImpl.java @@ -0,0 +1,83 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.IcServiceProjectAttachmentDao; +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import com.epmet.entity.IcServiceProjectAttachmentEntity; +import com.epmet.service.IcServiceProjectAttachmentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 事件附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Service +public class IcServiceProjectAttachmentServiceImpl extends BaseServiceImpl implements IcServiceProjectAttachmentService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcServiceProjectAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcServiceProjectAttachmentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcServiceProjectAttachmentDTO get(String id) { + IcServiceProjectAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcServiceProjectAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcServiceProjectAttachmentDTO dto) { + IcServiceProjectAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IcServiceProjectAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcServiceProjectAttachmentDTO dto) { + IcServiceProjectAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IcServiceProjectAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java new file mode 100644 index 0000000000..ecc399cfb3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceProjectServiceImpl.java @@ -0,0 +1,259 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.DictListFormDTO; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.DictListResultDTO; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcServiceProjectAttachmentDao; +import com.epmet.dao.IcServiceProjectDao; +import com.epmet.dto.IcServiceProjectAttachmentDTO; +import com.epmet.dto.IcServiceProjectDTO; +import com.epmet.dto.form.ServiceProjectFormDTO; +import com.epmet.dto.form.ServiceProjectListFormDTO; +import com.epmet.dto.result.ServiceProjectListResultDTO; +import com.epmet.entity.IcServiceProjectAttachmentEntity; +import com.epmet.entity.IcServiceProjectEntity; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.service.IcServiceProjectAttachmentService; +import com.epmet.service.IcServiceProjectService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 服务项目管理表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-27 + */ +@Service +public class IcServiceProjectServiceImpl extends BaseServiceImpl implements IcServiceProjectService { + + @Autowired + private IcServiceProjectAttachmentService attachmentService; + @Autowired + private IcServiceProjectAttachmentDao attachmentDao; + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IcServiceProjectDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IcServiceProjectDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IcServiceProjectDTO get(String id) { + IcServiceProjectEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IcServiceProjectDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IcServiceProjectDTO dto) { + IcServiceProjectEntity entity = ConvertUtils.sourceToTarget(dto, IcServiceProjectEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IcServiceProjectDTO dto) { + IcServiceProjectEntity entity = ConvertUtils.sourceToTarget(dto, IcServiceProjectEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * Desc: 服务项目新增 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:04 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void serviceProjectAdd(ServiceProjectFormDTO formDTO) { + IcServiceProjectEntity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceProjectEntity.class); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到此工作人员"+formDTO.getUserId()); + } + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); + if (null == agencyInfo){ + throw new EpmetException("未查询到此组织信息"+staffInfo.getStaffId()); + } + entity.setEnabled(NumConstant.ZERO); + entity.setAgencyId(staffInfo.getAgencyId()); + entity.setPid(agencyInfo.getPid()); + entity.setAgencyIdPath((StringUtils.isBlank(agencyInfo.getPids()) || agencyInfo.getPids().equals(NumConstant.ZERO_STR)) ? staffInfo.getAgencyId() : agencyInfo.getPids().concat(":").concat(staffInfo.getAgencyId())); + baseDao.insert(entity); + if (CollectionUtils.isNotEmpty(formDTO.getAttachmentList())){ + disposeAttachment(formDTO.getAttachmentList(), formDTO.getCustomerId(), entity.getId()); + } + } + + /** + * Desc: 服务项目列表 + * @param formDTO + * @author zxc + * @date 2022/5/27 16:46 + */ + @Override + public PageData> serviceProjectList(ServiceProjectListFormDTO formDTO) { + PageData result = new PageData(new ArrayList(),NumConstant.ZERO); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到此工作人员"+formDTO.getUserId()); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getServiceProjectList(formDTO)); + if (CollectionUtils.isNotEmpty(pageInfo.getList())){ + DictListFormDTO dictListFormDTO = new DictListFormDTO(); + dictListFormDTO.setDictType("ic_service_type"); + Result> listResult = adminOpenFeignClient.dictList(dictListFormDTO); + if (!listResult.success()){ + throw new EpmetException("获取字典表数据失败,类型为:ic_service_type"); + } + if (CollectionUtils.isNotEmpty(listResult.getData())){ + pageInfo.getList().forEach(p -> listResult.getData().stream().filter(l -> l.getValue().equals(p.getServiceCategoryKey())).forEach(l -> p.setServiceCategory(l.getLabel()))); + } + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + result.setList(pageInfo.getList()); + } + return result; + } + + /** + * Desc: 服务项目详情 + * @param formDTO + * @author zxc + * @date 2022/5/30 15:46 + */ + @Override + public ServiceProjectListResultDTO serviceProjectDetail(ServiceProjectListFormDTO formDTO) { + List serviceProjectList = baseDao.getServiceProjectList(formDTO); + if (CollectionUtils.isNotEmpty(serviceProjectList)){ + DictListFormDTO dictListFormDTO = new DictListFormDTO(); + dictListFormDTO.setDictType("ic_service_type"); + Result> listResult = adminOpenFeignClient.dictList(dictListFormDTO); + if (!listResult.success()){ + throw new EpmetException("获取字典表数据失败,类型为:ic_service_type"); + } + if (CollectionUtils.isNotEmpty(listResult.getData())){ + serviceProjectList.forEach(p -> listResult.getData().stream().filter(l -> l.getValue().equals(p.getServiceCategoryKey())).forEach(l -> p.setServiceCategory(l.getLabel()))); + } + return serviceProjectList.get(NumConstant.ZERO); + } + return new ServiceProjectListResultDTO(); + } + + /** + * Desc: 修改【服务项目】 + * @param formDTO + * @author zxc + * @date 2022/5/30 09:36 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void serviceProjectEdit(ServiceProjectFormDTO formDTO) { + LambdaQueryWrapper qw = new LambdaQueryWrapper<>(); + qw.eq(IcServiceProjectEntity::getId,formDTO.getServiceProjectId()); + IcServiceProjectEntity entity = ConvertUtils.sourceToTarget(formDTO, IcServiceProjectEntity.class); + baseDao.update(entity,qw); + if (CollectionUtils.isNotEmpty(formDTO.getAttachmentList())){ + // 先删后增 + attachmentDao.delAttachmentByServiceProjectId(formDTO.getServiceProjectId()); + disposeAttachment(formDTO.getAttachmentList(), formDTO.getCustomerId(), formDTO.getServiceProjectId()); + }else { + attachmentDao.delAttachmentByServiceProjectId(formDTO.getServiceProjectId()); + } + } + + /** + * Desc: 上下架【服务项目】 + * @param ids + * @author zxc + * @date 2022/5/30 10:17 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void serviceProjectEnabled(List ids) { + if (CollectionUtils.isNotEmpty(ids)){ + baseDao.serviceProjectEnabled(ids); + } + } + + /** + * Desc: 附件处理 + * @param attachmentList + * @param customerId + * @param serviceId + * @author zxc + * @date 2022/5/30 10:17 + */ + public void disposeAttachment(List attachmentList,String customerId,String serviceId){ + attachmentList.forEach(a -> { + a.setAttachmentName(a.getName()); + a.setAttachmentFormat(a.getFormat()); + a.setAttachmentType(a.getType()); + a.setAttachmentUrl(a.getUrl()); + }); + List entities = ConvertUtils.sourceToTarget(attachmentList, IcServiceProjectAttachmentEntity.class); + Integer sort = NumConstant.ZERO; + for (IcServiceProjectAttachmentEntity e : entities) { + e.setCustomerId(customerId); + e.setStatus("auto_passed"); + e.setSort(sort); + e.setIcServiceId(serviceId); + e.setAttachTo("service"); + sort++; + } + attachmentService.insertBatch(entities); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java new file mode 100644 index 0000000000..214b762cfc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordServiceImpl.java @@ -0,0 +1,324 @@ +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.enums.DictTypeEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.*; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.dto.form.IcServiceEditFormDTO; +import com.epmet.dto.form.ServiceProjectFeedbackFormDTO; +import com.epmet.dto.form.ServiceProjectRecordFormDTO; +import com.epmet.dto.result.IcServiceRecDetailRes; +import com.epmet.dto.result.IcServiceScopeDTO; +import com.epmet.dto.result.ServiceProjectRecordResultDTO; +import com.epmet.entity.*; +import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.IcServiceRecordService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Service +public class IcServiceRecordServiceImpl extends BaseServiceImpl implements IcServiceRecordService, ResultDataResolver { + @Autowired + private IcServiceScopeDao icServiceScopeDao; + @Autowired + private EpmetAdminOpenFeignClient adminOpenFeignClient; + @Autowired + private IcServiceProjectDao serviceProjectDao; + @Autowired + private IcServiceOrgDao serviceOrgDao; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private IcServiceFeedbackDao serviceFeedbackDao; + @Autowired + private IcServiceProjectAttachmentDao serviceProjectAttachmentDao; + @Autowired + private IcServiceRecordDao serviceRecordDao; + + /** + * http://yapi.elinkservice.cn/project/245/interface/api/7820 + * + * @param serviceId 【服务项目记录】取消:进行中的项目可以取消。删除该记录 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void cancelService(String serviceId,String userId) { + IcServiceRecordEntity icServiceRecordEntity = baseDao.selectById(serviceId); + if (null == icServiceRecordEntity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),String.format("服务记录不存在,serviceId:%s",serviceId),"服务记录不存在"); + } + if (!"in_service".equals(icServiceRecordEntity.getServiceStatus())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("服务状态:%s", icServiceRecordEntity.getServiceStatus()), "只有服务中的项目可以取消"); + } + baseDao.deleteById(serviceId); + icServiceScopeDao.update(serviceId,userId); + } + + /** + * 【服务项目记录】详情 + * + * @param serviceId + * @return + */ + @Override + public IcServiceRecDetailRes queryServiceDetail(String serviceId) { + IcServiceRecordEntity icServiceRecordEntity = baseDao.selectById(serviceId); + IcServiceRecDetailRes res = ConvertUtils.sourceToTarget(icServiceRecordEntity, IcServiceRecDetailRes.class); + if (null != res) { + res.setServiceScope(icServiceScopeDao.selectList(serviceId)); + //服务分类名称 + Result> icServiceTypeMapRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_SERVICE_TYPE.getCode()); + if (!icServiceTypeMapRes.success() || MapUtils.isEmpty(icServiceTypeMapRes.getData())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务分类字典查询异常"); + } + res.setServiceCategoryName(icServiceTypeMapRes.getData().get(res.getServiceCategoryKey())); + res.setFeedBack(serviceFeedbackDao.selectByRecId(icServiceRecordEntity.getId())); + } + return res; + } + + /** + * 【服务项目记录】修改 + * + * @param formDTO + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void updateServiceRecord(IcServiceEditFormDTO formDTO) { + IcServiceRecordEntity icServiceRecordEntity = baseDao.selectById(formDTO.getServiceRecordId()); + if (null == icServiceRecordEntity) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),String.format("服务记录不存在,serviceRecordId:%s",formDTO.getServiceRecordId()),"服务记录不存在"); + } + icServiceRecordEntity.setServiceTimeStart(formDTO.getServiceTimeStart()); + icServiceRecordEntity.setServiceTimeEnd(formDTO.getServiceTimeEnd()); + if(StringUtils.isNotBlank(formDTO.getPrincipalContact())){ + icServiceRecordEntity.setPrincipalContact(formDTO.getPrincipalContact()); + } + if(StringUtils.isNotBlank(formDTO.getPrincipalName())){ + icServiceRecordEntity.setPrincipalName(formDTO.getPrincipalName()); + } + if(StringUtils.isNotBlank(formDTO.getRemark())){ + icServiceRecordEntity.setRemark(formDTO.getRemark()); + } + baseDao.updateById(icServiceRecordEntity); + } + + + @Override + public PageData listServiceRecords(String serviceCategoryKey, String serviceProjectName, + String serviceOrgName, Date serviceTimeStart, + Date serviceTimeEnd, String serviceStatus, + String satisfaction, Integer pageNo, + Integer pageSize) { + + String msg = "【服务列表】查询服务类别失败"; + Map categories = getResultDataOrThrowsException(adminOpenFeignClient.dictMap(DictTypeEnum.IC_SERVICE_TYPE.getCode()), + ServiceConstant.EPMET_ADMIN_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg); + + if (categories == null || categories.size() == 0) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg); + } + + PageHelper.startPage(pageNo, pageSize); + List records = baseDao.listServiceRecords(serviceCategoryKey, serviceProjectName, serviceOrgName, serviceTimeStart, serviceTimeEnd, serviceStatus, satisfaction); + PageInfo pi = new PageInfo<>(records); + + // 补充信息 + records.forEach(r->{ + String categoryKey = r.getServiceCategoryKey(); + r.setServiceCategoryName(categories.get(categoryKey)); + }); + + return new PageData<>(records, pi.getTotal()); + } + + @Transactional(rollbackFor = Throwable.class) + public void initiateService(ServiceProjectRecordFormDTO input) { + + // 同一个项目暂时不做服务次数限制 + //LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + //query.eq(IcServiceRecordEntity::getServiceProjectId, input.getServiceProjectId()); + // + //if (serviceRecordDao.selectCount(query) > 0) { + // String msg = "该项目已经发起服务,不能重复发起"; + // throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + //} + + IcServiceProjectEntity serviceProject = serviceProjectDao.selectById(input.getServiceProjectId()); + IcServiceOrgEntity serviceOrg = serviceOrgDao.selectById(input.getServiceOrgId()); + + ServiceProjectFeedbackFormDTO feedbackDto = input.getFeedback(); + + // 1.服务记录 + IcServiceRecordEntity serviceRecord = new IcServiceRecordEntity(); + serviceRecord.setServiceCategoryKey(input.getServiceCategoryKey()); + serviceRecord.setServiceProjectId(input.getServiceProjectId()); + serviceRecord.setServiceProjectName(serviceProject.getServiceName()); + serviceRecord.setServiceOrgId(input.getServiceOrgId()); + serviceRecord.setServiceOrgName(serviceOrg.getOrgName()); + serviceRecord.setPrincipalName(input.getPrincipalName()); + serviceRecord.setPrincipalContact(input.getPrincipalContact()); + serviceRecord.setServiceTimeStart(input.getServiceTimeStart()); + serviceRecord.setServiceTimeEnd(input.getServiceTimeEnd()); + if (feedbackDto == null) { + // 没写反馈,给一个服务中 + serviceRecord.setServiceStatus("in_service"); + } else { + // 写了反馈,按照反馈的来 + serviceRecord.setServiceStatus(feedbackDto.getServiceStatus()); + serviceRecord.setServicePeopleNumber(feedbackDto.getServicePeopleNumber()); + } + serviceRecord.setRemark(input.getRemark()); + + baseDao.insert(serviceRecord); + + // 2.服务范围列表 + List serviceScope = input.getServiceScope(); + + serviceScope.stream().forEach(s -> { + String[] scopeObjectIdPathAndName = getScopeObjectIdPath(s.getObjectType(), s.getObjectId()); + IcServiceScopeEntity scope = new IcServiceScopeEntity(); + scope.setServiceCategoryKey(input.getServiceCategoryKey()); + scope.setServiceProjectId(input.getServiceProjectId()); + scope.setServiceOrgId(input.getServiceOrgId()); + scope.setServiceRecordId(serviceRecord.getId()); + scope.setObjectType(s.getObjectType()); + scope.setObjectId(s.getObjectId()); + scope.setObjectIdPath(scopeObjectIdPathAndName[0]); + scope.setObjectName(scopeObjectIdPathAndName[1]); + icServiceScopeDao.insert(scope); + //scope.setRemark(); 为什么会有这个字段?? + }); + + // 3.反馈 + if (feedbackDto == null) { + return; + } + + serviceFeedback(input.getServiceCategoryKey(), input.getServiceOrgId(), input.getServiceProjectId(), serviceRecord.getId(), feedbackDto); + } + + /** + * 查询服务范围的对象的Id path + * @param scopeObjectType + * @param scopeObjectId + * @return + */ + private String[] getScopeObjectIdPath(String scopeObjectType, String scopeObjectId) { + if ("neighborhood".equals(scopeObjectType)) { + + String msg = String.format("【服务项目】-发起服务-根据范围id查询小区信息失败。scopeObjectType:%s, scopeObjectId:%s", + scopeObjectType, scopeObjectId); + + IcNeighborHoodDTO neighborHoodDTO = getResultDataOrThrowsException(govOrgOpenFeignClient.getIcNeighbordhoodById(scopeObjectId), + ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.SERVER_ERROR.getCode(), + msg, msg); + + 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() }; + } else if ("agency".equals(scopeObjectType)) { + // 组织的pids是到父级组织 + AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(scopeObjectId); + if ("0".equals(agencyInfo.getPid())) { + return new String[]{ agencyInfo.getId(), agencyInfo.getOrganizationName() }; + } + return new String[]{ agencyInfo.getPids().concat(":").concat(agencyInfo.getPid()), agencyInfo.getOrganizationName() }; + } else if ("grid".equals(scopeObjectType)) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(scopeObjectId); + // 网格的pids是到社区的 + return new String[]{ gridInfo.getPids().concat(":").concat(gridInfo.getId()), gridInfo.getGridName() }; + } else { + String msg = String.format("【服务项目】-发起服务-范围type未知:scopeObjectType:%s,scopeObjectId:%s", scopeObjectType, scopeObjectId); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + } + + @Transactional(rollbackFor = Throwable.class) + @Override + public void serviceFeedback(String serviceCategoryKey, String serviceOrgId, String serviceProjectId, String serviceRecordId, ServiceProjectFeedbackFormDTO feedbackDto) { + + // 如果还在服务中,那么需要改为已结束 + IcServiceRecordEntity serviceRecord = serviceRecordDao.selectById(serviceRecordId); + if ("in_service".equals(serviceRecord.getServiceStatus())) { + serviceRecord.setServiceStatus("completed"); + serviceRecord.setServicePeopleNumber(feedbackDto.getServicePeopleNumber()); + serviceRecordDao.updateById(serviceRecord); + } + + // 反馈信息 + IcServiceFeedbackEntity feedbackEntity = new IcServiceFeedbackEntity(); + feedbackEntity.setServiceCategoryKey(serviceCategoryKey); + feedbackEntity.setServiceProjectId(serviceProjectId); + feedbackEntity.setServiceOrgId(serviceOrgId); + feedbackEntity.setServiceGoal(feedbackDto.getServiceGoal()); + feedbackEntity.setServiceEffect(feedbackDto.getServiceEffect()); + //feedbackEntity.setServicePeopleNumber(feedbackDto.getServicePeopleNumber()); + feedbackEntity.setSatisfaction(feedbackDto.getSatisfaction()); + feedbackEntity.setLongitude(feedbackDto.getLongitude()); + feedbackEntity.setLatitude(feedbackDto.getLatitude()); + feedbackEntity.setAddress(feedbackDto.getAddress()); + feedbackEntity.setServiceRecordId(serviceRecordId); + serviceFeedbackDao.insert(feedbackEntity); + + // 反馈附件列表 + List attachmentList = feedbackDto.getAttachmentList(); + if (CollectionUtils.isNotEmpty(attachmentList)) { + for (int i = 0; i < attachmentList.size(); i++) { + ServiceProjectFeedbackFormDTO.Attachment a = attachmentList.get(i); + + IcServiceProjectAttachmentEntity at = new IcServiceProjectAttachmentEntity(); + at.setAttachmentFormat(a.getAttachmentFormat()); + at.setAttachmentName(a.getAttachmentName()); + at.setAttachmentType(a.getAttachmentType()); + at.setAttachmentUrl(a.getAttachmentUrl()); + // feedback:反馈,service:服务本身 + at.setAttachTo("feedback"); + at.setDuration(0); + at.setIcServiceId(feedbackEntity.getId()); + // 根本不需要审核,逗你玩 + at.setReason(null); + at.setStatus("auto_passed"); + at.setSort(i); + serviceProjectAttachmentDao.insert(at); + } + } + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceScopeServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceScopeServiceImpl.java new file mode 100644 index 0000000000..8324f297d3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceScopeServiceImpl.java @@ -0,0 +1,19 @@ +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.IcServiceScopeDao; +import com.epmet.entity.IcServiceScopeEntity; +import com.epmet.service.IcServiceScopeService; +import org.springframework.stereotype.Service; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-05-30 + */ +@Service +public class IcServiceScopeServiceImpl extends BaseServiceImpl implements IcServiceScopeService { + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.17__ic_service_project.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.17__ic_service_project.sql new file mode 100644 index 0000000000..8882e7c143 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.17__ic_service_project.sql @@ -0,0 +1,137 @@ + +CREATE TABLE `ic_service_project` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织ID', + `PID` varchar(64) NOT NULL COMMENT '组织ID的上级', + `AGENCY_ID_PATH` varchar(255) NOT NULL COMMENT '组织ID的所有上级[包括自己]', + `SERVICE_CATEGORY_KEY` varchar(10) NOT NULL COMMENT '服务类别值', + `SERVICE_NAME` varchar(2000) NOT NULL COMMENT '服务名称', + `SERVICE_CONTENT` varchar(2000) NOT NULL COMMENT '服务内容', + `POLICY_LEVEL` varchar(1) DEFAULT '' COMMENT '政策级别,0市级;1区级;2街道级', + `POLICY_GROUND` varchar(2000) DEFAULT NULL COMMENT '政策依据', + `ENABLED` int(1) NOT NULL COMMENT '启用状态,0启用,1禁用', + `DEL_FLAG` int(1) NOT NULL, + `REVISION` int(1) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务项目管理表'; + + +CREATE TABLE `ic_service_project_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `IC_SERVICE_ID` varchar(64) NOT NULL COMMENT '服务记录id,服务项目id', + `ATTACH_TO` varchar(32) DEFAULT NULL COMMENT '隶属于。feedback:反馈;service:服务本身', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `STATUS` varchar(32) NOT NULL DEFAULT 'auto_passed' COMMENT '附件状态(审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)\r\n现在图片是同步审核的,所以图片只有auto_passed一种状态', + `REASON` varchar(255) DEFAULT NULL COMMENT '失败原因', + `DURATION` int(11) DEFAULT NULL COMMENT '语音或视频时长,秒', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='事件附件表'; + +CREATE TABLE `ic_service_org` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '所属组织机构Id', + `AGENCY_ID_PATH` varchar(256) NOT NULL COMMENT 'agencyId的所有上级,包含自己', + `SERVICE_TYPE` varchar(64) NOT NULL COMMENT '服务类别【字典表 ic_service_type】多个值逗号分隔', + `ORG_NAME` varchar(64) NOT NULL COMMENT '服务组织名称', + `ORG_DESCRIBE` varchar(512) DEFAULT NULL COMMENT '组织描述', + `PRINCIPAL_NAME` varchar(64) NOT NULL COMMENT '负责人姓名', + `PRINCIPAL_MOBILE` varchar(11) NOT NULL COMMENT '负责人电话', + `LONGITUDE` varchar(64) DEFAULT NULL COMMENT '经度', + `LATITUDE` varchar(64) DEFAULT NULL COMMENT '纬度', + `ADDRESS` varchar(256) DEFAULT NULL COMMENT '地址', + `REMARK` varchar(512) DEFAULT NULL COMMENT '备注', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', + `REVISION` int(10) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + KEY `idx_pid` (`AGENCY_ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='服务组织表'; + + +CREATE TABLE `ic_service_record` ( + `ID` varchar(64) NOT NULL, + `CUSTOMER_ID` varchar(64) NOT NULL, + `SERVICE_PROJECT_ID` varchar(64) NOT NULL COMMENT '服务项目ID', + `SERVICE_PROJECT_NAME` varchar(255) NOT NULL COMMENT '服务项目名称', + `SERVICE_ORG_ID` varchar(64) NOT NULL COMMENT '服务组织ID', + `SERVICE_ORG_NAME` varchar(255) NOT NULL COMMENT '服务组织名称', + `PRINCIPAL_NAME` varchar(32) DEFAULT NULL COMMENT '经办人姓名', + `PRINCIPAL_CONTACT` varchar(64) DEFAULT NULL COMMENT '联系方式', + `SERVICE_TIME_START` datetime NOT NULL COMMENT '服务时间', + `SERVICE_TIME_END` datetime NOT NULL COMMENT '服务截止时间', + `SERVICE_STATUS` varchar(32) NOT NULL COMMENT 'in_service服务中;completed:已完成', + `REMARK` varchar(255) DEFAULT NULL COMMENT '备注', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `SERVICE_CATEGORY_KEY` varchar(64) NOT NULL COMMENT '服务类别ID', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 comment '服务项目记录表'; + +CREATE TABLE `ic_service_feedback` ( + `ID` varchar(64) NOT NULL, + `CUSTOMER_ID` varchar(64) NOT NULL, + `SERVICE_PROJECT_ID` varchar(64) NOT NULL COMMENT '服务项目ID', + `SERVICE_ORG_ID` varchar(64) NOT NULL COMMENT '服务组织ID', + `SERVICE_GOAL` varchar(255) DEFAULT NULL COMMENT '服务目标', + `SERVICE_EFFECT` varchar(255) DEFAULT NULL COMMENT '服务效果', + `SERVICE_PEOPLE_NUMBER` int(10) DEFAULT NULL COMMENT '服务人数', + `SATISFACTION` varchar(30) DEFAULT NULL COMMENT '满意度。满意度 - 不满意:bad、基本满意:good、非常满意:perfect', + `LONGITUDE` varchar(255) DEFAULT NULL COMMENT '地址经度', + `LATITUDE` varchar(255) DEFAULT NULL COMMENT '地址纬度', + `address` varchar(64) DEFAULT NULL COMMENT '地址', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `SERVICE_RECORD_ID` varchar(64) NOT NULL, + `SERVICE_CATEGORY_KEY` varchar(64) NOT NULL COMMENT '服务类别ID', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 comment '服务项目反馈信息'; + + +CREATE TABLE `ic_service_scope` ( + `ID` varchar(64) NOT NULL, + `CUSTOMER_ID` varchar(64) NOT NULL, + `SERVICE_PROJECT_ID` varchar(64) NOT NULL COMMENT '服务项目ID', + `SERVICE_ORG_ID` varchar(64) NOT NULL COMMENT '服务组织ID', + `SERVICE_RECORD_ID` varchar(64) NOT NULL COMMENT '服务记录的ID', + `OBJECT_TYPE` varchar(32) NOT NULL COMMENT 'agency单位;grid网格;neighborhood小区', + `OBJECT_ID` varchar(64) NOT NULL COMMENT '选中的组织的ID', + `OBJECT_ID_PATH` varchar(255) NOT NULL COMMENT '发布范围的组织ID PATH', + `OBJECT_NAME` varchar(32) DEFAULT NULL, + `REMARK` varchar(255) DEFAULT NULL COMMENT '备注', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `SERVICE_CATEGORY_KEY` varchar(64) NOT NULL COMMENT '服务类别ID', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 comment '服务范围表' \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.18__alter_service_org.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.18__alter_service_org.sql new file mode 100644 index 0000000000..32cb514da9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.18__alter_service_org.sql @@ -0,0 +1,6 @@ +ALTER TABLE `ic_service_org` +MODIFY COLUMN `ORG_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '服务组织名称' AFTER `SERVICE_TYPE`, +MODIFY COLUMN `ORG_DESCRIBE` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组织描述' AFTER `ORG_NAME`, +MODIFY COLUMN `PRINCIPAL_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '负责人姓名' AFTER `ORG_DESCRIBE`, +MODIFY COLUMN `PRINCIPAL_MOBILE` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '负责人电话' AFTER `PRINCIPAL_NAME`; + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.19__service_move_people_to_record.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.19__service_move_people_to_record.sql new file mode 100644 index 0000000000..703651cf09 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.19__service_move_people_to_record.sql @@ -0,0 +1,2 @@ +alter table ic_service_record + add SERVICE_PEOPLE_NUMBER int(10) comment '服务人数' after SERVICE_STATUS; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackDao.xml new file mode 100755 index 0000000000..2f58637231 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceFeedbackDao.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceOrgDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceOrgDao.xml new file mode 100644 index 0000000000..18c6dbe981 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceOrgDao.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + UPDATE ic_service_org + SET del_flag = '1', + updated_by = #{updatedBy}, + updated_time = NOW() + WHERE + id = #{id} + AND del_flag = '0' + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectAttachmentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectAttachmentDao.xml new file mode 100644 index 0000000000..e33c5a3958 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectAttachmentDao.xml @@ -0,0 +1,11 @@ + + + + + + + + DELETE FROM ic_service_project_attachment + WHERE IC_SERVICE_ID = #{id} + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml new file mode 100644 index 0000000000..17f4de965a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceProjectDao.xml @@ -0,0 +1,72 @@ + + + + + + + + UPDATE ic_service_project + SET ENABLED = 1, + UPDATED_TIME = NOW() + WHERE ID IN ( + #{id} + ) + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordDao.xml new file mode 100644 index 0000000000..ad5df068ef --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordDao.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml new file mode 100644 index 0000000000..026d8c6ac4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceScopeDao.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + update ic_service_scope set del_flag='1',UPDATED_TIME=now(),UPDATED_BY=#{userId} + where SERVICE_RECORD_ID=#{serviceId} + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ServiceProjectScopeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ServiceProjectScopeResultDTO.java new file mode 100644 index 0000000000..a727b2dae8 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ServiceProjectScopeResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class ServiceProjectScopeResultDTO { + + private String objectId; + private String objectName; + private String objectType; + + private List children; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/ServiceProjectController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/ServiceProjectController.java new file mode 100644 index 0000000000..6bae4e8f2f --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/ServiceProjectController.java @@ -0,0 +1,35 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.result.ServiceProjectScopeResultDTO; +import com.epmet.service.ServiceProjectService; +import com.epmet.service.impl.ServiceProjectServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 服务项目 + */ +@RestController +@RequestMapping("icServiceProject") +public class ServiceProjectController { + + @Autowired + public ServiceProjectService serviceProjectService; + + + /** + * 服务范围树查询 + * @return + */ + @RequestMapping("service/serviceScopeTree") + public Result getServiceScopeTree(@LoginUser TokenDto loginInfo) { + ServiceProjectScopeResultDTO r = serviceProjectService.getServiceScopeTree(loginInfo.getUserId()); + return new Result().ok(r); + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/ServiceProjectService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/ServiceProjectService.java new file mode 100644 index 0000000000..22058470de --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/ServiceProjectService.java @@ -0,0 +1,9 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.result.ServiceProjectScopeResultDTO; +import com.epmet.entity.IcPlaceOrgEntity; + +public interface ServiceProjectService { + ServiceProjectScopeResultDTO getServiceScopeTree(String staffId); +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/ServiceProjectServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/ServiceProjectServiceImpl.java new file mode 100644 index 0000000000..3e4fc139d5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/ServiceProjectServiceImpl.java @@ -0,0 +1,107 @@ +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dao.CustomerAgencyDao; +import com.epmet.dao.CustomerGridDao; +import com.epmet.dao.IcNeighborHoodDao; +import com.epmet.dto.IcNeighborHoodDTO; +import com.epmet.dto.result.AgencyTreeResultDTO; +import com.epmet.dto.result.ServiceProjectScopeResultDTO; +import com.epmet.entity.CustomerAgencyEntity; +import com.epmet.entity.IcPlaceOrgEntity; +import com.epmet.service.CustomerAgencyService; +import com.epmet.service.NeighborHoodService; +import com.epmet.service.ServiceProjectService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +@Slf4j +@Service +public class ServiceProjectServiceImpl implements ServiceProjectService { + + @Autowired + private CustomerAgencyDao agencyDao; + + @Autowired + private CustomerGridDao gridDao; + + @Autowired + private IcNeighborHoodDao neighborHoodDao; + + @Autowired + private CustomerAgencyService customerAgencyService; + + public ServiceProjectServiceImpl() { + System.out.println(6); + } + + @Override + public ServiceProjectScopeResultDTO getServiceScopeTree(String staffId) { + AgencyTreeResultDTO orgTreeData = customerAgencyService.getOrgTreeData(staffId); + + ServiceProjectScopeResultDTO rootScope = new ServiceProjectScopeResultDTO(); + rootScope.setObjectId(orgTreeData.getAgencyId()); + rootScope.setObjectType(orgTreeData.getLevel()); + rootScope.setObjectName(orgTreeData.getAgencyName()); + rootScope.setChildren(convert2ServiceProjectScope(orgTreeData.getSubAgencyList())); + + return rootScope; + } + + private List convert2ServiceProjectScope(List oldChildren) { + + ArrayList scopes = new ArrayList<>(); + + for (AgencyTreeResultDTO oldChild : oldChildren) { + ServiceProjectScopeResultDTO scope = new ServiceProjectScopeResultDTO(); + scope.setObjectId(oldChild.getAgencyId()); + scope.setObjectType(oldChild.getLevel()); + scope.setObjectName(oldChild.getAgencyName()); + if ("grid".equals(oldChild.getLevel())) { + // 如果是网格,那么还要查询网格下的小区 + List neighborhoods = neighborHoodDao.selectNeighborList(oldChild.getAgencyId()); + + List neighborhoodScopes = neighborhoods.stream().map(n -> new ServiceProjectScopeResultDTO(n.getId(), + n.getNeighborHoodName(), + "neighborhood", + null)).collect(Collectors.toList()); + + scope.setChildren(neighborhoodScopes); + } else { + // 递归处理子级 + List subAgencyList = oldChild.getSubAgencyList(); + if (subAgencyList != null && !CollectionUtils.isEmpty(subAgencyList)) { + List subOrgScope = convert2ServiceProjectScope(subAgencyList); + scope.setChildren(subOrgScope); + } + } + + scopes.add(scope); + } + + return scopes; + } + + //public void recursiveFillChildren(ServiceProjectScopeResultDTO parentObject) { + // String parentObjectType = parentObject.getObjectType(); + // if ("grid".equals(parentObjectType)) { + // // 如果父级是网格,那么查询子级小区 + // neighborHoodService.listNeighborhood() + // } else if ("agency".equals(parentObjectType)) { + // // 如果父级是单位,那么查询子级单位或者网格 + // String parentObjectId = parentObject.getObjectId(); + // if ("community".equals(parentObject)) { + // gridDao.get + // } else { + // agencyDao.getSubAgencyList() + // } + // } + // + //} +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java index fb86222967..b357632bf8 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java @@ -1,8 +1,9 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -121,6 +122,11 @@ public class IcEventDTO implements Serializable { */ private Integer redDot; + /** + * 工作端的红点:展示1;不展示:0;【居民报事、回复更新为1】 + */ + private Integer govRedDot; + /** * 最近一次操作时间(回复、立项、转需求、办结更新此列) */ @@ -182,7 +188,7 @@ approved:人工审核通过) private String createdBy; /** - * 展示红点:visible;隐藏:invisible;人大回复、工作人员回复/立项更新为visible; 插入数据默认不展示 + * 创建时间 */ private Date createdTime; diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java index ad88c1ce36..7d8187c110 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java @@ -17,11 +17,13 @@ public class IcEventListFormDTO implements Serializable { public interface Detail extends CustomerClientShowGroup { } + public interface GovRedDot extends CustomerClientShowGroup { + } /** * 事件ID */ - @NotBlank(message = "事件ID不能为空", groups = Detail.class) + @NotBlank(message = "事件ID不能为空", groups = {Detail.class, GovRedDot.class}) private String icEventId; /** * 所属组织 diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java index 19bb9b55df..3daaf0de18 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java @@ -136,6 +136,10 @@ public class IcEventListResultDTO implements Serializable { * 报事人的红点:展示1;不展示:0;人大代表回复,工作人员回复/立项/转需求/办结更新为1; */ private Integer redDot; + /** + * 工作端的红点:展示1;不展示:0;【居民报事、回复更新为1】 + */ + private Integer govRedDot; /** * 最近一次操作时间(回复、立项、转需求、办结更新此列) */ diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java index 8e65d4273d..ac46560dc7 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java @@ -449,4 +449,15 @@ public class IcEventController { } } + /** + * @Author sun + * @Description 工作端事件红点消除 + **/ + @PostMapping("govRedDot") + public Result govRedDot(@RequestBody IcEventListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, IcEventListFormDTO.GovRedDot.class); + icEventService.govRedDot(formDTO.getIcEventId()); + return new Result(); + } + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java index db3fc54536..a8e83bcf7c 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java @@ -121,6 +121,11 @@ public class IcEventEntity extends BaseEpmetEntity { */ private Integer redDot; + /** + * 工作端的红点:展示1;不展示:0;【居民报事、回复更新为1】 + */ + private Integer govRedDot; + /** * 最近一次操作时间(回复、立项、转需求、办结更新此列) */ diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java index d7b548aca9..2a3545fc9c 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java @@ -215,4 +215,9 @@ public interface IcEventService extends BaseService { * @return */ MyReportIcEvResDTO myReportDetail(MyReportIcEvFormDTO formDTO); + + /** + * @Description 工作端事件红点消除 + **/ + void govRedDot(String icEventId); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java index 5d1c2f9fbd..7a43bf8e82 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java @@ -1267,9 +1267,12 @@ public class IcEventServiceImpl extends BaseServiceImpl attachmentEntityList = new ArrayList<>(); @@ -1426,7 +1429,10 @@ public class IcEventServiceImpl extends BaseServiceImpl + @@ -169,6 +170,7 @@ ie.operation_id, ie.read_flag, ie.red_dot, + ie.gov_red_dot, ie.latest_operated_time, ie.resolve_status, ie.close_remark, diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 12e1f1d616..f6692d8e85 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -441,11 +441,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcResiUserEntity::getCustomerId, tokenDto.getCustomerId()); + wrapper.eq(IcResiUserEntity::getIdCard, map.get("ID_CARD")); + wrapper.ne(IcResiUserEntity::getId, map.get("ID")); + List entityList = baseDao.selectList(wrapper); + if (CollectionUtils.isNotEmpty(entityList)) { String errorMsg = "修改居民信息失败,身份证号已存在!"; throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); }