Browse Source

支部党组织接口调整

dev
Jackwang 3 years ago
parent
commit
e05cd75d09
  1. 23
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/BranchlistTreeDTO.java
  2. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java
  3. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java
  4. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java
  5. 15
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java
  6. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

23
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/BranchlistTreeDTO.java

@ -0,0 +1,23 @@
package com.epmet.resi.partymember.dto.partyOrg.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @program: epmet-cloud
* @description:
* @author: wangtong
* @create: 2022-05-30 10:11
**/
@Data
public class BranchlistTreeDTO implements Serializable {
private String label;
private String value;
private List<BranchlistTreeDTO> children = new ArrayList<>();
}

3
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java

@ -15,6 +15,7 @@ import com.epmet.modules.partyOrg.excel.IcPartyOrgExcel;
import com.epmet.modules.partyOrg.service.IcPartyOrgService;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -103,7 +104,7 @@ public class IcPartyOrgController {
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.partymember.dto.partyOrg.result.BranchListResultDTO>
*/
@PostMapping("branchlist")
public Result<IcPartyOrgTreeDTO> branchlist(@LoginUser TokenDto tokenDto){
public Result<List<BranchlistTreeDTO>> branchlist(@LoginUser TokenDto tokenDto){
return icPartyOrgService.branchlist(tokenDto);
}

3
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java

@ -3,6 +3,7 @@ package com.epmet.modules.partyOrg.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -72,5 +73,5 @@ public interface IcPartyOrgDao extends BaseDao<IcPartyOrgEntity> {
* @params [agencyId, customerId]
* @return java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>
*/
List<IcPartyOrgTreeDTO> selectAllBranchByAgencyId(@Param("agencyId") String agencyId,@Param("customerId") String customerId);
List<BranchlistTreeDTO> selectAllBranchByAgencyId(@Param("agencyId") String agencyId, @Param("customerId") String customerId);
}

3
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java

@ -7,6 +7,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import java.util.List;
@ -96,5 +97,5 @@ public interface IcPartyOrgService extends BaseService<IcPartyOrgEntity> {
* @params [tokenDto]
* @return com.epmet.commons.tools.utils.Result<com.epmet.resi.partymember.dto.partyOrg.result.BranchListResultDTO>
*/
Result<IcPartyOrgTreeDTO> branchlist(TokenDto tokenDto);
Result<List<BranchlistTreeDTO>> branchlist(TokenDto tokenDto);
}

15
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java

@ -22,6 +22,7 @@ import com.epmet.modules.partymember.dao.IcPartyMemberDao;
import com.epmet.modules.partymember.entity.IcPartyMemberEntity;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -212,14 +213,16 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
}
@Override
public Result<IcPartyOrgTreeDTO> branchlist(TokenDto tokenDto) {
public Result<List<BranchlistTreeDTO>> branchlist(TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId());
IcPartyOrgTreeDTO result = new IcPartyOrgTreeDTO();
result.setId(staffInfo.getAgencyId());
result.setOrgPids(staffInfo.getAgencyPIds());
result.setPartyOrgName(staffInfo.getAgencyName());
List<BranchlistTreeDTO> resultList = new ArrayList<>();
BranchlistTreeDTO result = new BranchlistTreeDTO();
result.setValue(staffInfo.getAgencyId());
// result.setOrgPids(staffInfo.getAgencyPIds());
result.setLabel(staffInfo.getAgencyName());
result.setChildren(baseDao.selectAllBranchByAgencyId(staffInfo.getAgencyId(),tokenDto.getCustomerId()));
return new Result<IcPartyOrgTreeDTO>().ok(result);
resultList.add(result);
return new Result<List<BranchlistTreeDTO>>().ok(resultList);
}
/**

6
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

@ -78,15 +78,15 @@
and CUSTOMER_ID=#{customerId}
</select>
<select id="selectAllBranchByAgencyId"
resultType="com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO">
select ID,
resultType="com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO">
select ID as value,
CUSTOMER_ID,
ORG_PID as pid,
ORG_PIDS,
AGENCY_ID,
AGENCY_PIDS,
PARTY_ORG_TYPE,
PARTY_ORG_NAME
PARTY_ORG_NAME as label
from ic_party_org
where DEL_FLAG=0
and CUSTOMER_ID=#{customerId}

Loading…
Cancel
Save