70 changed files with 4192 additions and 8 deletions
@ -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'); |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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<Attachment> 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; |
||||
|
} |
||||
|
} |
||||
@ -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<IcServiceProjectAttachmentDTO> attachmentList; |
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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<IcServiceScopeDTO> 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; |
||||
|
|
||||
|
} |
||||
@ -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<IcServiceFeedbackResDTO.Attachment> attachmentList; |
||||
|
|
||||
|
@Data |
||||
|
public static class Attachment { |
||||
|
private String attachmentName; |
||||
|
private String attachmentFormat; |
||||
|
private String attachmentType; |
||||
|
private String attachmentUrl; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -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<ServiceType> 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; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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<IcServiceScopeDTO> serviceScope; |
||||
|
|
||||
|
/** |
||||
|
* 服务人数 |
||||
|
*/ |
||||
|
private Integer servicePeopleNumber; |
||||
|
|
||||
|
/** |
||||
|
* 反馈详情 |
||||
|
*/ |
||||
|
private IcServiceFeedbackResDTO feedBack; |
||||
|
} |
||||
@ -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; |
||||
|
} |
||||
@ -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<IcServiceProjectAttachmentDTO> attachmentList; |
||||
|
|
||||
|
public ServiceProjectListResultDTO() { |
||||
|
this.serviceCategory = ""; |
||||
|
this.serviceProjectId = ""; |
||||
|
this.serviceName = ""; |
||||
|
this.serviceContent = ""; |
||||
|
this.policyGround = ""; |
||||
|
this.policyLevel = ""; |
||||
|
this.policyLevelName = ""; |
||||
|
} |
||||
|
} |
||||
@ -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; |
||||
|
} |
||||
@ -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<PageData<IcServiceOrgListResultDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgListFormDTO formDTO){ |
||||
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
formDTO.setStaffId(tokenDto.getUserId()); |
||||
|
return new Result<PageData<IcServiceOrgListResultDTO>>().ok(icServiceOrgService.list(formDTO)); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
||||
|
public Result<IcServiceOrgDTO> get(@PathVariable("id") String id){ |
||||
|
IcServiceOrgDTO data = icServiceOrgService.get(id); |
||||
|
return new Result<IcServiceOrgDTO>().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<IcServiceOrgListResultDTO> detail(@RequestBody IcServiceOrgListFormDTO formDTO) { |
||||
|
return new Result<IcServiceOrgListResultDTO>().ok(icServiceOrgService.detail(formDTO)); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping("selectlist") |
||||
|
public Result<List<IcServiceOrgSelectListResultDTO>> selectList(@LoginUser TokenDto tokenDto, @RequestBody IcServiceOrgListFormDTO formDTO){ |
||||
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
formDTO.setStaffId(tokenDto.getUserId()); |
||||
|
return new Result<List<IcServiceOrgSelectListResultDTO>>().ok(icServiceOrgService.selectList(formDTO)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -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<PageData<IcServiceProjectAttachmentDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<IcServiceProjectAttachmentDTO> page = icServiceProjectAttachmentService.page(params); |
||||
|
return new Result<PageData<IcServiceProjectAttachmentDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
||||
|
public Result<IcServiceProjectAttachmentDTO> get(@PathVariable("id") String id){ |
||||
|
IcServiceProjectAttachmentDTO data = icServiceProjectAttachmentService.get(id); |
||||
|
return new Result<IcServiceProjectAttachmentDTO>().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(); |
||||
|
} |
||||
|
} |
||||
@ -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<PageData<IcServiceProjectDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<IcServiceProjectDTO> page = icServiceProjectService.page(params); |
||||
|
return new Result<PageData<IcServiceProjectDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
||||
|
public Result<IcServiceProjectDTO> get(@PathVariable("id") String id){ |
||||
|
IcServiceProjectDTO data = icServiceProjectService.get(id); |
||||
|
return new Result<IcServiceProjectDTO>().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<PageData> serviceProjectList(@LoginUser TokenDto tokenDto,@RequestBody ServiceProjectListFormDTO formDTO){ |
||||
|
formDTO.setCustomerId(tokenDto.getCustomerId()); |
||||
|
formDTO.setUserId(tokenDto.getUserId()); |
||||
|
return new Result<PageData>().ok(icServiceProjectService.serviceProjectList(formDTO)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Desc: 服务项目详情 |
||||
|
* @param formDTO |
||||
|
* @author zxc |
||||
|
* @date 2022/5/30 15:46 |
||||
|
*/ |
||||
|
@PostMapping("serviceProjectDetail") |
||||
|
public Result<ServiceProjectListResultDTO> serviceProjectDetail(@RequestBody ServiceProjectListFormDTO formDTO){ |
||||
|
ValidatorUtils.validateEntity(formDTO, ServiceProjectListFormDTO.ServiceProjectDetail.class); |
||||
|
return new Result<ServiceProjectListResultDTO>().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<String> 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<IcServiceRecDetailRes> queryServiceDetail(@PathVariable("service-id") String serviceId) { |
||||
|
return new Result<IcServiceRecDetailRes>().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<ServiceProjectRecordResultDTO> 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(); |
||||
|
} |
||||
|
} |
||||
@ -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<IcServiceFeedbackEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 根据服务记录id,查询反馈记录 |
||||
|
* @param serviceRecordId |
||||
|
* @return |
||||
|
*/ |
||||
|
IcServiceFeedbackResDTO selectByRecId(@Param("serviceRecordId") String serviceRecordId); |
||||
|
|
||||
|
/** |
||||
|
* 根据服务反馈id,查询附件列表 |
||||
|
* @param feedBackId |
||||
|
* @return |
||||
|
*/ |
||||
|
List<IcServiceFeedbackResDTO.Attachment> getAttachmentList(String feedBackId); |
||||
|
} |
||||
@ -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<IcServiceOrgEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 服务组织-列表查询 |
||||
|
**/ |
||||
|
List<IcServiceOrgListResultDTO> selectServiceOrgList(IcServiceOrgListFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* @Author sun |
||||
|
* @Description 服务组织列表_下拉框 |
||||
|
**/ |
||||
|
List<IcServiceOrgSelectListResultDTO> selectServiceOrgSelectList(IcServiceOrgListFormDTO formDTO); |
||||
|
|
||||
|
void del(IcServiceOrgEntity entity); |
||||
|
} |
||||
@ -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<IcServiceProjectAttachmentEntity> { |
||||
|
|
||||
|
/** |
||||
|
* Desc: 根据服务项目ID删除附件 |
||||
|
* @param id |
||||
|
* @author zxc |
||||
|
* @date 2022/5/30 09:50 |
||||
|
*/ |
||||
|
void delAttachmentByServiceProjectId(@Param("id")String id); |
||||
|
|
||||
|
} |
||||
@ -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<IcServiceProjectEntity> { |
||||
|
|
||||
|
/** |
||||
|
* Desc: 查询服务项目列表 |
||||
|
* @param formDTO |
||||
|
* @author zxc |
||||
|
* @date 2022/5/27 17:13 |
||||
|
*/ |
||||
|
List<ServiceProjectListResultDTO> getServiceProjectList(ServiceProjectListFormDTO formDTO); |
||||
|
|
||||
|
/** |
||||
|
* Desc: 上下架【服务项目】 |
||||
|
* @param ids |
||||
|
* @author zxc |
||||
|
* @date 2022/5/30 10:17 |
||||
|
*/ |
||||
|
void serviceProjectEnabled(@Param("ids") List<String> ids); |
||||
|
|
||||
|
} |
||||
@ -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<IcServiceRecordEntity> { |
||||
|
|
||||
|
List<ServiceProjectRecordResultDTO> 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); |
||||
|
} |
||||
@ -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<IcServiceScopeEntity> { |
||||
|
|
||||
|
int update(@Param("serviceId") String serviceId, @Param("userId") String userId); |
||||
|
|
||||
|
List<IcServiceScopeDTO> selectList(String serviceRecordId); |
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
} |
||||
@ -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; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -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<IcServiceOrgEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param formDTO |
||||
|
* @return java.util.List<IcServiceOrgDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-05-27 |
||||
|
*/ |
||||
|
PageData<IcServiceOrgListResultDTO> 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<IcServiceOrgSelectListResultDTO> selectList(IcServiceOrgListFormDTO formDTO); |
||||
|
|
||||
|
} |
||||
@ -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<IcServiceProjectAttachmentEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<IcServiceProjectAttachmentDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-05-27 |
||||
|
*/ |
||||
|
PageData<IcServiceProjectAttachmentDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<IcServiceProjectAttachmentDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-05-27 |
||||
|
*/ |
||||
|
List<IcServiceProjectAttachmentDTO> list(Map<String, Object> 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); |
||||
|
} |
||||
@ -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<IcServiceProjectEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<IcServiceProjectDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-05-27 |
||||
|
*/ |
||||
|
PageData<IcServiceProjectDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<IcServiceProjectDTO> |
||||
|
* @author generator |
||||
|
* @date 2022-05-27 |
||||
|
*/ |
||||
|
List<IcServiceProjectDTO> list(Map<String, Object> 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<String> ids); |
||||
|
|
||||
|
} |
||||
@ -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<IcServiceRecordEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 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<ServiceProjectRecordResultDTO> 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); |
||||
|
} |
||||
@ -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<IcServiceScopeEntity> { |
||||
|
|
||||
|
} |
||||
@ -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<IcServiceOrgDao, IcServiceOrgEntity> implements IcServiceOrgService { |
||||
|
@Autowired |
||||
|
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcServiceOrgListResultDTO> 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<IcServiceOrgListResultDTO> list = baseDao.selectServiceOrgList(formDTO); |
||||
|
PageInfo<IcServiceOrgListResultDTO> pageInfo = new PageInfo<>(list); |
||||
|
|
||||
|
//封装服务类别数据
|
||||
|
if (!CollectionUtils.isEmpty(list)) { |
||||
|
//服务类别字典表数据
|
||||
|
Result<Map<String, String>> statusRes = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.IC_SERVICE_TYPE.getCode()); |
||||
|
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); |
||||
|
List<IcServiceOrgListResultDTO.ServiceType> 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<IcServiceOrgEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcServiceOrgEntity> 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<IcServiceOrgEntity> tWrapper = new LambdaQueryWrapper<>(); |
||||
|
tWrapper.eq(IcServiceOrgEntity::getAgencyId, staffInfo.getAgencyId()); |
||||
|
tWrapper.eq(IcServiceOrgEntity::getOrgName, formDTO.getOrgName()); |
||||
|
List<IcServiceOrgEntity> 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<IcServiceOrgEntity> tWrapper = new LambdaQueryWrapper<>(); |
||||
|
tWrapper.eq(IcServiceOrgEntity::getAgencyId, staffInfo.getAgencyId()); |
||||
|
tWrapper.ne(IcServiceOrgEntity::getId, formDTO.getIcServiceOrgId()); |
||||
|
tWrapper.eq(IcServiceOrgEntity::getOrgName, formDTO.getOrgName()); |
||||
|
List<IcServiceOrgEntity> 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<IcServiceOrgListResultDTO> list = baseDao.selectServiceOrgList(formDTO); |
||||
|
|
||||
|
//封装服务类别数据
|
||||
|
if (!CollectionUtils.isEmpty(list)) { |
||||
|
resultDTO = list.get(NumConstant.ZERO); |
||||
|
//服务类别字典表数据
|
||||
|
Result<Map<String, String>> statusRes = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.IC_SERVICE_TYPE.getCode()); |
||||
|
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); |
||||
|
List<IcServiceOrgListResultDTO.ServiceType> 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<IcServiceOrgSelectListResultDTO> 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<IcServiceOrgSelectListResultDTO> resultList = baseDao.selectServiceOrgSelectList(formDTO); |
||||
|
|
||||
|
return resultList; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -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<IcServiceProjectAttachmentDao, IcServiceProjectAttachmentEntity> implements IcServiceProjectAttachmentService { |
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcServiceProjectAttachmentDTO> page(Map<String, Object> params) { |
||||
|
IPage<IcServiceProjectAttachmentEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, IcServiceProjectAttachmentDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IcServiceProjectAttachmentDTO> list(Map<String, Object> params) { |
||||
|
List<IcServiceProjectAttachmentEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, IcServiceProjectAttachmentDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<IcServiceProjectAttachmentEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcServiceProjectAttachmentEntity> 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)); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -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<IcServiceProjectDao, IcServiceProjectEntity> implements IcServiceProjectService { |
||||
|
|
||||
|
@Autowired |
||||
|
private IcServiceProjectAttachmentService attachmentService; |
||||
|
@Autowired |
||||
|
private IcServiceProjectAttachmentDao attachmentDao; |
||||
|
@Autowired |
||||
|
private EpmetAdminOpenFeignClient adminOpenFeignClient; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<IcServiceProjectDTO> page(Map<String, Object> params) { |
||||
|
IPage<IcServiceProjectEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, IcServiceProjectDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IcServiceProjectDTO> list(Map<String, Object> params) { |
||||
|
List<IcServiceProjectEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, IcServiceProjectDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<IcServiceProjectEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<IcServiceProjectEntity> 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<List<ServiceProjectListResultDTO>> 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<ServiceProjectListResultDTO> 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<List<DictListResultDTO>> 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<ServiceProjectListResultDTO> serviceProjectList = baseDao.getServiceProjectList(formDTO); |
||||
|
if (CollectionUtils.isNotEmpty(serviceProjectList)){ |
||||
|
DictListFormDTO dictListFormDTO = new DictListFormDTO(); |
||||
|
dictListFormDTO.setDictType("ic_service_type"); |
||||
|
Result<List<DictListResultDTO>> 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<IcServiceProjectEntity> 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<String> 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<IcServiceProjectAttachmentDTO> 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<IcServiceProjectAttachmentEntity> 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); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -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<IcServiceRecordDao, IcServiceRecordEntity> 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<Map<String, String>> 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<ServiceProjectRecordResultDTO> listServiceRecords(String serviceCategoryKey, String serviceProjectName, |
||||
|
String serviceOrgName, Date serviceTimeStart, |
||||
|
Date serviceTimeEnd, String serviceStatus, |
||||
|
String satisfaction, Integer pageNo, |
||||
|
Integer pageSize) { |
||||
|
|
||||
|
String msg = "【服务列表】查询服务类别失败"; |
||||
|
Map<String, String> 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<ServiceProjectRecordResultDTO> records = baseDao.listServiceRecords(serviceCategoryKey, serviceProjectName, serviceOrgName, serviceTimeStart, serviceTimeEnd, serviceStatus, satisfaction); |
||||
|
PageInfo<ServiceProjectRecordResultDTO> 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<IcServiceRecordEntity> 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<IcServiceScopeDTO> 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<ServiceProjectFeedbackFormDTO.Attachment> 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); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -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<IcServiceScopeDao, IcServiceScopeEntity> implements IcServiceScopeService { |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -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 '服务范围表' |
||||
@ -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`; |
||||
|
|
||||
@ -0,0 +1,2 @@ |
|||||
|
alter table ic_service_record |
||||
|
add SERVICE_PEOPLE_NUMBER int(10) comment '服务人数' after SERVICE_STATUS; |
||||
@ -0,0 +1,76 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcServiceFeedbackDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.IcServiceFeedbackEntity" id="icServiceFeedbackMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="serviceCategoryKey" column="SERVICE_CATEGORY_KEY"/> |
||||
|
<result property="serviceProjectId" column="SERVICE_PROJECT_ID"/> |
||||
|
<result property="serviceOrgId" column="SERVICE_ORG_ID"/> |
||||
|
<result property="serviceGoal" column="SERVICE_GOAL"/> |
||||
|
<result property="serviceEffect" column="SERVICE_EFFECT"/> |
||||
|
<!--<result property="servicePeopleNumber" column="SERVICE_PEOPLE_NUMBER"/>--> |
||||
|
<result property="satisfaction" column="SATISFACTION"/> |
||||
|
<result property="longitude" column="LONGITUDE"/> |
||||
|
<result property="latitude" column="LATITUDE"/> |
||||
|
<result property="address" column="address"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="serviceRecordId" column="SERVICE_RECORD_ID"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<resultMap id="IcServiceFeedbackResDTOMap" type="com.epmet.dto.result.IcServiceFeedbackResDTO"> |
||||
|
<result property="serviceGoal" column="SERVICE_GOAL"/> |
||||
|
<result property="serviceEffect" column="SERVICE_EFFECT"/> |
||||
|
<result property="satisfaction" column="SATISFACTION"/> |
||||
|
<result property="longitude" column="LONGITUDE"/> |
||||
|
<result property="latitude" column="LATITUDE"/> |
||||
|
<result property="address" column="address"/> |
||||
|
<result property="feedBackId" column="feedBackId"/> |
||||
|
<collection property="attachmentList" column="feedBackId" |
||||
|
ofType="com.epmet.dto.result.IcServiceFeedbackResDTO$Attachment" |
||||
|
select="com.epmet.dao.IcServiceFeedbackDao.getAttachmentList"> |
||||
|
<result property="attachmentName" column="ATTACHMENT_NAME"/> |
||||
|
<result property="attachmentFormat" column="ATTACHMENT_FORMAT"/> |
||||
|
<result property="attachmentType" column="ATTACHMENT_TYPE"/> |
||||
|
<result property="attachmentUrl" column="ATTACHMENT_URL"/> |
||||
|
</collection> |
||||
|
</resultMap> |
||||
|
<select id="selectByRecId" parameterType="map" resultMap="IcServiceFeedbackResDTOMap"> |
||||
|
SELECT |
||||
|
f.SERVICE_GOAL, |
||||
|
f.SERVICE_EFFECT, |
||||
|
f.SERVICE_PEOPLE_NUMBER, |
||||
|
f.SATISFACTION, |
||||
|
f.LATITUDE, |
||||
|
f.LONGITUDE, |
||||
|
f.address, |
||||
|
f.id as feedBackId |
||||
|
FROM |
||||
|
ic_service_feedback f |
||||
|
WHERE |
||||
|
f.DEL_FLAG = '0' |
||||
|
and f.SERVICE_RECORD_ID = #{serviceRecordId} |
||||
|
</select> |
||||
|
|
||||
|
<select id="getAttachmentList" parameterType="java.lang.String" resultType="com.epmet.dto.result.IcServiceFeedbackResDTO$Attachment"> |
||||
|
SELECT |
||||
|
t.ATTACHMENT_NAME, |
||||
|
t.ATTACHMENT_TYPE, |
||||
|
t.ATTACHMENT_FORMAT, |
||||
|
t.ATTACHMENT_URL |
||||
|
FROM |
||||
|
ic_service_project_attachment t |
||||
|
WHERE |
||||
|
t.DEL_FLAG = '0' |
||||
|
AND t.IC_SERVICE_ID = #{feedBackId} |
||||
|
ORDER BY |
||||
|
t.SORT ASC |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,78 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcServiceOrgDao"> |
||||
|
|
||||
|
<select id="selectServiceOrgList" resultType="com.epmet.dto.result.IcServiceOrgListResultDTO"> |
||||
|
SELECT |
||||
|
id icServiceOrgId, |
||||
|
agency_id agencyId, |
||||
|
service_type serviceType, |
||||
|
org_name orgName, |
||||
|
org_describe orgDescribe, |
||||
|
principal_name principalName, |
||||
|
principal_mobile principalMobile, |
||||
|
longitude longitude, |
||||
|
latitude latitude, |
||||
|
address address, |
||||
|
remark remark |
||||
|
FROM |
||||
|
ic_service_org |
||||
|
WHERE |
||||
|
del_flag = '0' |
||||
|
<if test="icServiceOrgId != null and icServiceOrgId != '' "> |
||||
|
AND id = #{icServiceOrgId} |
||||
|
</if> |
||||
|
<if test="customerId != null and customerId != '' "> |
||||
|
AND customer_id = #{customerId} |
||||
|
</if> |
||||
|
<if test="agencyId != null and agencyId != '' "> |
||||
|
AND agency_id_path LIKE CONCAT('%',#{agencyId},'%') |
||||
|
</if> |
||||
|
<if test="serviceType != null and serviceType != '' "> |
||||
|
AND service_type LIKE CONCAT('%', #{serviceType}, '%') |
||||
|
</if> |
||||
|
<if test="orgName != null and orgName != '' "> |
||||
|
AND org_name LIKE CONCAT('%', #{orgName}, '%') |
||||
|
</if> |
||||
|
<if test="address != null and address != '' "> |
||||
|
AND address LIKE CONCAT('%', #{address}, '%') |
||||
|
</if> |
||||
|
<if test="remark != null and remark != '' "> |
||||
|
AND remark LIKE CONCAT('%', #{remark}, '%') |
||||
|
</if> |
||||
|
ORDER BY created_time DESC |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectServiceOrgSelectList" resultType="com.epmet.dto.result.IcServiceOrgSelectListResultDTO"> |
||||
|
SELECT |
||||
|
id icServiceOrgId, |
||||
|
org_name orgName |
||||
|
FROM |
||||
|
ic_service_org |
||||
|
WHERE |
||||
|
del_flag = '0' |
||||
|
<if test="customerId != null and customerId != '' "> |
||||
|
AND customer_id = #{customerId} |
||||
|
</if> |
||||
|
<if test="agencyId != null and agencyId != '' "> |
||||
|
AND agency_id_path LIKE CONCAT('%',#{agencyId},'%') |
||||
|
</if> |
||||
|
<if test="serviceType != null and serviceType != '' "> |
||||
|
AND service_type LIKE CONCAT('%', #{serviceType}, '%') |
||||
|
</if> |
||||
|
ORDER BY created_time DESC |
||||
|
</select> |
||||
|
|
||||
|
<delete id="del"> |
||||
|
UPDATE ic_service_org |
||||
|
SET del_flag = '1', |
||||
|
updated_by = #{updatedBy}, |
||||
|
updated_time = NOW() |
||||
|
WHERE |
||||
|
id = #{id} |
||||
|
AND del_flag = '0' |
||||
|
</delete> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,11 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcServiceProjectAttachmentDao"> |
||||
|
|
||||
|
<!--根据服务项目IDs删除附件--> |
||||
|
<delete id="delAttachmentByServiceProjectId"> |
||||
|
DELETE FROM ic_service_project_attachment |
||||
|
WHERE IC_SERVICE_ID = #{id} |
||||
|
</delete> |
||||
|
</mapper> |
||||
@ -0,0 +1,72 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcServiceProjectDao"> |
||||
|
|
||||
|
<!-- 上下架【服务项目】 --> |
||||
|
<update id="serviceProjectEnabled"> |
||||
|
UPDATE ic_service_project |
||||
|
SET ENABLED = 1, |
||||
|
UPDATED_TIME = NOW() |
||||
|
WHERE ID IN ( |
||||
|
<foreach collection="ids" item="id" separator=",">#{id}</foreach> |
||||
|
) |
||||
|
</update> |
||||
|
|
||||
|
<!-- 查询服务项目列表 --> |
||||
|
<resultMap id="getServiceProjectListMap" type="com.epmet.dto.result.ServiceProjectListResultDTO"> |
||||
|
<result column="serviceProjectId" property="serviceProjectId"/> |
||||
|
<result column="serviceName" property="serviceName"/> |
||||
|
<result column="serviceContent" property="serviceContent"/> |
||||
|
<result column="serviceCategoryKey" property="serviceCategoryKey"/> |
||||
|
<result column="policyGround" property="policyGround"/> |
||||
|
<result column="policyLevel" property="policyLevel"/> |
||||
|
<result column="policyLevelName" property="policyLevelName"/> |
||||
|
<collection property="attachmentList" column="serviceProjectId" ofType="com.epmet.dto.IcServiceProjectAttachmentDTO" select="getAttachmentList"/> |
||||
|
</resultMap> |
||||
|
<select id="getServiceProjectList" resultMap="getServiceProjectListMap"> |
||||
|
SELECT |
||||
|
SERVICE_NAME AS serviceName, |
||||
|
SERVICE_CONTENT AS serviceContent, |
||||
|
SERVICE_CATEGORY_KEY AS serviceCategoryKey, |
||||
|
ID AS serviceProjectId, |
||||
|
POLICY_GROUND AS policyGround, |
||||
|
POLICY_LEVEL AS policyLevel, |
||||
|
(CASE WHEN POLICY_LEVEL = '0' THEN '市级' |
||||
|
WHEN POLICY_LEVEL = '1' THEN '区级' |
||||
|
WHEN POLICY_LEVEL = '2' THEN '街道级' |
||||
|
ELSE '' end) AS policyLevelName |
||||
|
FROM ic_service_project |
||||
|
WHERE DEL_FLAG = 0 |
||||
|
AND ENABLED = 0 |
||||
|
<if test='null != serviceProjectId and serviceProjectId != "" '> |
||||
|
AND ID = #{serviceProjectId} |
||||
|
</if> |
||||
|
<if test='null != agencyId and agencyId != "" '> |
||||
|
AND AGENCY_ID = #{agencyId} |
||||
|
</if> |
||||
|
<if test='null != serviceCategoryKey and serviceCategoryKey != "" '> |
||||
|
AND SERVICE_CATEGORY_KEY = #{serviceCategoryKey} |
||||
|
</if> |
||||
|
<if test='null != serviceName and serviceName != "" '> |
||||
|
AND SERVICE_NAME LIKE CONCAT('%',#{serviceName},'%') |
||||
|
</if> |
||||
|
<if test='null != serviceContent and serviceContent != "" '> |
||||
|
AND SERVICE_CONTENT LIKE CONCAT('%',#{serviceContent},'%') |
||||
|
</if> |
||||
|
<if test='null != policyGround and policyGround != "" '> |
||||
|
AND POLICY_GROUND LIKE CONCAT('%',#{policyGround},'%') |
||||
|
</if> |
||||
|
ORDER BY CREATED_TIME desc |
||||
|
</select> |
||||
|
<select id="getAttachmentList" resultType="com.epmet.dto.IcServiceProjectAttachmentDTO"> |
||||
|
SELECT |
||||
|
ATTACHMENT_NAME as name, |
||||
|
ATTACHMENT_TYPE as type, |
||||
|
ATTACHMENT_FORMAT as format, |
||||
|
ATTACHMENT_URL as url |
||||
|
FROM ic_service_project_attachment |
||||
|
WHERE DEL_FLAG = '0' |
||||
|
AND IC_SERVICE_ID = #{serviceProjectId} |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -0,0 +1,69 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcServiceRecordDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.IcServiceRecordEntity" id="icServiceRecordMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="serviceCategoryKey" column="SERVICE_CATEGORY_KEY"/> |
||||
|
<result property="serviceProjectId" column="SERVICE_PROJECT_ID"/> |
||||
|
<result property="serviceProjectName" column="SERVICE_PROJECT_NAME"/> |
||||
|
<result property="serviceOrgId" column="SERVICE_ORG_ID"/> |
||||
|
<result property="serviceOrgName" column="SERVICE_ORG_NAME"/> |
||||
|
<result property="principalName" column="PRINCIPAL_NAME"/> |
||||
|
<result property="principalContact" column="PRINCIPAL_CONTACT"/> |
||||
|
<result property="serviceTimeStart" column="SERVICE_TIME_START"/> |
||||
|
<result property="serviceTimeEnd" column="SERVICE_TIME_END"/> |
||||
|
<result property="serviceStatus" column="SERVICE_STATUS"/> |
||||
|
<result property="remark" column="REMARK"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="servicePeopleNumber" column="SERVICE_PEOPLE_NUMBER"/> |
||||
|
</resultMap> |
||||
|
<select id="listServiceRecords" resultType="com.epmet.dto.result.ServiceProjectRecordResultDTO"> |
||||
|
select record.ID as serviceRecordId, |
||||
|
record.SERVICE_CATEGORY_KEY, |
||||
|
record.SERVICE_PROJECT_ID, |
||||
|
record.SERVICE_PROJECT_NAME, |
||||
|
record.SERVICE_ORG_ID, |
||||
|
record.SERVICE_ORG_NAME, |
||||
|
record.SERVICE_TIME_START, |
||||
|
record.SERVICE_TIME_END, |
||||
|
record.SERVICE_STATUS, |
||||
|
record.SERVICE_PEOPLE_NUMBER |
||||
|
from ic_service_record record |
||||
|
left join ic_service_feedback feedback on (record.ID = feedback.SERVICE_RECORD_ID) |
||||
|
<where> |
||||
|
record.DEL_FLAG = '0' |
||||
|
and (feedback.DEL_FLAG is null or feedback.DEL_FLAG = '0') |
||||
|
<if test="serviceCategoryKey != null and serviceCategoryKey != ''"> |
||||
|
and record.SERVICE_CATEGORY_KEY = #{serviceCategoryKey} |
||||
|
</if> |
||||
|
<if test="serviceProjectName != null and serviceProjectName != ''"> |
||||
|
and record.SERVICE_PROJECT_NAME like CONCAT('%',#{serviceProjectName},'%') |
||||
|
</if> |
||||
|
<if test="serviceOrgName != null and serviceOrgName != ''"> |
||||
|
and record.SERVICE_ORG_NAME like CONCAT('%',#{serviceOrgName},'%') |
||||
|
</if> |
||||
|
<if test="serviceTimeStart != null and serviceTimeEnd != null"> |
||||
|
and ( |
||||
|
(record.SERVICE_TIME_START between #{serviceTimeStart} and #{serviceTimeEnd}) |
||||
|
or (record.SERVICE_TIME_END between #{serviceTimeStart} and #{serviceTimeEnd}) |
||||
|
) |
||||
|
</if> |
||||
|
<if test="serviceStatus != null and serviceStatus != ''"> |
||||
|
and record.SERVICE_STATUS = #{serviceStatus} |
||||
|
</if> |
||||
|
<if test="satisfaction != null and satisfaction != ''"> |
||||
|
and feedback.SATISFACTION = #{satisfaction} |
||||
|
</if> |
||||
|
</where> |
||||
|
order by record.CREATED_TIME desc |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,42 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.IcServiceScopeDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.IcServiceScopeEntity" id="icServiceScopeMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="serviceCategoryId" column="SERVICE_CATEGORY_ID"/> |
||||
|
<result property="serviceProjectId" column="SERVICE_PROJECT_ID"/> |
||||
|
<result property="serviceOrgId" column="SERVICE_ORG_ID"/> |
||||
|
<result property="serviceRecordId" column="SERVICE_RECORD_ID"/> |
||||
|
<result property="objectType" column="OBJECT_TYPE"/> |
||||
|
<result property="objectId" column="OBJECT_ID"/> |
||||
|
<result property="objectIdPath" column="OBJECT_ID_PATH"/> |
||||
|
<result property="objectName" column="OBJECT_NAME"/> |
||||
|
<result property="remark" column="REMARK"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<update id="update" parameterType="map"> |
||||
|
update ic_service_scope set del_flag='1',UPDATED_TIME=now(),UPDATED_BY=#{userId} |
||||
|
where SERVICE_RECORD_ID=#{serviceId} |
||||
|
</update> |
||||
|
|
||||
|
<select id="selectList" parameterType="java.lang.String" resultType="com.epmet.dto.result.IcServiceScopeDTO"> |
||||
|
SELECT |
||||
|
s.OBJECT_ID, |
||||
|
s.OBJECT_TYPE, |
||||
|
s.OBJECT_NAME, |
||||
|
s.OBJECT_ID_PATH |
||||
|
FROM |
||||
|
ic_service_scope s |
||||
|
WHERE |
||||
|
s.DEL_FLAG = '0' |
||||
|
AND s.SERVICE_RECORD_ID = #{serviceRecordId} |
||||
|
</select> |
||||
|
</mapper> |
||||
@ -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<ServiceProjectScopeResultDTO> children; |
||||
|
|
||||
|
} |
||||
@ -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<ServiceProjectScopeResultDTO> getServiceScopeTree(@LoginUser TokenDto loginInfo) { |
||||
|
ServiceProjectScopeResultDTO r = serviceProjectService.getServiceScopeTree(loginInfo.getUserId()); |
||||
|
return new Result<ServiceProjectScopeResultDTO>().ok(r); |
||||
|
} |
||||
|
} |
||||
@ -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); |
||||
|
} |
||||
@ -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<ServiceProjectScopeResultDTO> convert2ServiceProjectScope(List<AgencyTreeResultDTO> oldChildren) { |
||||
|
|
||||
|
ArrayList<ServiceProjectScopeResultDTO> 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<IcNeighborHoodDTO> neighborhoods = neighborHoodDao.selectNeighborList(oldChild.getAgencyId()); |
||||
|
|
||||
|
List<ServiceProjectScopeResultDTO> neighborhoodScopes = neighborhoods.stream().map(n -> new ServiceProjectScopeResultDTO(n.getId(), |
||||
|
n.getNeighborHoodName(), |
||||
|
"neighborhood", |
||||
|
null)).collect(Collectors.toList()); |
||||
|
|
||||
|
scope.setChildren(neighborhoodScopes); |
||||
|
} else { |
||||
|
// 递归处理子级
|
||||
|
List<AgencyTreeResultDTO> subAgencyList = oldChild.getSubAgencyList(); |
||||
|
if (subAgencyList != null && !CollectionUtils.isEmpty(subAgencyList)) { |
||||
|
List<ServiceProjectScopeResultDTO> 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()
|
||||
|
// }
|
||||
|
// }
|
||||
|
//
|
||||
|
//}
|
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
ALTER TABLE `ic_event` |
||||
|
ADD COLUMN `GOV_RED_DOT` tinyint(1) NOT NULL DEFAULT 0 COMMENT '工作端的红点:展示1;不展示:0;【居民报事、回复更新为1】' AFTER `RED_DOT`; |
||||
|
|
||||
|
ALTER TABLE `ic_event` |
||||
|
MODIFY COLUMN `CREATED_TIME` datetime NOT NULL COMMENT '创建时间' AFTER `CREATED_BY`; |
||||
|
|
||||
Loading…
Reference in new issue