forked from luyan/epmet-cloud-lingshan
15 changed files with 768 additions and 0 deletions
@ -0,0 +1,59 @@ |
|||
package com.epmet; |
|||
|
|||
/** |
|||
* @Description 红色待办-待办状态枚举 |
|||
* @Author wangxianzhang |
|||
* @Time 2023/5/9 9:59 AM |
|||
*/ |
|||
public enum LingShanAgentServiceProcessStatusEnum { |
|||
// 办理状态。0待受理,1已受理,2已驳回,3已办结,-1已撤回
|
|||
|
|||
WAIT_ACCEPT(0, "待受理"), |
|||
ACCEPTED(1, "已受理"), |
|||
REJECTED(2, "已驳回"), |
|||
CLOSED(3, "已办结"), |
|||
WITHDRAW(-1, "已撤回"); |
|||
|
|||
private int statusCode; |
|||
|
|||
private String statusName; |
|||
|
|||
LingShanAgentServiceProcessStatusEnum(int status, String name) { |
|||
this.statusCode = status; |
|||
this.statusName = name; |
|||
} |
|||
|
|||
public static LingShanAgentServiceProcessStatusEnum getByStatus(int statusCode) { |
|||
for (LingShanAgentServiceProcessStatusEnum e : LingShanAgentServiceProcessStatusEnum.values()) { |
|||
if (e.statusCode == statusCode) { |
|||
return e; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public static LingShanAgentServiceProcessStatusEnum getByName(String statusName) { |
|||
for (LingShanAgentServiceProcessStatusEnum e : LingShanAgentServiceProcessStatusEnum.values()) { |
|||
if (e.statusName.equals(statusName)) { |
|||
return e; |
|||
} |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public int getStatusCode() { |
|||
return statusCode; |
|||
} |
|||
|
|||
public void setStatusCode(int statusCode) { |
|||
this.statusCode = statusCode; |
|||
} |
|||
|
|||
public String getStatusName() { |
|||
return statusName; |
|||
} |
|||
|
|||
public void setStatusName(String statusName) { |
|||
this.statusName = statusName; |
|||
} |
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.epmet.dto.form.agentservice; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 工作端:代理服务办结 |
|||
*/ |
|||
@Data |
|||
public class WorkCloseAgentServiceFormDTO { |
|||
@NotBlank(message = "待办服务ID必填") |
|||
private String id; |
|||
|
|||
private String processDesc; |
|||
private List<String> processAttachments; |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.epmet.dto.form.lingshan; |
|||
|
|||
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.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class AgentServiceResiSubmitFormDTO { |
|||
|
|||
public interface Create extends CustomerClientShowGroup {} |
|||
|
|||
@NotBlank(message = "网格ID不能为空", groups = { Create.class }) |
|||
private String gridId; |
|||
@NotBlank(message = "服务类别不能为空", groups = { Create.class }) |
|||
private String serviceCategory; |
|||
@NotBlank(message = "详细说明不能为空", groups = { Create.class }) |
|||
private String content; |
|||
@NotBlank(message = "预约服务地点不能为空", groups = { Create.class }) |
|||
private String exceptServeAddress; |
|||
@NotBlank(message = "联系人不能为空", groups = { Create.class }) |
|||
private String contactName; |
|||
@NotBlank(message = "联系电话不能为空", groups = { Create.class }) |
|||
private String contactMobile; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@NotNull(message = "预约服务时间不能为空", groups = { Create.class }) |
|||
private Date exceptServeTime; |
|||
private List<String> attachmentsList; |
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.epmet.dto.result.agentservice; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
public class ResiMyCreatedAgentServiceResultDTO { |
|||
|
|||
private String serviceCategory; |
|||
private String serviceCategoryName; |
|||
private String content; |
|||
private Date createdTime; |
|||
// 待受理
|
|||
private Date exceptServeTime; |
|||
private String exceptServeAddress; |
|||
|
|||
/** |
|||
* 处理时间 |
|||
*/ |
|||
private Date processTime; |
|||
|
|||
/** |
|||
* 处理说明 |
|||
*/ |
|||
private String processDesc; |
|||
|
|||
/** |
|||
* 办结时间 |
|||
*/ |
|||
private Date closeTime; |
|||
|
|||
/** |
|||
* 办结说明 |
|||
*/ |
|||
private String closeDesc; |
|||
|
|||
private Integer processStatus; |
|||
|
|||
private String processStatusName; |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.epmet.dto.result.agentservice; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Description 工作单-服务代办列表 |
|||
* @Author wangxianzhang |
|||
* @Time 2023/5/9 10:52 AM |
|||
*/ |
|||
@Data |
|||
public class WorkServiceAgentResultDTO { |
|||
|
|||
private Integer serviceCategory; |
|||
private String serviceCategoryName; |
|||
|
|||
private Date createdTime; |
|||
private String content; |
|||
|
|||
// 待受理
|
|||
private Date exceptServeTime; |
|||
private String exceptServeAddress; |
|||
|
|||
} |
@ -0,0 +1,131 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.LingShanAgentServiceProcessStatusEnum; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.exception.ValidateException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dto.form.agentservice.WorkCloseAgentServiceFormDTO; |
|||
import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO; |
|||
import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO; |
|||
import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; |
|||
import com.epmet.service.LingShanAgentServiceService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @Description 灵山-服务代办 |
|||
* @Author wangxianzhang |
|||
* @Time 2023/5/6 2:49 PM |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("lingshan/serviceAgent") |
|||
public class LingShanAgentServiceController { |
|||
|
|||
@Autowired |
|||
private LingShanAgentServiceService lingShanServiceAgentService; |
|||
|
|||
/** |
|||
* @description: 居民端-提交代办服务 |
|||
* @param form: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/5/6 3:02 PM |
|||
*/ |
|||
@PostMapping("resi/submit") |
|||
public Result resiSubmit(@RequestBody AgentServiceResiSubmitFormDTO form) { |
|||
ValidatorUtils.validateEntity(form, AgentServiceResiSubmitFormDTO.Create.class); |
|||
lingShanServiceAgentService.resiSubmit(form); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* @description: 我创建的 |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/5/9 10:06 AM |
|||
*/ |
|||
@GetMapping("resi/mycreated") |
|||
public Result<PageData<ResiMyCreatedAgentServiceResultDTO>> myCreated(@RequestParam(value = "processStatus", required = false) Integer processStatus, |
|||
@RequestParam("gridId") String gridId, |
|||
@RequestParam("pageNo") Integer pageNo, |
|||
@RequestParam("pageSize") Integer pageSize) { |
|||
|
|||
PageData<ResiMyCreatedAgentServiceResultDTO> pd = lingShanServiceAgentService.myCreatedList(processStatus, gridId, pageNo, pageSize); |
|||
return new Result().ok(pd); |
|||
} |
|||
|
|||
/** |
|||
* @description: 工作端-服务列表 |
|||
* 这个接口返回的跟居民端一样,所以暂时就调用居民端一样的接口了。 |
|||
* @param processStatus: |
|||
* @param gridId: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/5/9 10:59 AM |
|||
*/ |
|||
@GetMapping("work/serviceList") |
|||
public Result<PageData<ResiMyCreatedAgentServiceResultDTO>> workServiceList(@RequestParam(value = "processStatus", required = false) Integer processStatus, |
|||
@RequestParam("gridId") String gridId, |
|||
@RequestParam("pageNo") Integer pageNo, |
|||
@RequestParam("pageSize") Integer pageSize) { |
|||
PageData<ResiMyCreatedAgentServiceResultDTO> pd = lingShanServiceAgentService.myCreatedList(processStatus, gridId, pageNo, pageSize); |
|||
return new Result().ok(pd); |
|||
} |
|||
|
|||
/** |
|||
* @description: 工作端提交处理。没几个参数,不值当用dto了 |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/5/9 11:10 AM |
|||
*/ |
|||
@PostMapping("work/process") |
|||
public Result workProcess(@RequestBody Map<String, Object> input) { |
|||
|
|||
String id = (String) input.get("id"); |
|||
Integer processType = (Integer) input.get("processType"); |
|||
String processDesc = (String) input.get("processDesc"); |
|||
|
|||
if (StringUtils.isAnyBlank(id) || processType == null) { |
|||
throw new ValidateException("参数错误"); |
|||
} |
|||
|
|||
LingShanAgentServiceProcessStatusEnum processTypeEnum = LingShanAgentServiceProcessStatusEnum.getByStatus(processType); |
|||
|
|||
// 如果是驳回,那么描述必填
|
|||
if (processTypeEnum == LingShanAgentServiceProcessStatusEnum.REJECTED |
|||
&& StringUtils.isBlank(processDesc)) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "驳回操作时,驳回原因为必填项"); |
|||
} |
|||
|
|||
lingShanServiceAgentService.workProcess(id, processType, processDesc); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* @description: 工作端:办结 |
|||
* @param input: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/5/9 2:57 PM |
|||
*/ |
|||
@PostMapping("work/close") |
|||
public Result workClose(@RequestBody WorkCloseAgentServiceFormDTO input) { |
|||
ValidatorUtils.validateEntity(input); |
|||
|
|||
String id = input.getId(); |
|||
String processDesc = input.getProcessDesc(); |
|||
List<String> processAttachments = input.getProcessAttachments(); |
|||
|
|||
lingShanServiceAgentService.workClose(id, processDesc, processAttachments); |
|||
return new Result(); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.LingshanAgentServiceCategoryEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 待办服务类别 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-06 |
|||
*/ |
|||
@Mapper |
|||
public interface LingshanAgentServiceCategoryDao extends BaseDao<LingshanAgentServiceCategoryEntity> { |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.LingshanAgentServiceRecordEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 待办服务记录 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-06 |
|||
*/ |
|||
@Mapper |
|||
public interface LingshanAgentServiceRecordDao extends BaseDao<LingshanAgentServiceRecordEntity> { |
|||
|
|||
} |
@ -0,0 +1,39 @@ |
|||
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 2023-05-06 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("lingshan_agent_service_category") |
|||
public class LingshanAgentServiceCategoryEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 租户号 |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 类别名称 |
|||
*/ |
|||
private String categoryName; |
|||
|
|||
/** |
|||
* 描述 |
|||
*/ |
|||
private String description; |
|||
|
|||
} |
@ -0,0 +1,131 @@ |
|||
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 2023-05-06 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("lingshan_agent_service_record") |
|||
public class LingshanAgentServiceRecordEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 租户号 |
|||
*/ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 申请人ID(居民端用户ID) |
|||
*/ |
|||
private String applicantId; |
|||
|
|||
/** |
|||
* 申请人姓名 |
|||
*/ |
|||
private String applicantName; |
|||
|
|||
/** |
|||
* 代办员ID。默认使用空字符串。 |
|||
*/ |
|||
private String agentId; |
|||
|
|||
/** |
|||
* 代办员姓名 |
|||
*/ |
|||
private String agentName; |
|||
|
|||
/** |
|||
* 提交者所在网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 组织id路径,含本级,含网格id |
|||
*/ |
|||
private String orgIdPath; |
|||
|
|||
private String attachments; |
|||
|
|||
/** |
|||
* 服务类型id |
|||
*/ |
|||
private String serviceCategory; |
|||
|
|||
/** |
|||
* 预约服务时间 |
|||
*/ |
|||
private Date exceptServeTime; |
|||
|
|||
/** |
|||
* 预约服务地点 |
|||
*/ |
|||
private String exceptServeAddress; |
|||
|
|||
/** |
|||
* 受理时间。状态变为受理的时间 |
|||
*/ |
|||
private Date processTime; |
|||
private String processDesc; |
|||
|
|||
private String processAttachments; |
|||
|
|||
/** |
|||
* 联系人姓名 |
|||
*/ |
|||
private String contactName; |
|||
|
|||
/** |
|||
* 联系电话 |
|||
*/ |
|||
private String contactMobile; |
|||
|
|||
/** |
|||
* 办理状态。0待受理,1已受理,2已驳回,3已办结,-1已撤回 |
|||
*/ |
|||
private Integer processStatus; |
|||
|
|||
/** |
|||
* 办结时间 |
|||
*/ |
|||
private Date closeTime; |
|||
|
|||
/** |
|||
* 办结说明 |
|||
*/ |
|||
private String closeDesc; |
|||
|
|||
/** |
|||
* 内容,详细说明 |
|||
*/ |
|||
private String content; |
|||
|
|||
/** |
|||
* 满意度评价。-1不满意,0基本满意,1非常满意 |
|||
*/ |
|||
private Integer satisfication; |
|||
|
|||
/** |
|||
* 经度 |
|||
*/ |
|||
private String longitude; |
|||
/** |
|||
* 纬度 |
|||
*/ |
|||
private String latitude; |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO; |
|||
import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO; |
|||
import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface LingShanAgentServiceService { |
|||
void resiSubmit(AgentServiceResiSubmitFormDTO form); |
|||
|
|||
PageData<ResiMyCreatedAgentServiceResultDTO> myCreatedList(Integer processStatus, String gridId, Integer pageNo, Integer pageSize); |
|||
|
|||
PageData<WorkServiceAgentResultDTO> workServiceList(Integer processStatus, String gridId); |
|||
|
|||
void workProcess(String id, Integer processType, String processDesc); |
|||
|
|||
void workClose(String id, String processDesc, List<String> processAttachments); |
|||
} |
@ -0,0 +1,173 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.epmet.LingShanAgentServiceProcessStatusEnum; |
|||
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.CustomerOrgRedis; |
|||
import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; |
|||
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
|||
import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.utils.EpmetRequestHolder; |
|||
import com.epmet.commons.tools.utils.PidUtils; |
|||
import com.epmet.dao.LingshanAgentServiceCategoryDao; |
|||
import com.epmet.dao.LingshanAgentServiceRecordDao; |
|||
import com.epmet.dto.form.lingshan.AgentServiceResiSubmitFormDTO; |
|||
import com.epmet.dto.result.agentservice.ResiMyCreatedAgentServiceResultDTO; |
|||
import com.epmet.dto.result.agentservice.WorkServiceAgentResultDTO; |
|||
import com.epmet.entity.LingshanAgentServiceCategoryEntity; |
|||
import com.epmet.entity.LingshanAgentServiceRecordEntity; |
|||
import com.epmet.service.LingShanAgentServiceService; |
|||
import com.github.pagehelper.PageHelper; |
|||
import com.github.pagehelper.PageInfo; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
import java.util.stream.Collectors; |
|||
|
|||
@Service |
|||
@Slf4j |
|||
public class LingShanAgentServiceServiceImpl implements LingShanAgentServiceService { |
|||
|
|||
@Autowired |
|||
private LingshanAgentServiceCategoryDao agentServiceCategoryDao; |
|||
|
|||
@Autowired |
|||
private LingshanAgentServiceRecordDao agentServiceRecordDao; |
|||
|
|||
|
|||
@Override |
|||
public void resiSubmit(AgentServiceResiSubmitFormDTO form) { |
|||
// 判断类别是否存在
|
|||
if (agentServiceCategoryDao.selectById(form.getServiceCategory()) == null) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【代办服务】未找到指定的服务类别ID:" + form.getServiceCategory()); |
|||
} |
|||
|
|||
ResiUserInfoCache resiInfo = CustomerResiUserRedis.getUserBaseInfo(EpmetRequestHolder.getLoginUserId()); |
|||
|
|||
LingshanAgentServiceRecordEntity e2Insert = ConvertUtils.sourceToTarget(form, LingshanAgentServiceRecordEntity.class); |
|||
e2Insert.setAttachments(JSON.toJSONString(form.getAttachmentsList())); |
|||
e2Insert.setApplicantId(EpmetRequestHolder.getLoginUserId()); |
|||
e2Insert.setApplicantName(resiInfo.getRealName()); |
|||
e2Insert.setProcessStatus(LingShanAgentServiceProcessStatusEnum.WAIT_ACCEPT.getStatusCode()); //初始为待受理状态
|
|||
|
|||
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(form.getGridId()); |
|||
e2Insert.setOrgIdPath(PidUtils.convertPid2OrgIdPath(gridInfo.getId(), gridInfo.getPids())); |
|||
|
|||
agentServiceRecordDao.insert(e2Insert); |
|||
} |
|||
|
|||
@Override |
|||
public PageData<ResiMyCreatedAgentServiceResultDTO> myCreatedList(Integer processStatus, String gridId, Integer pageNo, Integer pageSize) { |
|||
LambdaQueryWrapper<LingshanAgentServiceRecordEntity> q = new LambdaQueryWrapper<>(); |
|||
q.eq(processStatus != null, LingshanAgentServiceRecordEntity::getProcessStatus, processStatus); |
|||
q.eq(LingshanAgentServiceRecordEntity::getGridId, gridId); |
|||
|
|||
PageHelper.startPage(pageNo, pageSize); |
|||
List<LingshanAgentServiceRecordEntity> l = agentServiceRecordDao.selectList(q); |
|||
|
|||
List<ResiMyCreatedAgentServiceResultDTO> rl = l.stream().map(e -> { |
|||
ResiMyCreatedAgentServiceResultDTO d = ConvertUtils.sourceToTarget(e, ResiMyCreatedAgentServiceResultDTO.class); |
|||
|
|||
d.setProcessStatusName(LingShanAgentServiceProcessStatusEnum.getByStatus(e.getProcessStatus()).getStatusName()); |
|||
|
|||
LingshanAgentServiceCategoryEntity sc = agentServiceCategoryDao.selectById(e.getServiceCategory()); |
|||
if (sc != null) { |
|||
d.setServiceCategoryName(sc.getCategoryName()); |
|||
} else { |
|||
log.error("【红色待办】居民-我创建的列表:未找到服务类别数据:{}", e.getServiceCategory()); |
|||
} |
|||
|
|||
return d; |
|||
}).collect(Collectors.toList()); |
|||
|
|||
return new PageData<>(rl, new PageInfo<>(l).getTotal()); |
|||
} |
|||
|
|||
@Override |
|||
public PageData<WorkServiceAgentResultDTO> workServiceList(Integer processStatus, String gridId) { |
|||
|
|||
|
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public void workProcess(String id, Integer processType, String processDesc) { |
|||
LingshanAgentServiceRecordEntity service; |
|||
if ((service = agentServiceRecordDao.selectById(id)) == null) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【代办服务】未找到指定的服务信息,ID:" + id); |
|||
} |
|||
|
|||
// 执行状态变更校验
|
|||
statusChangeValid(service.getProcessStatus(), processType); |
|||
|
|||
Date now = new Date(); |
|||
|
|||
LingshanAgentServiceRecordEntity e2Update = new LingshanAgentServiceRecordEntity(); |
|||
e2Update.setId(id); |
|||
// 处理,处理受理状态和描述,以及处理时间
|
|||
e2Update.setProcessStatus(processType); |
|||
e2Update.setProcessDesc(processDesc); |
|||
e2Update.setProcessTime(now); |
|||
|
|||
agentServiceRecordDao.updateById(e2Update); |
|||
} |
|||
|
|||
@Override |
|||
public void workClose(String id, String processDesc, List<String> processAttachments) { |
|||
LingshanAgentServiceRecordEntity service; |
|||
if ((service = agentServiceRecordDao.selectById(id)) == null) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【代办服务】未找到指定的服务信息,ID:" + id); |
|||
} |
|||
|
|||
// 执行状态变更校验
|
|||
LingShanAgentServiceProcessStatusEnum closeStatusEnum = LingShanAgentServiceProcessStatusEnum.CLOSED; |
|||
statusChangeValid(service.getProcessStatus(), closeStatusEnum.getStatusCode()); |
|||
|
|||
Date now = new Date(); |
|||
|
|||
LingshanAgentServiceRecordEntity e2Update = new LingshanAgentServiceRecordEntity(); |
|||
e2Update.setId(id); |
|||
// 办结,设置处理状态,办结描述,办结时间
|
|||
e2Update.setProcessStatus(closeStatusEnum.getStatusCode()); |
|||
e2Update.setCloseDesc(processDesc); |
|||
e2Update.setCloseTime(now); |
|||
|
|||
agentServiceRecordDao.updateById(e2Update); |
|||
} |
|||
|
|||
/** |
|||
* @description: 状态变更校验 |
|||
* @param oldStatus: 旧状态 |
|||
* @param newStatus: 新状态 |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/5/9 1:57 PM |
|||
*/ |
|||
private void statusChangeValid(Integer oldStatus, Integer newStatus) { |
|||
if (newStatus.intValue() == LingShanAgentServiceProcessStatusEnum.WITHDRAW.getStatusCode() |
|||
&& oldStatus.intValue() != LingShanAgentServiceProcessStatusEnum.WAIT_ACCEPT.getStatusCode()) { |
|||
// 只有待处理状态,才能撤回
|
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, String.format("【代办服务】当前状态为'%s',不允许撤回", LingShanAgentServiceProcessStatusEnum.getByStatus(oldStatus).getStatusName())); |
|||
} |
|||
|
|||
if ((newStatus.intValue() == LingShanAgentServiceProcessStatusEnum.ACCEPTED.getStatusCode() |
|||
|| newStatus.intValue() == LingShanAgentServiceProcessStatusEnum.REJECTED.getStatusCode()) |
|||
&& oldStatus.intValue() != LingShanAgentServiceProcessStatusEnum.WAIT_ACCEPT.getStatusCode()) { |
|||
// 如果要接受,或者拒绝,那么当前状态必须为待处理
|
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, String.format("【代办服务】当前状态为'%s',不允许操作", LingShanAgentServiceProcessStatusEnum.getByStatus(oldStatus).getStatusName())); |
|||
} |
|||
|
|||
if (newStatus.intValue() == LingShanAgentServiceProcessStatusEnum.CLOSED.getStatusCode() |
|||
&& oldStatus.intValue() != LingShanAgentServiceProcessStatusEnum.ACCEPTED.getStatusCode()) { |
|||
// 如果要关闭,那么当前状态必须为已受理
|
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, String.format("【代办服务】当前状态为'%s',不允许操作", LingShanAgentServiceProcessStatusEnum.getByStatus(oldStatus).getStatusName())); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
<?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.LingshanAgentServiceCategoryDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.LingshanAgentServiceCategoryEntity" id="lingshanAgentServiceCategoryMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="categoryName" column="CATEGORY_NAME"/> |
|||
<result property="description" column="DESCRIPTION"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,39 @@ |
|||
<?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.LingshanAgentServiceRecordDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.LingshanAgentServiceRecordEntity" id="lingshanAgentServiceRecordMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="applicantId" column="APPLICANT_ID"/> |
|||
<result property="applicantName" column="APPLICANT_NAME"/> |
|||
<result property="agentId" column="AGENT_ID"/> |
|||
<result property="agentName" column="AGENT_NAME"/> |
|||
<result property="gridId" column="GRID_ID"/> |
|||
<result property="orgIdPath" column="ORG_ID_PATH"/> |
|||
<result property="serviceCategory" column="SERVICE_CATEGORY"/> |
|||
<result property="attachments" column="ATTACHMENTS"/> |
|||
<result property="exceptServeTime" column="EXCEPT_SERVE_TIME"/> |
|||
<result property="exceptServeAddress" column="EXCEPT_SERVE_ADDRESS"/> |
|||
<result property="processTime" column="PROCESS_TIME"/> |
|||
<result property="processDesc" column="PROCESS_DESC"/> |
|||
<result property="closeDesc" column="CLOSE_DESC"/> |
|||
<result property="closeTime" column="CLOSE_TIME"/> |
|||
<result property="contactName" column="CONTACT_NAME"/> |
|||
<result property="contactMobile" column="CONTACT_MOBILE"/> |
|||
<result property="processStatus" column="PROCESS_STATUS"/> |
|||
<result property="content" column="CONTENT"/> |
|||
<result property="satisfication" column="SATISFICATION"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<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="longitude" column="LONGITUDE"/> |
|||
<result property="latitude" column="LATITUDE"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue