Browse Source

ceshi xia

dev_shibei_match
yinzuomei 4 years ago
parent
commit
fa71911267
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandAddFromDTO.java
  3. 1
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java
  4. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  5. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  6. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  7. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

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

@ -89,6 +89,7 @@ public enum EpmetErrorCode {
DEMAND_FINISHED(8222,"需求已完成"),
DEMAND_CAN_NOT_UPDATE(8223,"当前状态,不可更新需求"),
DEMAND_NOT_EXITS(8224,"需求不存在"),
DEMAND_SERVICE_NOT_EXITS(8225,"服务记录不存在"),
REQUIRE_PERMISSION(8301, "您没有足够的操作权限"),
THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"),

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

@ -52,13 +52,13 @@ public class DemandAddFromDTO implements Serializable {
/**
* 二级需求分类编码
*/
@NotBlank(message = "需求类不能为空",groups = AddUserShowGroup.class)
@NotBlank(message = "需求类不能为空",groups = AddUserShowGroup.class)
private String categoryCode;
/**
* 父级需求分类编码
*/
@NotBlank(message = "需求类不能为空",groups = AddUserShowGroup.class)
@NotBlank(message = "需求类不能为空",groups = AddUserShowGroup.class)
private String parentCode;
/**

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

@ -69,6 +69,7 @@ public class DemandRecResultDTO implements Serializable {
/** 服务情况********************************************************************/
/** 服务情况********************************************************************/
/** 服务情况********************************************************************/
private String serviceId;
/**
* 志愿者的姓名
* 社会组织名

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

@ -27,6 +27,7 @@ import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -42,6 +43,7 @@ import java.util.List;
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-19
*/
@Slf4j
@RestController
@RequestMapping("userdemand")
public class IcUserDemandRecController {
@ -94,6 +96,7 @@ public class IcUserDemandRecController {
@PostMapping("add")
public Result<DemandRecId> add(@LoginUser TokenDto tokenDto, @RequestBody DemandAddFromDTO fromDTO){
fromDTO.setCustomerId(tokenDto.getCustomerId());
fromDTO.setCurrentUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(fromDTO,DemandAddFromDTO.AddUserShowGroup.class);
return new Result<DemandRecId>().ok(icUserDemandRecService.add(fromDTO));
}
@ -109,6 +112,7 @@ public class IcUserDemandRecController {
@PostMapping("update")
public Result<DemandRecId> update(@LoginUser TokenDto tokenDto, @RequestBody DemandAddFromDTO fromDTO){
fromDTO.setCustomerId(tokenDto.getCustomerId());
fromDTO.setCurrentUserId(tokenDto.getUserId());
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/service/impl/IcResiDemandDictServiceImpl.java

@ -97,6 +97,9 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
@Transactional(rollbackFor = Exception.class)
@Override
public void addChild(AddCategoryFormDTO formDTO) {
if(NumConstant.ZERO_STR.equals(formDTO.getParentCategoryCode())){
throw new RenException("添加一级分类,调用接口/heart/icresidemanddict/addfirst");
}
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());

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

@ -229,13 +229,15 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//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());
Map<String,String> userInfoMap=new HashMap<>();
List<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(userIdList)){
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList);
if(CollectionUtils.isEmpty(userIdList)||!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
throw new RenException("查询志愿者信息异常");
}
Map<String,String> userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName));
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());
@ -416,6 +418,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//3、更新服务记录
IcUserDemandServiceEntity serviceEntity=demandServiceDao.selectById(formDTO.getServerId());
if(null==serviceEntity){
throw new RenException(EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getMsg());
}
serviceEntity.setServiceStartTime(formDTO.getServiceStartTime());
serviceEntity.setServiceEndTime(formDTO.getServiceEndTime());
serviceEntity.setFinishDesc(formDTO.getFinishDesc());

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

@ -50,7 +50,7 @@
r.DEMAND_USER_MOBILE as demandUserMobile,
concat(r.DEMAND_USER_NAME,'(',r.DEMAND_USER_MOBILE,')') as demandUser,
r.WANT_SERVICE_TIME as wantServiceTime,
r.FINISH_RESULT as finishResult,
IFNULL(r.FINISH_RESULT,'') as finishResult,
r.CANCEL_TIME as cancelTime,
r.EVALUATE_FLAG as evaluateFlag,
IFNULL(sa.SCORE,0) as score,
@ -65,11 +65,13 @@
) as serviceName,
s.SERVICE_START_TIME as serviceStartTime,
s.SERVICE_END_TIME as serviceEndTime,
s.FINISH_DESC as finishDesc
IFNULL(s.FINISH_DESC,'') as finishDesc,
'' AS serviceShowName,
s.id as serviceId
FROM
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_satisfaction sa on(r.id=sa.DEMAND_REC_ID AND sa.DEL_FLAG = '0')
left JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' )
left join ic_user_demand_satisfaction sa on(r.id=sa.DEMAND_REC_ID AND sa.DEL_FLAG = '0')
WHERE
r.DEL_FLAG = '0'
AND r.CUSTOMER_ID = #{customerId}
@ -109,5 +111,6 @@
<if test="null != wantServiceEndDate and wantServiceEndDate != '' ">
AND DATE_FORMAT(r.WANT_SERVICE_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{wantServiceEndDate}
</if>
order by r.WANT_SERVICE_TIME desc,r.CREATED_TIME asc
</select>
</mapper>
Loading…
Cancel
Save