Browse Source

指派服务列表

dev_shibei_match
yinzuomei 4 years ago
parent
commit
1759dbb674
  1. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/SubCodeFormDTO.java
  2. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
  3. 15
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java
  4. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java
  5. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcSocietyOrgDao.java
  6. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java
  7. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  8. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  9. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
  10. 17
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml
  11. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml
  12. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/SubCodeFormDTO.java

@ -12,4 +12,6 @@ public class SubCodeFormDTO implements Serializable {
private String customerId;
@NotBlank(message = "parentCategoryCode不能为空",groups = AddUserInternalGroup.class)
private String parentCategoryCode;
private String categoryName;
}

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

@ -17,7 +17,9 @@
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.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@ -27,6 +29,8 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.excel.IcPartyUnitExcel;
import com.epmet.service.IcPartyUnitService;
import org.springframework.beans.factory.annotation.Autowired;
@ -92,4 +96,18 @@ public class IcPartyUnitController {
ExcelUtils.exportExcelToTarget(response, null, list, IcPartyUnitExcel.class);
}
/**
* 需求指派选择区域化党建单位调用此接口
* 返回需求所属组织线上的数据
*
* @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(icPartyUnitService.queryServiceList(formDTO));
}
}

15
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java

@ -18,8 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyUnitEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 联建单位
@ -29,5 +33,14 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcPartyUnitDao extends BaseDao<IcPartyUnitEntity> {
/**
* 需求指派选择区域化党建单位调用此接口
* @param agencyIds
* @param unitName
* @return
*/
List<OptionDTO> selectListByAgencyId(@Param("agencyIds") List<String> agencyIds,
@Param("unitName") String unitName,
@Param("customerId")String customerId);
}

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

@ -41,7 +41,9 @@ public interface IcResiDemandDictDao extends BaseDao<IcResiDemandDictEntity> {
String selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set<String> codeSet);
List<OptionDTO> selectByPCode(@Param("pcode") String pcode, @Param("customerId") String customerId);
List<OptionDTO> selectByPCode(@Param("pcode") String pcode,
@Param("customerId") String customerId,
@Param("categoryName")String categoryName);
List<DemandPageResDTO> pageSelect(@Param("customerId") String customerId, @Param("firstCategoryCode")String firstCategoryCode);

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,@Param("societyName")String societyName);
List<OptionDTO> selectListByAgencyId(@Param("agencyIds")List<String> agencyIds,@Param("societyName")String societyName,@Param("customerId")String customerId);
}

12
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java

@ -21,6 +21,8 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyUnitEntity;
import java.util.List;
@ -93,4 +95,14 @@ public interface IcPartyUnitService extends BaseService<IcPartyUnitEntity> {
* @date 2021-11-19
*/
void delete(String[] ids);
/**
* 需求指派选择区域化党建单位调用此接口
* 返回需求所属组织线上的数据
*
* @param formDTO
* @param formDTO
* @return
*/
List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO);
}

34
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -21,23 +21,30 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcPartyUnitDao;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyUnitEntity;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.service.IcPartyUnitService;
import com.epmet.service.IcUserDemandRecService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -53,6 +60,9 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
@Resource
private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
@Autowired
private IcUserDemandRecService icUserDemandRecService;
@Override
public PageData<IcPartyUnitDTO> search(PartyUnitFormDTO formDTO) {
@ -117,4 +127,28 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* 需求指派选择区域化党建单位调用此接口
* 返回需求所属组织线上的数据
*
* @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.getGridPids())){
return resultList;
}
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());
}
resultList=baseDao.selectListByAgencyId(agencyIds,formDTO.getServiceName(),formDTO.getCustomerId());
return resultList;
}
}

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

@ -200,7 +200,7 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
@Override
public List<OptionDTO> querySubCodeList(SubCodeFormDTO formDTO) {
return baseDao.selectByPCode(formDTO.getParentCategoryCode(),formDTO.getCustomerId());
return baseDao.selectByPCode(formDTO.getParentCategoryCode(),formDTO.getCustomerId(),formDTO.getCategoryName());
}
@Override

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,formDTO.getServiceName());
resultList=baseDao.selectListByAgencyId(agencyIds,formDTO.getServiceName(),formDTO.getCustomerId());
return resultList;
}

17
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml

@ -29,4 +29,21 @@
</resultMap>
<select id="selectListByAgencyId" parameterType="map" resultType="com.epmet.dto.result.demand.OptionDTO">
<foreach collection="agencyIds" item="agencyId" separator=" UNION ">
SELECT
i.ID AS `value`,
i.UNIT_NAME AS label
FROM
ic_party_unit i
WHERE
i.DEL_FLAG = '0'
AND i.CUSTOMER_ID = #{customerId}
AND i.AGENCY_ID = #{agencyId}
<if test="null != unitName and unitName != '' ">
and i.UNIT_NAME concat('%',#{unitName},'%')
</if>
</foreach>
</select>
</mapper>

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

@ -84,6 +84,9 @@
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
and m.PARENT_CODE = #{pcode}
<if test="null!=categoryName and categoryName!=''">
and m.category_name like concat('%',#{categoryName},'%')
</if>
order by m.sort asc
</select>

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

@ -51,6 +51,7 @@
ic_society_org
WHERE
del_flag = '0'
and CUSTOMER_ID=#{customerId}
and AGENCY_ID=#{agencyId}
<if test="null != societyName and societyName != '' ">
and society_name concat('%',#{societyName},'%')

Loading…
Cancel
Save