Browse Source

Merge remote-tracking branch 'origin/dev_ic_mp' into develop

dev
yinzuomei 4 years ago
parent
commit
a071fc8dc8
  1. 11
      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. 22
      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. 9
      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. 75
      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. 285
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  27. 25
      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
  29. 2
      epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml
  30. 8
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java
  31. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java
  32. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java
  33. 28
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java
  34. 6
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.9__alter_org.sql
  35. 13
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  36. 6
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml
  37. 12
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  38. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  39. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java
  40. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

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

@ -85,16 +85,7 @@ public enum EpmetErrorCode {
BUILDING_NAME_EXITED(8215,"楼栋名称已存在"), BUILDING_NAME_EXITED(8215,"楼栋名称已存在"),
DOOR_NAME_EXITED(8216,"门牌号已存在"), DOOR_NAME_EXITED(8216,"门牌号已存在"),
NEIGHBOOR_NAME_EXITED(8217,"小区名称已存在"), NEIGHBOOR_NAME_EXITED(8217,"小区名称已存在"),
DEMAND_NAME_EXITED(8218, "分类名称已存在"),
DEMAND_CAN_NOT_CANCEL(8219, "需求已完成,不可取消"),
DEMAND_CAN_NOT_ASSIGN(8220, "当前状态,不可指派"),
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, "您没有足够的操作权限"), REQUIRE_PERMISSION(8301, "您没有足够的操作权限"),
THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"), 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; package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* 居民需求评价记录表 * 居民需求评价记录表
@ -69,6 +69,11 @@ public class IcUserDemandSatisfactionDTO implements Serializable {
*/ */
private BigDecimal score; private BigDecimal score;
/**
* 评价时填写的完成情况
*/
private String remark;
/** /**
* 删除标识0.未删除 1.已删除 * 删除标识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; package com.epmet.dto;
import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import lombok.Data;
/** /**
@ -69,7 +70,7 @@ public class IcUserDemandServiceDTO implements Serializable {
private Date serviceEndTime; private Date serviceEndTime;
/** /**
* 完成情况 * 此列暂时没有用完成情况在ic_user_demand_satisfaction.remark
*/ */
private String finishDesc; 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.io.Serializable;
import java.util.List; import java.util.List;
/**
* 数据分析-个人档案-需求详情研判分析的 分类以及分类下的需求
*/
@Data @Data
public class DemandDataDTO implements Serializable { public class DemandDataDTO implements Serializable {
private String firstCategoryCode; 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 @Data
public class DemandDetailResDTO implements Serializable { public class DemandDetailResDTO implements Serializable {
@ -97,4 +98,12 @@ public class DemandDetailResDTO implements Serializable {
* 服务记录主键 * 服务记录主键
*/ */
private String serviceId; 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.math.BigDecimal;
import java.util.List; import java.util.List;
/**
* 需求分类列表返参
*/
@Data @Data
public class DemandPageResDTO implements Serializable { public class DemandPageResDTO implements Serializable {
private String customerId; 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.io.Serializable;
import java.util.Date; import java.util.Date;
/**
* 数据分析-个人档案居民需求列表table
* 数据分析-个人档案需求详情研判分析-需求列表
*/
@Data @Data
public class IcResiUserReportDemandRes implements Serializable { public class IcResiUserReportDemandRes implements Serializable {
private static final long serialVersionUID = 7043350476644105434L; 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;
}

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

@ -27,6 +27,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.demand.*; 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.DemandPageResDTO;
import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.service.IcResiDemandDictService; import com.epmet.service.IcResiDemandDictService;
@ -172,8 +173,27 @@ public class IcResiDemandDictController {
return new Result<List<OptionDTO>>().ok(icResiDemandDictService.querySubCodeList(formDTO)); return new Result<List<OptionDTO>>().ok(icResiDemandDictService.querySubCodeList(formDTO));
} }
/**
* 居民端我有需求分类列表
* 查询可用的需求
*
* @param tokenDto
* @return
*/
@PostMapping("category-list")
public Result<List<DemandCategoryResDTO>> queryCategoryList(@LoginUser TokenDto tokenDto){
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.constant.UserDemandConstant;
import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.demand.*; import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.DemandDetailResDTO; import com.epmet.dto.result.demand.*;
import com.epmet.dto.result.demand.DemandHallResultDTO;
import com.epmet.dto.result.demand.FinishResultDTO;
import com.epmet.dto.result.demand.TakeOrderResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.service.IcUserDemandRecService; import com.epmet.service.IcUserDemandRecService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -151,6 +148,18 @@ public class ResiDemandController {
return new Result(); 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));
}
} }

9
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.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.OptionResultDTO; 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.DemandPageResDTO;
import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcResiDemandDictEntity; import com.epmet.entity.IcResiDemandDictEntity;
@ -68,4 +69,12 @@ public interface IcResiDemandDictDao extends BaseDao<IcResiDemandDictEntity> {
String selectNameByCode(@Param("customerId")String customerId, @Param("categoryCode") String categoryCode); String selectNameByCode(@Param("customerId")String customerId, @Param("categoryCode") String categoryCode);
IcResiDemandDictEntity selectByCode(@Param("customerId") String customerId, @Param("categoryCode") String categoryCode); IcResiDemandDictEntity selectByCode(@Param("customerId") String customerId, @Param("categoryCode") String categoryCode);
/**
* 查询分类信息限制未被禁用的
* @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, List<DemandHallResultDTO> selectListDemandHall(@Param("gridId") String gridId,
@Param("type") String type, @Param("type") String type,
@Param("currentUserId") String currentUserId); @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 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; private Date serviceEndTime;
/** /**
* 完成情况 * 此列暂时没有用完成情况在ic_user_demand_satisfaction.remark
*/ */
private String finishDesc; 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 上午 * @date 2021/11/25 9:03 上午
*/ */
void importCommunitySelfOrganization(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException; 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 * @param formDTO
*/ */
void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO 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.page.PageData;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.demand.*; 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.DemandPageResDTO;
import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcResiDemandDictEntity; import com.epmet.entity.IcResiDemandDictEntity;
@ -128,4 +129,21 @@ public interface IcResiDemandDictService extends BaseService<IcResiDemandDictEnt
* @return * @return
*/ */
IcResiDemandDictEntity getByCode(String customerId, String categoryCode); 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<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 com.epmet.entity.IcUserDemandRecEntity;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 居民需求记录表 * 居民需求记录表
@ -35,25 +34,6 @@ import java.util.Map;
*/ */
public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntity> { 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); 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 * @return
*/ */
FinishResultDTO evaluate(EvaluateDemandFormDTO formDTO); 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) { private String getServiceMatter(Map<String, String> map, String matter) {
List<String> matters = Arrays.asList(matter.split(StrConstant.COLON)); List<String> matters = Arrays.asList(matter.split(StrConstant.COLON));
List<String> list = matters.stream().map(map::get).collect(Collectors.toList()); List<String> list = matters.stream().map(map::get).collect(Collectors.toList());

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

@ -17,6 +17,7 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
@ -24,27 +25,29 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcResiDemandDictDao; import com.epmet.dao.IcResiDemandDictDao;
import com.epmet.dto.form.demand.*; 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.DemandPageResDTO;
import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcResiDemandDictEntity; import com.epmet.entity.IcResiDemandDictEntity;
import com.epmet.service.IcResiDemandDictService; import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcUserDemandRecService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays; import java.util.*;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/** /**
* 居民需求字典表 * 居民需求字典表
@ -55,6 +58,8 @@ import java.util.Map;
@Slf4j @Slf4j
@Service @Service
public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDictDao, IcResiDemandDictEntity> implements IcResiDemandDictService { public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDictDao, IcResiDemandDictEntity> implements IcResiDemandDictService {
@Autowired
private IcUserDemandRecService icUserDemandRecService;
/** /**
* 分页查询 * 分页查询
@ -78,7 +83,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
public void addFirstCategory(AddFirstCategoryFormDTO formDTO) { public void addFirstCategory(AddFirstCategoryFormDTO formDTO) {
if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.ONE, NumConstant.ZERO_STR,null) > NumConstant.ZERO) { if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.ONE, NumConstant.ZERO_STR,null) > NumConstant.ZERO) {
// 名称唯一 // 名称唯一
throw new RenException(EpmetErrorCode.DEMAND_NAME_EXITED.getCode(), EpmetErrorCode.DEMAND_NAME_EXITED.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在");
} }
IcResiDemandDictEntity entity = new IcResiDemandDictEntity(); IcResiDemandDictEntity entity = new IcResiDemandDictEntity();
@ -105,7 +110,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
} }
if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.TWO, formDTO.getParentCategoryCode(),null) > NumConstant.ZERO) { if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.TWO, formDTO.getParentCategoryCode(),null) > NumConstant.ZERO) {
// 名称唯一 // 名称唯一
throw new RenException(EpmetErrorCode.DEMAND_NAME_EXITED.getCode(), EpmetErrorCode.DEMAND_NAME_EXITED.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在");
} }
IcResiDemandDictEntity entity = new IcResiDemandDictEntity(); IcResiDemandDictEntity entity = new IcResiDemandDictEntity();
@ -158,7 +163,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
IcResiDemandDictEntity origin = baseDao.selectById(formDTO.getCategoryId()); IcResiDemandDictEntity origin = baseDao.selectById(formDTO.getCategoryId());
if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.TWO, origin.getParentCode(), formDTO.getCategoryId()) > NumConstant.ZERO) { if (checkCategoryName(formDTO.getCustomerId(), formDTO.getCategoryName(), NumConstant.TWO, origin.getParentCode(), formDTO.getCategoryId()) > NumConstant.ZERO) {
// 名称唯一 // 名称唯一
throw new RenException(EpmetErrorCode.DEMAND_NAME_EXITED.getCode(), EpmetErrorCode.DEMAND_NAME_EXITED.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("【%s】已存在", formDTO.getCategoryName()), "分类名称已存在");
} }
origin.setCategoryName(formDTO.getCategoryName()); origin.setCategoryName(formDTO.getCategoryName());
if (NumConstant.TWO == origin.getLevel()) { if (NumConstant.TWO == origin.getLevel()) {
@ -263,5 +268,61 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
return baseDao.selectByCode(customerId,categoryCode); return baseDao.selectByCode(customerId,categoryCode);
} }
/**
* 居民端我有需求分类列表
* 查询可用的需求
*
* @param customerId
* @return
*/
@Override
public List<DemandCategoryResDTO> queryCategoryList(String customerId) {
List<DemandCategoryResDTO> list=new ArrayList<>();
LambdaQueryWrapper<IcResiDemandDictEntity> wrapper=new LambdaQueryWrapper();
wrapper.eq(IcResiDemandDictEntity::getCustomerId,customerId);
wrapper.eq(IcResiDemandDictEntity::getUsableFlag,true);
wrapper.eq(IcResiDemandDictEntity::getParentCode,NumConstant.ZERO_STR);
wrapper.orderByAsc(IcResiDemandDictEntity::getSort);
List<IcResiDemandDictEntity> first=baseDao.selectList(wrapper);
first.forEach(dto->{
DemandCategoryResDTO resultDto= ConvertUtils.sourceToTarget(dto,DemandCategoryResDTO.class);
resultDto.setCategoryId(dto.getId());
LambdaQueryWrapper<IcResiDemandDictEntity> query=new LambdaQueryWrapper();
query.eq(IcResiDemandDictEntity::getCustomerId,customerId);
query.eq(IcResiDemandDictEntity::getUsableFlag,true);
query.eq(IcResiDemandDictEntity::getParentCode,dto.getCategoryCode());
query.orderByAsc(IcResiDemandDictEntity::getSort);
List<IcResiDemandDictEntity> sub=baseDao.selectList(query);
List<DemandCategoryResDTO> children=new ArrayList<>();
sub.forEach(subDto->{
DemandCategoryResDTO subDTO= ConvertUtils.sourceToTarget(subDto,DemandCategoryResDTO.class);
subDTO.setCategoryId(subDto.getId());
children.add(subDTO);
});
resultDto.setChildren(children);
list.add(resultDto);
});
return list;
}
/**
* 居民端我有需求最近预约显示最近预约过的五个需求按照预约时间倒
*
* @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; return numList;
} }
@Override
public List<IcSocietyOrgEntity> queryListById(List<String> socialOrgIds) {
return baseDao.selectBatchIds(socialOrgIds);
}
} }

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

@ -19,16 +19,13 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.DictTypeEnum; import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
@ -49,9 +46,7 @@ import com.epmet.entity.*;
import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.IcResiDemandDictService; import com.epmet.service.*;
import com.epmet.service.IcUserDemandRecService;
import com.epmet.service.VolunteerInfoService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -91,31 +86,12 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
private EpmetAdminOpenFeignClient adminOpenFeignClient; private EpmetAdminOpenFeignClient adminOpenFeignClient;
@Autowired @Autowired
private VolunteerInfoService volunteerInfoService; private VolunteerInfoService volunteerInfoService;
@Autowired
@Override private IcPartyUnitService partyUnitService;
public PageData<IcUserDemandRecDTO> page(Map<String, Object> params) { @Autowired
IPage<IcUserDemandRecEntity> page = baseDao.selectPage( private IcSocietyOrgService societyOrgService;
getPage(params, FieldConstant.CREATED_TIME, false), @Autowired
getWrapper(params) private IcCommunitySelfOrganizationService communitySelfOrganizationService;
);
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;
}
@Override @Override
public IcUserDemandRecDTO get(String id) { public IcUserDemandRecDTO get(String id) {
@ -123,29 +99,22 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
return ConvertUtils.sourceToTarget(entity, IcUserDemandRecDTO.class); 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 @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public DemandRecId update(DemandAddFromDTO dto) { public DemandRecId update(DemandAddFromDTO dto) {
IcUserDemandRecEntity origin = baseDao.selectById(dto.getDemandRecId()); IcUserDemandRecEntity origin = baseDao.selectById(dto.getDemandRecId());
if (null == origin) { if (null == origin) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
} }
if(!UserDemandConstant.PENDING.equals(origin.getStatus())){ if(!UserDemandConstant.PENDING.equals(origin.getStatus())){
//待处理的才可以修改需求 //待处理的才可以修改需求
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_UPDATE.getCode(),EpmetErrorCode.DEMAND_CAN_NOT_UPDATE.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不允许重新编辑", origin.getStatus()), "需求已处理,不允许重新编辑");
} }
CustomerGridFormDTO customerGridFormDTO=new CustomerGridFormDTO(); CustomerGridFormDTO customerGridFormDTO=new CustomerGridFormDTO();
customerGridFormDTO.setGridId(dto.getGridId()); customerGridFormDTO.setGridId(dto.getGridId());
Result<CustomerGridDTO> gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); Result<CustomerGridDTO> gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO);
if(!gridInfoRes.success()||null==gridInfoRes.getData()){ if(!gridInfoRes.success()||null==gridInfoRes.getData()){
throw new RenException("查询网格信息失败"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询网格信息失败");
} }
IcUserDemandRecEntity updateEntity=ConvertUtils.sourceToTarget(dto,IcUserDemandRecEntity.class); IcUserDemandRecEntity updateEntity=ConvertUtils.sourceToTarget(dto,IcUserDemandRecEntity.class);
updateEntity.setAgencyId(gridInfoRes.getData().getPid()); updateEntity.setAgencyId(gridInfoRes.getData().getPid());
@ -215,7 +184,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
customerGridFormDTO.setGridId(fromDTO.getGridId()); customerGridFormDTO.setGridId(fromDTO.getGridId());
Result<CustomerGridDTO> gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); Result<CustomerGridDTO> gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO);
if(!gridInfoRes.success()||null==gridInfoRes.getData()){ if(!gridInfoRes.success()||null==gridInfoRes.getData()){
throw new RenException("查询网格信息失败"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询网格信息失败");
} }
IcUserDemandRecEntity insertEntity=ConvertUtils.sourceToTarget(fromDTO,IcUserDemandRecEntity.class); IcUserDemandRecEntity insertEntity=ConvertUtils.sourceToTarget(fromDTO,IcUserDemandRecEntity.class);
insertEntity.setAgencyId(gridInfoRes.getData().getPid()); insertEntity.setAgencyId(gridInfoRes.getData().getPid());
@ -267,7 +236,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
public PageData<DemandRecResultDTO> pageList(UserDemandPageFormDTO formDTO) { public PageData<DemandRecResultDTO> pageList(UserDemandPageFormDTO formDTO) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getCurrentStaffId()); CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getCurrentStaffId());
if (null == staffInfo) { if (null == staffInfo) {
throw new RenException("工作人员所属组织信息查询异常"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"工作人员所属组织信息查询异常");
} }
if (StringUtils.isBlank(staffInfo.getAgencyPIds())|| NumConstant.ZERO_STR.equals(staffInfo.getAgencyPIds())) { if (StringUtils.isBlank(staffInfo.getAgencyPIds())|| NumConstant.ZERO_STR.equals(staffInfo.getAgencyPIds())) {
//当前用户属于根组织下的人 //当前用户属于根组织下的人
@ -297,7 +266,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
if(CollectionUtils.isNotEmpty(userIdList)){ if(CollectionUtils.isNotEmpty(userIdList)){
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList));
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
throw new RenException("查询志愿者信息异常"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询志愿者信息异常");
} }
userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName));
} }
@ -326,55 +295,10 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
} }
//社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help //社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help
res.setReportTypeName(reportTypeMap.containsKey(res.getReportType())?reportTypeMap.get(res.getReportType()):StrConstant.EPMETY_STR); 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 //待处理:pending;已取消canceled;已派单:assigned;已接单:have_order;已完成:finished
res.setStatusName(statusMap.containsKey(res.getStatus())?statusMap.get(res.getStatus()):StrConstant.EPMETY_STR); 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; //服务方类型:志愿者: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); 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); res.setServiceShowFlag(StringUtils.isNotBlank(res.getServerId()) ? true : false);
} }
} }
@ -391,11 +315,11 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
public void cancel(CancelDemandFormDTO formDTO) { public void cancel(CancelDemandFormDTO formDTO) {
IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId());
if (null == entity) { if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.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()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不可取消需求", entity.getStatus()), "当前状态,不可取消");
} }
//1、修改主表 //1、修改主表
//置为取消状态、设置取消时间 //置为取消状态、设置取消时间
@ -422,11 +346,11 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
public void assign(AssignFormDTO formDTO) { public void assign(AssignFormDTO formDTO) {
IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId());
if (null == entity) { if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "需求不存在", EpmetErrorCode.SERVER_ERROR.getMsg());
} }
if (!UserDemandConstant.PENDING.equals(entity.getStatus()) && !UserDemandConstant.ASSIGNED.equals(entity.getStatus())) { if (!UserDemandConstant.PENDING.equals(entity.getStatus()) && !UserDemandConstant.ASSIGNED.equals(entity.getStatus())) {
//待处理+已派单才可以指派 //待处理+已派单才可以指派
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_ASSIGN.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_ASSIGN.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不可指派",entity.getStatus()),"当前状态,不可指派");
} }
//1、修改主表 //1、修改主表
//置为已派单 //置为已派单
@ -474,11 +398,10 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//2、更新服务记录,记录实际开始,实际结束时间 //2、更新服务记录,记录实际开始,实际结束时间
IcUserDemandServiceEntity serviceEntity=demandServiceDao.selectById(formDTO.getServiceId()); IcUserDemandServiceEntity serviceEntity=demandServiceDao.selectById(formDTO.getServiceId());
if(null==serviceEntity){ if(null==serviceEntity){
throw new RenException(EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getMsg()); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "服务记录不存在", EpmetErrorCode.SERVER_ERROR.getMsg());
} }
serviceEntity.setServiceStartTime(formDTO.getServiceStartTime()); serviceEntity.setServiceStartTime(formDTO.getServiceStartTime());
serviceEntity.setServiceEndTime(formDTO.getServiceEndTime()); serviceEntity.setServiceEndTime(formDTO.getServiceEndTime());
serviceEntity.setFinishDesc(StringUtils.isNotBlank(formDTO.getFinishDesc())?formDTO.getFinishDesc():StrConstant.EPMETY_STR);
demandServiceDao.updateById(serviceEntity); demandServiceDao.updateById(serviceEntity);
// 3、pc完成情况:完成+评价 // 3、pc完成情况:完成+评价
@ -486,6 +409,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//3.1、插入评价得分记录 //3.1、插入评价得分记录
IcUserDemandSatisfactionEntity satisfactionEntity=ConvertUtils.sourceToTarget(formDTO,IcUserDemandSatisfactionEntity.class); IcUserDemandSatisfactionEntity satisfactionEntity=ConvertUtils.sourceToTarget(formDTO,IcUserDemandSatisfactionEntity.class);
satisfactionEntity.setEvaluateTime(logEntity.getOperateTime()); satisfactionEntity.setEvaluateTime(logEntity.getOperateTime());
satisfactionEntity.setRemark(StringUtils.isNotBlank(formDTO.getFinishDesc())?formDTO.getFinishDesc():StrConstant.EPMETY_STR);
demandSatisfactionDao.insert(satisfactionEntity); demandSatisfactionDao.insert(satisfactionEntity);
// 3.2插入评价操作日志 // 3.2插入评价操作日志
@ -518,15 +442,15 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
private IcUserDemandRecEntity checkFinishPreCondition(String demandRecId) { private IcUserDemandRecEntity checkFinishPreCondition(String demandRecId) {
IcUserDemandRecEntity entity=baseDao.selectById(demandRecId); IcUserDemandRecEntity entity=baseDao.selectById(demandRecId);
if (null == entity) { if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.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()) ){ if(UserDemandConstant.FINISHED.equals(entity.getStatus()) ){
//已经完成 //已经完成
throw new RenException(EpmetErrorCode.DEMAND_FINISHED.getCode(), EpmetErrorCode.DEMAND_FINISHED.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务已完成,不可重复提交", "服务已完成,不可重复提交");
}
if (!UserDemandConstant.ASSIGNED.equals(entity.getStatus()) && !UserDemandConstant.HAVE_ORDER.equals(entity.getStatus())) {
//已指派、已抢单的才可以完成
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不可点击服务完成",entity.getStatus()), "当前状态,不能确认服务完成");
} }
return entity; return entity;
} }
@ -659,7 +583,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
resiUserFormDTO.setIcResiUserId(formDTO.getIcResiUserId()); resiUserFormDTO.setIcResiUserId(formDTO.getIcResiUserId());
Result<ResiUserResDTO> resiRes = epmetUserOpenFeignClient.findEpmetUser(resiUserFormDTO); Result<ResiUserResDTO> resiRes = epmetUserOpenFeignClient.findEpmetUser(resiUserFormDTO);
if (!resiRes.success()) { if (!resiRes.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询小程序用户异常"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询小程序用户异常");
} }
if (null != resiRes.getData() && CollectionUtils.isNotEmpty(resiRes.getData().getEpmetUserIdList())) { if (null != resiRes.getData() && CollectionUtils.isNotEmpty(resiRes.getData().getEpmetUserIdList())) {
formDTO.setEpmetUserIdList(resiRes.getData().getEpmetUserIdList()); formDTO.setEpmetUserIdList(resiRes.getData().getEpmetUserIdList());
@ -675,7 +599,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
} }
if(StringUtils.isBlank(formDTO.getIcResiUserId())&&CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){ if(StringUtils.isBlank(formDTO.getIcResiUserId())&&CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){
//需求人不能为空 //需求人不能为空
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求人不能为空,icResiUserId与epmetUserIdList不能同时为空"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "需求人不能为空,icResiUserId与epmetUserIdList不能同时为空");
} }
@ -724,13 +648,13 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
HouseMemResDTO houseMemResDTO=new HouseMemResDTO(); HouseMemResDTO houseMemResDTO=new HouseMemResDTO();
if(StringUtils.isBlank(formDTO.getIcResiUserId())&&CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){ if(StringUtils.isBlank(formDTO.getIcResiUserId())&&CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){
//需求人不能为空 //需求人不能为空
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求人不能为空,icResiUserId与epmetUserIdList不能同时为空"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "需求人不能为空,icResiUserId与epmetUserIdList不能同时为空");
} }
//服务措施分析点击了PC录入的需求,或者个人档案进来的(这两种情况肯定会有icResiUserId) //服务措施分析点击了PC录入的需求,或者个人档案进来的(这两种情况肯定会有icResiUserId)
if(StringUtils.isNotBlank(formDTO.getIcResiUserId())){ if(StringUtils.isNotBlank(formDTO.getIcResiUserId())){
Result<IcResiUserBriefDTO> userRes = epmetUserOpenFeignClient.findFamilyMem(formDTO.getIcResiUserId()); Result<IcResiUserBriefDTO> userRes = epmetUserOpenFeignClient.findFamilyMem(formDTO.getIcResiUserId());
if (!userRes.success() || null == userRes.getData()) { if (!userRes.success() || null == userRes.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民信息接口异常"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "获取居民信息接口异常");
} }
houseMemResDTO=ConvertUtils.sourceToTarget(userRes.getData(),HouseMemResDTO.class); houseMemResDTO=ConvertUtils.sourceToTarget(userRes.getData(),HouseMemResDTO.class);
} }
@ -743,7 +667,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
findIcUserFormDTO.setEpmetUserId(formDTO.getEpmetUserIdList().get(NumConstant.ZERO)); findIcUserFormDTO.setEpmetUserId(formDTO.getEpmetUserIdList().get(NumConstant.ZERO));
Result<EpmetUserFamilyDTO> epmetUserFamilyDTOResult=epmetUserOpenFeignClient.findIcUser(findIcUserFormDTO); Result<EpmetUserFamilyDTO> epmetUserFamilyDTOResult=epmetUserOpenFeignClient.findIcUser(findIcUserFormDTO);
if (!epmetUserFamilyDTOResult.success() || null == epmetUserFamilyDTOResult.getData()) { if (!epmetUserFamilyDTOResult.success() || null == epmetUserFamilyDTOResult.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "根据小程序用户id,获取ic居民信息接口异常"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "根据小程序用户id,获取ic居民信息接口异常");
} }
houseMemResDTO=ConvertUtils.sourceToTarget(epmetUserFamilyDTOResult.getData(),HouseMemResDTO.class); houseMemResDTO=ConvertUtils.sourceToTarget(epmetUserFamilyDTOResult.getData(),HouseMemResDTO.class);
formDTO.setEpmetUserIdList(epmetUserFamilyDTOResult.getData().getEpmetUserIdList()); formDTO.setEpmetUserIdList(epmetUserFamilyDTOResult.getData().getEpmetUserIdList());
@ -763,7 +687,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//找到当前组织的所有上级,再拼接上自己 //找到当前组织的所有上级,再拼接上自己
Result<CustomerAgencyDTO> customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId()); Result<CustomerAgencyDTO> customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId());
if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){ if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById");
} }
if(NumConstant.ZERO_STR.equals(customerAgencyDTOResult.getData().getPid())){ if(NumConstant.ZERO_STR.equals(customerAgencyDTOResult.getData().getPid())){
//当前传入的组织id=客户的根组织 //当前传入的组织id=客户的根组织
@ -801,7 +725,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
if(CollectionUtils.isNotEmpty(userIdList)){ if(CollectionUtils.isNotEmpty(userIdList)){
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList));
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
throw new RenException("查询志愿者信息异常"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询志愿者信息异常");
} }
userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName));
} }
@ -859,7 +783,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//2、没有服务类型直接退出 //2、没有服务类型直接退出
Result<Map<String, String>> serviceTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); Result<Map<String, String>> serviceTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode());
if(!serviceTypeRes.success()||MapUtils.isEmpty(serviceTypeRes.getData())){ if(!serviceTypeRes.success()||MapUtils.isEmpty(serviceTypeRes.getData())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询服务方类型异常,请检查是否已经配置字典信息"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询服务方类型异常,请检查是否已经配置字典信息");
} }
List<LegendDTO> legend=new ArrayList<>(); List<LegendDTO> legend=new ArrayList<>();
serviceTypeRes.getData().forEach((code,name)->{ serviceTypeRes.getData().forEach((code,name)->{
@ -875,7 +799,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//找到当前组织的所有上级,再拼接上自己 //找到当前组织的所有上级,再拼接上自己
Result<CustomerAgencyDTO> customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId()); Result<CustomerAgencyDTO> customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId());
if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){ if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById");
} }
if(NumConstant.ZERO_STR.equals(customerAgencyDTOResult.getData().getPid())){ if(NumConstant.ZERO_STR.equals(customerAgencyDTOResult.getData().getPid())){
//当前传入的组织id=客户的根组织 //当前传入的组织id=客户的根组织
@ -1025,11 +949,11 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
public TakeOrderResultDTO takeOrder(TakeOrderFormDTO formDTO) { public TakeOrderResultDTO takeOrder(TakeOrderFormDTO formDTO) {
IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId());
if (null == entity) { if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
} }
if (!UserDemandConstant.PENDING.equals(entity.getStatus())) { if (!UserDemandConstant.PENDING.equals(entity.getStatus())) {
//待处理的才可以抢单 //待处理的才可以抢单
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_TAKE_ORDER.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_TAKE_ORDER.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("需求当前状态为【%s】,不可接单",entity.getStatus()), "当前状态不可接单");
} }
TakeOrderResultDTO takeOrderResultDTO=new TakeOrderResultDTO(); TakeOrderResultDTO takeOrderResultDTO=new TakeOrderResultDTO();
//只有志愿者才可以接单 //只有志愿者才可以接单
@ -1085,11 +1009,10 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
public FinishResultDTO evaluate(EvaluateDemandFormDTO formDTO) { public FinishResultDTO evaluate(EvaluateDemandFormDTO formDTO) {
IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId());
if (null == entity) { if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg()); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求不存在", EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg());
} }
if (!UserDemandConstant.FINISHED.equals(entity.getStatus())) { if (!UserDemandConstant.FINISHED.equals(entity.getStatus())) {
// 已完成的可以评价 throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务未完成,不可评价", "服务未完成,不可评价");
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_EVALUATE.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_EVALUATE.getMsg());
} }
// todo 只有需求人才可以评价 // todo 只有需求人才可以评价
@ -1120,5 +1043,135 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
return finishResultDTO; 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.SERVER_ERROR.getCode(),"查询志愿者信息异常");
}
userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, o -> o, (o1, o2) -> o1));
}
return userInfoMap;
}
} }

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

@ -254,4 +254,29 @@
and customer_id=#{customerId} and customer_id=#{customerId}
and category_code=#{categoryCode} and category_code=#{categoryCode}
</select> </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> </mapper>

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

@ -68,7 +68,7 @@
) as serviceName, ) as serviceName,
s.SERVICE_START_TIME as serviceStartTime, s.SERVICE_START_TIME as serviceStartTime,
s.SERVICE_END_TIME as serviceEndTime, s.SERVICE_END_TIME as serviceEndTime,
IFNULL(s.FINISH_DESC,'') as finishDesc, IFNULL(sa.remark,'') as finishDesc,
'' AS serviceShowName, '' AS serviceShowName,
s.id as serviceId, s.id as serviceId,
( (
@ -192,7 +192,7 @@
) as serviceName, ) as serviceName,
s.SERVICE_START_TIME as serviceStartTime, s.SERVICE_START_TIME as serviceStartTime,
s.SERVICE_END_TIME as serviceEndTime, s.SERVICE_END_TIME as serviceEndTime,
IFNULL(s.FINISH_DESC,'') as finishDesc, IFNULL(sa.remark,'') as finishDesc,
'' AS serviceShowName, '' AS serviceShowName,
s.id as serviceId, s.id as serviceId,
left(r.CATEGORY_CODE,4) as firstCategoryCode, left(r.CATEGORY_CODE,4) as firstCategoryCode,
@ -253,7 +253,7 @@
) as serviceName, ) as serviceName,
s.SERVICE_START_TIME as serviceStartTime, s.SERVICE_START_TIME as serviceStartTime,
s.SERVICE_END_TIME as serviceEndTime, s.SERVICE_END_TIME as serviceEndTime,
IFNULL(s.FINISH_DESC,'') as finishDesc, IFNULL(s.remark,'') as finishDesc,
'' AS serviceShowName, '' AS serviceShowName,
s.id as serviceId, s.id as serviceId,
( (
@ -452,4 +452,43 @@
</if> </if>
order by r.WANT_SERVICE_TIME asc order by r.WANT_SERVICE_TIME asc
</select> </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> </mapper>

2
epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml

@ -84,7 +84,7 @@
<delete id="delReadMsg"> <delete id="delReadMsg">
UPDATE user_message UPDATE user_message
SET del_flag = '0', SET del_flag = '1',
updated_by = #{userId}, updated_by = #{userId},
updated_time = NOW() updated_time = NOW()
WHERE WHERE

8
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java

@ -45,18 +45,18 @@ public class AgencyListResultDTO implements Serializable {
/** /**
* 总人数 * 总人数
*/ */
private Integer totalUser; private Integer totalUser = 0;
/** /**
* 编码 * 编码
*/ */
private String code; private String code = "";
/** /**
* 负责人 * 负责人
*/ */
private String contacts; private String contacts = "";
/** /**
* 联系电话 * 联系电话
*/ */
private String mobile; private String mobile = "";
} }

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java

@ -49,7 +49,7 @@ public class DepartmentListResultDTO implements Serializable {
/** /**
* 编码 * 编码
*/ */
private String code; private String code = "";
/** /**
* 负责人 * 负责人
*/ */

12
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java

@ -51,4 +51,16 @@ public class ParentListResultDTO implements Serializable {
* 增加此返回值为了调试用 * 增加此返回值为了调试用
*/ */
private String areaCode; private String areaCode;
/**
* 组织编码[手动输入的]
*/
private String code;
/**
* 负责人
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
} }

28
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java

@ -55,12 +55,14 @@ public class GridController {
Result<AddGridResultDTO> resultDTOResult = customerGridService.addGrid(tokenDto,addGridFormDTO); Result<AddGridResultDTO> resultDTOResult = customerGridService.addGrid(tokenDto,addGridFormDTO);
//2021-10-18 推送mq,数据同步到中介库 start //2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); if (resultDTOResult.success()) {
mq.setCustomerId(tokenDto.getCustomerId()); OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setOrgId(resultDTOResult.getData().getGridId()); mq.setCustomerId(tokenDto.getCustomerId());
mq.setOrgType("grid"); mq.setOrgId(resultDTOResult.getData().getGridId());
mq.setType("grid_create"); mq.setOrgType("grid");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); mq.setType("grid_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
}
//2021-10-18 end //2021-10-18 end
return resultDTOResult; return resultDTOResult;
@ -77,12 +79,14 @@ public class GridController {
Result result = customerGridService.editGrid(tokenDto,editGridFormDTO); Result result = customerGridService.editGrid(tokenDto,editGridFormDTO);
//2021-10-18 推送mq,数据同步到中介库 start //2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); if (result.success()) {
mq.setCustomerId(tokenDto.getCustomerId()); OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setOrgId(editGridFormDTO.getGridId()); mq.setCustomerId(tokenDto.getCustomerId());
mq.setOrgType("grid"); mq.setOrgId(editGridFormDTO.getGridId());
mq.setType("grid_change"); mq.setOrgType("grid");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); mq.setType("grid_change");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
}
//2021-10-18 end //2021-10-18 end
return result; return result;

6
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.9__alter_org.sql

@ -1,14 +1,14 @@
ALTER TABLE `customer_agency` ALTER TABLE `customer_agency`
ADD COLUMN `CONTACTS` varchar(64) NULL COMMENT '负责人' AFTER `PARENT_AREA_CODE`, ADD COLUMN `CONTACTS` varchar(64) NULL COMMENT '负责人' AFTER `PARENT_AREA_CODE`,
ADD COLUMN `MOBILE` varchar(32) NULL COMMENT '联系电话' AFTER `PERSON`; ADD COLUMN `MOBILE` varchar(32) NULL COMMENT '联系电话' AFTER `CONTACTS`;
ALTER TABLE `customer_department` ALTER TABLE `customer_department`
ADD COLUMN `CODE` varchar(64) NULL COMMENT '编码' AFTER `UPDATED_TIME`, ADD COLUMN `CODE` varchar(64) NULL COMMENT '编码' AFTER `UPDATED_TIME`,
ADD COLUMN `CONTACTS` varchar(64) NULL COMMENT '负责人' AFTER `CODE`, ADD COLUMN `CONTACTS` varchar(64) NULL COMMENT '负责人' AFTER `CODE`,
ADD COLUMN `MOBILE` varchar(32) NULL COMMENT '联系电话' AFTER `PERSON`; ADD COLUMN `MOBILE` varchar(32) NULL COMMENT '联系电话' AFTER `CONTACTS`;
ALTER TABLE `customer_grid` ALTER TABLE `customer_grid`
ADD COLUMN `GRID_TYPE` varchar(64) NULL COMMENT '网格类型【字典表sys_dict_data,key:grid_type】' AFTER `PIDS`, ADD COLUMN `GRID_TYPE` varchar(64) NULL COMMENT '网格类型【字典表sys_dict_data,key:grid_type】' AFTER `PIDS`,
ADD COLUMN `CONTACTS` varchar(64) NULL COMMENT '负责人' AFTER `GRID_TYPE`, ADD COLUMN `CONTACTS` varchar(64) NULL COMMENT '负责人' AFTER `GRID_TYPE`,
ADD COLUMN `MOBILE` varchar(32) NULL COMMENT '联系电话' AFTER `PERSON`; ADD COLUMN `MOBILE` varchar(32) NULL COMMENT '联系电话' AFTER `CONTACTS`;

13
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -82,7 +82,12 @@
<select id="selectPAgencyById" resultType="com.epmet.dto.result.ParentListResultDTO"> <select id="selectPAgencyById" resultType="com.epmet.dto.result.ParentListResultDTO">
SELECT SELECT
id, id,
organization_name AS 'name' organization_name AS 'name',
level AS 'level',
area_code AS 'areaCode',
code 'code',
contacts 'contacts',
mobile 'mobile'
FROM customer_agency FROM customer_agency
WHERE del_flag = '0' WHERE del_flag = '0'
AND id IN AND id IN
@ -124,9 +129,9 @@
id AS 'agencyId', id AS 'agencyId',
organization_name AS 'agencyName', organization_name AS 'agencyName',
total_user AS 'totalUser', total_user AS 'totalUser',
code 'code', IFNULL(code,'')AS 'code',
contacts 'contacts', IFNULL(contacts,'')AS 'contacts',
mobile 'mobile' IFNULL(mobile,'')AS 'mobile'
FROM customer_agency FROM customer_agency
WHERE del_flag = '0' WHERE del_flag = '0'
AND pid = #{pId} AND pid = #{pId}

6
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml

@ -24,9 +24,9 @@
id AS 'departmentId', id AS 'departmentId',
department_name AS 'departmentName', department_name AS 'departmentName',
total_user AS 'totalUser', total_user AS 'totalUser',
code AS 'code', IFNULL(code,'')AS 'code',
contacts AS 'contacts', IFNULL(contacts,'')AS 'contacts',
mobile AS 'mobile' IFNULL(mobile,'')AS 'mobile'
FROM customer_department FROM customer_department
WHERE del_flag = '0' WHERE del_flag = '0'
AND agency_id = #{agencyId} AND agency_id = #{agencyId}

12
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -237,6 +237,10 @@
set set
grid_name = #{gridName}, grid_name = #{gridName},
manage_district = #{manageDistrict}, manage_district = #{manageDistrict},
code = #{code},
grid_type = #{gridType},
contacts = #{contacts},
mobile = #{mobile},
updated_by = #{updatedBy}, updated_by = #{updatedBy},
UPDATED_TIME=NOW() UPDATED_TIME=NOW()
where where
@ -284,10 +288,10 @@
id AS gridId, id AS gridId,
IFNULL(grid_name,"") AS gridName, IFNULL(grid_name,"") AS gridName,
total_user, total_user,
code, IFNULL(code,'')AS 'code',
grid_type, IFNULL(grid_type,'')AS 'gridType',
contacts, IFNULL(contacts,'')AS 'contacts',
mobile IFNULL(mobile,'')AS 'mobile'
FROM FROM
CUSTOMER_GRID CUSTOMER_GRID
<where> <where>

4
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -484,9 +484,9 @@ public class CustomerStaffController {
* @Description 事件网格员服务电话 * @Description 事件网格员服务电话
**/ **/
@PostMapping(value = "gridmobilelist") @PostMapping(value = "gridmobilelist")
public Result<List<GridMobileListResultDTO>> gridMobileList(@RequestBody GridMobileListFormDTO formDTO) { public Result<List<GridMobileListResultDTO>> gridMobileList(@LoginUser TokenDto tokenDto, @RequestBody GridMobileListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, GridMobileListFormDTO.Gridobile.class); ValidatorUtils.validateEntity(formDTO, GridMobileListFormDTO.Gridobile.class);
return new Result<List<GridMobileListResultDTO>>().ok(customerStaffService.gridMobileList(formDTO.getGridId())); return new Result<List<GridMobileListResultDTO>>().ok(customerStaffService.gridMobileList(formDTO.getGridId(), tokenDto.getUserId()));
} }

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java

@ -346,5 +346,5 @@ public interface CustomerStaffService extends BaseService<CustomerStaffEntity> {
* @Author sun * @Author sun
* @Description 事件网格员服务电话 * @Description 事件网格员服务电话
**/ **/
List<GridMobileListResultDTO> gridMobileList(String gridId); List<GridMobileListResultDTO> gridMobileList(String gridId, String userId);
} }

3
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -804,11 +804,12 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
* @Description 事件网格员服务电话 * @Description 事件网格员服务电话
**/ **/
@Override @Override
public List<GridMobileListResultDTO> gridMobileList(String gridId) { public List<GridMobileListResultDTO> gridMobileList(String gridId, String userId) {
List<GridMobileListResultDTO> resultList = new ArrayList<>(); List<GridMobileListResultDTO> resultList = new ArrayList<>();
//1.查询网格下工作人员列表 //1.查询网格下工作人员列表
CommonGridIdFormDTO dto = new CommonGridIdFormDTO(); CommonGridIdFormDTO dto = new CommonGridIdFormDTO();
dto.setGridId(gridId); dto.setGridId(gridId);
dto.setUserId(userId);
Result<List<String>> gridStaffs = govOrgOpenFeignClient.getGridStaffs(dto); Result<List<String>> gridStaffs = govOrgOpenFeignClient.getGridStaffs(dto);
if (!gridStaffs.success()) { if (!gridStaffs.success()) {
throw new RenException("获取网格下工作人员列表失败!"); throw new RenException("获取网格下工作人员列表失败!");

Loading…
Cancel
Save