Browse Source

社区自组织列表

master
yinzuomei 4 years ago
parent
commit
821383e3f6
  1. 19
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java
  2. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java
  3. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcSocietyOrgDao.java
  4. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java
  5. 33
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
  6. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
  7. 15
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml
  8. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml

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

@ -20,19 +20,20 @@ package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcCommunitySelfOrganizationDTO;
import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO;
import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO;
import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.excel.IcCommunitySelfOrganizationExcel;
import com.epmet.service.IcCommunitySelfOrganizationService;
import org.springframework.beans.factory.annotation.Autowired;
@ -139,4 +140,18 @@ public class IcCommunitySelfOrganizationController {
return new Result<CommunitySelfOrganizationListResultDTO>().ok(icCommunitySelfOrganizationService.communitySelfOrganizationList(tokenDto, formDTO));
}
/**
* 需求指派选择社区自组织调用此接口
* 返回需求所属社区下的 组织
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("servicelist")
public Result<List<OptionDTO>> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.DemandId.class);
return new Result<List<OptionDTO>>().ok(icCommunitySelfOrganizationService.queryServiceList(formDTO));
}
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java

@ -19,8 +19,8 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO;
import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO;
import com.epmet.dto.result.CommunitySelfOrganizationListDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcCommunitySelfOrganizationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -52,4 +52,7 @@ public interface IcCommunitySelfOrganizationDao extends BaseDao<IcCommunitySelfO
*/
List<CommunitySelfOrganizationListDTO> selectCommunitySelfOrganizationList(CommunitySelfOrganizationListFormDTO formDTO);
List<OptionDTO> selectListByAgencyId(@Param("customerId") String customerId,
@Param("agencyId") String agencyId,
@Param("orgName") String orgName);
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcSocietyOrgDao.java

@ -48,5 +48,5 @@ public interface IcSocietyOrgDao extends BaseDao<IcSocietyOrgEntity> {
* @param agencyIds
* @return
*/
List<OptionDTO> selectListByAgencyId(@Param("agencyIds")List<String> agencyIds);
List<OptionDTO> selectListByAgencyId(@Param("agencyIds")List<String> agencyIds,@Param("societyName")String societyName);
}

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

@ -24,7 +24,9 @@ import com.epmet.dto.IcCommunitySelfOrganizationDTO;
import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO;
import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO;
import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcCommunitySelfOrganizationEntity;
import java.util.List;
@ -124,4 +126,13 @@ public interface IcCommunitySelfOrganizationService extends BaseService<IcCommun
* @date 2021/11/19 1:59 下午
*/
CommunitySelfOrganizationListResultDTO communitySelfOrganizationList(TokenDto tokenDto, CommunitySelfOrganizationListFormDTO formDTO);
/**
* 需求指派选择社区自组织调用此接口
* 返回需求所属社区下的 组织
*
* @param formDTO
* @return
*/
List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO);
}

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

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
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.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -15,21 +16,23 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.validator.PhoneValidatorUtils;
import com.epmet.constant.IcCommunitySelfOrganizationConstant;
import com.epmet.dao.IcCommunitySelfOrganizationDao;
import com.epmet.dto.IcCommunitySelfOrganizationDTO;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO;
import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO;
import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.CommunitySelfOrganizationListDTO;
import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcCommunitySelfOrganizationEntity;
import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity;
import com.epmet.service.IcCommunitySelfOrganizationPersonnelService;
import com.epmet.service.IcCommunitySelfOrganizationService;
import com.epmet.service.IcUserDemandRecService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
@ -38,11 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.xml.crypto.Data;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
import static com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN;
@ -57,6 +56,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
@Autowired
private IcCommunitySelfOrganizationPersonnelService personnelService;
@Autowired
private IcUserDemandRecService icUserDemandRecService;
@Override
public PageData<IcCommunitySelfOrganizationDTO> page(Map<String, Object> params) {
@ -222,4 +223,22 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
return result;
}
/**
* 需求指派选择社区自组织调用此接口
* 返回需求所属社区下的 组织
*
* @param formDTO
* @return
*/
@Override
public List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO) {
List<OptionDTO> resultList=new ArrayList<>();
IcUserDemandRecDTO icUserDemandRecDTO=icUserDemandRecService.get(formDTO.getDemandRecId());
if(null==icUserDemandRecDTO|| org.springframework.util.StringUtils.isEmpty(icUserDemandRecDTO.getAgencyId())){
return resultList;
}
resultList=baseDao.selectListByAgencyId(formDTO.getCustomerId(),icUserDemandRecDTO.getAgencyId(),formDTO.getServiceName());
return resultList;
}
}

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

@ -155,7 +155,7 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
}else{
agencyIds.add(icUserDemandRecDTO.getGridPids());
}
resultList=baseDao.selectListByAgencyId(agencyIds);
resultList=baseDao.selectListByAgencyId(agencyIds,formDTO.getServiceName());
return resultList;
}

15
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml

@ -69,4 +69,19 @@
</if>
ORDER BY so.ORGANIZATION_CREATED_TIME DESC
</select>
<select id="selectListByAgencyId" parameterType="map" resultType="com.epmet.dto.result.demand.OptionDTO">
select
so.ORGANIZATION_NAME AS label,
so.id as `value`
from ic_community_self_organization so
WHERE so.DEL_FLAG = 0
AND so.ORG_ID = #{agencyId}
AND so.CUSTOMER_ID = #{customerId}
<if test="null != orgName and orgName != '' ">
and so.ORGANIZATION_NAME concat('%',#{orgName},'%')
</if>
order by so.CREATED_TIME asc
</select>
</mapper>

3
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml

@ -52,6 +52,9 @@
WHERE
del_flag = '0'
and AGENCY_ID=#{agencyId}
<if test="null != societyName and societyName != '' ">
and society_name concat('%',#{societyName},'%')
</if>
</foreach>
</select>
</mapper>
Loading…
Cancel
Save