Commit 3aa1f727 by hongzhong

体系查询调整

parent 3389ce0e
...@@ -7,6 +7,7 @@ import com.yd.api.order.vo.SurrenderFortuneResponseVO; ...@@ -7,6 +7,7 @@ import com.yd.api.order.vo.SurrenderFortuneResponseVO;
import com.yd.api.result.CommonResult; import com.yd.api.result.CommonResult;
import com.yd.dal.entity.agms.fortune.*; import com.yd.dal.entity.agms.fortune.*;
import com.yd.dal.entity.customer.*; import com.yd.dal.entity.customer.*;
import com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo;
import com.yd.dal.entity.meta.MdIncometaxRate; import com.yd.dal.entity.meta.MdIncometaxRate;
import com.yd.dal.entity.order.PoOrder; import com.yd.dal.entity.order.PoOrder;
import com.yd.dal.entity.product.Product; import com.yd.dal.entity.product.Product;
...@@ -51,6 +52,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -51,6 +52,8 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
private AclCustomerFortuneStatisticDALService customerFortuneStatisticDalService; private AclCustomerFortuneStatisticDALService customerFortuneStatisticDalService;
private AclUserDALService userDalService; private AclUserDALService userDalService;
@Autowired @Autowired
private AclPractitionerSubordinateSystemDALService aclPractitionerSubordinateSystemDalService;
@Autowired
public void setAclCustomerFortuneDalService(AclCustomerFortuneDALService customerFortuneDalService) { public void setAclCustomerFortuneDalService(AclCustomerFortuneDALService customerFortuneDalService) {
this.customerFortuneDalService = customerFortuneDalService; this.customerFortuneDalService = customerFortuneDalService;
} }
...@@ -591,6 +594,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -591,6 +594,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
CommissionPayoutStatusQueryResponseVO responseVO = new CommissionPayoutStatusQueryResponseVO(); CommissionPayoutStatusQueryResponseVO responseVO = new CommissionPayoutStatusQueryResponseVO();
CommissionPayoutStatusQueryInfo info = new CommissionPayoutStatusQueryInfo(); CommissionPayoutStatusQueryInfo info = new CommissionPayoutStatusQueryInfo();
BeanUtils.copyProperties(requestVO,info); BeanUtils.copyProperties(requestVO,info);
//体系查询调整,如果体系为S3,则需要查询它下面的所有子集
PractitionerSubordinateInfo practitionerSubordinateInfo = new PractitionerSubordinateInfo();
BeanUtils.copyProperties(requestVO,practitionerSubordinateInfo);
practitionerSubordinateInfo.setDeptId(requestVO.getInsurerBranchDeptId());
List<Long> subsystemIdList = aclPractitionerSubordinateSystemDalService.getLongs(practitionerSubordinateInfo);
info.setSubsystemIdList(subsystemIdList);
List<CommissionPayoutStatus> commissionPayoutStatusList = agmsFortuneDalService.commissionPayoutStatusQuery(info); List<CommissionPayoutStatus> commissionPayoutStatusList = agmsFortuneDalService.commissionPayoutStatusQuery(info);
int totalSingular = 0; int totalSingular = 0;
BigDecimal totalOrderPrice = BigDecimal.ZERO; BigDecimal totalOrderPrice = BigDecimal.ZERO;
...@@ -623,6 +633,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -623,6 +633,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
WithdrawQueryResponseVO responseVO = new WithdrawQueryResponseVO(); WithdrawQueryResponseVO responseVO = new WithdrawQueryResponseVO();
WithdrawQueryInfo info = new WithdrawQueryInfo(); WithdrawQueryInfo info = new WithdrawQueryInfo();
BeanUtils.copyProperties(requestVO,info); BeanUtils.copyProperties(requestVO,info);
//体系查询调整,如果体系为S3,则需要查询它下面的所有子集
PractitionerSubordinateInfo practitionerSubordinateInfo = new PractitionerSubordinateInfo();
BeanUtils.copyProperties(requestVO,practitionerSubordinateInfo);
practitionerSubordinateInfo.setDeptId(requestVO.getInsurerBranchDeptId());
List<Long> subsystemIdList = aclPractitionerSubordinateSystemDalService.getLongs(practitionerSubordinateInfo);
info.setSubsystemIdList(subsystemIdList);
List<WithdrawLabelInfo> withdraws = agmsFortuneDalService.transformForWithdrawLabel(info); List<WithdrawLabelInfo> withdraws = agmsFortuneDalService.transformForWithdrawLabel(info);
responseVO.setTotalPeople(withdraws.size()); responseVO.setTotalPeople(withdraws.size());
BigDecimal totalReferralAmount = withdraws.stream() BigDecimal totalReferralAmount = withdraws.stream()
...@@ -834,6 +851,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService { ...@@ -834,6 +851,13 @@ public class AgmsFortuneServiceImpl implements AgmsFortuneService {
ExportFortunePayResponseVO responseVO = new ExportFortunePayResponseVO(); ExportFortunePayResponseVO responseVO = new ExportFortunePayResponseVO();
WithdrawQueryInfo info = new WithdrawQueryInfo(); WithdrawQueryInfo info = new WithdrawQueryInfo();
BeanUtils.copyProperties(requestVO,info); BeanUtils.copyProperties(requestVO,info);
//体系查询调整,如果体系为S3,则需要查询它下面的所有子集
PractitionerSubordinateInfo practitionerSubordinateInfo = new PractitionerSubordinateInfo();
BeanUtils.copyProperties(requestVO,practitionerSubordinateInfo);
practitionerSubordinateInfo.setDeptId(requestVO.getInsurerBranchDeptId());
List<Long> subsystemIdList = aclPractitionerSubordinateSystemDalService.getLongs(practitionerSubordinateInfo);
info.setSubsystemIdList(subsystemIdList);
List<WithdrawLabelInfo> withdraws = agmsFortuneDalService.transformForWithdrawLabel(info); List<WithdrawLabelInfo> withdraws = agmsFortuneDalService.transformForWithdrawLabel(info);
Long[] payIds = new Long[withdraws.size()]; Long[] payIds = new Long[withdraws.size()];
for (int i = 0; i < withdraws.size(); i ++){ for (int i = 0; i < withdraws.size(); i ++){
......
...@@ -43,6 +43,14 @@ public class CommissionPayoutStatusQueryRequestVO { ...@@ -43,6 +43,14 @@ public class CommissionPayoutStatusQueryRequestVO {
*/ */
private String payoutYearmonth; private String payoutYearmonth;
/**
* 系统标志,区分公司营业部和体系,1,分公司,2营业部,3,S1分部,4,S2体系,5,S3纵队
*/
private String systemFlag;
private Long s3Id;
private Long s2Id;
private Long s1Id;
public Long getInsurerId() { public Long getInsurerId() {
return insurerId; return insurerId;
} }
...@@ -107,6 +115,39 @@ public class CommissionPayoutStatusQueryRequestVO { ...@@ -107,6 +115,39 @@ public class CommissionPayoutStatusQueryRequestVO {
this.payoutYearmonth = payoutYearmonth; this.payoutYearmonth = payoutYearmonth;
} }
public String getSystemFlag() {
return systemFlag;
}
public void setSystemFlag(String systemFlag) {
this.systemFlag = systemFlag;
}
public Long getS3Id() {
return s3Id;
}
public void setS3Id(Long s3Id) {
this.s3Id = s3Id;
}
public Long getS2Id() {
return s2Id;
}
public void setS2Id(Long s2Id) {
this.s2Id = s2Id;
}
public Long getS1Id() {
return s1Id;
}
public void setS1Id(Long s1Id) {
this.s1Id = s1Id;
}
@Override @Override
public String toString() { public String toString() {
return "CommissionPayoutStatusQueryRequestVO{" + return "CommissionPayoutStatusQueryRequestVO{" +
......
...@@ -35,6 +35,18 @@ public class ExportFortunePayRequestVO { ...@@ -35,6 +35,18 @@ public class ExportFortunePayRequestVO {
private Long commissionPayoutStatus; private Long commissionPayoutStatus;
/** /**
* 公司
*/
private Long insurerId;
/**
* 系统标志,区分公司营业部和体系,1,分公司,2营业部,3,S1分部,4,S2体系,5,S3纵队
*/
private String systemFlag;
private Long s3Id;
private Long s2Id;
private Long s1Id;
/**
* 获取 预计发佣年月 * 获取 预计发佣年月
* *
* @return payoutYearmonth 预计发佣年月 * @return payoutYearmonth 预计发佣年月
...@@ -142,6 +154,46 @@ public class ExportFortunePayRequestVO { ...@@ -142,6 +154,46 @@ public class ExportFortunePayRequestVO {
this.commissionPayoutStatus = commissionPayoutStatus; this.commissionPayoutStatus = commissionPayoutStatus;
} }
public Long getInsurerId() {
return insurerId;
}
public void setInsurerId(Long insurerId) {
this.insurerId = insurerId;
}
public String getSystemFlag() {
return systemFlag;
}
public void setSystemFlag(String systemFlag) {
this.systemFlag = systemFlag;
}
public Long getS3Id() {
return s3Id;
}
public void setS3Id(Long s3Id) {
this.s3Id = s3Id;
}
public Long getS2Id() {
return s2Id;
}
public void setS2Id(Long s2Id) {
this.s2Id = s2Id;
}
public Long getS1Id() {
return s1Id;
}
public void setS1Id(Long s1Id) {
this.s1Id = s1Id;
}
@Override @Override
public String toString() { public String toString() {
return "ExportFortunePayRequestVO{" + return "ExportFortunePayRequestVO{" +
......
...@@ -36,4 +36,16 @@ public class WithdrawQueryRequestVO { ...@@ -36,4 +36,16 @@ public class WithdrawQueryRequestVO {
* 发佣状态 暂不开放 可发 保留 已发并关账 * 发佣状态 暂不开放 可发 保留 已发并关账
*/ */
private Long commissionPayoutStatus; private Long commissionPayoutStatus;
/**
* 公司
*/
private Long insurerId;
/**
* 系统标志,区分公司营业部和体系,1,分公司,2营业部,3,S1分部,4,S2体系,5,S3纵队
*/
private String systemFlag;
private Long s3Id;
private Long s2Id;
private Long s1Id;
} }
...@@ -13,6 +13,12 @@ public class PractitionerHiringListRequestVO { ...@@ -13,6 +13,12 @@ public class PractitionerHiringListRequestVO {
private Long subsystemId; private Long subsystemId;
private String name; private String name;
private String status; private String status;
//系统标志,区分公司营业部和体系,1,分公司,2营业部,3,S1分部,4,S2体系,5,S3纵队
private String systemFlag;
private Long s3Id;
private Long s2Id;
private Long s1Id;
private PageInfo<PractitionerHiringListInfo> pageInfo; private PageInfo<PractitionerHiringListInfo> pageInfo;
public PageInfo<PractitionerHiringListInfo> getPageInfo() { public PageInfo<PractitionerHiringListInfo> getPageInfo() {
...@@ -77,4 +83,36 @@ public class PractitionerHiringListRequestVO { ...@@ -77,4 +83,36 @@ public class PractitionerHiringListRequestVO {
public void setLoginId(Long loginId) { public void setLoginId(Long loginId) {
this.loginId = loginId; this.loginId = loginId;
} }
public String getSystemFlag() {
return systemFlag;
}
public void setSystemFlag(String systemFlag) {
this.systemFlag = systemFlag;
}
public Long getS3Id() {
return s3Id;
}
public void setS3Id(Long s3Id) {
this.s3Id = s3Id;
}
public Long getS2Id() {
return s2Id;
}
public void setS2Id(Long s2Id) {
this.s2Id = s2Id;
}
public Long getS1Id() {
return s1Id;
}
public void setS1Id(Long s1Id) {
this.s1Id = s1Id;
}
} }
package com.yd.dal.entity.agms.fortune; package com.yd.dal.entity.agms.fortune;
import java.util.List;
/** /**
* @author xxy * @author xxy
*/ */
...@@ -44,6 +46,11 @@ public class CommissionPayoutStatusQueryInfo { ...@@ -44,6 +46,11 @@ public class CommissionPayoutStatusQueryInfo {
*/ */
private String payoutYearmonth; private String payoutYearmonth;
/**
* 体系子集id
*/
List<Long> subsystemIdList;
public Long getInsurerId() { public Long getInsurerId() {
return insurerId; return insurerId;
} }
...@@ -108,6 +115,14 @@ public class CommissionPayoutStatusQueryInfo { ...@@ -108,6 +115,14 @@ public class CommissionPayoutStatusQueryInfo {
this.payoutYearmonth = payoutYearmonth; this.payoutYearmonth = payoutYearmonth;
} }
public List<Long> getSubsystemIdList() {
return subsystemIdList;
}
public void setSubsystemIdList(List<Long> subsystemIdList) {
this.subsystemIdList = subsystemIdList;
}
@Override @Override
public String toString() { public String toString() {
return "CommissionPayoutStatusQueryRequestVO{" + return "CommissionPayoutStatusQueryRequestVO{" +
......
...@@ -2,6 +2,8 @@ package com.yd.dal.entity.agms.fortune; ...@@ -2,6 +2,8 @@ package com.yd.dal.entity.agms.fortune;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* @author xxy * @author xxy
*/ */
...@@ -36,4 +38,10 @@ public class WithdrawQueryInfo { ...@@ -36,4 +38,10 @@ public class WithdrawQueryInfo {
*/ */
private Long commissionPayoutStatus; private Long commissionPayoutStatus;
/**
* 体系子集id
*/
List<Long> subsystemIdList;
} }
...@@ -84,5 +84,15 @@ public class AclPractitionerSubordinateSystem implements Serializable { ...@@ -84,5 +84,15 @@ public class AclPractitionerSubordinateSystem implements Serializable {
*/ */
private Long updatedBy; private Long updatedBy;
/**
* 父级体系id
*/
private Long parentId;
/**
* 体系类型,S1:分部,S2:体系,S3:纵队
*/
private String systemType;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -10,6 +10,15 @@ public class PractitionerSubordinateInfo { ...@@ -10,6 +10,15 @@ public class PractitionerSubordinateInfo {
private String contactNo; private String contactNo;
private String remark; private String remark;
private Long insurerId;//公司
private Long insurerBranchId;//分公司
private Long deptId;//营业部
private Long subordinateSystemId;//体系
private String systemFlag;//系统标志,区分公司营业部和体系,1,分公司,2营业部,3,S1分部,4,S2体系,5,S3纵队
private Long s3Id;
private Long s2Id;
private Long s1Id;
public Long getSubordinateId() { public Long getSubordinateId() {
return subordinateId; return subordinateId;
} }
...@@ -73,4 +82,68 @@ public class PractitionerSubordinateInfo { ...@@ -73,4 +82,68 @@ public class PractitionerSubordinateInfo {
public void setRemark(String remark) { public void setRemark(String remark) {
this.remark = remark; this.remark = remark;
} }
public Long getInsurerId() {
return insurerId;
}
public void setInsurerId(Long insurerId) {
this.insurerId = insurerId;
}
public Long getInsurerBranchId() {
return insurerBranchId;
}
public void setInsurerBranchId(Long insurerBranchId) {
this.insurerBranchId = insurerBranchId;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Long getSubordinateSystemId() {
return subordinateSystemId;
}
public void setSubordinateSystemId(Long subordinateSystemId) {
this.subordinateSystemId = subordinateSystemId;
}
public String getSystemFlag() {
return systemFlag;
}
public void setSystemFlag(String systemFlag) {
this.systemFlag = systemFlag;
}
public Long getS3Id() {
return s3Id;
}
public void setS3Id(Long s3Id) {
this.s3Id = s3Id;
}
public Long getS2Id() {
return s2Id;
}
public void setS2Id(Long s2Id) {
this.s2Id = s2Id;
}
public Long getS1Id() {
return s1Id;
}
public void setS1Id(Long s1Id) {
this.s1Id = s1Id;
}
} }
...@@ -66,7 +66,7 @@ public interface AgmsHiringMapper { ...@@ -66,7 +66,7 @@ public interface AgmsHiringMapper {
@Param("status")String status, @Param("status")String status,
@Param("branchId")Long branchId, @Param("branchId")Long branchId,
@Param("deptId")Long deptId, @Param("deptId")Long deptId,
@Param("subsystemId")Long subsystemId, @Param("subsystemIdList")List<Long> subsystemIdList,
@Param("name")String name @Param("name")String name
); );
...@@ -74,7 +74,7 @@ public interface AgmsHiringMapper { ...@@ -74,7 +74,7 @@ public interface AgmsHiringMapper {
@Param("list")List<String> canAprroveGrades, @Param("list")List<String> canAprroveGrades,
@Param("branchId")Long branchId, @Param("branchId")Long branchId,
@Param("deptId")Long deptId, @Param("deptId")Long deptId,
@Param("subsystemId")Long subsystemId, @Param("subsystemIdList")List<Long> subsystemIdList,
@Param("name")String name @Param("name")String name
); );
......
...@@ -32,4 +32,12 @@ public interface AclPractitionerSubordinateSystemMapper { ...@@ -32,4 +32,12 @@ public interface AclPractitionerSubordinateSystemMapper {
List<SubordinateSystemMemberInfoE> findStatisticsE(@Param("subordinateIdForEGolden")String subordinateIdForEGolden, @Param("time")Integer time); List<SubordinateSystemMemberInfoE> findStatisticsE(@Param("subordinateIdForEGolden")String subordinateIdForEGolden, @Param("time")Integer time);
List<SubordinateSystemMemberInfoE> findStatisticsEBymobileList(@Param("list")List<String> mobileNoList, @Param("time")Integer time); List<SubordinateSystemMemberInfoE> findStatisticsEBymobileList(@Param("list")List<String> mobileNoList, @Param("time")Integer time);
}
\ No newline at end of file List<AclPractitionerSubordinateSystem> findByDeptId(Long deptId);
List<AclPractitionerSubordinateSystem> findByInsurerBranchId(Long insurerBranchId);
List<AclPractitionerSubordinateSystem> findDeptIdAndInsureBranchIdNull(Long insurerId);
List<AclPractitionerSubordinateSystem> findDeptIdNotNull(Long insurerId);
}
...@@ -5,11 +5,13 @@ import com.github.pagehelper.PageHelper; ...@@ -5,11 +5,13 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yd.api.agms.vo.hiring.PractitionerHiringListRequestVO; import com.yd.api.agms.vo.hiring.PractitionerHiringListRequestVO;
import com.yd.dal.entity.agms.hiring.*; import com.yd.dal.entity.agms.hiring.*;
import com.yd.dal.entity.customer.practitioner.PractitionerSubordinateInfo;
import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps; import com.yd.dal.entity.meta.MdPractitionerHiringApproveSteps;
import com.yd.dal.entity.practitioner.hiring.HiringListInfo; import com.yd.dal.entity.practitioner.hiring.HiringListInfo;
import com.yd.dal.entity.user.AclUser; import com.yd.dal.entity.user.AclUser;
import com.yd.dal.mapper.agms.AgmsHiringMapper; import com.yd.dal.mapper.agms.AgmsHiringMapper;
import com.yd.dal.service.agms.AgmsHiringDALService; import com.yd.dal.service.agms.AgmsHiringDALService;
import com.yd.dal.service.customer.AclPractitionerSubordinateSystemDALService;
import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService; import com.yd.dal.service.meta.MdPractitionerHiringApproveStepsDALService;
import com.yd.dal.service.practitioner.PractitionerHiringDALService; import com.yd.dal.service.practitioner.PractitionerHiringDALService;
import com.yd.dal.service.user.AclUserDALService; import com.yd.dal.service.user.AclUserDALService;
...@@ -17,6 +19,8 @@ import com.yd.util.CommonUtil; ...@@ -17,6 +19,8 @@ import com.yd.util.CommonUtil;
import com.yd.util.page.PageInfoUtils; import com.yd.util.page.PageInfoUtils;
import net.sf.ehcache.Element; import net.sf.ehcache.Element;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -36,6 +40,9 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService { ...@@ -36,6 +40,9 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService {
private MdPractitionerHiringApproveStepsDALService mdPractitionerHiringApproveStepsDalService; private MdPractitionerHiringApproveStepsDALService mdPractitionerHiringApproveStepsDalService;
@Autowired @Autowired
private PractitionerHiringDALService practitionerHiringDalService; private PractitionerHiringDALService practitionerHiringDalService;
@Autowired
private AclPractitionerSubordinateSystemDALService aclPractitionerSubordinateSystemDalService;
@Autowired @Autowired
public void setAgmsHiringMapper(AgmsHiringMapper agmsHiringMapper){ public void setAgmsHiringMapper(AgmsHiringMapper agmsHiringMapper){
...@@ -89,11 +96,16 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService { ...@@ -89,11 +96,16 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService {
@Override @Override
public PageInfo<PractitionerHiringListInfo> queryHandledList(Long loginPractitionerId, String status, PractitionerHiringListRequestVO requestVO) { public PageInfo<PractitionerHiringListInfo> queryHandledList(Long loginPractitionerId, String status, PractitionerHiringListRequestVO requestVO) {
//体系查询调整,如果体系为S3,则需要查询它下面的所有子集
PractitionerSubordinateInfo practitionerSubordinateInfo = new PractitionerSubordinateInfo();
BeanUtils.copyProperties(requestVO,practitionerSubordinateInfo);
practitionerSubordinateInfo.setInsurerBranchId(requestVO.getBranchId());
List<Long> subsystemIdList = aclPractitionerSubordinateSystemDalService.getLongs(practitionerSubordinateInfo);
List<PractitionerHiringListInfo> destList = List<PractitionerHiringListInfo> destList =
agmsHiringMapper.queryHandledList(loginPractitionerId, status, requestVO.getBranchId(), agmsHiringMapper.queryHandledList(loginPractitionerId, status, requestVO.getBranchId(),
requestVO.getDeptId(), requestVO.getDeptId(),
requestVO.getSubsystemId(), subsystemIdList,
requestVO.getName()); requestVO.getName());
// list去重 // list去重
...@@ -128,6 +140,13 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService { ...@@ -128,6 +140,13 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService {
String stepName; String stepName;
Integer stepSeq; Integer stepSeq;
String canAprroveGrade; String canAprroveGrade;
//体系查询调整,如果体系为S3,则需要查询它下面的所有子集
PractitionerSubordinateInfo practitionerSubordinateInfo = new PractitionerSubordinateInfo();
BeanUtils.copyProperties(requestVO,practitionerSubordinateInfo);
practitionerSubordinateInfo.setInsurerBranchId(requestVO.getBranchId());
List<Long> subsystemIdList = aclPractitionerSubordinateSystemDalService.getLongs(practitionerSubordinateInfo);
for (MdPractitionerHiringApproveSteps step : ownSteps) { for (MdPractitionerHiringApproveSteps step : ownSteps) {
stepName = step.getStepName(); stepName = step.getStepName();
stepSeq = step.getStepSeq(); stepSeq = step.getStepSeq();
...@@ -141,7 +160,7 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService { ...@@ -141,7 +160,7 @@ public class AgmsHiringDALServiceImpl implements AgmsHiringDALService {
agmsHiringMapper.queryUnhandledList(approveStatus, canAprroveGrades, agmsHiringMapper.queryUnhandledList(approveStatus, canAprroveGrades,
requestVO.getBranchId(), requestVO.getBranchId(),
requestVO.getDeptId(), requestVO.getDeptId(),
requestVO.getSubsystemId(), subsystemIdList,
requestVO.getName() requestVO.getName()
); );
if (CollectionUtils.isNotEmpty(resultList)) { if (CollectionUtils.isNotEmpty(resultList)) {
......
...@@ -25,4 +25,27 @@ public interface AclPractitionerSubordinateSystemDALService { ...@@ -25,4 +25,27 @@ public interface AclPractitionerSubordinateSystemDALService {
List<SubordinateSystemMemberInfoE> findStatisticsEBymobileList(List<String> mobileNoList, Integer time); List<SubordinateSystemMemberInfoE> findStatisticsEBymobileList(List<String> mobileNoList, Integer time);
AclPractitionerSubordinateSystem findById(Long subsystemId); AclPractitionerSubordinateSystem findById(Long subsystemId);
List<AclPractitionerSubordinateSystem> findByDeptId(Long deptId);
List<AclPractitionerSubordinateSystem> findByInsurerBranchId(Long insurerBranchId);
List<AclPractitionerSubordinateSystem> findDeptIdAndInsureBranchIdNull(Long insurerId);
List<AclPractitionerSubordinateSystem> findDeptIdNotNull(Long insurerId);
/**
* 组织架构体系查询改造,如果条件是S3,则需要查询出其组织下的所有子集。
* @return
*/
public List<Long> getLongs(PractitionerSubordinateInfo practitionerSubordinateInfo);
/**
* 递归获取某个父节点下面的所有子节点
* @param childOrg 要返回的结果
* @param allList 数据库查询出来的所有集合
* @param pid 父id
*/
public void orgRecursion(List<AclPractitionerSubordinateSystem> childOrg, List<AclPractitionerSubordinateSystem> allList, Long pid);
} }
...@@ -10,6 +10,7 @@ import com.yd.util.intercept.commons.DataSourceKey; ...@@ -10,6 +10,7 @@ import com.yd.util.intercept.commons.DataSourceKey;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Service("aclPractitionerSubordinateSystemDALService") @Service("aclPractitionerSubordinateSystemDALService")
...@@ -67,4 +68,91 @@ public class AclPractitionerSubordinateSystemDALServiceImpl implements AclPracti ...@@ -67,4 +68,91 @@ public class AclPractitionerSubordinateSystemDALServiceImpl implements AclPracti
public AclPractitionerSubordinateSystem findById(Long subsystemId) { public AclPractitionerSubordinateSystem findById(Long subsystemId) {
return aclPractitionerSubordinateSystemMapper.selectByPrimaryKey(subsystemId); return aclPractitionerSubordinateSystemMapper.selectByPrimaryKey(subsystemId);
} }
@Override
public List<AclPractitionerSubordinateSystem> findByDeptId(Long deptId) {
return aclPractitionerSubordinateSystemMapper.findByDeptId(deptId);
}
@Override
public List<AclPractitionerSubordinateSystem> findByInsurerBranchId(Long insurerBranchId) {
return aclPractitionerSubordinateSystemMapper.findByInsurerBranchId(insurerBranchId);
}
@Override
public List<AclPractitionerSubordinateSystem> findDeptIdAndInsureBranchIdNull(Long insurerId) {
return aclPractitionerSubordinateSystemMapper.findDeptIdAndInsureBranchIdNull(insurerId);
}
@Override
public List<AclPractitionerSubordinateSystem> findDeptIdNotNull(Long insurerId) {
return aclPractitionerSubordinateSystemMapper.findDeptIdNotNull(insurerId);
}
@Override
public List<Long> getLongs(PractitionerSubordinateInfo practitionerSubordinateInfo) {
// 经纪人管理 组织架构更新保存调整
Long s1Id = practitionerSubordinateInfo.getS1Id(),s2Id = practitionerSubordinateInfo.getS2Id(),s3Id = practitionerSubordinateInfo.getS3Id();
List<AclPractitionerSubordinateSystem> childOrg = new ArrayList<>();
List<AclPractitionerSubordinateSystem> allList = new ArrayList<>();
List<Long> longList = new ArrayList<>();
if("3".equals(practitionerSubordinateInfo.getSystemFlag())){
practitionerSubordinateInfo.setSubordinateSystemId(s1Id);
}
if("4".equals(practitionerSubordinateInfo.getSystemFlag())){
practitionerSubordinateInfo.setSubordinateSystemId(s2Id);
}
if("5".equals(practitionerSubordinateInfo.getSystemFlag())){
practitionerSubordinateInfo.setSubordinateSystemId(s3Id);
}
if(null != practitionerSubordinateInfo.getSubordinateSystemId()){
//1,总公司下的体系
if(null == practitionerSubordinateInfo.getInsurerBranchId() && null == practitionerSubordinateInfo.getDeptId()){
allList = this.findDeptIdAndInsureBranchIdNull(practitionerSubordinateInfo.getInsurerId() == null ? 888 : practitionerSubordinateInfo.getInsurerId());
}
//2,总公司营业部下的体系
if(null == practitionerSubordinateInfo.getInsurerBranchId() && null != practitionerSubordinateInfo.getDeptId()) {
allList = this.findDeptIdNotNull(practitionerSubordinateInfo.getInsurerId() == null ? 888 : practitionerSubordinateInfo.getInsurerId());
}
//3,分公司下的体系
if(null != practitionerSubordinateInfo.getInsurerBranchId() && null == practitionerSubordinateInfo.getDeptId()){
allList = this.findByInsurerBranchId(practitionerSubordinateInfo.getInsurerBranchId());
}
//4,分公司营业部下的体系
if(null != practitionerSubordinateInfo.getInsurerBranchId() && null != practitionerSubordinateInfo.getDeptId()){
allList = this.findByDeptId(practitionerSubordinateInfo.getDeptId());
}
//5,根据父节点获取到所有子节点
this.orgRecursion(childOrg,allList, practitionerSubordinateInfo.getSubordinateSystemId());
}
if(childOrg.size() > 0) {
for (AclPractitionerSubordinateSystem org : childOrg) {
longList.add(org.getId());
}
}
if(null != practitionerSubordinateInfo.getSubordinateSystemId()){
longList.add(practitionerSubordinateInfo.getSubordinateSystemId());
}
return longList;
}
/**
* 递归获取某个父节点下面的所有子节点
* @param childOrg 要返回的结果
* @param allList 数据库查询出来的所有集合
* @param pid 父id
*/
@Override
public void orgRecursion(List<AclPractitionerSubordinateSystem> childOrg,List<AclPractitionerSubordinateSystem> allList, Long pid) {
if(null != allList && allList.size() > 0 ){
for (AclPractitionerSubordinateSystem org : allList) {
if (org.getParentId() != null && org.getParentId().equals(pid)) {
//遍历出父id等于参数的id,add进子节点集合
//递归遍历下一级
orgRecursion(childOrg,allList, org.getId());
childOrg.add(org);
}
}
}
}
} }
...@@ -75,8 +75,14 @@ ...@@ -75,8 +75,14 @@
<if test="item.insurerBranchDeptId != null"> <if test="item.insurerBranchDeptId != null">
and dept.id = #{item.insurerBranchDeptId,jdbcType=BIGINT} and dept.id = #{item.insurerBranchDeptId,jdbcType=BIGINT}
</if> </if>
<if test="item.subordinateSystemId != null"> <!-- <if test="item.subordinateSystemId != null">
and sub.id = #{item.subordinateSystemId,jdbcType=BIGINT} and sub.id = #{item.subordinateSystemId,jdbcType=BIGINT}
</if>-->
<if test="item.subsystemIdList != null and item.subsystemIdList.size() > 0">
and sub.id in
<foreach collection="item.subsystemIdList" index="index" item="subordinateSystemId" open="(" separator="," close=")">
#{subordinateSystemId}
</foreach>
</if> </if>
<if test="item.practitionerId != null"> <if test="item.practitionerId != null">
and pra.id = #{item.practitionerId,jdbcType=BIGINT} and pra.id = #{item.practitionerId,jdbcType=BIGINT}
...@@ -186,8 +192,14 @@ ...@@ -186,8 +192,14 @@
<if test="item.insurerBranchDeptId != null"> <if test="item.insurerBranchDeptId != null">
and dept.id = #{item.insurerBranchDeptId,jdbcType=BIGINT} and dept.id = #{item.insurerBranchDeptId,jdbcType=BIGINT}
</if> </if>
<if test="item.subordinateSystemId != null"> <!-- <if test="item.subordinateSystemId != null">
and sub.id = #{item.subordinateSystemId,jdbcType=BIGINT} and sub.id = #{item.subordinateSystemId,jdbcType=BIGINT}
</if>-->
<if test="item.subsystemIdList != null and item.subsystemIdList.size() > 0">
and sub.id in
<foreach collection="item.subsystemIdList" index="index" item="subordinateSystemId" open="(" separator="," close=")">
#{subordinateSystemId}
</foreach>
</if> </if>
<if test="item.practitionerId != null"> <if test="item.practitionerId != null">
and pra.id = #{item.practitionerId,jdbcType=BIGINT} and pra.id = #{item.practitionerId,jdbcType=BIGINT}
...@@ -197,4 +209,4 @@ ...@@ -197,4 +209,4 @@
</if> </if>
order by pb.payout_yearmonth order by pb.payout_yearmonth
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -236,13 +236,19 @@ ...@@ -236,13 +236,19 @@
</if> </if>
) )
<if test="branchId != null"> <if test="branchId != null">
and m.branch = #{branchId} and m.branch_id = #{branchId}
</if> </if>
<if test="deptId != null"> <if test="deptId != null">
and sys.dept_id = #{deptId} and sys.dept_id = #{deptId}
</if> </if>
<if test="subsystemId != null"> <!-- <if test="subsystemId != null">
and m.subsystem = #{subsystemId} and m.subsystem = #{subsystemId}
</if>-->
<if test="subsystemIdList != null and subsystemIdList.size() > 0">
and m.subsystem_id in
<foreach collection="subsystemIdList" index="index" item="subsystemId" open="(" separator="," close=")">
#{subsystemId}
</foreach>
</if> </if>
<if test="name != null"> <if test="name != null">
and b.name = #{name} and b.name = #{name}
...@@ -277,13 +283,19 @@ ...@@ -277,13 +283,19 @@
</if> </if>
<if test="branchId != null"> <if test="branchId != null">
and m.branch = #{branchId} and m.branch_id = #{branchId}
</if> </if>
<if test="deptId != null"> <if test="deptId != null">
and sys.dept_id = #{deptId} and sys.dept_id = #{deptId}
</if> </if>
<if test="subsystemId != null"> <!-- <if test="subsystemId != null">
and m.subsystem = #{subsystemId} and m.subsystem = #{subsystemId}
</if>-->
<if test="subsystemIdList != null and subsystemIdList.size() > 0">
and m.subsystem_id in
<foreach collection="subsystemIdList" index="index" item="subsystemId" open="(" separator="," close=")">
#{subsystemId}
</foreach>
</if> </if>
<if test="name != null"> <if test="name != null">
and b.name = #{name} and b.name = #{name}
...@@ -314,4 +326,4 @@ ...@@ -314,4 +326,4 @@
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
<result column="contact_no" jdbcType="VARCHAR" property="contactNo" /> <result column="contact_no" jdbcType="VARCHAR" property="contactNo" />
<result column="remark" jdbcType="VARCHAR" property="remark" /> <result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="is_active" jdbcType="INTEGER" property="isActive" /> <result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="parent_id" jdbcType="BIGINT" property="parentId" />
<result column="system_ype" jdbcType="VARCHAR" property="systemType" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" /> <result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
...@@ -331,4 +333,24 @@ ...@@ -331,4 +333,24 @@
group by p.SAL_MST_ID; group by p.SAL_MST_ID;
</select> </select>
</mapper> <select id="findByDeptId" resultMap="BaseResultMap">
\ No newline at end of file SELECT t.* FROM ag_acl_practitioner_subordinate_system t WHERE t.dept_id =#{deptId,jdbcType=BIGINT} and t.is_active = 1
</select>
<select id="findByInsurerBranchId" resultMap="BaseResultMap">
SELECT t.* FROM ag_acl_practitioner_subordinate_system t WHERE t.insurer_branch_id =#{insurerBranchId,jdbcType=BIGINT} and t.dept_id is null and t.is_active = 1
</select>
<select id="findDeptIdAndInsureBranchIdNull" resultMap="BaseResultMap">
SELECT t.* FROM ag_acl_practitioner_subordinate_system t
WHERE t.insurer_branch_id is null and t.dept_id is null and t.is_active = 1 and t.insurer_id= #{insurerId,jdbcType=BIGINT}
union all
SELECT t.* FROM ag_acl_practitioner_subordinate_system t
WHERE t.insurer_branch_id is null and t.dept_id is not null and t.is_active = 1 and t.insurer_id= #{insurerId,jdbcType=BIGINT}
</select>
<select id="findDeptIdNotNull" resultMap="BaseResultMap">
SELECT t.* FROM ag_acl_practitioner_subordinate_system t WHERE t.insurer_branch_id is null and t.dept_id is not null and t.is_active = 1 and t.insurer_id= #{insurerId,jdbcType=BIGINT}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment