Browse Source

Merge branch 'dev' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev

dev_shibei_match
wxz 4 years ago
parent
commit
c04da794db
  1. 28
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/CategoryTopAppealFormDTO.java
  2. 38
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/CategoryTopAppealResultDTO.java
  3. 16
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java
  4. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java
  5. 12
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java
  6. 33
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  7. 17
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml
  8. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridManagerUserListResultDTO.java
  9. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java
  10. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java
  11. 29
      epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml

28
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/CategoryTopAppealFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.project.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/8/17 10:06 上午
* @DESC
*/
@Data
public class CategoryTopAppealFormDTO implements Serializable {
private static final long serialVersionUID = -1252908912057212505L;
public interface CategoryTopAppealForm{}
@NotBlank(message = "组织ID不能为空",groups = CategoryTopAppealForm.class)
private String agencyId;
@NotNull(message = "topCount不能为空",groups = CategoryTopAppealForm.class)
private Integer topCount;
private String customerId;
}

38
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/CategoryTopAppealResultDTO.java

@ -0,0 +1,38 @@
package com.epmet.project.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/8/18 11:09 上午
* @DESC
*/
@Data
public class CategoryTopAppealResultDTO implements Serializable {
private static final long serialVersionUID = -4334256489103188282L;
/**
* 分类ID
*/
private String categoryId;
/**
* 分类名称
*/
private String categoryName;
/**
* 分类数量
*/
private Integer categoryCount;
public CategoryTopAppealResultDTO() {
this.categoryId = "";
this.categoryName = "";
this.categoryCount = NumConstant.ZERO;
}
}

16
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java

@ -12,6 +12,8 @@ import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import com.epmet.project.dto.form.CategoryTopAppealFormDTO;
import com.epmet.project.dto.result.CategoryTopAppealResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -139,4 +141,18 @@ public class ScreenProjectController {
return new Result<ColorProjectTotalResultDTO>().ok(screenProjectService.colorProjectTotal(formDTO));
}
/**
* @Description 事件分析-类型分析-群众诉求top20
* @Param customerId
* @Param formDTO
* @author zxc
* @date 2021/8/18 11:16 上午
*/
@PostMapping("categorytopappeal")
public Result<List<CategoryTopAppealResultDTO>> categoryTopAppeal(@RequestHeader("CustomerId") String customerId, @RequestBody CategoryTopAppealFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, CategoryTopAppealFormDTO.CategoryTopAppealForm.class);
formDTO.setCustomerId(customerId);
return new Result<List<CategoryTopAppealResultDTO>>().ok(screenProjectService.categoryTopAppeal(formDTO));
}
}

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

@ -19,6 +19,7 @@ package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.project.CustomerProjectCategoryDTO;
import com.epmet.project.dto.result.CategoryTopAppealResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -42,4 +43,13 @@ public interface ScreenProjectCategoryOrgDailyDao {
List<CategoryAnalysisResultDTO> selectCategoryAnalysis(@Param("agencyId") String agencyId,@Param("customerId")String customerId);
CustomerProjectCategoryDTO selectProjectCategory(@Param("categoryCode")String categoryCode, @Param("customerId")String customerId, @Param("subCustomerIds")List<String> subCustomerIds);
/**
* @Description 查询事件分类
* @Param agencyId
* @Param customerId
* @author zxc
* @date 2021/8/18 1:40 下午
*/
List<CategoryTopAppealResultDTO> categoryTopAppeal(@Param("agencyId") String agencyId,@Param("customerId")String customerId,@Param("topCount")Integer topCount);
}

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

@ -10,6 +10,8 @@ import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import com.epmet.project.dto.form.CategoryTopAppealFormDTO;
import com.epmet.project.dto.result.CategoryTopAppealResultDTO;
import java.util.List;
@ -50,4 +52,14 @@ public interface ScreenProjectService {
* @date 2021/6/1 3:20 下午
*/
ColorProjectTotalResultDTO colorProjectTotal(ColorProjectTotalFormDTO formDTO);
/**
* @Description 事件分析-类型分析-群众诉求top20
* @Param customerId
* @Param formDTO
* @author zxc
* @date 2021/8/18 11:16 上午
*/
List<CategoryTopAppealResultDTO> categoryTopAppeal(CategoryTopAppealFormDTO formDTO);
}

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

@ -25,6 +25,8 @@ import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResu
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.project.CustomerProjectCategoryDTO;
import com.epmet.project.dto.form.CategoryTopAppealFormDTO;
import com.epmet.project.dto.result.CategoryTopAppealResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -206,4 +208,35 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
}
return result;
}
/**
* @Description 事件分析-类型分析-群众诉求top20分类level = '1'
* 为了方便直接copy的事件分析接口 哈哈哈😂
* @Param customerId
* @Param formDTO
* @author zxc
* @date 2021/8/18 11:16 上午
*/
@Override
public List<CategoryTopAppealResultDTO> categoryTopAppeal(CategoryTopAppealFormDTO formDTO) {
String customerId = formDTO.getCustomerId();
List<CategoryTopAppealResultDTO> result = screenProjectCategoryOrgDailyDao.categoryTopAppeal(formDTO.getAgencyId(), customerId, formDTO.getTopCount());
if (CollectionUtils.isEmpty(result)){
return new ArrayList<>();
}
Result<List<String>> sonCustomer = operCrmOpenFeignClient.getAllSubCustomerIds(customerId);
List<String> subCustomerIds = new ArrayList<>();
if (sonCustomer.success() && !CollectionUtils.isEmpty(sonCustomer.getData())) {
subCustomerIds = sonCustomer.getData();
}
for (CategoryTopAppealResultDTO r : result) {
CustomerProjectCategoryDTO projectCategoryDTO = screenProjectCategoryOrgDailyDao.selectProjectCategory(r.getCategoryId(), customerId, subCustomerIds);
if (null == projectCategoryDTO || StringUtils.isBlank(projectCategoryDTO.getCategoryName())) {
log.warn(String.format("查询分类名称失败,当前客户:%s, categoryCode:%s", r.getCategoryId(), customerId));
continue;
}
r.setCategoryName(projectCategoryDTO.getCategoryName());
}
return result;
}
}

17
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml

@ -64,6 +64,23 @@
) temp
WHERE
temp.CATEGORY_CODE = #{categoryCode}
ORDER BY temp.`LEVEL` DESC
LIMIT 1
</select>
<!-- 查询事件分类 -->
<select id="categoryTopAppeal" resultType="com.epmet.project.dto.result.CategoryTopAppealResultDTO">
SELECT
CATEGORY_CODE AS categoryId,
PROJECT_TOTAL AS categoryCount
FROM
screen_project_category_org_daily
WHERE
DEL_FLAG = '0'
AND `LEVEL` = '1'
AND ORG_ID = #{agencyId}
AND CUSTOMER_ID = #{customerId}
AND DATE_ID = (select date_id from screen_project_category_org_daily where del_flag = '0' and ORG_ID = #{agencyId} and CUSTOMER_ID= #{customerId} order by date_id desc, created_time desc limit 1)
ORDER BY PROJECT_TOTAL DESC LIMIT #{topCount}
</select>
</mapper>

3
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridManagerUserListResultDTO.java

@ -62,4 +62,7 @@ public class GridManagerUserListResultDTO implements Serializable {
@JsonIgnore
private Boolean llStatus;
@JsonIgnore
private String recordId;
}

10
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffPatrolRecordDao.java

@ -44,6 +44,16 @@ public interface StaffPatrolRecordDao extends BaseDao<StaffPatrolRecordEntity> {
*/
List<GridManagerUserListResultDTO> selectLL(@Param("userIds")List<String> userIds);
List<GridManagerUserListResultDTO> selectPatrolRecord(@Param("userIds")List<String> userIds);
/**
* @Description 按照巡查记录查询经纬度
* @Param recordIds
* @author zxc
* @date 2021/8/18 5:16 下午
*/
List<GridManagerUserListResultDTO> selectPatrolLL(@Param("recordIds")List<String> recordIds);
/**
* @Description 巡查记录查询
* @Param formDTO

19
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

@ -411,10 +411,21 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec
if (CollectionUtils.isEmpty(userIds)){
return result;
}
// 经纬度查询
List<GridManagerUserListResultDTO> llResult = baseDao.selectLL(userIds);
if (!CollectionUtils.isEmpty(llResult)){
result.setLl(llResult);
// 查询记录
// List<GridManagerUserListResultDTO> llResult = baseDao.selectLL(userIds);
List<GridManagerUserListResultDTO> recordList = baseDao.selectPatrolRecord(userIds);
if (!CollectionUtils.isEmpty(recordList)){
// 查询经纬度
List<GridManagerUserListResultDTO> llList = baseDao.selectPatrolLL(recordList.stream().map(m -> m.getRecordId()).collect(Collectors.toList()));
recordList.forEach(r -> {
llList.forEach(l -> {
if (r.getRecordId().equals(l.getRecordId())){
r.setLatitude(l.getLatitude());
r.setLongitude(l.getLongitude());
}
});
});
result.setLl(recordList);
}
// 姓名查询
List<UserNameResultDTO> nameResult = customerStaffDao.selectUserName(userIds);

29
epmet-user/epmet-user-server/src/main/resources/mapper/StaffPatrolRecordDao.xml

@ -46,4 +46,33 @@
ORDER BY CREATED_TIME DESC
</select>
<select id="selectPatrolRecord" resultType="com.epmet.dto.result.GridManagerUserListResultDTO">
SELECT t.* FROM (SELECT
pr.ID AS recordId,
pr.GRID AS gridId,
pr.STAFF_ID,
pr.`STATUS`
FROM staff_patrol_record pr
WHERE pr.DEL_FLAG = 0
AND pr.staff_id IN (
<foreach collection="userIds" item="userId" separator=",">
#{userId}
</foreach>
)
ORDER BY pr.CREATED_TIME DESC)t GROUP BY STAFF_ID
</select>
<!-- 按照巡查记录查询经纬度 -->
<select id="selectPatrolLL" resultType="com.epmet.dto.result.GridManagerUserListResultDTO">
SELECT
t.*
FROM
( SELECT DISTINCT ID, SERIAL_NUM, LATITUDE, LONGITUDE, STAFF_PATROL_REC_ID AS recordId FROM staff_patrol_detail WHERE DEL_FLAG = 0 AND STAFF_PATROL_REC_ID IN (
<foreach collection="recordIds" item="recordId" separator=",">
#{recordId}
</foreach>
) ORDER BY SERIAL_NUM DESC ) t
GROUP BY recordId
</select>
</mapper>
Loading…
Cancel
Save