Browse Source

test

dev_shibei_match
yinzuomei 4 years ago
parent
commit
c322e56b04
  1. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java
  2. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java
  3. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
  4. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java
  5. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java
  6. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcSocietyOrgDao.java
  7. 17
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
  8. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
  9. 23
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml
  10. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml
  11. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java
  12. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  13. 9
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java

@ -8,17 +8,24 @@ import java.io.Serializable;
@Data
public class ServiceQueryFormDTO implements Serializable {
private static final long serialVersionUID = -2738313255838176318L;
public interface AddUserInternalGroup {}
public interface DemandId {
}
public interface SocietyOrgInternalGroup {}
/**
* 前端入参
*/
private String serviceName;
// 社会组织的:query_demand 新增需求:add_demand
@NotBlank(message = "新增需求:add_demand;列表查询:query_demand",groups = SocietyOrgInternalGroup.class)
private String queryPurpose;
@NotBlank(message = "需求id不能为空", groups = DemandId.class)
private String demandRecId;
// 以下参数从token中获取
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class)
private String staffId;
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
private String demandRecId;
private String customerId;
}

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

@ -165,7 +165,8 @@ public class IcCommunitySelfOrganizationController {
@PostMapping("servicelist")
public Result<List<OptionDTO>> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.DemandId.class);
formDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class);
return new Result<List<OptionDTO>>().ok(icCommunitySelfOrganizationService.queryServiceList(formDTO));
}
}

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java

@ -107,7 +107,8 @@ public class IcPartyUnitController {
@PostMapping("servicelist")
public Result<List<OptionDTO>> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.DemandId.class);
formDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class);
return new Result<List<OptionDTO>>().ok(icPartyUnitService.queryServiceList(formDTO));
}
}

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java

@ -104,7 +104,8 @@ public class IcSocietyOrgController {
@PostMapping("servicelist")
public Result<List<OptionDTO>> queryServiceList(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.DemandId.class);
formDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class,ServiceQueryFormDTO.SocietyOrgInternalGroup.class);
return new Result<List<OptionDTO>>().ok(societyOrgService.queryServiceList(formDTO));
}
}

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

@ -53,6 +53,6 @@ public interface IcCommunitySelfOrganizationDao extends BaseDao<IcCommunitySelfO
List<CommunitySelfOrganizationListDTO> selectCommunitySelfOrganizationList(CommunitySelfOrganizationListFormDTO formDTO);
List<OptionDTO> selectListByAgencyId(@Param("customerId") String customerId,
@Param("agencyId") String agencyId,
@Param("agencyIds") List<String> agencyIds,
@Param("orgName") String orgName);
}

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

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

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

@ -7,6 +7,7 @@ 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.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
@ -20,7 +21,6 @@ import com.epmet.commons.tools.utils.DateUtils;
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.DelCommunitySelfOrganizationFormDTO;
@ -248,11 +248,18 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
@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;
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyId())) {
throw new RenException("工作人员所属组织信息查询异常");
}
resultList=baseDao.selectListByAgencyId(formDTO.getCustomerId(),icUserDemandRecDTO.getAgencyId(),formDTO.getServiceName());
List<String> agencyIds=new ArrayList<>();
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
if(staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)){
agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON)));
}
}
agencyIds.add(staffInfoCacheResult.getAgencyId());
resultList=baseDao.selectListByAgencyId(formDTO.getCustomerId(),agencyIds,formDTO.getServiceName());
return resultList;
}

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

@ -26,7 +26,6 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcSocietyOrgDao;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.AddSocietyOrgFormDTO;
import com.epmet.dto.form.EditSocietyOrgFormDTO;
import com.epmet.dto.form.GetListSocietyOrgFormDTO;
@ -41,13 +40,13 @@ import com.epmet.service.IcSocietyOrgService;
import com.epmet.service.IcUserDemandRecService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Arrays;
@ -145,17 +144,18 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
@Override
public List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO) {
List<OptionDTO> resultList=new ArrayList<>();
IcUserDemandRecDTO icUserDemandRecDTO=icUserDemandRecService.get(formDTO.getDemandRecId());
if(null==icUserDemandRecDTO|| StringUtils.isEmpty(icUserDemandRecDTO.getGridPids())){
return resultList;
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyId())) {
throw new RenException("工作人员所属组织信息查询异常");
}
List<String> agencyIds=new ArrayList<>();
if(icUserDemandRecDTO.getGridPids().contains(StrConstant.COLON)){
agencyIds.addAll(Arrays.asList(icUserDemandRecDTO.getGridPids().split(StrConstant.COLON)));
}else{
agencyIds.add(icUserDemandRecDTO.getGridPids());
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
if(staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)){
agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON)));
}
}
resultList=baseDao.selectListByAgencyId(agencyIds,formDTO.getServiceName(),formDTO.getCustomerId());
agencyIds.add(staffInfoCacheResult.getAgencyId());
resultList=baseDao.selectListByAgencyId(agencyIds,formDTO.getServiceName(),formDTO.getCustomerId(),formDTO.getQueryPurpose());
return resultList;
}

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

@ -72,16 +72,17 @@
<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
<foreach collection="agencyIds" item="agencyId" separator=" UNION ">
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 like concat('%',#{orgName},'%')
</if>
</foreach>
</select>
</mapper>

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

@ -53,9 +53,13 @@
del_flag = '0'
and CUSTOMER_ID=#{customerId}
and AGENCY_ID=#{agencyId}
<if test="null != societyName and societyName != '' ">
and society_name concat('%',#{societyName},'%')
</if>
<if test="null != queryPurpose and 'add_demand'==queryPurpose ">
and SERVICE_START_TIME &lt;= NOW()
and SERVICE_END_TIME &gt;= NOW()
</if>
<if test="null != societyName and societyName != '' ">
and society_name like concat('%',#{societyName},'%')
</if>
</foreach>
</select>
</mapper>

7
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/DemandUserResDTO.java

@ -6,9 +6,10 @@ import java.io.Serializable;
@Data
public class DemandUserResDTO implements Serializable {
private String icResiUserId;
private String name;
private String mobile;
private String demandUserId;
private String demandUserName;
private String demandUserMobile;
private String label;
private String gridId;
private String idCard;
}

4
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -23,8 +23,8 @@ import java.util.Set;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:09
*/
//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087")
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class)
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087")
//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class)
public interface EpmetUserOpenFeignClient {
/**

9
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -275,11 +275,12 @@
<select id="selectDemandUsers" parameterType="map" resultType="com.epmet.dto.result.DemandUserResDTO">
SELECT
ir.id as icResiUserId,
IFNULL(ir.`NAME`,'') AS name,
IFNULL(ir.MOBILE,'') AS mobile,
ir.id as demandUserId,
IFNULL(ir.`NAME`,'') AS demandUserName,
IFNULL(ir.MOBILE,'') AS demandUserMobile,
concat(ir.`NAME`,'(',ir.MOBILE,')')as label,
ir.grid_id as gridId
ir.grid_id as gridId,
ir.ID_CARD as idCard
FROM
ic_resi_user ir
WHERE

Loading…
Cancel
Save