Browse Source

大屏接口满意度等接口

feature/dangjian
wanggongfeng 3 years ago
parent
commit
54b36aca49
  1. 42
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ScreenTotalFormDTO.java
  2. 32
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/CategoryAnalysisPieResultDTO.java
  3. 35
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/EvaluationTotalLineDetailResultDTO.java
  4. 36
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/EvaluationTotalLineResultDTO.java
  5. 30
      esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/EvaluationTotalPieResultDTO.java
  6. 121
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemScreenCountController.java
  7. 29
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemDao.java
  8. 25
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java
  9. 83
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java
  10. 120
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

42
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/form/ScreenTotalFormDTO.java

@ -0,0 +1,42 @@
package com.elink.esua.epdc.dto.item.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 大屏统计FormDTO
* @Author wgf
* @Date 2022-10-10
*/
@Data
public class ScreenTotalFormDTO implements Serializable {
private static final long serialVersionUID = -7871958578795227805L;
/**
* 部门ID
*/
private String deptId;
/**
* 开始时间
*/
private String startTime;
/**
* 结束时间
*/
private String endTime;
/**
* 年月满意度趋势使用
*/
private String yearMonth;
/**
* 时间数组
*/
private List<String> timeArr;
}

32
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/CategoryAnalysisPieResultDTO.java

@ -0,0 +1,32 @@
package com.elink.esua.epdc.dto.item.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 大屏-类别分析-返回值DTO
* @Author wgf
* @Date 2022-10-10
*/
@Data
public class CategoryAnalysisPieResultDTO implements Serializable {
private static final long serialVersionUID = -2494874960456321677L;
/**
* 名称
*/
private String name;
/**
*
*/
private String value;
/**
* 占比
*/
private String proportion;
}

35
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/EvaluationTotalLineDetailResultDTO.java

@ -0,0 +1,35 @@
package com.elink.esua.epdc.dto.item.result;
import lombok.Data;
import java.io.Serializable;
/**
* 大屏-满意度趋势-SQL返回值DTO
* @Author wgf
* @Date 2022-10-11
*/
@Data
public class EvaluationTotalLineDetailResultDTO implements Serializable {
private static final long serialVersionUID = -2494874960456321677L;
/**
* 时间
*/
private String time;
/**
* 非常满意
*/
private String fcmy;
/**
* 基本满意
*/
private String jbmy;
/**
* 不满意
*/
private String bmy;
}

36
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/EvaluationTotalLineResultDTO.java

@ -0,0 +1,36 @@
package com.elink.esua.epdc.dto.item.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 大屏-满意度趋势-返回值DTO
* @Author wgf
* @Date 2022-10-11
*/
@Data
public class EvaluationTotalLineResultDTO implements Serializable {
private static final long serialVersionUID = -2494874960456321677L;
/**
* 横坐标
*/
private List<String> xValue;
/**
* 非常满意
*/
private List<String> fcmyArr;
/**
* 基本满意
*/
private List<String> jbmyArr;
/**
* 不满意
*/
private List<String> bmyArr;
}

30
esua-epdc/epdc-module/epdc-events/epdc-events-client/src/main/java/com/elink/esua/epdc/dto/item/result/EvaluationTotalPieResultDTO.java

@ -0,0 +1,30 @@
package com.elink.esua.epdc.dto.item.result;
import lombok.Data;
import java.io.Serializable;
/**
* 大屏-满意度统计-返回值DTO
* @Author wgf
* @Date 2022-10-10
*/
@Data
public class EvaluationTotalPieResultDTO implements Serializable {
private static final long serialVersionUID = -2494874960456321677L;
/**
* 名称
*/
private String name;
/**
*
*/
private String value;
/**
* 占比
*/
private String proportion;
}

121
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/controller/ItemScreenCountController.java

@ -0,0 +1,121 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.item.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.events.EpdcEventsCommentsDTO;
import com.elink.esua.epdc.dto.events.form.EventDeleteCommentsFormDTO;
import com.elink.esua.epdc.dto.form.KpiMetaDataOfEventsFormDTO;
import com.elink.esua.epdc.dto.item.ItemDTO;
import com.elink.esua.epdc.dto.item.ItemPendingHandleDTO;
import com.elink.esua.epdc.dto.item.form.*;
import com.elink.esua.epdc.dto.item.result.*;
import com.elink.esua.epdc.dto.result.KpiEvaluationAmountResultDTO;
import com.elink.esua.epdc.dto.result.KpiItemHandleAmountResultDTO;
import com.elink.esua.epdc.modules.item.excel.ItemExcel;
import com.elink.esua.epdc.modules.item.excel.ItemTimeoutNewExcel;
import com.elink.esua.epdc.modules.item.excel.StayItemExcel;
import com.elink.esua.epdc.modules.item.service.ItemService;
import com.elink.esua.epdc.modules.item.service.ItemTimeoutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 大屏接口
*
* @author wgf
* @since v1.0.0 2022-10-10
*/
@RestController
@RequestMapping("itemScreen")
public class ItemScreenCountController {
@Autowired
private ItemService itemService;
/**
* 大屏诉求列表
*
* @Params: [params]
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData < com.elink.esua.epdc.dto.item.ItemPendingHandleDTO>>
* @Author: wgf
* @Date: 2022-10-10 9:56
*/
@GetMapping("itemPageList")
public Result<PageData<ItemPendingHandleDTO>> itemPageList(@RequestParam Map<String, Object> params) {
PageData<ItemPendingHandleDTO> page = itemService.itemPageList(params);
return new Result<PageData<ItemPendingHandleDTO>>().ok(page);
}
/**
* 大屏-类别分析
*
* @Params: [params]
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<>
* @Author: wgf
* @Date: 2022-10-10 9:56
*/
@GetMapping("categoryAnalysis")
public Result<List<CategoryAnalysisPieResultDTO>> categoryAnalysis(@RequestBody ScreenTotalFormDTO formDTO) {
List<CategoryAnalysisPieResultDTO> list = itemService.categoryAnalysis(formDTO);
return new Result<List<CategoryAnalysisPieResultDTO>>().ok(list);
}
/**
* 大屏-满意度统计
*
* @Params: [params]
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<>
* @Author: wgf
* @Date: 2022-10-10 9:56
*/
@GetMapping("evaluationTotal")
public Result<List<EvaluationTotalPieResultDTO>> evaluationTotal(@RequestBody ScreenTotalFormDTO formDTO) {
List<EvaluationTotalPieResultDTO> list = itemService.evaluationTotal(formDTO);
return new Result<List<EvaluationTotalPieResultDTO>>().ok(list);
}
/**
* 大屏-满意度趋势
*
* @Params: [params]
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<>
* @Author: wgf
* @Date: 2022-10-11 9:56
*/
@GetMapping("evaluationTrend")
public Result<EvaluationTotalLineResultDTO> evaluationTrend(@RequestBody ScreenTotalFormDTO formDTO) {
EvaluationTotalLineResultDTO list = itemService.evaluationTrend(formDTO);
return new Result<EvaluationTotalLineResultDTO>().ok(list);
}
}

29
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/dao/ItemDao.java

@ -148,6 +148,7 @@ public interface ItemDao extends BaseDao<ItemEntity> {
*/
List<ItemPendingHandleDTO> selectListOfPendingHandleItems(Map<String, Object> params);
List<ItemPendingHandleDTO> listEqPc(ItemWorkListFormDTO formDTO);
List<ItemPendingHandleDTO> itemPageList(Map<String, Object> params);
/**
* PC端项目驳回列表
@ -464,4 +465,32 @@ public interface ItemDao extends BaseDao<ItemEntity> {
* @date 2022/9/19 10:51
*/
List<ItemHandleProcessDTO> listItemHandleDept();
/**
* 类别分析
* @param formDTO
* @return
*/
List<CategoryAnalysisPieResultDTO> categoryAnalysis(ScreenTotalFormDTO formDTO);
/**
* 满意度统计
* @param formDTO
* @return
*/
List<EvaluationTotalPieResultDTO> evaluationTotal(ScreenTotalFormDTO formDTO);
/**
* 满意度趋势-日数据
* @param formDTO
* @return
*/
List<EvaluationTotalLineDetailResultDTO> getEvaluationDataListByDays(ScreenTotalFormDTO formDTO);
/**
* 满意度趋势-月数据
* @param formDTO
* @return
*/
List<EvaluationTotalLineDetailResultDTO> getEvaluationDataListByMonths(ScreenTotalFormDTO formDTO);
}

25
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java

@ -34,6 +34,7 @@ import com.elink.esua.epdc.modules.item.entity.ItemEntity;
import com.elink.esua.epdc.modules.rocketmq.dto.CategoryModifyDTO;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.Map;
@ -66,6 +67,7 @@ public interface ItemService extends BaseService<ItemEntity> {
*/
PageData<ItemPendingHandleDTO> listOfItemsForPCEnd(Map<String, Object> params);
List<ItemPendingHandleDTO> listEqPc(ItemWorkListFormDTO formDTO);
PageData<ItemPendingHandleDTO> itemPageList(Map<String, Object> params);
/**
* PC端项目驳回列表
@ -607,4 +609,27 @@ public interface ItemService extends BaseService<ItemEntity> {
* @date 2022/9/19 10:51
*/
String getSqid(String itemId);
/**
* 大屏-类别分析
* @param formDTO
* @return
*/
List<CategoryAnalysisPieResultDTO> categoryAnalysis(ScreenTotalFormDTO formDTO);
/**
* 大屏-满意度统计
* @param formDTO
* @return
*/
List<EvaluationTotalPieResultDTO> evaluationTotal(ScreenTotalFormDTO formDTO);
/**
* 大屏-满意度趋势
* @param formDTO
* @return
*/
EvaluationTotalLineResultDTO evaluationTrend(ScreenTotalFormDTO formDTO);
}

83
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java

@ -269,6 +269,13 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
return new PageData<>(list, page.getTotal());
}
@Override
public PageData<ItemPendingHandleDTO> itemPageList(Map<String, Object> params) {
IPage<ItemPendingHandleDTO> page = getPage(params);
List<ItemPendingHandleDTO> list = baseDao.itemPageList(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<ItemPendingHandleDTO> listEqPc(ItemWorkListFormDTO formDTO) {
UserDetail user = SecurityUser.getUser();
@ -3873,4 +3880,80 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
return "";
}
@Override
public List<CategoryAnalysisPieResultDTO> categoryAnalysis(ScreenTotalFormDTO formDTO) {
List<CategoryAnalysisPieResultDTO> list = baseDao.categoryAnalysis(formDTO);
return list;
}
@Override
public List<EvaluationTotalPieResultDTO> evaluationTotal(ScreenTotalFormDTO formDTO) {
List<EvaluationTotalPieResultDTO> list = baseDao.evaluationTotal(formDTO);
return list;
}
@Override
public EvaluationTotalLineResultDTO evaluationTrend(ScreenTotalFormDTO formDTO) {
EvaluationTotalLineResultDTO resultDTO = new EvaluationTotalLineResultDTO();
// 时间数组
List<String> timeArr = new ArrayList<>();
// 非常满意数组
List<String> fcmyArr = new ArrayList<>();
// 不满意数组
List<String> bmyArr = new ArrayList<>();
// 基本满意数组
List<String> jbmyArr = new ArrayList<>();
List<EvaluationTotalLineDetailResultDTO> dataList = new ArrayList<>();
if(formDTO.getYearMonth().length() > 4){
String[] arr = formDTO.getYearMonth().split("-");
// 按日统计
timeArr = YearMonthUtils.getMonthFullDay(Integer.parseInt(arr[0]),Integer.parseInt(arr[1]));
formDTO.setTimeArr(timeArr);
dataList = baseDao.getEvaluationDataListByDays(formDTO);
}else{
// 按月统计
timeArr = YearMonthUtils.getMonthBetween(formDTO.getYearMonth() + "-01",formDTO.getYearMonth() + "-12");
formDTO.setTimeArr(timeArr);
dataList = baseDao.getEvaluationDataListByMonths(formDTO);
}
for(int i = 0 ; i < timeArr.size() ; i++){
Boolean flag = false; // 是否完成该时间赋值
for(EvaluationTotalLineDetailResultDTO dto : dataList){
if(timeArr.get(i).equals(dto.getTime())){
fcmyArr.add(dto.getFcmy());
jbmyArr.add(dto.getJbmy());
bmyArr.add(dto.getBmy());
flag = true;
break;
}
}
// 判断该时间是否赋值
if(!flag){
fcmyArr.add("0");
jbmyArr.add("0");
bmyArr.add("0");
}
}
// 组装数据
resultDTO.setXValue(timeArr);
resultDTO.setBmyArr(bmyArr);
resultDTO.setJbmyArr(jbmyArr);
resultDTO.setFcmyArr(fcmyArr);
return resultDTO;
}
}

120
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

@ -701,6 +701,22 @@
LIMIT #{pageIndex},#{pageSize}
</select>
<select id="itemPageList" resultType="com.elink.esua.epdc.dto.item.ItemPendingHandleDTO">
SELECT
item.ID,
item.ITEM_CONTENT
FROM epdc_item item
WHERE item.DEL_FLAG = '0'
and item.IS_PEOPLE = '1'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="deptId != null and deptId != ''">
AND find_in_set(#{deptId},item.ALL_DEPT_IDS)
</if>
ORDER BY item.CREATED_TIME DESC
</select>
<select id="listOfItemsForPCReject" resultType="com.elink.esua.epdc.dto.item.ItemPendingHandleDTO">
SELECT
item.ID,
@ -2021,4 +2037,108 @@
b.ITEM_ID
</select>
<select id="categoryAnalysis" resultType="com.elink.esua.epdc.dto.item.result.CategoryAnalysisPieResultDTO"
parameterType="com.elink.esua.epdc.dto.item.form.ScreenTotalFormDTO">
select
SUBSTRING_INDEX(item.CATEGORY_FULL_NAME,'-',1) as name,
count(item.ID) as value
from epdc_item item
where item.DEL_FLAG = '0'
and item.IS_PEOPLE = '1'
and item.EVENT_ID is null
and item.ISSUE_ID is null
and SUBSTRING_INDEX(item.CATEGORY_FULL_NAME,'-',1) != '其他'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="deptId != null and deptId != ''">
AND find_in_set(#{deptId},item.ALL_DEPT_IDS)
</if>
group by SUBSTRING_INDEX(item.CATEGORY_FULL_NAME,'-',1)
ORDER BY count(item.ID) desc
</select>
<select id="evaluationTotal" resultType="com.elink.esua.epdc.dto.item.result.EvaluationTotalPieResultDTO"
parameterType="com.elink.esua.epdc.dto.item.form.ScreenTotalFormDTO">
select
case item.EVALUATION_SCORE
when '0' then '不满意'
when '1' then '基本满意'
when '2' then '非常满意'
else ''
end as name,
count(item.ID) as value
from epdc_item item
where item.DEL_FLAG = '0'
and item.IS_PEOPLE = '1'
and item.EVENT_ID is null
and item.ISSUE_ID is null
and SUBSTRING_INDEX(item.CATEGORY_FULL_NAME,'-',1) != '其他'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="deptId != null and deptId != ''">
AND find_in_set(#{deptId},item.ALL_DEPT_IDS)
</if>
and item.EVALUATION_SCORE is not null
group by item.EVALUATION_SCORE
ORDER BY count(item.ID) desc
</select>
<select id="getEvaluationDataListByDays" resultType="com.elink.esua.epdc.dto.item.result.EvaluationTotalLineDetailResultDTO"
parameterType="com.elink.esua.epdc.dto.item.form.ScreenTotalFormDTO">
select
DATE_FORMAT(item.CREATED_TIME,'%Y-%m-%d') as time,
count(item.EVALUATION_SCORE = 0 or null) as bmy,
count(item.EVALUATION_SCORE = 1 or null) as jbmy,
count(item.EVALUATION_SCORE = 2 or null) as fcmy
from epdc_item item
where item.DEL_FLAG = '0'
and item.IS_PEOPLE = '1'
and item.EVENT_ID is null
and item.ISSUE_ID is null
and SUBSTRING_INDEX(item.CATEGORY_FULL_NAME,'-',1) != '其他'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="deptId != null and deptId != ''">
AND find_in_set(#{deptId},item.ALL_DEPT_IDS)
</if>
AND DATE_FORMAT(item.CREATED_TIME,'%Y-%m-%d') IN
<foreach collection="timeArr" index="index" item="time" open="(" separator="," close=")">
#{time}
</foreach>
and item.EVALUATION_SCORE is not null
group by DATE_FORMAT(item.CREATED_TIME,'%Y-%m-%d')
ORDER BY DATE_FORMAT(item.CREATED_TIME,'%Y-%m-%d') asc
</select>
<select id="getEvaluationDataListByMonths" resultType="com.elink.esua.epdc.dto.item.result.EvaluationTotalLineDetailResultDTO"
parameterType="com.elink.esua.epdc.dto.item.form.ScreenTotalFormDTO">
select
DATE_FORMAT(item.CREATED_TIME,'%Y-%m') as time,
count(item.EVALUATION_SCORE = 0 or null) as bmy,
count(item.EVALUATION_SCORE = 1 or null) as jbmy,
count(item.EVALUATION_SCORE = 2 or null) as fcmy
from epdc_item item
where item.DEL_FLAG = '0'
and item.IS_PEOPLE = '1'
and item.EVENT_ID is null
and item.ISSUE_ID is null
and SUBSTRING_INDEX(item.CATEGORY_FULL_NAME,'-',1) != '其他'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( item.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="deptId != null and deptId != ''">
AND find_in_set(#{deptId},item.ALL_DEPT_IDS)
</if>
AND DATE_FORMAT(item.CREATED_TIME,'%Y-%m') IN
<foreach collection="timeArr" index="index" item="time" open="(" separator="," close=")">
#{time}
</foreach>
and item.EVALUATION_SCORE is not null
group by DATE_FORMAT(item.CREATED_TIME,'%Y-%m')
ORDER BY DATE_FORMAT(item.CREATED_TIME,'%Y-%m') asc
</select>
</mapper>

Loading…
Cancel
Save