Browse Source

组织区域查询【智慧社区】

dev_shibei_match
zxc 5 years ago
parent
commit
1538f9af90
  1. 31
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/CompartmentByBizTypeFormDTO.java
  2. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java
  3. 7
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java
  4. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  5. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
  6. 19
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  7. 33
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

31
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/CompartmentByBizTypeFormDTO.java

@ -0,0 +1,31 @@
package com.epmet.evaluationindex.screen.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/10/22
*/
@Data
public class CompartmentByBizTypeFormDTO implements Serializable {
private static final long serialVersionUID = -3354778434424878413L;
public interface CompartmentByBizType extends CustomerClientShowGroup {}
/**
* 机关ID
*/
@NotBlank(message = "机关ID不能为空",groups = {CompartmentByBizType.class})
private String agencyId;
/**
* 业务类型
*/
@NotBlank(message = "bizType不能为空", groups = {CompartmentByBizType.class})
private String bizType;
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java

@ -37,4 +37,9 @@ public class AgencyDistributionResultDTO implements Serializable {
* 组织agency; 网格grid ; 部门dept * 组织agency; 网格grid ; 部门dept
*/ */
private String type; private String type;
public AgencyDistributionResultDTO() {
this.subAreaMarks = "";
this.subCenterMark = "";
}
} }

7
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java

@ -3,6 +3,7 @@ package com.epmet.datareport.controller.screen;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO;
@ -59,4 +60,10 @@ public class AgencyController {
return new Result<CompartmentResultDTO>().ok(agencyService.compartment(compartmentFormDTO)); return new Result<CompartmentResultDTO>().ok(agencyService.compartment(compartmentFormDTO));
} }
@PostMapping("compartmentbybiztype")
public Result<CompartmentResultDTO> compartmentByBizType(@RequestBody CompartmentByBizTypeFormDTO compartmentFormDTO){
ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentByBizTypeFormDTO.CompartmentByBizType.class);
return new Result<CompartmentResultDTO>().ok(agencyService.compartmentByBizType(compartmentFormDTO));
}
} }

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -60,6 +60,8 @@ public interface ScreenCustomerAgencyDao {
*/ */
CompartmentResultDTO getAgencyAreaInfo(@Param("agencyId")String agencyId); CompartmentResultDTO getAgencyAreaInfo(@Param("agencyId")String agencyId);
CompartmentResultDTO getAgencyAreaInfoByBizType(@Param("agencyId")String agencyId,@Param("bizType")String bizType);
/** /**
* @Description 查询子级区域分布信息机关级别 * @Description 查询子级区域分布信息机关级别
* @param agencyId * @param agencyId
@ -67,6 +69,7 @@ public interface ScreenCustomerAgencyDao {
* @date 2020/8/18 5:12 下午 * @date 2020/8/18 5:12 下午
*/ */
List<AgencyDistributionResultDTO> selectSubDistribution(@Param("agencyId")String agencyId); List<AgencyDistributionResultDTO> selectSubDistribution(@Param("agencyId")String agencyId);
List<AgencyDistributionResultDTO> selectSubDistributionByType(@Param("agencyId")String agencyId,@Param("bizType")String bizType);
/** /**
* @Description 查询子级用户分布机关级别 * @Description 查询子级用户分布机关级别

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java

@ -1,5 +1,6 @@
package com.epmet.datareport.service.evaluationindex.screen; package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO;
@ -32,4 +33,6 @@ public interface AgencyService {
*/ */
CompartmentResultDTO compartment(CompartmentFormDTO compartmentFormDTO); CompartmentResultDTO compartment(CompartmentFormDTO compartmentFormDTO);
CompartmentResultDTO compartmentByBizType(CompartmentByBizTypeFormDTO compartmentFormDTO);
} }

19
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

@ -8,6 +8,7 @@ import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO;
@ -206,4 +207,22 @@ public class AgencyServiceImpl implements AgencyService {
} }
return agencyAreaInfo; return agencyAreaInfo;
} }
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public CompartmentResultDTO compartmentByBizType(CompartmentByBizTypeFormDTO compartmentFormDTO) {
CompartmentResultDTO agencyAreaInfo = screenCustomerAgencyDao.getAgencyAreaInfoByBizType(compartmentFormDTO.getAgencyId(),compartmentFormDTO.getBizType());
if (null == agencyAreaInfo){
return new CompartmentResultDTO();
}
if (agencyAreaInfo.getLevel().equals(ScreenConstant.COMMUNITY)){
// 当level为"community"时,查询screen_customer_grid表
List<AgencyDistributionResultDTO> agencyDistributionResultDTOS = screenCustomerGridDao.selectSubDistribution(compartmentFormDTO.getAgencyId());
agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS);
}else {
List<AgencyDistributionResultDTO> agencyDistributionResultDTOS = screenCustomerAgencyDao.selectSubDistributionByType(compartmentFormDTO.getAgencyId(),compartmentFormDTO.getBizType());
agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS);
}
return agencyAreaInfo;
}
} }

33
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

@ -151,4 +151,37 @@
ca.created_time DESC ca.created_time DESC
</select> </select>
<select id="getAgencyAreaInfoByBizType" resultType="com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO">
SELECT
bo.ORG_ID AS agencyId,
sca.agency_name AS name,
IFNULL(sca.area_marks,'') AS areaMarks,
sca.level AS level
FROM
screen_customer_agency sca
LEFT JOIN screen_customer_biz_org bo ON bo.ORG_ID = sca.AGENCY_ID
WHERE
sca.del_flag = 0
AND bo.DEL_FLAG = 0
AND bo.ORG_ID = #{agencyId}
AND bo.BIZ_TYPE = #{bizType}
</select>
<select id="selectSubDistributionByType" resultType="com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO">
SELECT
ORG_ID AS subId,
sca.agency_name AS subName,
IFNULL(sca.area_marks,'') AS subAreaMarks,
IFNULL(sca.center_mark,'') AS subCenterMark,
'agency' AS type
FROM
screen_customer_agency sca
LEFT JOIN screen_customer_biz_org cbo ON cbo.ORG_ID = sca.AGENCY_ID
WHERE
sca.del_flag = 0
AND cbo.DEL_FLAG = 0
AND cbo.BIZ_TYPE = #{bizType}
AND sca.pid = #{agencyId}
</select>
</mapper> </mapper>
Loading…
Cancel
Save