diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ListHallFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ListHallFormDTO.java new file mode 100644 index 0000000000..00c28d50cd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ListHallFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form.demand; + + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * * 居民端-需求大厅(未处理、处理中、已完成)入参 + */ +@Data +public class ListHallFormDTO extends PageFormDTO implements Serializable { + public interface AddUserInternalGroup {} + + /** + * 当前所在网格id + */ + @NotBlank(message = "gridId不能为空", groups = AddUserInternalGroup.class) + private String gridId; + + /** + * 未处理:unprocessed;处理中:processing;已完成:finished + */ + @NotBlank(message = "type不能为空", groups = AddUserInternalGroup.class) + private String type; + + // 以下入参从token中获取 + @NotBlank(message = "tokenDto获取userId不能为空", groups = AddUserInternalGroup.class) + private String currentUserId; + @NotBlank(message = "tokenDto获取customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandHallResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandHallResultDTO.java new file mode 100644 index 0000000000..407767d6a2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandHallResultDTO.java @@ -0,0 +1,79 @@ +package com.epmet.dto.result.demand; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 居民端-需求大厅(未处理、处理中、已完成)返参DTO + * 返参DTO + */ +@Data +public class DemandHallResultDTO implements Serializable { + /** + * 需求id + */ + private String demandRecId; + + /** + * 分类编码 + */ + @JsonIgnore + private String categoryCode; + + /** + * 父级分类编码 + */ + @JsonIgnore + private String parentCode; + + /** + * 服务事项,实际就是需求分类二级分类名字 + */ + private String categoryName; + + /** + * 服务时间,yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date wantServiceTime; + + /** + * 服务地点 + */ + private String serviceAddress; + + /** + * 奖励积分 + */ + private Integer awardPoint; + + /** + * 需求人名字 + */ + private String demandUserName; + + /** + * 需求人联系电话 + */ + private String demandUserMobile; + + /** + * 得分可为半星 + */ + private BigDecimal score; + + /** + * 待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished + */ + private String status; + + /** + * 1:已评价;0:未评价;评价后ic_user_satisfaction表有记录 + */ + private Boolean evaluateFlag; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java new file mode 100644 index 0000000000..2094df9809 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java @@ -0,0 +1,48 @@ +package com.epmet.controller; + + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.dto.form.PageFormDTO; +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.form.demand.ListHallFormDTO; +import com.epmet.dto.result.demand.DemandHallResultDTO; +import com.epmet.service.IcUserDemandRecService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 居民端-需求相关API 写在这吧 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Slf4j +@RestController +@RequestMapping("residemand") +public class ResiDemandController { + @Autowired + private IcUserDemandRecService icUserDemandRecService; + + /** + * 居民端-需求大厅(未处理、处理中、已完成) + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("list-hall") + public Result> listHall(@LoginUser TokenDto tokenDto, @RequestBody ListHallFormDTO formDTO){ + formDTO.setCurrentUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class,ListHallFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icUserDemandRecService.listHall(formDTO)); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java index 6c36e11618..c118a2d8b2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java @@ -86,4 +86,17 @@ public interface IcUserDemandRecDao extends BaseDao { @Param("endDateId") String endDateId); List selectGroupByPartyUnit(@Param("customerId") String customerId, @Param("partyUnitId") String partyUnitId); + + /** + * 居民端-需求大厅(未处理、处理中、已完成) + * 未处理:未指派、未接单;处理中:已指派、已接单给我的 ;已完成:我填写实际服务时间,并点击确认 + * + * @param gridId + * @param type 未处理:unprocessed;处理中:processing;已完成:finished + * @param currentUserId 当前用户自己提出的,不在这展示,在我的需求里面展示 + * @return + */ + List selectListDemandHall(@Param("gridId") String gridId, + @Param("type") String type, + @Param("currentUserId") String currentUserId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index d17b6b3bfc..9446699dc5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -21,12 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcUserDemandRecDTO; import com.epmet.dto.form.demand.*; -import com.epmet.dto.result.demand.CategoryAnalysisResDTO; -import com.epmet.dto.result.demand.DemandRecResultDTO; -import com.epmet.dto.result.demand.DemandResearchAnalysisResultDTO; -import com.epmet.dto.result.demand.FinishResultDTO; -import com.epmet.dto.result.demand.IcResiUserReportDemandRes; -import com.epmet.dto.result.demand.ServiceStatDTO; +import com.epmet.dto.result.demand.*; import com.epmet.entity.IcUserDemandRecEntity; import java.util.List; @@ -180,4 +175,11 @@ public interface IcUserDemandRecService extends BaseService groupByPartyUnit(String customerId, String partyUnitId); + + /** + * 居民端-需求大厅(未处理、处理中、已完成) + * @param formDTO + * @return + */ + List listHall(ListHallFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index b9726081f7..86446e5f53 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -967,4 +967,26 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl listHall(ListHallFormDTO formDTO) { + PageInfo result = PageHelper.startPage(formDTO.getPageNo(), + formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectListDemandHall(formDTO.getGridId(), + formDTO.getType(),formDTO.getCurrentUserId())); + result.getList().forEach(resultDTO->{ + //设置分类名称 + IcResiDemandDictEntity demandDictEntity=demandDictService.getByCode(formDTO.getCustomerId(),resultDTO.getCategoryCode()); + if(null!=demandDictEntity){ + resultDTO.setCategoryName(demandDictEntity.getCategoryName()); + } + }); + return result.getList(); + } + + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index 11d3190a6c..466e6c4b1e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -411,4 +411,43 @@ group by s.SERVER_ID + + + + \ No newline at end of file