Browse Source

branchList接口调整

dev
Jackwang 3 years ago
parent
commit
4ae2b4ad67
  1. 34
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/BranchListResultDTO.java
  2. 5
      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/service/IcPartyOrgService.java
  4. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java
  5. 18
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

34
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/BranchListResultDTO.java

@ -1,34 +0,0 @@
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-25 11:15
**/
@Data
public class BranchListResultDTO implements Serializable {
/**
* 工作人员所属组织ID
*/
private String agencyId;
/**
* 工作人员所属组织ID的pids
*/
private String agencyPIds;
/**
* 工作人员所属组织名称
*/
private String agencyName;
private List<IcPartyOrgTreeDTO> children = new ArrayList<>();
}

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

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

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

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

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

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

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

@ -36,12 +36,18 @@
from ic_party_org from ic_party_org
where DEL_FLAG=0 where DEL_FLAG=0
and CUSTOMER_ID=#{customerId} and CUSTOMER_ID=#{customerId}
<if test="agencyId != null and agencyId != ''"> <choose>
AND (AGENCY_ID = #{agencyId} or AGENCY_PIDS LIKE concat('%',#{agencyId}, '%' )) <when test="orgPid != ''' and orgPid != null and agencyId != null and agencyId != ''">
</if> AND ((AGENCY_ID = #{agencyId} or AGENCY_PIDS LIKE concat('%',#{agencyId}, '%' ))
<if test="orgPid != null and orgPid != ''"> or
or id =#{orgPid} id =#{orgPid})
</if> </when>
<otherwise>
<if test="agencyId != null and agencyId != ''">
AND (AGENCY_ID = #{agencyId} or AGENCY_PIDS LIKE concat('%',#{agencyId}, '%' ))
</if>
</otherwise>
</choose>
</select> </select>
<select id="selectAllByOrgId" resultType="com.epmet.modules.partyOrg.entity.IcPartyOrgEntity"> <select id="selectAllByOrgId" resultType="com.epmet.modules.partyOrg.entity.IcPartyOrgEntity">
select * from ic_party_org select * from ic_party_org

Loading…
Cancel
Save