forked from luyan/epmet-cloud-lingshan
				
			
				 7 changed files with 243 additions and 6 deletions
			
			
		| @ -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; | |||
| } | |||
| @ -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; | |||
| } | |||
| @ -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<List<DemandHallResultDTO>> 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<List<DemandHallResultDTO>>().ok(icUserDemandRecService.listHall(formDTO)); | |||
|     } | |||
| } | |||
					Loading…
					
					
				
		Reference in new issue