Browse Source

错误码

dev_shibei_match
yinzuomei 4 years ago
parent
commit
2b94e2cf96
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java
  3. 17
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java
  4. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
  5. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  6. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java
  7. 23
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java
  8. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  9. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  10. 146
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  11. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml
  12. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
  13. 107
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDictDTO.java

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

@ -87,6 +87,8 @@ public enum EpmetErrorCode {
DEMAND_CAN_NOT_ASSIGN(8220, "当前状态,不可指派"), DEMAND_CAN_NOT_ASSIGN(8220, "当前状态,不可指派"),
DEMAND_CAN_NOT_FINISH(8221, "当前状态,不能评价"), DEMAND_CAN_NOT_FINISH(8221, "当前状态,不能评价"),
DEMAND_FINISHED(8222,"需求已完成"), DEMAND_FINISHED(8222,"需求已完成"),
DEMAND_CAN_NOT_UPDATE(8223,"当前状态,不可更新需求"),
DEMAND_NOT_EXITS(8224,"需求不存在"),
REQUIRE_PERMISSION(8301, "您没有足够的操作权限"), REQUIRE_PERMISSION(8301, "您没有足够的操作权限"),
THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"), THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"),

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java

@ -20,6 +20,11 @@ public class DemandAddFromDTO implements Serializable {
public interface AddUserShowGroup extends CustomerClientShowGroup { public interface AddUserShowGroup extends CustomerClientShowGroup {
} }
public interface UpdateInternalGroup {
}
@NotBlank(message = "需求id不能为空",groups = UpdateInternalGroup.class)
private String demandRecId;
private String customerId; private String customerId;
private String currentUserId; private String currentUserId;

17
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java

@ -22,27 +22,34 @@ public class DemandRecResultDTO implements Serializable {
private String categoryName; private String categoryName;
private String content;
//社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help
private String reportType; private String reportType;
private String reportTypeName;
private String content;
private String reportUserName; private String reportUserName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date reportTime; private Date reportTime;
private String demandUserId;
private String demandUser; private String demandUser;
private String demandUserName; private String demandUserName;
private String demandUserMobile; private String demandUserMobile;
@JsonIgnore //@JsonIgnore
private String serviceType; private String serviceType;
@JsonIgnore
private String serverId; private String serverId;
//@JsonIgnore
private String serviceName; private String serviceName;
private String serviceShowName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private String wantServiceTime; private String wantServiceTime;
/**
* 待处理pending已取消canceled已派单assigned已接单have_order已完成finished
*/
private String status; private String status;
private String statusName; private String statusName;
} }

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java

@ -9,6 +9,13 @@ public interface UserDemandConstant {
String MINI_RESI = "mini_resi"; String MINI_RESI = "mini_resi";
String IC_RESI_USER = "ic_resi_user"; String IC_RESI_USER = "ic_resi_user";
/**
* 上报类型社区帮办community楼长帮办building_caption;党员帮办party;自身上报self_help
*/
String COMMUNITY_REPORT="community";
String BUILDING_CAPTION_REPORT="building_caption";
String PARTY_REPORT="party";
String SELF_HELP_REPORT="self_help";
/** /**
* 待处理pending已取消canceled已派单assigned已接单have_order已完成finished * 待处理pending已取消canceled已派单assigned已接单have_order已完成finished
*/ */
@ -29,8 +36,10 @@ public interface UserDemandConstant {
/** /**
* 创建需求create;撤销需求cancel;指派assign;接单take_order;完成finish; * 创建需求create;撤销需求cancel;指派assign;接单take_order;完成finish;
* 更新需求update
*/ */
String CREATE="create"; String CREATE="create";
String UPDATE="update";
String CANCEL="cancel"; String CANCEL="cancel";
String ASSIGN="assign"; String ASSIGN="assign";
String TAKE_ORDER="take_order"; String TAKE_ORDER="take_order";

14
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java

@ -98,6 +98,20 @@ public class IcUserDemandRecController {
return new Result<DemandRecId>().ok(icUserDemandRecService.add(fromDTO)); return new Result<DemandRecId>().ok(icUserDemandRecService.add(fromDTO));
} }
/**
* 更新需求
* 只有待处理的才可以编辑
*
* @param tokenDto
* @param fromDTO
* @return
*/
@PostMapping("update")
public Result<DemandRecId> update(@LoginUser TokenDto tokenDto, @RequestBody DemandAddFromDTO fromDTO){
fromDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(fromDTO,DemandAddFromDTO.UpdateInternalGroup.class,DemandAddFromDTO.AddUserShowGroup.class);
return new Result<DemandRecId>().ok(icUserDemandRecService.update(fromDTO));
}
/** /**
* 列表查询 分页 * 列表查询 分页

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

@ -62,4 +62,7 @@ public interface IcResiDemandDictDao extends BaseDao<IcResiDemandDictEntity> {
Integer selectMaxSort(@Param("customerId") String customerId, Integer selectMaxSort(@Param("customerId") String customerId,
@Param("level") int level, @Param("level") int level,
@Param("parentCode") String parentCode); @Param("parentCode") String parentCode);
List<IcResiDemandDictEntity> selectSecondCodes(@Param("customerId") String customerId, @Param("cateogryCodes") List<String> categoryCodes);
} }

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

@ -21,14 +21,12 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.OptionResultDTO; 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.IcResiDemandDictDTO;
import com.epmet.dto.form.demand.*; import com.epmet.dto.form.demand.*;
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 java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 居民需求字典表 * 居民需求字典表
@ -42,7 +40,6 @@ public interface IcResiDemandDictService extends BaseService<IcResiDemandDictEnt
* 默认分页 * 默认分页
* *
* @param formDTO * @param formDTO
* @return PageData<IcResiDemandDictDTO>
* @author generator * @author generator
* @date 2021-10-27 * @date 2021-10-27
*/ */
@ -60,18 +57,6 @@ public interface IcResiDemandDictService extends BaseService<IcResiDemandDictEnt
*/ */
void addChild(AddCategoryFormDTO formDTO); void addChild(AddCategoryFormDTO formDTO);
/**
* 默认查询
*
* @param params
* @return java.util.List<IcResiDemandDictDTO>
* @author generator
* @date 2021-10-27
*/
List<IcResiDemandDictDTO> list(Map<String, Object> params);
/** /**
* 默认更新 * 默认更新
* *
@ -116,4 +101,12 @@ public interface IcResiDemandDictService extends BaseService<IcResiDemandDictEnt
* @param formDTO * @param formDTO
*/ */
void updateStatus(StatusFormDTO formDTO); void updateStatus(StatusFormDTO formDTO);
/**
* 供服务措施管理列表查询显示需求类型名称用
* @param customerId
* @param categoryCodes
* @return
*/
List<IcResiDemandDictEntity> listByCodes(String customerId, List<String> categoryCodes);
} }

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

@ -76,14 +76,14 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
void save(IcUserDemandRecDTO dto); void save(IcUserDemandRecDTO dto);
/** /**
* 默认更新 * 更新需求
* *
* @param dto * @param dto
* @return void * @return void
* @author generator * @author generator
* @date 2021-11-19 * @date 2021-11-19
*/ */
void update(IcUserDemandRecDTO dto); DemandRecId update(DemandAddFromDTO dto);
/** /**
* 批量删除 * 批量删除

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

@ -25,10 +25,8 @@ 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.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.IcResiDemandDictDTO;
import com.epmet.dto.form.demand.*; import com.epmet.dto.form.demand.*;
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;
@ -132,16 +130,6 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
return baseDao.selectCountName(customerId,categoryName,level,parentCategoryCode,id); return baseDao.selectCountName(customerId,categoryName,level,parentCategoryCode,id);
} }
@Override
public List<IcResiDemandDictDTO> list(Map<String, Object> params) {
List<IcResiDemandDictEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IcResiDemandDictDTO.class);
}
private QueryWrapper<IcResiDemandDictEntity> getWrapper(Map<String, Object> params){ private QueryWrapper<IcResiDemandDictEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP); String id = (String)params.get(FieldConstant.ID_HUMP);
@ -224,5 +212,17 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
} }
} }
/**
* 供服务措施管理列表查询显示需求类型名称用
*
* @param customerId
* @param categoryCodes
* @return
*/
@Override
public List<IcResiDemandDictEntity> listByCodes(String customerId, List<String> categoryCodes) {
return baseDao.selectSecondCodes(customerId,categoryCodes);
}
} }

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

@ -38,12 +38,13 @@ import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.IcUserDemandRecDTO; import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.CustomerGridFormDTO; import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.demand.*; import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.AllGridsByUserIdResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.demand.DemandRecResultDTO; import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.entity.IcUserDemandOperateLogEntity; import com.epmet.entity.*;
import com.epmet.entity.IcUserDemandRecEntity; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.entity.IcUserDemandSatisfactionEntity;
import com.epmet.entity.IcUserDemandServiceEntity;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcUserDemandRecService; 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;
@ -53,10 +54,9 @@ 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.Date; import java.util.function.Function;
import java.util.List; import java.util.stream.Collectors;
import java.util.Map;
/** /**
* 居民需求记录表 * 居民需求记录表
@ -74,6 +74,10 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
private IcUserDemandSatisfactionDao demandSatisfactionDao; private IcUserDemandSatisfactionDao demandSatisfactionDao;
@Autowired @Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient; private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private IcResiDemandDictService demandDictService;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override @Override
@ -116,9 +120,41 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void update(IcUserDemandRecDTO dto) { public DemandRecId update(DemandAddFromDTO dto) {
IcUserDemandRecEntity entity = ConvertUtils.sourceToTarget(dto, IcUserDemandRecEntity.class); IcUserDemandRecEntity origin = baseDao.selectById(dto.getDemandRecId());
updateById(entity); if (null == origin) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg());
}
if(!UserDemandConstant.PENDING.equals(origin.getStatus())){
//待处理的才可以修改需求
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_UPDATE.getCode(),EpmetErrorCode.DEMAND_CAN_NOT_UPDATE.getMsg());
}
CustomerGridFormDTO customerGridFormDTO=new CustomerGridFormDTO();
customerGridFormDTO.setGridId(dto.getGridId());
Result<CustomerGridDTO> gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO);
if(!gridInfoRes.success()||null==gridInfoRes.getData()){
throw new RenException("查询网格信息失败");
}
IcUserDemandRecEntity updateEntity=ConvertUtils.sourceToTarget(dto,IcUserDemandRecEntity.class);
updateEntity.setAgencyId(gridInfoRes.getData().getPid());
updateEntity.setGridPids(gridInfoRes.getData().getPids());
updateEntity.setDemandUserType(UserDemandConstant.IC_RESI_USER);
updateEntity.setStatus(UserDemandConstant.PENDING);
updateEntity.setEvaluateFlag(false);
updateEntity.setId(dto.getDemandRecId());
baseDao.updateById(updateEntity);
IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity();
logEntity.setCustomerId(dto.getCustomerId());
logEntity.setDemandRecId(dto.getDemandRecId());
logEntity.setUserType(UserDemandConstant.STAFF);
logEntity.setUserId(dto.getCurrentUserId());
logEntity.setActionCode(UserDemandConstant.UPDATE);
logEntity.setOperateTime(new Date());
operateLogDao.insert(logEntity);
DemandRecId resultDto=new DemandRecId();
resultDto.setDemandRecId(updateEntity.getId());
return resultDto;
} }
@Override @Override
@ -180,9 +216,87 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.pageSelect(formDTO)); formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.pageSelect(formDTO));
List<DemandRecResultDTO> list=pageInfo.getList(); List<DemandRecResultDTO> list=pageInfo.getList();
if(CollectionUtils.isNotEmpty(list)){ if(CollectionUtils.isNotEmpty(list)){
/*for(){ //1、查询网格信息
List<String> gridIds=list.stream().map(DemandRecResultDTO::getGridId).collect(Collectors.toList());
Result<List<AllGridsByUserIdResultDTO>> gridInfoRes=govOrgOpenFeignClient.getGridListByGridIds(gridIds);
List<AllGridsByUserIdResultDTO> gridInfoList = gridInfoRes.success() && !CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>();
Map<String, AllGridsByUserIdResultDTO> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, Function.identity()));
}*/ //2、查询分类名称
List<String> categoryCodes=list.stream().map(DemandRecResultDTO::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));
//3、查询志愿者
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
List<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getCategoryCode).collect(Collectors.toList());
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList);
if(CollectionUtils.isEmpty(userIdList)||!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
throw new RenException("查询志愿者信息异常");
}
Map<String,String> userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName));
for(DemandRecResultDTO res:list){
if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) {
res.setGridName(gridInfoMap.get(res.getGridId()).getGridName());
}
if (null != dictMap && dictMap.containsKey(res.getCategoryCode())) {
res.setCategoryName(dictMap.get(res.getCategoryCode()));
}
if (null != userInfoMap && userInfoMap.containsKey(res.getServerId())) {
res.setServiceName(userInfoMap.get(res.getServerId()));
}
//社区帮办:community;楼长帮办:building_caption;党员帮办:party;自身上报:self_help
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
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;
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;
}
}
} }
return new PageData<>(list, pageInfo.getTotal()); return new PageData<>(list, pageInfo.getTotal());
} }
@ -197,7 +311,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
public void cancel(StaffCancelFormDTO formDTO) { public void cancel(StaffCancelFormDTO formDTO) {
IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId());
if (null == entity) { if (null == entity) {
throw new RenException("需求不存在"); 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())) {
//需求已完成,不可取消 //需求已完成,不可取消
@ -232,7 +346,7 @@ 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("需求不存在"); throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg());
} }
if (!UserDemandConstant.PENDING.equals(entity.getStatus()) && !UserDemandConstant.ASSIGNED.equals(entity.getStatus())) { if (!UserDemandConstant.PENDING.equals(entity.getStatus()) && !UserDemandConstant.ASSIGNED.equals(entity.getStatus())) {
//待处理+已派单才可以指派 //待处理+已派单才可以指派
@ -274,7 +388,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
public void finish(FinishStaffFromDTO formDTO) { public void finish(FinishStaffFromDTO formDTO) {
IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId()); IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId());
if (null == entity) { if (null == entity) {
throw new RenException("需求不存在"); throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg());
} }
if (UserDemandConstant.PENDING.equals(entity.getStatus()) ||UserDemandConstant.CANCELED.equals(entity.getStatus())) { if (UserDemandConstant.PENDING.equals(entity.getStatus()) ||UserDemandConstant.CANCELED.equals(entity.getStatus())) {
//待处理或者已取消的不能评价 //待处理或者已取消的不能评价

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

@ -197,4 +197,24 @@
and m.parent_code=#{parentCode} and m.parent_code=#{parentCode}
</if> </if>
</select> </select>
<select id="selectSecondCodes" parameterType="map" resultType="com.epmet.entity.IcResiDemandDictEntity">
SELECT
d.CATEGORY_CODE,
d.PARENT_CODE,
concat( p.CATEGORY_NAME, '-', d.CATEGORY_NAME ) AS CATEGORY_NAME
FROM
ic_resi_demand_dict d
LEFT JOIN ic_resi_demand_dict p ON ( d.PARENT_CODE = p.CATEGORY_CODE AND p.CUSTOMER_ID = #{customerId} )
WHERE
d.DEL_FLAG = '0'
AND d.`LEVEL` = '2'
AND d.CUSTOMER_ID = #{customerId}
<if test="null!=cateogryCodes and cateogryCodes.size()>0">
and d.category_code in
<foreach item="code" collection="cateogryCodes" open="(" separator="," close=")">
#{code}
</foreach>
</if>
</select>
</mapper> </mapper>

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

@ -37,20 +37,28 @@
<!-- 列表查询 --> <!-- 列表查询 -->
<select id="pageSelect" parameterType="com.epmet.dto.form.demand.UserDemandPageFormDTO" resultType="com.epmet.dto.result.demand.DemandRecResultDTO"> <select id="pageSelect" parameterType="com.epmet.dto.form.demand.UserDemandPageFormDTO" resultType="com.epmet.dto.result.demand.DemandRecResultDTO">
SELECT SELECT
r.id as demandRecId, r.ID as demandRecId,
r.GRID_ID , r.GRID_ID as gridId,
r.CATEGORY_CODE, r.CATEGORY_CODE as categoryCode,
r.CONTENT, r.CONTENT,
r.REPORT_TYPE, r.REPORT_TYPE as reportType,
r.REPORT_TIME, r.REPORT_TIME as reportTime,
r.REPORT_USER_NAME, r.REPORT_USER_NAME as reportUserName,
r.`STATUS`, r.`STATUS` as status,
r.DEMAND_USER_ID, r.DEMAND_USER_ID as demandUserId,
r.DEMAND_USER_NAME, r.DEMAND_USER_NAME as demandUserName,
r.DEMAND_USER_MOBILE, r.DEMAND_USER_MOBILE as demandUserMobile,
IFNULL( s.SERVICE_TYPE, '' ) AS SERVICE_TYPE, concat(r.DEMAND_USER_NAME,'(',r.DEMAND_USER_MOBILE,')') as demandUser,
IFNULL( s.SERVER_ID, '' ) AS SERVER_ID, IFNULL( s.SERVICE_TYPE, '' ) AS serviceType,
r.WANT_SERVICE_TIME IFNULL( s.SERVER_ID, '' ) AS serverId,
(
CASE WHEN s.SERVICE_TYPE='social_org' then (select m1.SOCIETY_NAME as socialOrgName from ic_society_org m1 where m1.id=s.SERVER_ID)
WHEN s.SERVICE_TYPE='community_org' then (select m2.ORGANIZATION_NAME as communityName from ic_community_self_organization m2 where m2.id=s.SERVER_ID)
WHEN s.SERVICE_TYPE='party_unit' then (select m3.UNIT_NAME as partyUnitName from ic_party_unit m3 where m3.id=s.SERVER_ID)
else ''
end
) as serviceName,
r.WANT_SERVICE_TIME as wantServiceTime
FROM FROM
ic_user_demand_rec r ic_user_demand_rec r
INNER JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' ) INNER JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' )

107
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDictDTO.java

@ -1,107 +0,0 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 居民需求字典表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-27
*/
@Data
public class IcResiDemandDictDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 父级
*/
private String parentCode;
/**
* 字典值
*/
private String categoryCode;
/**
* 字典描述
*/
private String categoryName;
/**
* 级别
*/
private String level;
/**
* 备注
*/
private String remark;
/**
* 排序
*/
private Integer sort;
/**
* 删除标识0.未删除 1.已删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}
Loading…
Cancel
Save