Browse Source

需求大厅

dev_shibei_match
yinzuomei 4 years ago
parent
commit
f2afb49b12
  1. 34
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ListHallFormDTO.java
  2. 79
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandHallResultDTO.java
  3. 48
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
  4. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
  5. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  6. 22
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  7. 39
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

34
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;
}

79
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;
}

48
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<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));
}
}

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java

@ -86,4 +86,17 @@ public interface IcUserDemandRecDao extends BaseDao<IcUserDemandRecEntity> {
@Param("endDateId") String endDateId);
List<ServiceStatDTO> selectGroupByPartyUnit(@Param("customerId") String customerId, @Param("partyUnitId") String partyUnitId);
/**
* 居民端-需求大厅未处理处理中已完成
* 未处理未指派未接单;处理中已指派已接单给我的 ;已完成我填写实际服务时间并点击确认
*
* @param gridId
* @param type 未处理unprocessed处理中processing已完成finished
* @param currentUserId 当前用户自己提出的不在这展示在我的需求里面展示
* @return
*/
List<DemandHallResultDTO> selectListDemandHall(@Param("gridId") String gridId,
@Param("type") String type,
@Param("currentUserId") String currentUserId);
}

14
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<IcUserDemandRecEntit
* @return
*/
List<ServiceStatDTO> groupByPartyUnit(String customerId, String partyUnitId);
/**
* 居民端-需求大厅未处理处理中已完成
* @param formDTO
* @return
*/
List<DemandHallResultDTO> listHall(ListHallFormDTO formDTO);
}

22
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<IcUserDemandRecD
}
/**
* 居民端-需求大厅未处理处理中已完成
* 未处理未指派未接单;处理中已指派已接单给我的 ;已完成我填写实际服务时间并点击确认
* @param formDTO
* @return
*/
@Override
public List<DemandHallResultDTO> listHall(ListHallFormDTO formDTO) {
PageInfo<DemandHallResultDTO> 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();
}
}

39
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

@ -411,4 +411,43 @@
</if>
group by s.SERVER_ID
</select>
<!-- 居民端-需求大厅(未处理、处理中、已完成) type 未处理:unprocessed;处理中:processing;已完成:finished -->
<!-- 未处理:未指派、未接单;处理中:已指派、已接单给我的 ;已完成:我填写实际服务时间,并点击确认 -->
<select id="selectListDemandHall" parameterType="map" resultType="com.epmet.dto.result.demand.DemandHallResultDTO">
SELECT
r.id as demandRecId,
r.CATEGORY_CODE,
r.PARENT_CODE,
r.WANT_SERVICE_TIME,
concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) AS serviceAddress,
r.AWARD_POINT,
r.DEMAND_USER_NAME,
r.DEMAND_USER_MOBILE,
s.SCORE,
r.`STATUS`,
r.EVALUATE_FLAG
FROM
ic_user_demand_rec r
left join ic_user_demand_service m
on(r.id=m.DEMAND_REC_ID and m.DEL_FLAG='0')
LEFT JOIN ic_user_demand_satisfaction s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' )
WHERE
r.DEL_FLAG = '0'
AND r.GRID_ID = #{gridId}
AND R.DEMAND_USER_ID !=#{currentUserId}
<if test="null !=type and type =='unprocessed' ">
AND r.`STATUS` = 'pending'
</if>
<if test="null !=type and type =='processing' ">
AND (r.`STATUS` = 'assigned' OR r.`STATUS` = 'have_order')
and m.SERVER_ID=#{currentUserId}
</if>
<if test="null !=type and type =='finished' ">
AND r.`STATUS`='finished'
and m.SERVER_ID=#{currentUserId}
and m.SERVICE_START_TIME is not null and m.SERVICE_END_TIME is not null
</if>
order by r.WANT_SERVICE_TIME asc
</select>
</mapper>
Loading…
Cancel
Save