Browse Source

/heart/icpartyunit/list 联建单位列表本组织及下级

master
yinzuomei 3 years ago
parent
commit
d4d9bd6f3a
  1. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java
  2. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
  3. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java
  4. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  5. 31
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/PartyUnitFormDTO.java

@ -24,4 +24,9 @@ public class PartyUnitFormDTO implements Serializable {
private String contactMobile;
private Integer pageNo;
private Integer pageSize;
/**
* 工作端当前登录人员
*/
private String currentStaffId;
}

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

@ -3,6 +3,7 @@ package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.ServerSatisfactionCalFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
@ -16,10 +17,6 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.PartyUnitListFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.*;
@ -37,12 +34,10 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@ -70,9 +65,20 @@ public class IcPartyUnitController {
private Path IC_PARTY_UNIT_UPLOAD_DIR;
/**
* 联建单位-列表查询
* 本组织及下级数据
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("list")
public Result<PageData<IcPartyUnitDTO>> search(@LoginUser TokenDto tokenDto, @RequestBody PartyUnitFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
//工作端调用的话,赋值当前登录用户id
if(AppClientConstant.APP_GOV.equals(tokenDto.getApp())){
formDTO.setCurrentStaffId(tokenDto.getUserId());
}
PageData<IcPartyUnitDTO> page = icPartyUnitService.search(formDTO);
return new Result<PageData<IcPartyUnitDTO>>().ok(page);
}

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

@ -19,6 +19,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.PartyUnitListbriefFormDTO;
import com.epmet.dto.result.PartyTypepercentResultDTO;
import com.epmet.dto.result.PartyUnitDistributionResultDTO;
@ -116,4 +117,11 @@ public interface IcPartyUnitDao extends BaseDao<IcPartyUnitEntity> {
@Param("customerId") String customerId);
List<IcPartyUnitEntity> selectByIds(@Param("partyUnitIds") List<String> partyUnitIds);
/**
* 联建单位-分页列表查询
* @param formDTO
* @return
*/
List<IcPartyUnitEntity> pageList(PartyUnitFormDTO formDTO);
}

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

@ -77,7 +77,6 @@ import org.apache.http.entity.ContentType;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
@ -119,7 +118,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
@Override
public PageData<IcPartyUnitDTO> search(PartyUnitFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
LambdaQueryWrapper<IcPartyUnitEntity> wrapper = new LambdaQueryWrapper<>();
/*LambdaQueryWrapper<IcPartyUnitEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPartyUnitEntity::getAgencyId, formDTO.getAgencyId());
wrapper.like(StringUtils.isNotBlank(formDTO.getUnitName()), IcPartyUnitEntity::getUnitName, formDTO.getUnitName());
wrapper.like(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyUnitEntity::getServiceMatter, formDTO.getServiceMatter());
@ -127,7 +126,13 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
wrapper.like(StringUtils.isNotBlank(formDTO.getContact()), IcPartyUnitEntity::getContact, formDTO.getContact());
wrapper.like(StringUtils.isNotBlank(formDTO.getContactMobile()), IcPartyUnitEntity::getContactMobile, formDTO.getContactMobile());
wrapper.orderByDesc(IcPartyUnitEntity::getCreatedTime);
List<IcPartyUnitEntity> list = baseDao.selectList(wrapper);
List<IcPartyUnitEntity> list = baseDao.selectList(wrapper);*/
//本组织及下级
if(StringUtils.isNotBlank(formDTO.getCurrentStaffId())&&StringUtils.isBlank(formDTO.getAgencyId())){
CustomerStaffInfoCacheResult staffInfo=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getCurrentStaffId());
formDTO.setAgencyId(staffInfo.getAgencyId());
}
List<IcPartyUnitEntity> list = baseDao.pageList(formDTO);
PageInfo<IcPartyUnitEntity> pageInfo = new PageInfo<>(list);
List<IcPartyUnitDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class);
Result<Map<String, String>> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode());

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

@ -193,4 +193,35 @@
</foreach>
)
</select>
<select id="pageList" parameterType="com.epmet.dto.form.PartyUnitFormDTO" resultType="com.epmet.entity.IcPartyUnitEntity">
SELECT
u.*
FROM
ic_party_unit u
WHERE
u.DEL_FLAG = '0'
<if test="null != customerId and customerId != '' ">
AND u.CUSTOMER_ID = #{customerId}
</if>
<if test="null != agencyId and agencyId != '' ">
AND ( u.AGENCY_ID = #{agencyId} OR u.PIDS LIKE concat( '%', #{agencyId}, '%' ))
</if>
<if test="null != unitName and unitName != '' ">
and u.UNIT_NAME like concat( '%', #{unitName}, '%' )
</if>
<if test="null != serviceMatter and serviceMatter != '' ">
and u.SERVICE_MATTER like concat( '%', #{serviceMatter}, '%' )
</if>
<if test="null != type and type != '' ">
and u.TYPE =#{type}
</if>
<if test="null != contact and contact != '' ">
and u.CONTACT like concat( '%', #{contact}, '%' )
</if>
<if test="null != contactMobile and contactMobile != '' ">
and u.CONTACT_MOBILE like concat( '%', #{contactMobile}, '%' )
</if>
order by u.CREATED_TIME desc
</select>
</mapper>
Loading…
Cancel
Save