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 @Data
public class ServiceQueryFormDTO implements Serializable { public class ServiceQueryFormDTO implements Serializable {
private static final long serialVersionUID = -2738313255838176318L; private static final long serialVersionUID = -2738313255838176318L;
public interface AddUserInternalGroup {}
public interface DemandId { public interface SocietyOrgInternalGroup {}
} /**
* 前端入参
*/
private String serviceName; 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) // 以下参数从token中获取
private String demandRecId; @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") @PostMapping("servicelist")
public Result<List<OptionDTO>> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO){ public Result<List<OptionDTO>> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId()); 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)); 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") @PostMapping("servicelist")
public Result<List<OptionDTO>> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO){ public Result<List<OptionDTO>> queryServiceList(@LoginUser TokenDto tokenDto, @RequestBody ServiceQueryFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId()); 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)); 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") @PostMapping("servicelist")
public Result<List<OptionDTO>> queryServiceList(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){ public Result<List<OptionDTO>> queryServiceList(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId()); 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)); 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<CommunitySelfOrganizationListDTO> selectCommunitySelfOrganizationList(CommunitySelfOrganizationListFormDTO formDTO);
List<OptionDTO> selectListByAgencyId(@Param("customerId") String customerId, List<OptionDTO> selectListByAgencyId(@Param("customerId") String customerId,
@Param("agencyId") String agencyId, @Param("agencyIds") List<String> agencyIds,
@Param("orgName") String orgName); @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 * @param agencyIds
* @return * @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.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; 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.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
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;
@ -20,7 +21,6 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.IcCommunitySelfOrganizationConstant; import com.epmet.constant.IcCommunitySelfOrganizationConstant;
import com.epmet.dao.IcCommunitySelfOrganizationDao; import com.epmet.dao.IcCommunitySelfOrganizationDao;
import com.epmet.dto.IcCommunitySelfOrganizationDTO; import com.epmet.dto.IcCommunitySelfOrganizationDTO;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO; import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO;
import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO; import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO;
import com.epmet.dto.form.DelCommunitySelfOrganizationFormDTO; import com.epmet.dto.form.DelCommunitySelfOrganizationFormDTO;
@ -248,11 +248,18 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
@Override @Override
public List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO) { public List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO) {
List<OptionDTO> resultList=new ArrayList<>(); List<OptionDTO> resultList=new ArrayList<>();
IcUserDemandRecDTO icUserDemandRecDTO=icUserDemandRecService.get(formDTO.getDemandRecId()); CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if(null==icUserDemandRecDTO|| org.springframework.util.StringUtils.isEmpty(icUserDemandRecDTO.getAgencyId())){ if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyId())) {
return resultList; 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; 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.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcSocietyOrgDao; import com.epmet.dao.IcSocietyOrgDao;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.AddSocietyOrgFormDTO; import com.epmet.dto.form.AddSocietyOrgFormDTO;
import com.epmet.dto.form.EditSocietyOrgFormDTO; import com.epmet.dto.form.EditSocietyOrgFormDTO;
import com.epmet.dto.form.GetListSocietyOrgFormDTO; import com.epmet.dto.form.GetListSocietyOrgFormDTO;
@ -41,13 +40,13 @@ import com.epmet.service.IcSocietyOrgService;
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;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; 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 org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -145,17 +144,18 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
@Override @Override
public List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO) { public List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO) {
List<OptionDTO> resultList=new ArrayList<>(); List<OptionDTO> resultList=new ArrayList<>();
IcUserDemandRecDTO icUserDemandRecDTO=icUserDemandRecService.get(formDTO.getDemandRecId()); CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if(null==icUserDemandRecDTO|| StringUtils.isEmpty(icUserDemandRecDTO.getGridPids())){ if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyId())) {
return resultList; throw new RenException("工作人员所属组织信息查询异常");
} }
List<String> agencyIds=new ArrayList<>(); List<String> agencyIds=new ArrayList<>();
if(icUserDemandRecDTO.getGridPids().contains(StrConstant.COLON)){ if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
agencyIds.addAll(Arrays.asList(icUserDemandRecDTO.getGridPids().split(StrConstant.COLON))); if(staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)){
}else{ agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON)));
agencyIds.add(icUserDemandRecDTO.getGridPids()); }
} }
resultList=baseDao.selectListByAgencyId(agencyIds,formDTO.getServiceName(),formDTO.getCustomerId()); agencyIds.add(staffInfoCacheResult.getAgencyId());
resultList=baseDao.selectListByAgencyId(agencyIds,formDTO.getServiceName(),formDTO.getCustomerId(),formDTO.getQueryPurpose());
return resultList; 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 id="selectListByAgencyId" parameterType="map" resultType="com.epmet.dto.result.demand.OptionDTO">
select <foreach collection="agencyIds" item="agencyId" separator=" UNION ">
so.ORGANIZATION_NAME AS label, select
so.id as `value` so.ORGANIZATION_NAME AS label,
from ic_community_self_organization so so.id as `value`
WHERE so.DEL_FLAG = 0 from ic_community_self_organization so
AND so.ORG_ID = #{agencyId} WHERE so.DEL_FLAG = 0
AND so.CUSTOMER_ID = #{customerId} AND so.ORG_ID = #{agencyId}
<if test="null != orgName and orgName != '' "> AND so.CUSTOMER_ID = #{customerId}
and so.ORGANIZATION_NAME concat('%',#{orgName},'%') <if test="null != orgName and orgName != '' ">
</if> and so.ORGANIZATION_NAME like concat('%',#{orgName},'%')
order by so.CREATED_TIME asc </if>
</foreach>
</select> </select>
</mapper> </mapper>

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

@ -53,9 +53,13 @@
del_flag = '0' del_flag = '0'
and CUSTOMER_ID=#{customerId} and CUSTOMER_ID=#{customerId}
and AGENCY_ID=#{agencyId} and AGENCY_ID=#{agencyId}
<if test="null != societyName and societyName != '' "> <if test="null != queryPurpose and 'add_demand'==queryPurpose ">
and society_name concat('%',#{societyName},'%') and SERVICE_START_TIME &lt;= NOW()
</if> and SERVICE_END_TIME &gt;= NOW()
</if>
<if test="null != societyName and societyName != '' ">
and society_name like concat('%',#{societyName},'%')
</if>
</foreach> </foreach>
</select> </select>
</mapper> </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 @Data
public class DemandUserResDTO implements Serializable { public class DemandUserResDTO implements Serializable {
private String icResiUserId; private String demandUserId;
private String name; private String demandUserName;
private String mobile; private String demandUserMobile;
private String label; private String label;
private String gridId; 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 * @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:09 * @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, url = "localhost:8087")
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class) //@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class)
public interface EpmetUserOpenFeignClient { 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 id="selectDemandUsers" parameterType="map" resultType="com.epmet.dto.result.DemandUserResDTO">
SELECT SELECT
ir.id as icResiUserId, ir.id as demandUserId,
IFNULL(ir.`NAME`,'') AS name, IFNULL(ir.`NAME`,'') AS demandUserName,
IFNULL(ir.MOBILE,'') AS mobile, IFNULL(ir.MOBILE,'') AS demandUserMobile,
concat(ir.`NAME`,'(',ir.MOBILE,')')as label, concat(ir.`NAME`,'(',ir.MOBILE,')')as label,
ir.grid_id as gridId ir.grid_id as gridId,
ir.ID_CARD as idCard
FROM FROM
ic_resi_user ir ic_resi_user ir
WHERE WHERE

Loading…
Cancel
Save