Browse Source

加点注释

dev_shibei_match
yinzuomei 4 years ago
parent
commit
a2399ec2eb
  1. 6
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 9
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandSatisfactionDTO.java
  3. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandServiceDTO.java
  4. 56
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ResiClientMyDemandFormDTO.java
  5. 23
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandCategoryResDTO.java
  6. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java
  7. 9
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java
  8. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandPageResDTO.java
  9. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/IcResiUserReportDemandRes.java
  10. 74
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ResiClientMyDemandResDTO.java
  11. 29
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java
  12. 19
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
  13. 17
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java
  14. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
  15. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandSatisfactionEntity.java
  16. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandServiceEntity.java
  17. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java
  18. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java
  19. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java
  20. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java
  21. 46
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  22. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
  23. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  24. 39
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  25. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
  26. 231
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  27. 52
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml
  28. 45
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

6
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -85,16 +85,18 @@ public enum EpmetErrorCode {
BUILDING_NAME_EXITED(8215,"楼栋名称已存在"),
DOOR_NAME_EXITED(8216,"门牌号已存在"),
NEIGHBOOR_NAME_EXITED(8217,"小区名称已存在"),
//需求相关的改用EpmetException
DEMAND_NAME_EXITED(8218, "分类名称已存在"),
DEMAND_CAN_NOT_CANCEL(8219, "需求已完成,不可取消"),
DEMAND_CAN_NOT_CANCEL(8219, "当前状态,不可取消"),
DEMAND_CAN_NOT_ASSIGN(8220, "当前状态,不可指派"),
DEMAND_CAN_NOT_FINISH(8221, "当前状态,不能评价"),
DEMAND_CAN_NOT_FINISH(8221, "当前状态,不能确认服务完成"),
DEMAND_FINISHED(8222,"需求已完成"),
DEMAND_CAN_NOT_UPDATE(8223,"当前状态,不可更新需求"),
DEMAND_NOT_EXITS(8224,"需求不存在"),
DEMAND_SERVICE_NOT_EXITS(8225,"服务记录不存在"),
DEMAND_CAN_NOT_TAKE_ORDER(8226, "当前状态,不可接单"),
DEMAND_CAN_NOT_EVALUATE(8227, "当前状态,不可评价"),
REQUIRE_PERMISSION(8301, "您没有足够的操作权限"),
THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"),

9
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandSatisfactionDTO.java

@ -17,11 +17,11 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 居民需求评价记录表
@ -69,6 +69,11 @@ public class IcUserDemandSatisfactionDTO implements Serializable {
*/
private BigDecimal score;
/**
* 评价时填写的完成情况
*/
private String remark;
/**
* 删除标识0.未删除 1.已删除
*/

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcUserDemandServiceDTO.java

@ -17,9 +17,10 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -69,7 +70,7 @@ public class IcUserDemandServiceDTO implements Serializable {
private Date serviceEndTime;
/**
* 完成情况
* 此列暂时没有用完成情况在ic_user_demand_satisfaction.remark
*/
private String finishDesc;

56
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ResiClientMyDemandFormDTO.java

@ -0,0 +1,56 @@
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 ResiClientMyDemandFormDTO extends PageFormDTO implements Serializable {
/*List<String> userIds=new ArrayList<>();
userIds.add(formDTO.getIcResiUserId());
if(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList())){
userIds.addAll(formDTO.getEpmetUserIdList());
}
formDTO.setUserIds(userIds);
//2、小程序内自己上报+赋能平台待录入的
PageInfo<IcResiUserReportDemandRes> pageInfo = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectUserDemand(formDTO));
List<IcResiUserReportDemandRes> list = pageInfo.getList();
if (CollectionUtils.isNotEmpty(list)) {
// 1、状态字典
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode());
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>();
//2、查询分类名称
List<String> categoryCodes = list.stream().map(IcResiUserReportDemandRes::getCategoryCode).collect(Collectors.toList());
List<IcResiDemandDictEntity> dictList = demandDictService.listByCodes(formDTO.getCustomerId(), categoryCodes);
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName));
for (IcResiUserReportDemandRes resDto : list) {
resDto.setStatusName(statusMap.containsKey(resDto.getStatus()) ? statusMap.get(resDto.getStatus()) : StrConstant.EPMETY_STR);
if (null != dictMap && dictMap.containsKey(resDto.getCategoryCode())) {
resDto.setCategoryName(dictMap.get(resDto.getCategoryCode()));
}
resDto.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(),resDto.getFirstCategoryCode()));
}
}*/
public interface AddUserInternalGroup {}
@NotBlank(message = "gridId不能为空",groups = AddUserInternalGroup.class)
private String gridId;
/**
* 待处理unprocessed处理中processing已完成finished已取消canceled
*/
@NotBlank(message = "type不能为空,待处理:unprocessed;处理中:processing;已完成:finished;已取消:canceled",groups = AddUserInternalGroup.class)
private String type;
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class)
private String userId;
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

23
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandCategoryResDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.result.demand;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 1居民端-我有需求分类列表发布餐可用
* 2居民端-我有需求最近预约返参
*/
@Data
public class DemandCategoryResDTO implements Serializable {
private String categoryId;
private String categoryCode;
private String parentCode;
private String categoryName;
@JsonIgnore
private String customerId;
private List<DemandCategoryResDTO> children;
}

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java

@ -5,6 +5,9 @@ import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 数据分析-个人档案-需求详情研判分析的 分类以及分类下的需求
*/
@Data
public class DemandDataDTO implements Serializable {
private String firstCategoryCode;

9
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java

@ -10,6 +10,7 @@ import java.util.Date;
/**
* 需求大厅-需求详情
* 我的需求-需求详情 todo
*/
@Data
public class DemandDetailResDTO implements Serializable {
@ -97,4 +98,12 @@ public class DemandDetailResDTO implements Serializable {
* 服务记录主键
*/
private String serviceId;
// 以下几个返参在我的需求详情中返回:
private String serviceType;
private String serviceUserName;
private String serviceUserMobile;
private String serviceUnitName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date cancelTime;
}

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandPageResDTO.java

@ -6,6 +6,9 @@ import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* 需求分类列表返参
*/
@Data
public class DemandPageResDTO implements Serializable {
private String customerId;

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/IcResiUserReportDemandRes.java

@ -7,6 +7,10 @@ import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 数据分析-个人档案居民需求列表table
* 数据分析-个人档案需求详情研判分析-需求列表
*/
@Data
public class IcResiUserReportDemandRes implements Serializable {
private static final long serialVersionUID = 7043350476644105434L;

74
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ResiClientMyDemandResDTO.java

@ -0,0 +1,74 @@
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;
/**
* 居民端-我的需求列表入参
*/
@Data
public class ResiClientMyDemandResDTO implements Serializable {
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:ss", timezone = "GMT+8")
private Date wantServiceTime;
/**
* 服务地点
*/
private String serviceAddress;
/**
* 根据服务方类型找名字
*/
//服务方类型:服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
@JsonIgnore
private String serviceType;
@JsonIgnore
private String serverId;
/**
* 服务方负责人姓名如果是志愿者返回志愿者的姓名
*/
private String serviceUserName;
/**
* 服务方负责人联系电话如果是志愿者返回志愿者的注册手机号
*/
private String serviceUserMobile;
/**
* 社会组织名
* 社区自组织名
* 区域党建单位名
*/
private String serviceUnitName;
/**
* 1已评价0未评价;评价后ic_user_satisfaction表有记录
*/
private Boolean evaluateFlag;
/**
* 得分可为半星
*/
private BigDecimal score;
/**
* 待处理pending已取消canceled已派单assigned已接单have_order已完成finished
*/
private String status;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date cancelTime;
}

29
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java

@ -21,15 +21,19 @@ import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
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.dto.form.demand.*;
import com.epmet.dto.result.demand.DemandCategoryResDTO;
import com.epmet.dto.result.demand.DemandPageResDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.service.IcResiDemandDictService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -172,8 +176,31 @@ public class IcResiDemandDictController {
return new Result<List<OptionDTO>>().ok(icResiDemandDictService.querySubCodeList(formDTO));
}
/**
* 居民端我有需求分类列表
* 查询可用的需求
*
* @param tokenDto
* @return
*/
@PostMapping("category-list")
public Result<List<DemandCategoryResDTO>> queryCategoryList(@LoginUser TokenDto tokenDto){
//测试EpmetEx
if(StringUtils.isNotBlank(tokenDto.getCustomerId())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "internalMsg","用户看到的msg???");
}
return new Result<List<DemandCategoryResDTO>>().ok(icResiDemandDictService.queryCategoryList(tokenDto.getCustomerId()));
}
/**
* 居民端我有需求最近预约显示最近预约过的五个需求按照预约时间倒
* @param tokenDto
* @return
*/
@PostMapping("latest-order")
public Result<List<DemandCategoryResDTO>> queryLatestOrder(@LoginUser TokenDto tokenDto){
return new Result<List<DemandCategoryResDTO>>().ok(icResiDemandDictService.queryLatestOrder(tokenDto.getUserId(),tokenDto.getCustomerId()));
}

19
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java

@ -12,10 +12,7 @@ import com.epmet.constant.SystemMessageType;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.DemandDetailResDTO;
import com.epmet.dto.result.demand.DemandHallResultDTO;
import com.epmet.dto.result.demand.FinishResultDTO;
import com.epmet.dto.result.demand.TakeOrderResultDTO;
import com.epmet.dto.result.demand.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.service.IcUserDemandRecService;
import lombok.extern.slf4j.Slf4j;
@ -151,6 +148,18 @@ public class ResiDemandController {
return new Result();
}
/**
* 居民端-我的需求待处理处理中已完成已取消
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("mydemand")
public Result<List<ResiClientMyDemandResDTO>> queryMyDemand(@LoginUser TokenDto tokenDto, @RequestBody ResiClientMyDemandFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,PageFormDTO.AddUserInternalGroup.class,ResiClientMyDemandFormDTO.AddUserInternalGroup.class);
return new Result<List<ResiClientMyDemandResDTO>>().ok(icUserDemandRecService.queryMyDemandForResiClient(formDTO));
}
}

17
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java

@ -19,6 +19,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.dto.result.demand.DemandCategoryResDTO;
import com.epmet.dto.result.demand.DemandPageResDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcResiDemandDictEntity;
@ -68,4 +69,20 @@ public interface IcResiDemandDictDao extends BaseDao<IcResiDemandDictEntity> {
String selectNameByCode(@Param("customerId")String customerId, @Param("categoryCode") String categoryCode);
IcResiDemandDictEntity selectByCode(@Param("customerId") String customerId, @Param("categoryCode") String categoryCode);
/**
* 居民端-我有需求分类列表
* @param customerId
* @param parentCode
* @return
*/
List<DemandCategoryResDTO> queryCategoryList(@Param("customerId") String customerId, @Param("parentCode")String parentCode);
/**
* 查询分类信息限制未被禁用的
* @param customerId
* @param categoryCodes
* @return
*/
List<DemandCategoryResDTO> selectListByCodes(@Param("customerId") String customerId, @Param("categoryCodes") List<String> categoryCodes);
}

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

@ -99,4 +99,14 @@ public interface IcUserDemandRecDao extends BaseDao<IcUserDemandRecEntity> {
List<DemandHallResultDTO> selectListDemandHall(@Param("gridId") String gridId,
@Param("type") String type,
@Param("currentUserId") String currentUserId);
/**
* 居民端-我的需求待处理处理中已完成已取消
*
* @param gridId
* @param type 待处理unprocessed处理中processing已完成finished已取消canceled
* @return demandUserId 需求人id
*/
List<ResiClientMyDemandResDTO> queryMyDemandForResiClient(@Param("gridId") String gridId,
@Param("type")String type,
@Param("demandUserId")String demandUserId);
}

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandSatisfactionEntity.java

@ -69,4 +69,8 @@ public class IcUserDemandSatisfactionEntity extends BaseEpmetEntity {
*/
private BigDecimal score;
/**
* 评价时填写的完成情况
*/
private String remark;
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandServiceEntity.java

@ -69,7 +69,7 @@ public class IcUserDemandServiceEntity extends BaseEpmetEntity {
private Date serviceEndTime;
/**
* 完成情况
* 此列暂时没有用完成情况在ic_user_demand_satisfaction.remark
*/
private String finishDesc;

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java

@ -158,4 +158,6 @@ public interface IcCommunitySelfOrganizationService extends BaseService<IcCommun
* @date 2021/11/25 9:03 上午
*/
void importCommunitySelfOrganization(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException;
List<IcCommunitySelfOrganizationEntity> queryListById(List<String> communityOrgIds);
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java

@ -148,4 +148,6 @@ public interface IcPartyUnitService extends BaseService<IcPartyUnitEntity> {
* @param formDTO
*/
void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO formDTO);
List<IcPartyUnitEntity> queryListById(List<String> partyUnitIds);
}

18
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java

@ -22,6 +22,7 @@ import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.DemandCategoryResDTO;
import com.epmet.dto.result.demand.DemandPageResDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcResiDemandDictEntity;
@ -128,4 +129,21 @@ public interface IcResiDemandDictService extends BaseService<IcResiDemandDictEnt
* @return
*/
IcResiDemandDictEntity getByCode(String customerId, String categoryCode);
/**
* 居民端我有需求分类列表
* 查询可用的需求
*
* @param customerId
* @return
*/
List<DemandCategoryResDTO> queryCategoryList(String customerId);
/**
* 居民端我有需求最近预约显示最近预约过的五个需求按照预约时间倒
* @param userId
* @param customerId
* @return
*/
List<DemandCategoryResDTO> queryLatestOrder(String userId, String customerId);
}

1
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java

@ -75,4 +75,5 @@ public interface IcSocietyOrgService extends BaseService<IcSocietyOrgEntity> {
**/
List<Integer> importExcel(String customerId, List<IcSocietyOrgExcel> list, String staffId, List<Integer> numList) throws ParseException;
List<IcSocietyOrgEntity> queryListById(List<String> socialOrgIds);
}

46
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java

@ -25,7 +25,6 @@ import com.epmet.dto.result.demand.*;
import com.epmet.entity.IcUserDemandRecEntity;
import java.util.List;
import java.util.Map;
/**
* 居民需求记录表
@ -35,25 +34,6 @@ import java.util.Map;
*/
public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IcUserDemandRecDTO>
* @author generator
* @date 2021-11-19
*/
PageData<IcUserDemandRecDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcUserDemandRecDTO>
* @author generator
* @date 2021-11-19
*/
List<IcUserDemandRecDTO> list(Map<String, Object> params);
/**
* 单条查询
@ -65,16 +45,6 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
*/
IcUserDemandRecDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-11-19
*/
void save(IcUserDemandRecDTO dto);
/**
* 更新需求
*
@ -204,4 +174,20 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
* @return
*/
FinishResultDTO evaluate(EvaluateDemandFormDTO formDTO);
/**
* 居民端我有需求最近预约显示最近预约过的五个需求按照预约时间倒
* 查询最近预约的5个编码
*
* @param userId
* @return
*/
List<String> getLatestRegCode(String userId);
/**
* 居民端-我的需求待处理处理中已完成已取消
* @param formDTO
* @return
*/
List<ResiClientMyDemandResDTO> queryMyDemandForResiClient(ResiClientMyDemandFormDTO formDTO);
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java

@ -399,4 +399,9 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
}
}
@Override
public List<IcCommunitySelfOrganizationEntity> queryListById(List<String> communityOrgIds) {
return baseDao.selectBatchIds(communityOrgIds);
}
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -452,6 +452,11 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
}
}
@Override
public List<IcPartyUnitEntity> queryListById(List<String> partyUnitIds) {
return baseDao.selectBatchIds(partyUnitIds);
}
private String getServiceMatter(Map<String, String> map, String matter) {
List<String> matters = Arrays.asList(matter.split(StrConstant.COLON));
List<String> list = matters.stream().map(map::get).collect(Collectors.toList());

39
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java

@ -29,22 +29,22 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcResiDemandDictDao;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.DemandCategoryResDTO;
import com.epmet.dto.result.demand.DemandPageResDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcResiDemandDictEntity;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcUserDemandRecService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
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.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 居民需求字典表
@ -55,6 +55,8 @@ import java.util.Map;
@Slf4j
@Service
public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDictDao, IcResiDemandDictEntity> implements IcResiDemandDictService {
@Autowired
private IcUserDemandRecService icUserDemandRecService;
/**
* 分页查询
@ -263,5 +265,34 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
return baseDao.selectByCode(customerId,categoryCode);
}
/**
* 居民端我有需求分类列表
* 查询可用的需求
*
* @param customerId
* @return
*/
@Override
public List<DemandCategoryResDTO> queryCategoryList(String customerId) {
return baseDao.queryCategoryList(customerId,NumConstant.ZERO_STR);
}
/**
* 居民端我有需求最近预约显示最近预约过的五个需求按照预约时间倒
*
* @param userId
* @param customerId
* @return
*/
@Override
public List<DemandCategoryResDTO> queryLatestOrder(String userId, String customerId) {
List<String> categoryCodes=icUserDemandRecService.getLatestRegCode(userId);
if(CollectionUtils.isNotEmpty(categoryCodes)){
//限制未被禁用的
return baseDao.selectListByCodes(customerId,categoryCodes);
}
return new ArrayList<>();
}
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java

@ -268,4 +268,9 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
return numList;
}
@Override
public List<IcSocietyOrgEntity> queryListById(List<String> socialOrgIds) {
return baseDao.selectBatchIds(socialOrgIds);
}
}

231
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -19,9 +19,7 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
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.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
@ -49,9 +47,7 @@ import com.epmet.entity.*;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcUserDemandRecService;
import com.epmet.service.VolunteerInfoService;
import com.epmet.service.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -91,31 +87,12 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
private EpmetAdminOpenFeignClient adminOpenFeignClient;
@Autowired
private VolunteerInfoService volunteerInfoService;
@Override
public PageData<IcUserDemandRecDTO> page(Map<String, Object> params) {
IPage<IcUserDemandRecEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IcUserDemandRecDTO.class);
}
@Override
public List<IcUserDemandRecDTO> list(Map<String, Object> params) {
List<IcUserDemandRecEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcUserDemandRecDTO.class);
}
private QueryWrapper<IcUserDemandRecEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcUserDemandRecEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Autowired
private IcPartyUnitService partyUnitService;
@Autowired
private IcSocietyOrgService societyOrgService;
@Autowired
private IcCommunitySelfOrganizationService communitySelfOrganizationService;
@Override
public IcUserDemandRecDTO get(String id) {
@ -123,13 +100,6 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
return ConvertUtils.sourceToTarget(entity, IcUserDemandRecDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IcUserDemandRecDTO dto) {
IcUserDemandRecEntity entity = ConvertUtils.sourceToTarget(dto, IcUserDemandRecEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public DemandRecId update(DemandAddFromDTO dto) {
@ -326,55 +296,10 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
}
//社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help
res.setReportTypeName(reportTypeMap.containsKey(res.getReportType())?reportTypeMap.get(res.getReportType()):StrConstant.EPMETY_STR);
/*switch(res.getReportType()){
case UserDemandConstant.COMMUNITY_REPORT :
res.setReportTypeName("社区帮办");
break;
case UserDemandConstant.BUILDING_CAPTION_REPORT :
res.setReportTypeName("楼长帮办");
break;
case UserDemandConstant.PARTY_REPORT :
res.setReportTypeName("党员帮办");
break;
case UserDemandConstant.SELF_HELP_REPORT :
res.setReportTypeName("自身上报");
break;
}*/
//待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished
res.setStatusName(statusMap.containsKey(res.getStatus())?statusMap.get(res.getStatus()):StrConstant.EPMETY_STR);
/*switch(res.getStatus()){
case UserDemandConstant.PENDING :
res.setStatusName("待处理");
break;
case UserDemandConstant.CANCELED :
res.setStatusName("已取消");
break;
case UserDemandConstant.ASSIGNED :
res.setStatusName("已指派");
break;
case UserDemandConstant.HAVE_ORDER :
res.setStatusName("已接单");
break;
case UserDemandConstant.FINISHED :
res.setStatusName("已完成");
break;
}*/
//服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
res.setServiceShowName(serviceTypeMap.containsKey(res.getServiceType())?res.getServiceName().concat("(").concat(serviceTypeMap.get(res.getServiceType())).concat(")"):StrConstant.EPMETY_STR);
/*switch(res.getServiceType()){
case UserDemandConstant.VOLUNTEER :
res.setServiceShowName(res.getServiceName().concat("(志愿者)"));
break;
case UserDemandConstant.SOCIAL_ORG :
res.setServiceShowName(res.getServiceName().concat("(社会组织)"));
break;
case UserDemandConstant.COMMUNITY_ORG :
res.setServiceShowName(res.getServiceName().concat("(社区自组织"));
break;
case UserDemandConstant.PARTY_UNIT :
res.setServiceShowName(res.getServiceName().concat("(区域化党建单位)"));
break;
}*/
res.setServiceShowFlag(StringUtils.isNotBlank(res.getServerId()) ? true : false);
}
}
@ -393,7 +318,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg());
}
if (UserDemandConstant.FINISH.equals(entity.getStatus())) {
if (UserDemandConstant.FINISH.equals(entity.getStatus())||UserDemandConstant.CANCELED.equals(entity.getStatus())) {
//需求已完成,不可取消
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_CANCEL.getCode(),EpmetErrorCode.DEMAND_CAN_NOT_CANCEL.getMsg());
}
@ -478,7 +403,6 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
}
serviceEntity.setServiceStartTime(formDTO.getServiceStartTime());
serviceEntity.setServiceEndTime(formDTO.getServiceEndTime());
serviceEntity.setFinishDesc(StringUtils.isNotBlank(formDTO.getFinishDesc())?formDTO.getFinishDesc():StrConstant.EPMETY_STR);
demandServiceDao.updateById(serviceEntity);
// 3、pc完成情况:完成+评价
@ -486,6 +410,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//3.1、插入评价得分记录
IcUserDemandSatisfactionEntity satisfactionEntity=ConvertUtils.sourceToTarget(formDTO,IcUserDemandSatisfactionEntity.class);
satisfactionEntity.setEvaluateTime(logEntity.getOperateTime());
satisfactionEntity.setRemark(StringUtils.isNotBlank(formDTO.getFinishDesc())?formDTO.getFinishDesc():StrConstant.EPMETY_STR);
demandSatisfactionDao.insert(satisfactionEntity);
// 3.2插入评价操作日志
@ -520,14 +445,14 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg());
}
if (UserDemandConstant.PENDING.equals(entity.getStatus()) ||UserDemandConstant.CANCELED.equals(entity.getStatus())) {
//待处理或者已取消的不能评价
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getMsg());
}
if(UserDemandConstant.FINISHED.equals(entity.getStatus()) ){
//已经完成
throw new RenException(EpmetErrorCode.DEMAND_FINISHED.getCode(), EpmetErrorCode.DEMAND_FINISHED.getMsg());
}
if (!UserDemandConstant.ASSIGNED.equals(entity.getStatus()) && !UserDemandConstant.HAVE_ORDER.equals(entity.getStatus())) {
//已指派、已抢单的才可以完成
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getMsg());
}
return entity;
}
@ -1120,5 +1045,135 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
return finishResultDTO;
}
/**
* 居民端我有需求最近预约显示最近预约过的五个需求按照预约时间倒
* 查询最近预约的5个编码
*
* @param userId
* @return
*/
@Override
public List<String> getLatestRegCode(String userId) {
QueryWrapper<IcUserDemandRecEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("DEMAND_USER_ID",userId);
queryWrapper.orderByDesc("WANT_SERVICE_TIME");
queryWrapper.last("limit 5");
queryWrapper.select("DISTINCT CATEGORY_CODE");
return baseDao.selectList(queryWrapper).stream().map(o->o.toString()).collect(Collectors.toList());
}
/**
* 居民端-我的需求待处理处理中已完成已取消
* 待处理unprocessed处理中processing已完成finished已取消canceled
*
* @param formDTO
* @return
*/
@Override
public List<ResiClientMyDemandResDTO> queryMyDemandForResiClient(ResiClientMyDemandFormDTO formDTO) {
PageInfo<ResiClientMyDemandResDTO> result = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.queryMyDemandForResiClient(formDTO.getGridId(),
formDTO.getType(), formDTO.getUserId()));
List<ResiClientMyDemandResDTO> list=result.getList();
if (CollectionUtils.isNotEmpty(list)) {
//1、服务方(社会组织、社区自组织、区域化党建单位)单位名称,负责人姓名,负责人手机号
List<String> partyUnitIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.PARTY_UNIT)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
Map<String, IcPartyUnitEntity> partyUnitMap =getPartyUnitMap(partyUnitIds);
List<String> socialOrgIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.SOCIAL_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
Map<String, IcSocietyOrgEntity> socialOrgMap=getSocialOrgMap(socialOrgIds);
List<String> communityOrgIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.COMMUNITY_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap=getCommunityOrgMap(communityOrgIds);
//2、志愿者姓名、手机号
Set<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toSet());
Map<String,UserBaseInfoResultDTO> userInfoMap=getVolunteerMap(userIdList);
for (ResiClientMyDemandResDTO resDto : list) {
//3、查询分类名称
IcResiDemandDictEntity demandDict = demandDictService.getByCode(formDTO.getCustomerId(), resDto.getCategoryCode());
resDto.setCategoryName(null != demandDict ? demandDict.getCategoryName() : StrConstant.EPMETY_STR);
switch (resDto.getServiceType())
{
case UserDemandConstant.PARTY_UNIT:
resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName());
resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact());
resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile());
break;
case UserDemandConstant.SOCIAL_ORG:
resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName());
resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge());
resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile());
break;
case UserDemandConstant.COMMUNITY_ORG:
resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName());
resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName());
resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone());
break;
case UserDemandConstant.VOLUNTEER:
resDto.setServiceUnitName(StrConstant.EPMETY_STR);
resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName());
resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile());
break;
default:
log.warn("serviceType 错误");
break;
}
}
}
return list;
}
/**
* 获取党建单位基本信息
* @param partyUnitIds
* @return
*/
private Map<String, IcPartyUnitEntity> getPartyUnitMap(List<String> partyUnitIds) {
List<IcPartyUnitEntity> partyUnitList=partyUnitService.queryListById(partyUnitIds);
Map<String, IcPartyUnitEntity> partyUnitMap = partyUnitList.stream().collect(Collectors.toMap(IcPartyUnitEntity::getId, o -> o, (o1, o2) -> o1));
return partyUnitMap;
}
/**
* 获取社会组织基本信息
* @param socialOrgIds
* @return
*/
private Map<String, IcSocietyOrgEntity> getSocialOrgMap(List<String> socialOrgIds) {
List<IcSocietyOrgEntity> socialOrgList=societyOrgService.queryListById(socialOrgIds);
Map<String, IcSocietyOrgEntity> socialOrgMap = socialOrgList.stream().collect(Collectors.toMap(IcSocietyOrgEntity::getId, o -> o, (o1, o2) -> o1));
return socialOrgMap;
}
/**
* 获取社区自组织基本信息
* @param communityOrgIds
* @return
*/
private Map<String, IcCommunitySelfOrganizationEntity> getCommunityOrgMap(List<String> communityOrgIds) {
List<IcCommunitySelfOrganizationEntity> communityOrgList=communitySelfOrganizationService.queryListById(communityOrgIds);
Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap = communityOrgList.stream().collect(Collectors.toMap(IcCommunitySelfOrganizationEntity::getId, o -> o, (o1, o2) -> o1));
return communityOrgMap;
}
/**
* 获取志愿者基本信息
* @param userIdList
* @return
*/
private Map<String, UserBaseInfoResultDTO> getVolunteerMap(Set<String> userIdList) {
Map<String,UserBaseInfoResultDTO> userInfoMap=new HashMap<>();
if(CollectionUtils.isNotEmpty(userIdList)){
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList));
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询志愿者信息异常","服务方查询异常");
}
userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, o -> o, (o1, o2) -> o1));
}
return userInfoMap;
}
}

52
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml

@ -254,4 +254,56 @@
and customer_id=#{customerId}
and category_code=#{categoryCode}
</select>
<resultMap id="DemandCategoryResMap" type="com.epmet.dto.result.demand.DemandCategoryResDTO">
<result column="ID" property="categoryId"/>
<result column="CATEGORY_CODE" property="categoryCode"/>
<result column="PARENT_CODE" property="parentCode"/>
<result column="CATEGORY_NAME" property="categoryName"/>
<result column="CUSTOMER_ID" property="customerId"/>
<collection property="children" ofType="com.epmet.dto.result.demand.DemandCategoryResDTO"
select="queryCategoryList" column="customerId=customerId,parentCode=PARENT_CODE">
</collection>
</resultMap>
<!-- 居民端-我有需求 分类列表 -->
<select id="queryCategoryList" parameterType="map" resultMap="DemandCategoryResMap">
select
ID,
CATEGORY_CODE,
PARENT_CODE,
CATEGORY_NAME,
CUSTOMER_ID
from ic_resi_demand_dict
where del_flag='0'
AND USABLE_FLAG='1'
and customer_id = #{customerId}
and PARENT_CODE = #{parentCode}
ORDER BY SORT ASC
</select>
<!-- 查询分类信息,限制未被禁用的 -->
<select id="selectListByCodes" parameterType="map" resultType="com.epmet.dto.result.demand.DemandCategoryResDTO">
select
ID,
CATEGORY_CODE,
PARENT_CODE,
CATEGORY_NAME,
CUSTOMER_ID
from ic_resi_demand_dict
where del_flag='0'
AND USABLE_FLAG='1'
and customer_id = #{customerId}
AND CATEGORY_CODE IN
<foreach item="categoryCode" collection="categoryCodes" open="(" separator="," close=")">
#{categoryCode}
</foreach>
ORDER BY field(
CATEGORY_CODE,
<foreach item="code" collection="categoryCodes" separator=",">
#{code}
</foreach>
)
</select>
</mapper>

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

@ -68,7 +68,7 @@
) as serviceName,
s.SERVICE_START_TIME as serviceStartTime,
s.SERVICE_END_TIME as serviceEndTime,
IFNULL(s.FINISH_DESC,'') as finishDesc,
IFNULL(sa.remark,'') as finishDesc,
'' AS serviceShowName,
s.id as serviceId,
(
@ -192,7 +192,7 @@
) as serviceName,
s.SERVICE_START_TIME as serviceStartTime,
s.SERVICE_END_TIME as serviceEndTime,
IFNULL(s.FINISH_DESC,'') as finishDesc,
IFNULL(sa.remark,'') as finishDesc,
'' AS serviceShowName,
s.id as serviceId,
left(r.CATEGORY_CODE,4) as firstCategoryCode,
@ -253,7 +253,7 @@
) as serviceName,
s.SERVICE_START_TIME as serviceStartTime,
s.SERVICE_END_TIME as serviceEndTime,
IFNULL(s.FINISH_DESC,'') as finishDesc,
IFNULL(s.remark,'') as finishDesc,
'' AS serviceShowName,
s.id as serviceId,
(
@ -452,4 +452,43 @@
</if>
order by r.WANT_SERVICE_TIME asc
</select>
<!-- 居民端-我的需求(待处理,处理中,已完成,已取消) -->
<!-- type 待处理:unprocessed;处理中:processing;已完成:finished;已取消:canceled -->
<select id="queryMyDemandForResiClient" parameterType="map" resultType="com.epmet.dto.result.demand.ResiClientMyDemandResDTO">
SELECT
r.id as demandRecId,
r.CATEGORY_CODE,
r.PARENT_CODE,
r.WANT_SERVICE_TIME,
concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) AS serviceAddress,
m.SERVICE_TYPE,
m.SERVER_ID,
r.EVALUATE_FLAG,
s.SCORE,
r.`STATUS`,
r.CANCEL_TIME
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 !=#{demandUserId}
<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')
</if>
<if test="null !=type and type =='finished' ">
AND r.`STATUS` = 'finished'
</if>
<if test="null !=type and type =='canceled' ">
AND r.`STATUS` = 'canceled'
</if>
order by r.WANT_SERVICE_TIME asc
</select>
</mapper>
Loading…
Cancel
Save