Browse Source

Merge remote-tracking branch 'origin/dev_ic_data' into dev_ic_data

dev_shibei_match
yinzuomei 4 years ago
parent
commit
397b2c367f
  1. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java
  2. 21
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java
  3. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
  4. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  5. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  6. 26
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  7. 22
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

12
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java

@ -40,5 +40,17 @@ public class AgencyGridList implements Serializable {
* 机关-网格名称
*/
private String agencyGridName = "";
/**
* 网格名称
*/
private String gridName = "";
/**
* 网格经度网格没有经纬度时获取客户根组织下的
*/
private String longitude = "";
/**
* 网格维度网格没有经纬度时获取客户根组织下的
*/
private String latitude = "";
}

21
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java

@ -30,23 +30,22 @@ import java.io.Serializable;
*/
@Data
public class AgencyResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 机关组织Id
*/
//机关组织Id
private String agencyId = "";
/**
* 机关组织名称
*/
//机关组织名称
private String agencyName = "";
//上级组织id
private String pid;
//组织级别
private String level;
/**
* 所有上级组织机构ID(以英文:隔开)
*/
//所有上级组织机构ID(以英文:隔开)
@JsonIgnore
private String pids = "";
//经度【没值则取跟客户的值】
private String longitude;
//维度【没值则取跟客户的值】
private String latitude;
}

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java

@ -309,4 +309,14 @@ public class CustomerGridController {
List<CustomerGridDTO> resultDTOS = customerGridService.getGridIListByAgency(agencyId);
return new Result<List<CustomerGridDTO>>().ok(resultDTOS);
}
/**
* @Author sun
* @Description 查询组织直属网格列表
**/
@PostMapping("getGridIListByAgency/{agencyId}")
public Result<List<AgencyGridList>> gridListByAgencyId(@PathVariable("agencyId") String agencyId) {
return new Result<List<AgencyGridList>>().ok(customerGridService.gridListByAgencyId(agencyId));
}
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java

@ -348,4 +348,10 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @Date 2021/11/29 17:00
*/
List<CustomerGridDTO> getGridIListByAgency(String agencyId);
/**
* @Author sun
* @Description 查询组织直属网格列表
**/
List<AgencyGridList> gridListByAgencyId(String agencyId);
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
@ -47,7 +46,6 @@ import com.epmet.entity.CustomerGridEntity;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerGridService;
import com.epmet.util.ModuleConstant;
@ -866,4 +864,14 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
return ConvertUtils.sourceToTarget(list, CustomerGridDTO.class);
}
/**
* @Author sun
* @Description 查询组织直属网格列表
**/
@Override
public List<AgencyGridList> gridListByAgencyId(String agencyId) {
List<AgencyGridList> result = baseDao.selectAgencyGridMsgList(agencyId);
return result;
}
}

26
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -340,11 +340,27 @@
<select id="selectAgencyByStaffId" resultType="com.epmet.dto.result.AgencyResultDTO">
SELECT
ca.id AS "agencyId",
ca.organization_name AS "agencyName",
ca.pids AS "pids",
ca.PID AS pid,
ca.LEVEL
ca.id agencyId,
ca.organization_name agencyName,
ca.pids pids,
ca.pid pid,
ca.level level,
( CASE WHEN ca.longitude is null THEN
( SELECT longitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
ORDER BY pid ASC LIMIT 1
)
ELSE ca.longitude
END
) longitude,
( CASE WHEN ca.latitude is null THEN
( SELECT latitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
ORDER BY pid ASC LIMIT 1
)
ELSE ca.latitude
END
) latitude
FROM
customer_agency ca
INNER JOIN customer_staff_agency csa ON ca.id = csa.agency_id

22
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -389,12 +389,30 @@
<select id="selectAgencyGridMsgList" resultType="com.epmet.dto.result.AgencyGridList">
SELECT
cg.id AS "gridId",
cg.id gridId,
CONCAT(
ca.organization_name,
"-",
cg.grid_name
) "agencyGridName"
) agencyGridName,
cg.grid_name gridName,
<!-- 网格没有经纬度时获取客户根组织下的 -->
( CASE WHEN cg.longitude is null THEN
( SELECT longitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
ORDER BY pid ASC LIMIT 1
)
ELSE cg.longitude
END
) longitude,
( CASE WHEN cg.latitude is null THEN
( SELECT latitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
ORDER BY pid ASC LIMIT 1
)
ELSE cg.latitude
END
) latitude
FROM
customer_grid cg
INNER JOIN customer_agency ca ON cg.pid = ca.id

Loading…
Cancel
Save