87 changed files with 5010 additions and 17 deletions
@ -0,0 +1,91 @@ |
|||
package com.epmet.commons.tools.utils.poi.excel.handler;/** |
|||
* @author ZhaoQiFeng |
|||
* @date 2022/12/14 |
|||
* @apiNote |
|||
*/ |
|||
|
|||
import com.alibaba.excel.metadata.Head; |
|||
import com.alibaba.excel.write.merge.AbstractMergeStrategy; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.apache.poi.ss.usermodel.Cell; |
|||
import org.apache.poi.ss.usermodel.Sheet; |
|||
import org.apache.poi.ss.util.CellRangeAddress; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 自定义合并策略 该类继承了AbstractMergeStrategy抽象合并策略,需要重写merge()方法 |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/14 15:10 |
|||
*/ |
|||
public class CustomMergeStrategy extends AbstractMergeStrategy { |
|||
|
|||
/** |
|||
* 分组,每几行合并一次 |
|||
*/ |
|||
private List<Integer> exportFieldGroupCountList; |
|||
|
|||
/** |
|||
* 目标合并列index |
|||
*/ |
|||
private Integer targetColumnIndex; |
|||
|
|||
// 需要开始合并单元格的首行index
|
|||
private Integer rowIndex; |
|||
|
|||
// exportDataList为待合并目标列的值
|
|||
public CustomMergeStrategy(List<String> exportDataList, Integer targetColumnIndex) { |
|||
this.exportFieldGroupCountList = getGroupCountList(exportDataList); |
|||
this.targetColumnIndex = targetColumnIndex; |
|||
} |
|||
|
|||
|
|||
@Override |
|||
protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) { |
|||
|
|||
if (null == rowIndex) { |
|||
rowIndex = cell.getRowIndex(); |
|||
} |
|||
// 仅从首行以及目标列的单元格开始合并,忽略其他
|
|||
if (cell.getRowIndex() == rowIndex && cell.getColumnIndex() == targetColumnIndex) { |
|||
mergeGroupColumn(sheet); |
|||
} |
|||
} |
|||
|
|||
private void mergeGroupColumn(Sheet sheet) { |
|||
int rowCount = rowIndex; |
|||
for (Integer count : exportFieldGroupCountList) { |
|||
if(count == 1) { |
|||
rowCount += count; |
|||
continue ; |
|||
} |
|||
// 合并单元格
|
|||
CellRangeAddress cellRangeAddress = new CellRangeAddress(rowCount, rowCount + count - 1, targetColumnIndex, targetColumnIndex); |
|||
sheet.addMergedRegionUnsafe(cellRangeAddress); |
|||
rowCount += count; |
|||
} |
|||
} |
|||
|
|||
// 该方法将目标列根据值是否相同连续可合并,存储可合并的行数
|
|||
private List<Integer> getGroupCountList(List<String> exportDataList){ |
|||
if (CollectionUtils.isEmpty(exportDataList)) { |
|||
return new ArrayList<>(); |
|||
} |
|||
|
|||
List<Integer> groupCountList = new ArrayList<>(); |
|||
int count = 1; |
|||
|
|||
for (int i = 1; i < exportDataList.size(); i++) { |
|||
if (exportDataList.get(i).equals(exportDataList.get(i - 1))) { |
|||
count++; |
|||
} else { |
|||
groupCountList.add(count); |
|||
count = 1; |
|||
} |
|||
} |
|||
// 处理完最后一条后
|
|||
groupCountList.add(count); |
|||
return groupCountList; |
|||
} |
|||
} |
@ -0,0 +1,61 @@ |
|||
package com.epmet.commons.tools.utils.poi.excel.handler; |
|||
|
|||
import com.alibaba.excel.metadata.Head; |
|||
import com.alibaba.excel.metadata.data.CellData; |
|||
import com.alibaba.excel.metadata.data.WriteCellData; |
|||
import com.alibaba.excel.write.handler.CellWriteHandler; |
|||
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
|||
import com.alibaba.excel.write.metadata.holder.WriteTableHolder; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.apache.poi.ss.usermodel.Cell; |
|||
import org.apache.poi.ss.usermodel.CellType; |
|||
import org.apache.poi.ss.usermodel.Row; |
|||
import org.apache.poi.ss.usermodel.Sheet; |
|||
import org.apache.poi.ss.util.CellRangeAddress; |
|||
import org.springframework.util.PropertyPlaceholderHelper; |
|||
|
|||
import java.util.List; |
|||
import java.util.Properties; |
|||
|
|||
/** |
|||
* desc:标头策略 |
|||
* |
|||
*/ |
|||
public class CustomerTitleHandler implements CellWriteHandler { |
|||
private String title = "xixihaha"; |
|||
PropertyPlaceholderHelper placeholderHelper = new PropertyPlaceholderHelper("${", "}"); |
|||
public CustomerTitleHandler(String title) { |
|||
this.title = title; |
|||
} |
|||
/*public CustomerTitleHandler(String title) { |
|||
this.title = "nihao s"; |
|||
}*/ |
|||
@Override |
|||
public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder,Row row, Head head, Integer integer, Integer integer1, Boolean aBoolean) { |
|||
if (head != null) { |
|||
List<String> headNameList = head.getHeadNameList(); |
|||
if (CollectionUtils.isNotEmpty(headNameList)) { |
|||
Properties properties = new Properties(); |
|||
properties.setProperty("title", title); |
|||
headNameList.set(1, placeholderHelper.replacePlaceholders(headNameList.get(1), properties)); |
|||
} |
|||
} |
|||
} |
|||
@Override |
|||
public void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, |
|||
Cell cell, Head head, Integer integer, Boolean aBoolean) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterCellDataConverted(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, |
|||
WriteCellData cellData, Cell cell, Head head, Integer integer, Boolean aBoolean) { |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void afterCellDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, |
|||
List<WriteCellData<?>> list, Cell cell, Head head, Integer integer, Boolean aBoolean) { |
|||
|
|||
} |
|||
} |
@ -0,0 +1,10 @@ |
|||
package com.epmet.dataaggre.constant; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2020/12/25 上午10:47 |
|||
*/ |
|||
public interface EventConstant { |
|||
String PROJECT = "project"; |
|||
String WORK = "work"; |
|||
} |
@ -0,0 +1,69 @@ |
|||
package com.epmet.dataaggre.dto.evaluationindex; |
|||
|
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2021/11/4 3:13 下午 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class EventCategoryResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 类型,project:事件, work:例行工作 |
|||
*/ |
|||
private String eventType; |
|||
|
|||
/** |
|||
* 分类CODE |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
/** |
|||
* 分类code父级 |
|||
*/ |
|||
private String parentCategoryCode; |
|||
|
|||
/** |
|||
* 分类名字 |
|||
*/ |
|||
private String categoryName; |
|||
|
|||
/** |
|||
* 分类名字父级 |
|||
*/ |
|||
private String parentCategoryName; |
|||
|
|||
/** |
|||
* 项目数 |
|||
*/ |
|||
private Integer eventTotal; |
|||
|
|||
/** |
|||
* 分值 |
|||
*/ |
|||
private Integer score; |
|||
|
|||
private Integer totalScore; |
|||
|
|||
private List<EventCategoryResultDTO> children; |
|||
@JsonIgnore |
|||
private Integer index; |
|||
|
|||
public EventCategoryResultDTO() { |
|||
this.categoryCode = ""; |
|||
this.categoryName = ""; |
|||
this.eventTotal = NumConstant.ZERO; |
|||
this.totalScore = NumConstant.ZERO; |
|||
this.children = new ArrayList<>(); |
|||
} |
|||
} |
@ -0,0 +1,54 @@ |
|||
package com.epmet.dataaggre.dto.evaluationindex.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author Administrator |
|||
*/ |
|||
@Data |
|||
public class EventCategoryFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
public interface EventCategoryForm{} |
|||
public interface CategoryEventExportForm {} |
|||
|
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String orgId; |
|||
|
|||
/** |
|||
* 组织类型 组织:agency,网格:grid |
|||
*/ |
|||
private String orgType; |
|||
private String areaCode; |
|||
/** |
|||
* 组织级别 |
|||
*/ |
|||
private String orgLevel; |
|||
@NotBlank(message = "结束时间不能为空",groups = {EventCategoryForm.class,CategoryEventExportForm.class}) |
|||
private String endTime; |
|||
|
|||
/** |
|||
* 开始时间 |
|||
*/ |
|||
private String startTime; |
|||
|
|||
/** |
|||
* 组织名称 |
|||
*/ |
|||
@NotBlank(message = "组织名称不能为空",groups = CategoryEventExportForm.class) |
|||
private String orgName; |
|||
|
|||
private String name; |
|||
private String mobile; |
|||
} |
@ -0,0 +1,65 @@ |
|||
package com.epmet.dataaggre.dto.evaluationindex.form; |
|||
|
|||
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author Administrator |
|||
*/ |
|||
@Data |
|||
public class EventCategoryListFormDTO extends PageFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
public interface EventCategoryForm{} |
|||
public interface CategoryEventExportForm {} |
|||
public interface CategoryEventListExportForm {} |
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String orgId; |
|||
|
|||
/** |
|||
* 组织类型 组织:agency,网格:grid |
|||
*/ |
|||
private String orgType; |
|||
|
|||
@NotBlank(message = "结束时间不能为空",groups = {EventCategoryForm.class,CategoryEventExportForm.class}) |
|||
private String endTime; |
|||
|
|||
/** |
|||
* 类型,project:事件, work:例行工作 |
|||
*/ |
|||
@NotNull(message = "事件类型不能为空",groups = CategoryEventListExportForm.class) |
|||
private String eventType; |
|||
|
|||
/** |
|||
* 开始时间 |
|||
*/ |
|||
private String startTime; |
|||
|
|||
/** |
|||
* 组织名称 |
|||
*/ |
|||
@NotBlank(message = "组织名称不能为空",groups = CategoryEventExportForm.class) |
|||
private String orgName; |
|||
|
|||
@NotNull(message = "categoryCode不能为空",groups = {EventCategoryForm.class, CategoryEventListExportForm.class}) |
|||
private String categoryCode; |
|||
|
|||
@NotNull(message = "categoryName不能为空",groups = CategoryEventListExportForm.class) |
|||
private String categoryName; |
|||
private String parentCategoryName; |
|||
|
|||
private String name; |
|||
private String mobile; |
|||
} |
@ -0,0 +1,59 @@ |
|||
package com.epmet.dataaggre.dto.evaluationindex.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author Administrator |
|||
*/ |
|||
@Data |
|||
public class EventCategoryListResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 事件ID |
|||
*/ |
|||
private String eventId; |
|||
|
|||
/** |
|||
* 事件类型 项目:project,例行工作:work |
|||
*/ |
|||
private String eventType; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 类别 |
|||
*/ |
|||
private String category; |
|||
|
|||
/** |
|||
* 项目状态:待处理 pending,结案closed |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 项目状态:待处理 pending,结案closed |
|||
*/ |
|||
private String statusDesc; |
|||
|
|||
/** |
|||
* 所属网格 |
|||
*/ |
|||
private String gridName; |
|||
private String gridId; |
|||
/** |
|||
* 项目创建时间 |
|||
*/ |
|||
private String createTime; |
|||
|
|||
private String staffName; |
|||
|
|||
private Integer score; |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.epmet.dataaggre.dto.evaluationindex.result;/** |
|||
* @author ZhaoQiFeng |
|||
* @date 2022/12/14 |
|||
* @apiNote |
|||
*/ |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/14 13:39 |
|||
*/ |
|||
@Data |
|||
public class EventScoreTotalResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 2570384890580378137L; |
|||
private String orgName; |
|||
private String date; |
|||
/** |
|||
* 总分 |
|||
*/ |
|||
private String totalScore; |
|||
/** |
|||
* 网格员数量 |
|||
*/ |
|||
private String memberCount; |
|||
/** |
|||
* 考核得分 |
|||
*/ |
|||
private String aveScore; |
|||
} |
@ -0,0 +1,44 @@ |
|||
package com.epmet.dataaggre.dto.evaluationindex.result;/** |
|||
* @author ZhaoQiFeng |
|||
* @date 2022/12/14 |
|||
* @apiNote |
|||
*/ |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/14 13:39 |
|||
*/ |
|||
@Data |
|||
public class OrgEventScoreResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 2570384890580378137L; |
|||
private String orgName; |
|||
/** |
|||
* 上报事件数 |
|||
*/ |
|||
private String projectCount; |
|||
/** |
|||
* 上报事件总分 |
|||
*/ |
|||
private String projectScore; |
|||
/** |
|||
* 例行工作数 |
|||
*/ |
|||
private String workCount; |
|||
/** |
|||
* 例行工作总分 |
|||
*/ |
|||
private String workScore; |
|||
/** |
|||
* 网格员数量 |
|||
*/ |
|||
private String memberCount; |
|||
/** |
|||
* 考核得分 |
|||
*/ |
|||
private String aveScore; |
|||
} |
@ -0,0 +1,183 @@ |
|||
package com.epmet.dataaggre.controller; |
|||
|
|||
import com.alibaba.excel.EasyExcelFactory; |
|||
import com.alibaba.excel.ExcelWriter; |
|||
import com.alibaba.excel.write.metadata.WriteSheet; |
|||
import com.alibaba.excel.write.metadata.fill.FillConfig; |
|||
import com.alibaba.fastjson.JSON; |
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.DateUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.utils.poi.excel.handler.CustomMergeStrategy; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dataaggre.dto.evaluationindex.EventCategoryResultDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryFormDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryListFormDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.result.EventCategoryListResultDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.result.EventScoreTotalResultDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.result.OrgEventScoreResultDTO; |
|||
import com.epmet.dataaggre.service.evaluationindex.PingYinEventService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.core.io.ClassPathResource; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.servlet.ServletOutputStream; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.IOException; |
|||
import java.io.InputStream; |
|||
import java.io.PrintWriter; |
|||
import java.io.UnsupportedEncodingException; |
|||
import java.net.URLEncoder; |
|||
import java.util.List; |
|||
import java.util.stream.Collectors; |
|||
|
|||
|
|||
/** |
|||
* @author Administrator |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("pyevent") |
|||
@Slf4j |
|||
public class PingYinEventController { |
|||
@Resource |
|||
private PingYinEventService pingYinEventService; |
|||
|
|||
/** |
|||
* 事件赋值得分 |
|||
* |
|||
* @Param tokenDto |
|||
* @Return {@link Result<List<EventCategoryResultDTO>>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/9 9:42 |
|||
*/ |
|||
@PostMapping("getEventCategorySore") |
|||
public Result<List<EventCategoryResultDTO>> getEventCategorySore(@LoginUser TokenDto tokenDto, @RequestBody EventCategoryFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, EventCategoryFormDTO.EventCategoryForm.class); |
|||
return new Result<List<EventCategoryResultDTO>>().ok(pingYinEventService.getEventCategorySore(tokenDto, formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* 事件分类列表 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link Result< PageData< EventCategoryListResultDTO>>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/13 9:55 |
|||
*/ |
|||
@PostMapping("getEventCategoryList") |
|||
public Result<PageData<EventCategoryListResultDTO>> getEventCategoryList(@LoginUser TokenDto tokenDto, @RequestBody EventCategoryListFormDTO formDTO){ |
|||
ValidatorUtils.validateEntity(formDTO, EventCategoryListFormDTO.EventCategoryForm.class); |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
return new Result<PageData<EventCategoryListResultDTO>>().ok(pingYinEventService.getEventCategoryList(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* 事件赋值得分总计 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link Result< EventScoreTotalResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/14 13:46 |
|||
*/ |
|||
@PostMapping("getEventScoreTotal") |
|||
public Result<EventScoreTotalResultDTO> getEventScoreTotal(@LoginUser TokenDto tokenDto, @RequestBody EventCategoryFormDTO formDTO){ |
|||
ValidatorUtils.validateEntity(formDTO, EventCategoryListFormDTO.EventCategoryForm.class); |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
return new Result<EventScoreTotalResultDTO>().ok(pingYinEventService.getEventScoreTotal(formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* 事件赋值得分导出 |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Param response |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/14 16:08 |
|||
*/ |
|||
@PostMapping("eventScoreExport") |
|||
public void eventScoreExport(@LoginUser TokenDto tokenDto, |
|||
@RequestBody EventCategoryFormDTO formDTO, HttpServletResponse response) throws Exception{ |
|||
ValidatorUtils.validateEntity(formDTO, EventCategoryListFormDTO.EventCategoryForm.class); |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
String fileName = formDTO.getOrgName() + "事件赋值得分.xlsx"; |
|||
ExcelWriter excelWriter = null; |
|||
//获取模板
|
|||
ClassPathResource classPathResource = new ClassPathResource("excel/eventScore.xlsx"); |
|||
InputStream inputStream = classPathResource.getInputStream(); |
|||
try { |
|||
|
|||
try { |
|||
fileName = URLEncoder.encode("事件赋值得分.xlsx", "UTF-8"); |
|||
} catch (UnsupportedEncodingException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
response.setHeader("Content-disposition", "attachment; filename=" + fileName); |
|||
response.setContentType("application/msexcel;charset=UTF-8"); |
|||
response.setHeader("Pragma", "No-cache"); |
|||
response.setHeader("Cache-Control", "no-cache"); |
|||
response.setDateHeader("Expires", 0); |
|||
ServletOutputStream outputStream = response.getOutputStream(); |
|||
//总计
|
|||
EventScoreTotalResultDTO scoreTotal = pingYinEventService.getEventScoreTotal(formDTO); |
|||
scoreTotal.setOrgName(formDTO.getOrgName()); |
|||
String endTime =DateUtils.format(DateUtils.parse(formDTO.getEndTime(), DateUtils.DATE_PATTERN_YYYYMMDD), DateUtils.DATE_NAME_PATTERN); |
|||
if (StringUtils.isNotEmpty(formDTO.getStartTime())) { |
|||
String startTime =DateUtils.format(DateUtils.parse(formDTO.getStartTime(), DateUtils.DATE_PATTERN_YYYYMMDD), DateUtils.DATE_NAME_PATTERN); |
|||
scoreTotal.setDate(startTime.concat("—").concat(endTime)); |
|||
} else { |
|||
scoreTotal.setDate("截止到" + endTime); |
|||
} |
|||
//分类统计
|
|||
List<EventCategoryResultDTO> categoryList = pingYinEventService.getEventCategorySoreExport(tokenDto, formDTO); |
|||
//设置输出流和模板信息
|
|||
excelWriter = EasyExcelFactory.write(outputStream).withTemplate(inputStream).build(); |
|||
WriteSheet writeSheet = EasyExcelFactory.writerSheet(0) |
|||
.registerWriteHandler(new CustomMergeStrategy(categoryList.stream().map(EventCategoryResultDTO::getEventType).collect(Collectors.toList()), 0)) |
|||
.registerWriteHandler(new CustomMergeStrategy(categoryList.stream().map(EventCategoryResultDTO::getParentCategoryName).collect(Collectors.toList()), 1)) |
|||
.build(); |
|||
//开启自动换行,自动换行表示每次写入一条list数据是都会重新生成一行空行,此选项默认是关闭的,需要提前设置为true
|
|||
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); |
|||
excelWriter.fill(categoryList, fillConfig, writeSheet); |
|||
excelWriter.fill(scoreTotal, writeSheet); |
|||
|
|||
List<OrgEventScoreResultDTO> orgScoreList = pingYinEventService.getOrgEventScoreList(formDTO); |
|||
WriteSheet writeSheet1 = EasyExcelFactory.writerSheet(1).build(); |
|||
excelWriter.fill(orgScoreList, fillConfig, writeSheet1); |
|||
excelWriter.fill(scoreTotal, writeSheet1); |
|||
} catch (EpmetException e) { |
|||
response.reset(); |
|||
response.setCharacterEncoding("UTF-8"); |
|||
response.setHeader("content-type", "application/json; charset=UTF-8"); |
|||
PrintWriter printWriter = response.getWriter(); |
|||
Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); |
|||
printWriter.write(JSON.toJSONString(result)); |
|||
printWriter.close(); |
|||
} catch (Exception e) { |
|||
log.error("export exception", e); |
|||
} finally { |
|||
if (excelWriter != null) { |
|||
excelWriter.finish(); |
|||
} |
|||
try { |
|||
inputStream.close(); |
|||
} catch (IOException e) { |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,157 @@ |
|||
/** |
|||
* 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.epmet.dataaggre.dao.evaluationindex; |
|||
|
|||
import com.epmet.dataaggre.dto.evaluationindex.EventCategoryResultDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryFormDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryListFormDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.result.EventCategoryListResultDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.result.OrgEventScoreResultDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 指标统计服务 |
|||
*/ |
|||
@Mapper |
|||
public interface PingYinEventDao { |
|||
/** |
|||
* 获取项目分类 |
|||
* |
|||
* @Param customerId |
|||
* @Return {@link List< EventCategoryResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/9 13:40 |
|||
*/ |
|||
List<EventCategoryResultDTO> selectProjectCategory(@Param("customerId")String customerId); |
|||
|
|||
/** |
|||
* 获取例行工作分类 |
|||
* |
|||
* @Param |
|||
* @Return {@link List< EventCategoryResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/9 13:41 |
|||
*/ |
|||
List<EventCategoryResultDTO> selectWorkCategory(); |
|||
|
|||
/** |
|||
* 项目赋值得分 |
|||
* @Param formDTO |
|||
* @Return {@link List< EventCategoryResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/9 11:00 |
|||
*/ |
|||
List<EventCategoryResultDTO> selectProjectCategoryScoreList(EventCategoryFormDTO formDTO); |
|||
|
|||
/** |
|||
* 例行工作赋值得分 |
|||
* @Param formDTO |
|||
* @Return {@link List< EventCategoryResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/9 11:00 |
|||
*/ |
|||
List<EventCategoryResultDTO> selectWorkCategoryScoreList(EventCategoryFormDTO formDTO); |
|||
|
|||
/** |
|||
* 项目分类列表 |
|||
* |
|||
* @Param formDTO |
|||
* @Return {@link List< EventCategoryListResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/13 10:12 |
|||
*/ |
|||
List<EventCategoryListResultDTO> getProjectCategoryList(EventCategoryListFormDTO formDTO); |
|||
|
|||
/** |
|||
* 例行工作 |
|||
* |
|||
* @Param formDTO |
|||
* @Return {@link List< EventCategoryListResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/13 10:12 |
|||
*/ |
|||
List<EventCategoryListResultDTO> getWorkCategoryList(EventCategoryListFormDTO formDTO); |
|||
|
|||
/** |
|||
* 上报事件总分 |
|||
* |
|||
* @Param formDTO |
|||
* @Return {@link Long} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/14 13:56 |
|||
*/ |
|||
Long getProjectTotalScore(EventCategoryFormDTO formDTO); |
|||
|
|||
/** |
|||
* 例行工作总分 |
|||
* |
|||
* @Param formDTO |
|||
* @Return {@link Long} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/14 13:56 |
|||
*/ |
|||
Long getWorkTotalScore(EventCategoryFormDTO formDTO); |
|||
|
|||
/** |
|||
* 网格员数 |
|||
* |
|||
* @Param formDTO |
|||
* @Return {@link Long} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/14 13:56 |
|||
*/ |
|||
Long getMemberCount(EventCategoryFormDTO formDTO); |
|||
|
|||
/** |
|||
* 获取项目分类 |
|||
* |
|||
* @Param customerId |
|||
* @Return {@link List< EventCategoryResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/9 13:40 |
|||
*/ |
|||
List<EventCategoryResultDTO> selectProjectCategoryForExport(@Param("customerId")String customerId); |
|||
|
|||
/** |
|||
* 获取例行工作分类 |
|||
* |
|||
* @Param |
|||
* @Return {@link List< EventCategoryResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/9 13:41 |
|||
*/ |
|||
List<EventCategoryResultDTO> selectWorkCategoryForExport(); |
|||
|
|||
/** |
|||
* 下级得分 |
|||
* |
|||
* @Param formDTO |
|||
* @Return {@link List< OrgEventScoreResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/15 9:31 |
|||
*/ |
|||
List<OrgEventScoreResultDTO> selectOrgEventScoreList(EventCategoryFormDTO formDTO); |
|||
|
|||
List<OrgEventScoreResultDTO> selectGridEventScoreList(EventCategoryFormDTO formDTO); |
|||
|
|||
String getAreaCode(@Param("agencyId")String agencyId); |
|||
} |
@ -0,0 +1,70 @@ |
|||
package com.epmet.dataaggre.service.evaluationindex; |
|||
|
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.dataaggre.dto.evaluationindex.EventCategoryResultDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryFormDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryListFormDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.result.EventCategoryListResultDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.result.EventScoreTotalResultDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.result.OrgEventScoreResultDTO; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author Administrator |
|||
*/ |
|||
public interface PingYinEventService { |
|||
|
|||
/** |
|||
* 事件赋值得分 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link List<EventCategoryResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/9 9:55 |
|||
*/ |
|||
List<EventCategoryResultDTO> getEventCategorySore (TokenDto tokenDto, EventCategoryFormDTO formDTO); |
|||
|
|||
/** |
|||
* 事件分类列表 |
|||
* |
|||
* @Param formDTO |
|||
* @Return {@link PageData< EventCategoryListResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/13 9:55 |
|||
*/ |
|||
PageData<EventCategoryListResultDTO> getEventCategoryList(EventCategoryListFormDTO formDTO); |
|||
|
|||
/** |
|||
* 事件赋值得分总计 |
|||
* |
|||
* @Param formDTO |
|||
* @Return {@link EventScoreTotalResultDTO} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/14 13:46 |
|||
*/ |
|||
EventScoreTotalResultDTO getEventScoreTotal(EventCategoryFormDTO formDTO); |
|||
|
|||
/** |
|||
* 事件赋值得分导出 |
|||
* |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link List<EventCategoryResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/9 9:55 |
|||
*/ |
|||
List<EventCategoryResultDTO> getEventCategorySoreExport (TokenDto tokenDto, EventCategoryFormDTO formDTO); |
|||
|
|||
/** |
|||
* 下级得分 |
|||
* |
|||
* @Param formDTO |
|||
* @Return {@link List< OrgEventScoreResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/15 11:05 |
|||
*/ |
|||
List<OrgEventScoreResultDTO> getOrgEventScoreList(EventCategoryFormDTO formDTO); |
|||
} |
@ -0,0 +1,262 @@ |
|||
package com.epmet.dataaggre.service.evaluationindex.impl; |
|||
|
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|||
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|||
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.dataaggre.constant.DataSourceConstant; |
|||
import com.epmet.dataaggre.constant.EventConstant; |
|||
import com.epmet.dataaggre.constant.OrgConstant; |
|||
import com.epmet.dataaggre.dao.evaluationindex.PingYinEventDao; |
|||
import com.epmet.dataaggre.dto.evaluationindex.EventCategoryResultDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryFormDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.form.EventCategoryListFormDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.result.EventCategoryListResultDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.result.EventScoreTotalResultDTO; |
|||
import com.epmet.dataaggre.dto.evaluationindex.result.OrgEventScoreResultDTO; |
|||
import com.epmet.dataaggre.service.evaluationindex.PingYinEventService; |
|||
import com.github.pagehelper.PageHelper; |
|||
import com.github.pagehelper.PageInfo; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.math.BigDecimal; |
|||
import java.math.RoundingMode; |
|||
import java.util.ArrayList; |
|||
import java.util.Collections; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 指标统计服务 |
|||
*/ |
|||
@Service |
|||
@DataSource(DataSourceConstant.EVALUATION_INDEX_READ) |
|||
@Slf4j |
|||
public class PingYinEventServiceImpl implements PingYinEventService { |
|||
|
|||
@Resource |
|||
private PingYinEventDao pingYinEventDao; |
|||
|
|||
/** |
|||
* 事件赋值得分 |
|||
* |
|||
* @param tokenDto |
|||
* @param formDTO |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link List < EventCategoryResultDTO >} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/9 9:55 |
|||
*/ |
|||
@Override |
|||
public List<EventCategoryResultDTO> getEventCategorySore(TokenDto tokenDto, EventCategoryFormDTO formDTO) { |
|||
List<EventCategoryResultDTO> result = new ArrayList<>(); |
|||
if (StringUtils.isBlank(formDTO.getOrgId())){ |
|||
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); |
|||
if (null == staffInfo){ |
|||
throw new EpmetException("未查询到此工作人员的所属组织信息..."); |
|||
} |
|||
formDTO.setOrgId(staffInfo.getAgencyId()); |
|||
formDTO.setOrgType("agency"); |
|||
} |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
//获取项目分类
|
|||
List<EventCategoryResultDTO> projectCategoryList = pingYinEventDao.selectProjectCategory(formDTO.getCustomerId()); |
|||
//获取项目赋值得分统计
|
|||
List<EventCategoryResultDTO> projectScoreList = pingYinEventDao.selectProjectCategoryScoreList(formDTO); |
|||
if (CollectionUtils.isNotEmpty(projectScoreList)) { |
|||
projectCategoryList.forEach(item -> { |
|||
projectScoreList.stream().filter(e -> item.getCategoryCode().equals(e.getParentCategoryCode())).forEach(e -> { |
|||
item.setEventTotal(item.getEventTotal() + e.getEventTotal()); |
|||
item.setTotalScore(item.getTotalScore() + e.getTotalScore()); |
|||
}); |
|||
item.getChildren().forEach(son -> projectScoreList.stream().filter(e -> son.getCategoryCode().equals(e.getCategoryCode())).forEach(e -> { |
|||
son.setEventTotal(e.getEventTotal()); |
|||
son.setTotalScore(e.getTotalScore()); |
|||
})); |
|||
}); |
|||
} |
|||
result.addAll(projectCategoryList); |
|||
//获取例行工作分类
|
|||
List<EventCategoryResultDTO> workCategoryList = pingYinEventDao.selectWorkCategory(); |
|||
//获取例行工作赋值得分统计
|
|||
List<EventCategoryResultDTO> workScoreList = pingYinEventDao.selectWorkCategoryScoreList(formDTO); |
|||
if (CollectionUtils.isNotEmpty(workScoreList)) { |
|||
workCategoryList.forEach(item -> { |
|||
workScoreList.stream().filter(e -> item.getCategoryCode().equals(e.getParentCategoryCode())).forEach(e -> { |
|||
item.setEventTotal(item.getEventTotal() + e.getEventTotal()); |
|||
item.setTotalScore(item.getTotalScore() + e.getTotalScore()); |
|||
}); |
|||
item.getChildren().forEach(son -> workScoreList.stream().filter(e -> son.getCategoryCode().equals(e.getCategoryCode())).forEach(e -> { |
|||
son.setEventTotal(e.getEventTotal()); |
|||
son.setTotalScore(e.getTotalScore()); |
|||
})); |
|||
}); |
|||
} |
|||
result.addAll(workCategoryList); |
|||
return result; |
|||
} |
|||
|
|||
/** |
|||
* 事件分类列表 |
|||
* |
|||
* @param formDTO |
|||
* @Param formDTO |
|||
* @Return {@link PageData < EventCategoryListResultDTO >} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/13 9:55 |
|||
*/ |
|||
@Override |
|||
public PageData<EventCategoryListResultDTO> getEventCategoryList(EventCategoryListFormDTO formDTO) { |
|||
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); |
|||
List<EventCategoryListResultDTO> list; |
|||
if (EventConstant.PROJECT.equals(formDTO.getEventType())) { |
|||
//项目分类列表
|
|||
list = pingYinEventDao.getProjectCategoryList(formDTO); |
|||
} else { |
|||
//例行工作分类列表
|
|||
list = pingYinEventDao.getWorkCategoryList(formDTO); |
|||
} |
|||
PageInfo<EventCategoryListResultDTO> pageInfo = new PageInfo<>(list); |
|||
if(CollectionUtils.isNotEmpty(list)) { |
|||
list.forEach(item -> { |
|||
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); |
|||
if (null == gridInfo) { |
|||
log.error("获取网格信息失败"); |
|||
return; |
|||
} |
|||
item.setGridName(gridInfo.getGridNamePath()); |
|||
if (EventConstant.PROJECT.equals(item.getEventType())) { |
|||
item.setStatusDesc("pending".equals(item.getStatus())?"处理中":"已结案"); |
|||
} |
|||
}); |
|||
} |
|||
return new PageData<>(list, pageInfo.getTotal()); |
|||
} |
|||
|
|||
/** |
|||
* 事件赋值得分总计 |
|||
* |
|||
* @param formDTO |
|||
* @Param formDTO |
|||
* @Return {@link EventScoreTotalResultDTO} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/14 13:46 |
|||
*/ |
|||
@Override |
|||
public EventScoreTotalResultDTO getEventScoreTotal(EventCategoryFormDTO formDTO) { |
|||
EventScoreTotalResultDTO result = new EventScoreTotalResultDTO(); |
|||
Long projectScore = pingYinEventDao.getProjectTotalScore(formDTO); |
|||
Long workScore = pingYinEventDao.getWorkTotalScore(formDTO); |
|||
Long memberCount = pingYinEventDao.getMemberCount(formDTO); |
|||
Long totalScore = projectScore + workScore; |
|||
result.setTotalScore(totalScore.toString()); |
|||
result.setMemberCount(memberCount.toString()); |
|||
result.setAveScore("0.00"); |
|||
if (memberCount != 0L) { |
|||
BigDecimal total = new BigDecimal(totalScore); |
|||
BigDecimal count = new BigDecimal(memberCount); |
|||
BigDecimal ave = total.divide(count, NumConstant.TWO, RoundingMode.HALF_UP); |
|||
result.setAveScore(ave.toString()); |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
/** |
|||
* 事件赋值得分导出 |
|||
* |
|||
* @param tokenDto |
|||
* @param formDTO |
|||
* @Param tokenDto |
|||
* @Param formDTO |
|||
* @Return {@link List<EventCategoryResultDTO>} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/9 9:55 |
|||
*/ |
|||
@Override |
|||
public List<EventCategoryResultDTO> getEventCategorySoreExport(TokenDto tokenDto, EventCategoryFormDTO formDTO) { |
|||
if (StringUtils.isBlank(formDTO.getOrgId())){ |
|||
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); |
|||
if (null == staffInfo){ |
|||
throw new EpmetException("未查询到此工作人员的所属组织信息..."); |
|||
} |
|||
formDTO.setOrgId(staffInfo.getAgencyId()); |
|||
formDTO.setOrgType("agency"); |
|||
} |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
//获取项目分类
|
|||
List<EventCategoryResultDTO> projectCategoryList = pingYinEventDao.selectProjectCategoryForExport(formDTO.getCustomerId()); |
|||
//获取项目赋值得分统计
|
|||
List<EventCategoryResultDTO> projectScoreList = pingYinEventDao.selectProjectCategoryScoreList(formDTO); |
|||
if (CollectionUtils.isNotEmpty(projectScoreList)) { |
|||
projectCategoryList.forEach(item -> { |
|||
projectScoreList.stream().filter(e -> item.getCategoryCode().equals(e.getCategoryCode())).forEach(e -> { |
|||
item.setEventTotal(e.getEventTotal()); |
|||
item.setTotalScore(e.getTotalScore()); |
|||
}); |
|||
}); |
|||
} |
|||
List<EventCategoryResultDTO> result = new ArrayList<>(projectCategoryList); |
|||
//获取例行工作分类
|
|||
List<EventCategoryResultDTO> workCategoryList = pingYinEventDao.selectWorkCategoryForExport(); |
|||
//获取例行工作赋值得分统计
|
|||
List<EventCategoryResultDTO> workScoreList = pingYinEventDao.selectWorkCategoryScoreList(formDTO); |
|||
if (CollectionUtils.isNotEmpty(workScoreList)) { |
|||
workCategoryList.forEach(item -> { |
|||
workScoreList.stream().filter(e -> item.getCategoryCode().equals(e.getCategoryCode())).forEach(e -> { |
|||
item.setEventTotal(e.getEventTotal()); |
|||
item.setTotalScore(e.getTotalScore()); |
|||
}); |
|||
}); |
|||
} |
|||
result.addAll(workCategoryList); |
|||
return result; |
|||
} |
|||
|
|||
/** |
|||
* 下级得分 |
|||
* |
|||
* @param formDTO |
|||
* @Param formDTO |
|||
* @Return {@link List< OrgEventScoreResultDTO >} |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/15 11:05 |
|||
*/ |
|||
@Override |
|||
public List<OrgEventScoreResultDTO> getOrgEventScoreList(EventCategoryFormDTO formDTO) { |
|||
if (OrgConstant.GRID.equals((formDTO.getOrgLevel()))) { |
|||
return Collections.emptyList(); |
|||
} |
|||
List<OrgEventScoreResultDTO> result; |
|||
//获取areacode
|
|||
if (StringUtils.isBlank(formDTO.getAreaCode())) { |
|||
formDTO.setAreaCode(pingYinEventDao.getAreaCode(formDTO.getOrgId())); |
|||
} |
|||
if (OrgConstant.COMMUNITY.equals(formDTO.getOrgLevel())) { |
|||
result = pingYinEventDao.selectGridEventScoreList(formDTO); |
|||
} else { |
|||
result = pingYinEventDao.selectOrgEventScoreList(formDTO); |
|||
} |
|||
result.forEach(item -> { |
|||
item.setAveScore("0.00"); |
|||
if (!NumConstant.ZERO_STR.equals(item.getMemberCount())) { |
|||
BigDecimal projectScore = new BigDecimal(item.getProjectScore()); |
|||
BigDecimal workScore = new BigDecimal(item.getWorkScore()); |
|||
BigDecimal total = projectScore.add(workScore); |
|||
BigDecimal count = new BigDecimal(item.getMemberCount()); |
|||
BigDecimal ave = total.divide(count, NumConstant.TWO, RoundingMode.HALF_UP); |
|||
item.setAveScore(ave.toString()); |
|||
} |
|||
}); |
|||
return result; |
|||
} |
|||
} |
Binary file not shown.
@ -0,0 +1,584 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dataaggre.dao.evaluationindex.PingYinEventDao"> |
|||
<!-- 查询客户下所有分类 --> |
|||
<resultMap id="selectCategoryByCustomerIdMap" type="com.epmet.dataaggre.dto.evaluationindex.EventCategoryResultDTO"> |
|||
<result column="e" property="eventType"/> |
|||
<result column="c" property="categoryCode"/> |
|||
<result column="n" property="categoryName"/> |
|||
<result column="pc1" property="parentCategoryCode"/> |
|||
<result column="score1" property="score"/> |
|||
<collection property="children" ofType="com.epmet.dataaggre.dto.evaluationindex.EventCategoryResultDTO"> |
|||
<result column="e" property="eventType"/> |
|||
<result column="c2" property="categoryCode"/> |
|||
<result column="n2" property="categoryName"/> |
|||
<result column="pc2" property="parentCategoryCode"/> |
|||
<result column="score2" property="score"/> |
|||
<result column="n" property="parentCategoryName"/> |
|||
</collection> |
|||
</resultMap> |
|||
<select id="selectProjectCategory" resultMap="selectCategoryByCustomerIdMap"> |
|||
SELECT |
|||
'事件' AS e, |
|||
'事件' AS e2, |
|||
p1.CATEGORY_CODE AS c, |
|||
p2.CATEGORY_CODE AS c2, |
|||
p1.CATEGORY_NAME AS n, |
|||
p2.CATEGORY_NAME AS n2, |
|||
p1.PARENT_CATEGORY_CODE AS pc1, |
|||
p2.PARENT_CATEGORY_CODE AS pc2, |
|||
p1.SCORE AS score1, |
|||
p2.SCORE AS score2 |
|||
FROM customer_project_category_dict p1,customer_project_category_dict p2 |
|||
WHERE p1.DEL_FLAG = '0' |
|||
AND p2.DEL_FLAG = '0' |
|||
AND p1.CUSTOMER_ID = #{customerId} |
|||
AND p2.CUSTOMER_ID = #{customerId} |
|||
AND p1.CATEGORY_CODE = p2.PARENT_CATEGORY_CODE |
|||
AND p1.CUSTOMER_TYPE = 'internal' |
|||
AND p2.CUSTOMER_TYPE = 'internal' |
|||
AND p1.IS_DISABLE = 'enable' |
|||
AND p2.IS_DISABLE = 'enable' |
|||
ORDER BY p1.SORT, p2.SORT |
|||
</select> |
|||
|
|||
<select id="selectWorkCategory" resultMap="selectCategoryByCustomerIdMap"> |
|||
SELECT |
|||
'例行工作' AS e, |
|||
'例行工作' AS e2, |
|||
p1.CATEGORY_CODE AS c, |
|||
p2.CATEGORY_CODE AS c2, |
|||
p1.CATEGORY_NAME AS n, |
|||
p2.CATEGORY_NAME AS n2, |
|||
p1.PARENT_CATEGORY_CODE AS pc1, |
|||
p2.PARENT_CATEGORY_CODE AS pc2, |
|||
p1.SCORE AS score1, |
|||
p2.SCORE AS score2 |
|||
FROM customer_patrol_work_type_dict p1,customer_patrol_work_type_dict p2 |
|||
WHERE p1.DEL_FLAG = '0' |
|||
AND p2.DEL_FLAG = '0' |
|||
AND p1.CATEGORY_CODE = p2.PARENT_CATEGORY_CODE |
|||
AND p1.IS_DISABLE = 'enable' |
|||
AND p2.IS_DISABLE = 'enable' |
|||
ORDER BY p1.SORT, p2.SORT |
|||
</select> |
|||
|
|||
<select id="selectProjectCategoryScoreList" resultType="com.epmet.dataaggre.dto.evaluationindex.EventCategoryResultDTO"> |
|||
SELECT |
|||
* |
|||
FROM |
|||
(SELECT |
|||
a.CATEGORY_CODE, |
|||
c.PARENT_CATEGORY_CODE, |
|||
COUNT( a.EVENT_ID ) AS eventTotal, |
|||
c.SCORE, |
|||
SUM( c.SCORE ) AS totalScore |
|||
FROM |
|||
screen_py_event_data a |
|||
INNER JOIN customer_project_category_dict c ON a.CATEGORY_CODE = c.CATEGORY_CODE |
|||
AND c.DEL_FLAG = '0' |
|||
AND c.CUSTOMER_ID = #{customerId} |
|||
AND c.IS_DISABLE = 'enable' |
|||
WHERE |
|||
a.DEL_FLAG = '0' |
|||
AND a.EVENT_TYPE = 'project' |
|||
<if test="startTime != null and startTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) >= #{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) <= #{endTime} |
|||
</if> |
|||
<if test="orgType == 'grid'"> |
|||
AND a.ORG_ID = #{orgId} |
|||
</if> |
|||
<if test="orgType == 'agency'"> |
|||
AND a.PIDS LIKE CONCAT('%', #{orgId}, '%') |
|||
</if> |
|||
<if test="name != null and name != ''"> |
|||
AND a.STAFF_NAME LIKE CONCAT('%', #{name}, '%') |
|||
</if> |
|||
<if test="mobile != null and mobile != ''"> |
|||
AND a.MOBILE LIKE CONCAT('%', #{mobile}, '%') |
|||
</if> |
|||
GROUP BY a.CATEGORY_CODE |
|||
) a |
|||
WHERE CATEGORY_CODE IS NOT NULL |
|||
</select> |
|||
|
|||
<select id="selectWorkCategoryScoreList" resultType="com.epmet.dataaggre.dto.evaluationindex.EventCategoryResultDTO"> |
|||
SELECT |
|||
* |
|||
FROM |
|||
(SELECT |
|||
a.CATEGORY_CODE, |
|||
c.PARENT_CATEGORY_CODE, |
|||
COUNT( a.EVENT_ID ) AS eventTotal, |
|||
c.SCORE, |
|||
SUM( c.SCORE ) AS totalScore |
|||
FROM |
|||
screen_py_event_data a |
|||
INNER JOIN customer_patrol_work_type_dict c ON a.CATEGORY_CODE = c.CATEGORY_CODE |
|||
AND c.IS_DISABLE = 'enable' |
|||
WHERE |
|||
a.DEL_FLAG = '0' |
|||
AND a.EVENT_TYPE = 'work' |
|||
<if test="startTime != null and startTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) >= #{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) <= #{endTime} |
|||
</if> |
|||
<if test="orgType == 'grid'"> |
|||
AND a.ORG_ID = #{orgId} |
|||
</if> |
|||
<if test="orgType == 'agency'"> |
|||
AND a.PIDS LIKE CONCAT('%', #{orgId}, '%') |
|||
</if> |
|||
<if test="name != null and name != ''"> |
|||
AND a.STAFF_NAME LIKE CONCAT('%', #{name}, '%') |
|||
</if> |
|||
<if test="mobile != null and mobile != ''"> |
|||
AND a.MOBILE LIKE CONCAT('%', #{mobile}, '%') |
|||
</if> |
|||
GROUP BY a.CATEGORY_CODE |
|||
) a |
|||
WHERE CATEGORY_CODE IS NOT NULL |
|||
</select> |
|||
|
|||
<select id="getProjectCategoryList" resultType="com.epmet.dataaggre.dto.evaluationindex.result.EventCategoryListResultDTO"> |
|||
SELECT |
|||
a.EVENT_ID, |
|||
a.EVENT_TYPE, |
|||
b.PROJECT_TITLE AS "title", |
|||
CONCAT( d.CATEGORY_NAME, '-', c.CATEGORY_NAME ) AS "category", |
|||
b.PROJECT_STATUS_CODE AS "status", |
|||
b.PROJECT_CREATE_TIME AS "createTime", |
|||
b.ORG_ID AS "gridId", |
|||
b.LINK_NAME AS "staffName", |
|||
c.SCORE |
|||
FROM |
|||
screen_py_event_data a |
|||
INNER JOIN screen_project_data b ON a.EVENT_ID = b.PROJECT_ID |
|||
INNER JOIN customer_project_category_dict c ON a.CATEGORY_CODE = c.CATEGORY_CODE |
|||
AND c.CUSTOMER_ID = #{customerId} |
|||
INNER JOIN customer_project_category_dict d ON d.CATEGORY_CODE = c.PARENT_CATEGORY_CODE |
|||
AND d.CUSTOMER_ID = #{customerId} |
|||
WHERE |
|||
a.EVENT_TYPE = 'project' |
|||
AND (c.CATEGORY_CODE = #{categoryCode} OR d.CATEGORY_CODE = #{categoryCode}) |
|||
<if test="orgType == 'grid'"> |
|||
AND b.ORG_ID = #{orgId} |
|||
</if> |
|||
<if test="orgType == 'agency'"> |
|||
AND b.ALL_PARENT_IDS LIKE CONCAT('%', #{orgId}, '%') |
|||
</if> |
|||
<if test="startTime != null and startTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) >= #{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) <= #{endTime} |
|||
</if> |
|||
<if test="name != null and name != ''"> |
|||
AND b.LINK_NAME LIKE CONCAT('%', #{name}, '%') |
|||
</if> |
|||
<if test="mobile != null and mobile != ''"> |
|||
AND b.LINK_MOBILE LIKE CONCAT('%', #{mobile}, '%') |
|||
</if> |
|||
ORDER BY PROJECT_CREATE_TIME DESC |
|||
</select> |
|||
|
|||
<select id="getWorkCategoryList" resultType="com.epmet.dataaggre.dto.evaluationindex.result.EventCategoryListResultDTO"> |
|||
SELECT |
|||
a.EVENT_ID, |
|||
a.EVENT_TYPE, |
|||
a.TITLE, |
|||
CONCAT( d.CATEGORY_NAME, '-', c.CATEGORY_NAME ) AS "category", |
|||
DATE_FORMAT(a.EVENT_CREATE_TIME,'%Y-%m-%d') AS "createTime", |
|||
a.ORG_ID AS 'gridId', |
|||
a.STAFF_NAME AS 'staffName', |
|||
c.SCORE |
|||
FROM |
|||
screen_py_event_data a |
|||
INNER JOIN customer_patrol_work_type_dict c ON a.CATEGORY_CODE = c.CATEGORY_CODE |
|||
INNER JOIN customer_patrol_work_type_dict d ON d.CATEGORY_CODE = c.PARENT_CATEGORY_CODE |
|||
WHERE |
|||
a.EVENT_TYPE = 'WORK' |
|||
AND (c.CATEGORY_CODE = '01' OR d.CATEGORY_CODE = '01') |
|||
<if test="orgType == 'grid'"> |
|||
AND a.ORG_ID = #{orgId} |
|||
</if> |
|||
<if test="orgType == 'agency'"> |
|||
AND a.PIDS LIKE CONCAT('%', #{orgId}, '%') |
|||
</if> |
|||
<if test="startTime != null and startTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) >= #{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) <= #{endTime} |
|||
</if> |
|||
<if test="name != null and name != ''"> |
|||
AND a.STAFF_NAME LIKE CONCAT('%', #{name}, '%') |
|||
</if> |
|||
<if test="mobile != null and mobile != ''"> |
|||
AND a.MOBILE LIKE CONCAT('%', #{mobile}, '%') |
|||
</if> |
|||
ORDER BY EVENT_CREATE_TIME DESC |
|||
</select> |
|||
<select id="getProjectTotalScore" resultType="java.lang.Long"> |
|||
SELECT |
|||
IFNULL(SUM( c.SCORE ), 0) AS totalScore |
|||
FROM |
|||
screen_py_event_data a |
|||
INNER JOIN customer_project_category_dict c ON a.CATEGORY_CODE = c.CATEGORY_CODE |
|||
AND c.DEL_FLAG = '0' |
|||
AND c.CUSTOMER_ID = #{customerId} |
|||
AND c.IS_DISABLE = 'enable' |
|||
WHERE |
|||
a.DEL_FLAG = '0' |
|||
AND a.EVENT_TYPE = 'project' |
|||
<if test="startTime != null and startTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) >= #{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) <= #{endTime} |
|||
</if> |
|||
<if test="orgType == 'grid'"> |
|||
AND a.ORG_ID = #{orgId} |
|||
</if> |
|||
<if test="orgType == 'agency'"> |
|||
AND a.PIDS LIKE CONCAT('%', #{orgId}, '%') |
|||
</if> |
|||
<if test="name != null and name != ''"> |
|||
AND a.STAFF_NAME LIKE CONCAT('%', #{name}, '%') |
|||
</if> |
|||
<if test="mobile != null and mobile != ''"> |
|||
AND a.MOBILE LIKE CONCAT('%', #{mobile}, '%') |
|||
</if> |
|||
</select> |
|||
<select id="getWorkTotalScore" resultType="java.lang.Long"> |
|||
SELECT |
|||
IFNULL(SUM( c.SCORE ), 0) AS totalScore |
|||
FROM |
|||
screen_py_event_data a |
|||
INNER JOIN customer_patrol_work_type_dict c ON a.CATEGORY_CODE = c.CATEGORY_CODE |
|||
AND c.IS_DISABLE = 'enable' |
|||
WHERE |
|||
a.DEL_FLAG = '0' |
|||
AND a.EVENT_TYPE = 'work' |
|||
<if test="startTime != null and startTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) >= #{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) <= #{endTime} |
|||
</if> |
|||
<if test="orgType == 'grid'"> |
|||
AND a.ORG_ID = #{orgId} |
|||
</if> |
|||
<if test="orgType == 'agency'"> |
|||
AND a.PIDS LIKE CONCAT('%', #{orgId}, '%') |
|||
</if> |
|||
<if test="name != null and name != ''"> |
|||
AND a.STAFF_NAME LIKE CONCAT('%', #{name}, '%') |
|||
</if> |
|||
<if test="mobile != null and mobile != ''"> |
|||
AND a.MOBILE LIKE CONCAT('%', #{mobile}, '%') |
|||
</if> |
|||
</select> |
|||
<select id="getMemberCount" resultType="java.lang.Long"> |
|||
SELECT |
|||
IFNULL(COUNT(DISTINCT STAFF_ID), 0) |
|||
FROM |
|||
screen_py_grid_staff |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND IS_LEAVE = 'N' |
|||
<if test="orgType == 'grid'"> |
|||
AND GRID_ID = #{orgId} |
|||
</if> |
|||
<if test="orgType == 'agency'"> |
|||
AND PIDS LIKE CONCAT('%', #{orgId}, '%') |
|||
</if> |
|||
<if test="name != null and name != ''"> |
|||
AND STAFF_NAME LIKE CONCAT('%', #{name}, '%') |
|||
</if> |
|||
<if test="mobile != null and mobile != ''"> |
|||
AND MOBILE LIKE CONCAT('%', #{mobile}, '%') |
|||
</if> |
|||
</select> |
|||
<select id="selectProjectCategoryForExport" resultType="com.epmet.dataaggre.dto.evaluationindex.EventCategoryResultDTO"> |
|||
SELECT |
|||
'上报事件' AS eventType, |
|||
p1.CATEGORY_CODE AS parentCategoryCode, |
|||
p2.CATEGORY_CODE AS categoryCode, |
|||
p1.CATEGORY_NAME AS parentCategoryName, |
|||
p2.CATEGORY_NAME AS categoryName, |
|||
p2.SCORE AS score |
|||
FROM |
|||
customer_project_category_dict p1, |
|||
customer_project_category_dict p2 |
|||
WHERE |
|||
p1.DEL_FLAG = '0' |
|||
AND p2.DEL_FLAG = '0' |
|||
AND p1.CUSTOMER_ID = #{customerId} |
|||
AND p2.CUSTOMER_ID = #{customerId} |
|||
AND p1.CATEGORY_CODE = p2.PARENT_CATEGORY_CODE |
|||
AND p1.CUSTOMER_TYPE = 'internal' |
|||
AND p2.CUSTOMER_TYPE = 'internal' |
|||
AND p1.IS_DISABLE = 'enable' |
|||
AND p2.IS_DISABLE = 'enable' |
|||
ORDER BY |
|||
p1.SORT, |
|||
p2.SORT |
|||
</select> |
|||
<select id="selectWorkCategoryForExport" resultType="com.epmet.dataaggre.dto.evaluationindex.EventCategoryResultDTO"> |
|||
SELECT |
|||
'例行工作' AS eventType, |
|||
p1.CATEGORY_CODE AS parentCategoryCode, |
|||
p2.CATEGORY_CODE AS categoryCode, |
|||
p1.CATEGORY_NAME AS parentCategoryName, |
|||
p2.CATEGORY_NAME AS categoryName, |
|||
p2.SCORE AS score |
|||
FROM customer_patrol_work_type_dict p1,customer_patrol_work_type_dict p2 |
|||
WHERE p1.DEL_FLAG = '0' |
|||
AND p2.DEL_FLAG = '0' |
|||
AND p1.CATEGORY_CODE = p2.PARENT_CATEGORY_CODE |
|||
AND p1.IS_DISABLE = 'enable' |
|||
AND p2.IS_DISABLE = 'enable' |
|||
ORDER BY p1.SORT, p2.SORT |
|||
</select> |
|||
|
|||
<select id="selectOrgEventScoreList" resultType="com.epmet.dataaggre.dto.evaluationindex.result.OrgEventScoreResultDTO"> |
|||
SELECT |
|||
a.orgName, |
|||
projectCount, |
|||
projectScore, |
|||
workCount, |
|||
workScore, |
|||
memberCount |
|||
FROM |
|||
( |
|||
SELECT |
|||
a.AGENCY_ID, |
|||
a.AGENCY_NAME AS orgName, |
|||
IFNULL( SUM( b.eventCount ), 0 ) AS projectCount, |
|||
IFNULL( SUM( b.eventScore ), 0 ) AS projectScore |
|||
FROM |
|||
screen_customer_agency a |
|||
LEFT JOIN ( |
|||
SELECT |
|||
a.PIDS, |
|||
COUNT( a.EVENT_ID ) AS eventCount, |
|||
SUM( b.SCORE ) AS eventScore |
|||
FROM |
|||
screen_py_event_data a |
|||
INNER JOIN customer_project_category_dict b ON a.CATEGORY_CODE = b.CATEGORY_CODE |
|||
AND b.CUSTOMER_ID = #{customerId} |
|||
AND b.IS_DISABLE = 'enable' |
|||
WHERE |
|||
a.EVENT_TYPE = 'project' |
|||
<if test="startTime != null and startTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) >= #{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) <= #{endTime} |
|||
</if> |
|||
<if test="name != null and name != ''"> |
|||
AND a.STAFF_NAME LIKE CONCAT('%', #{name}, '%') |
|||
</if> |
|||
<if test="mobile != null and mobile != ''"> |
|||
AND a.MOBILE LIKE CONCAT('%', #{mobile}, '%') |
|||
</if> |
|||
GROUP BY |
|||
a.PIDS |
|||
) b ON b.PIDS LIKE CONCAT( '%', a.AGENCY_ID, '%' ) |
|||
WHERE |
|||
a.DEL_FLAG = '0' |
|||
AND a.PARENT_AREA_CODE = #{areaCode} |
|||
GROUP BY |
|||
a.AGENCY_ID |
|||
) a |
|||
INNER JOIN ( |
|||
SELECT |
|||
a.AGENCY_ID, |
|||
a.AGENCY_NAME AS orgName, |
|||
IFNULL( SUM( c.eventCount ), 0 ) AS workCount, |
|||
IFNULL( SUM( c.eventScore ), 0 ) AS workScore |
|||
FROM |
|||
screen_customer_agency a |
|||
LEFT JOIN ( |
|||
SELECT |
|||
a.PIDS, |
|||
COUNT( a.EVENT_ID ) AS eventCount, |
|||
SUM( b.SCORE ) AS eventScore |
|||
FROM |
|||
screen_py_event_data a |
|||
INNER JOIN customer_patrol_work_type_dict b ON a.CATEGORY_CODE = b.CATEGORY_CODE |
|||
AND b.IS_DISABLE = 'enable' |
|||
WHERE |
|||
a.EVENT_TYPE = 'work' |
|||
<if test="startTime != null and startTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) >= #{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) <= #{endTime} |
|||
</if> |
|||
<if test="name != null and name != ''"> |
|||
AND a.STAFF_NAME LIKE CONCAT('%', #{name}, '%') |
|||
</if> |
|||
<if test="mobile != null and mobile != ''"> |
|||
AND a.MOBILE LIKE CONCAT('%', #{mobile}, '%') |
|||
</if> |
|||
GROUP BY |
|||
a.PIDS |
|||
) c ON c.PIDS LIKE CONCAT( '%', a.AGENCY_ID, '%' ) |
|||
WHERE |
|||
a.DEL_FLAG = '0' |
|||
AND a.PARENT_AREA_CODE = #{areaCode} |
|||
GROUP BY |
|||
a.AGENCY_ID |
|||
) b ON a.AGENCY_ID = b.AGENCY_ID |
|||
INNER JOIN ( |
|||
SELECT |
|||
a.AGENCY_ID, |
|||
a.AGENCY_NAME AS orgName, |
|||
IFNULL( COUNT( DISTINCT d.STAFF_ID ), 0 ) AS memberCount |
|||
FROM |
|||
screen_customer_agency a |
|||
LEFT JOIN screen_py_grid_staff d ON d.DEL_FLAG = '0' |
|||
AND IS_LEAVE = 'N' |
|||
AND d.PIDS LIKE CONCAT( '%', a.AGENCY_ID, '%' ) |
|||
<if test="name != null and name != ''"> |
|||
AND d.STAFF_NAME LIKE CONCAT('%', #{name}, '%') |
|||
</if> |
|||
<if test="mobile != null and mobile != ''"> |
|||
AND d.MOBILE LIKE CONCAT('%', #{mobile}, '%') |
|||
</if> |
|||
WHERE |
|||
a.DEL_FLAG = '0' |
|||
AND a.PARENT_AREA_CODE = #{areaCode} |
|||
GROUP BY |
|||
a.AGENCY_ID |
|||
) c ON a.AGENCY_ID = c.AGENCY_ID |
|||
</select> |
|||
<select id="selectGridEventScoreList" resultType="com.epmet.dataaggre.dto.evaluationindex.result.OrgEventScoreResultDTO"> |
|||
SELECT |
|||
a.orgName, |
|||
projectCount, |
|||
projectScore, |
|||
workCount, |
|||
workScore, |
|||
memberCount |
|||
FROM |
|||
( |
|||
SELECT |
|||
a.GRID_ID, |
|||
a.GRID_NAME AS orgName, |
|||
IFNULL( SUM( b.eventCount ), 0 ) AS projectCount, |
|||
IFNULL( SUM( b.eventScore ), 0 ) AS projectScore |
|||
FROM |
|||
screen_customer_grid a |
|||
LEFT JOIN ( |
|||
SELECT |
|||
a.ORG_ID, |
|||
COUNT( a.EVENT_ID ) AS eventCount, |
|||
SUM( b.SCORE ) AS eventScore |
|||
FROM |
|||
screen_py_event_data a |
|||
INNER JOIN customer_project_category_dict b ON a.CATEGORY_CODE = b.CATEGORY_CODE |
|||
AND b.CUSTOMER_ID = #{customerId} |
|||
AND b.IS_DISABLE = 'enable' |
|||
WHERE |
|||
a.EVENT_TYPE = 'project' |
|||
<if test="startTime != null and startTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) >= #{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) <= #{endTime} |
|||
</if> |
|||
<if test="name != null and name != ''"> |
|||
AND a.STAFF_NAME LIKE CONCAT('%', #{name}, '%') |
|||
</if> |
|||
<if test="mobile != null and mobile != ''"> |
|||
AND a.MOBILE LIKE CONCAT('%', #{mobile}, '%') |
|||
</if> |
|||
GROUP BY |
|||
a.ORG_ID |
|||
) b ON b.ORG_ID = a.GRID_ID |
|||
WHERE |
|||
a.DEL_FLAG = '0' |
|||
AND a.PARENT_AGENCY_ID = #{orgId} |
|||
GROUP BY |
|||
a.GRID_ID |
|||
) a |
|||
INNER JOIN ( |
|||
SELECT |
|||
a.GRID_ID, |
|||
a.GRID_NAME AS orgName, |
|||
IFNULL( SUM( c.eventCount ), 0 ) AS workCount, |
|||
IFNULL( SUM( c.eventScore ), 0 ) AS workScore |
|||
FROM |
|||
screen_customer_grid a |
|||
LEFT JOIN ( |
|||
SELECT |
|||
a.ORG_ID, |
|||
COUNT( a.EVENT_ID ) AS eventCount, |
|||
SUM( b.SCORE ) AS eventScore |
|||
FROM |
|||
screen_py_event_data a |
|||
INNER JOIN customer_patrol_work_type_dict b ON a.CATEGORY_CODE = b.CATEGORY_CODE |
|||
AND b.IS_DISABLE = 'enable' |
|||
WHERE |
|||
a.EVENT_TYPE = 'work' |
|||
<if test="startTime != null and startTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) >= #{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime != ''"> |
|||
AND DATE_FORMAT( a.EVENT_CREATE_TIME, '%Y%m%d' ) <= #{endTime} |
|||
</if> |
|||
<if test="name != null and name != ''"> |
|||
AND a.STAFF_NAME LIKE CONCAT('%', #{name}, '%') |
|||
</if> |
|||
<if test="mobile != null and mobile != ''"> |
|||
AND a.MOBILE LIKE CONCAT('%', #{mobile}, '%') |
|||
</if> |
|||
GROUP BY |
|||
a.ORG_ID |
|||
) c ON c.ORG_ID = a.GRID_ID |
|||
WHERE |
|||
a.DEL_FLAG = '0' |
|||
AND a.PARENT_AGENCY_ID = #{orgId} |
|||
GROUP BY |
|||
a.GRID_ID |
|||
) b ON a.GRID_ID = b.GRID_ID |
|||
INNER JOIN ( |
|||
SELECT |
|||
a.GRID_ID, |
|||
a.GRID_NAME AS orgName, |
|||
IFNULL( COUNT( DISTINCT d.STAFF_ID ), 0 ) AS memberCount |
|||
FROM |
|||
screen_customer_grid a |
|||
LEFT JOIN screen_py_grid_staff d ON d.DEL_FLAG = '0' |
|||
AND IS_LEAVE = 'N' |
|||
AND d.GRID_ID = a.GRID_ID |
|||
<if test="name != null and name != ''"> |
|||
AND d.STAFF_NAME LIKE CONCAT('%', #{name}, '%') |
|||
</if> |
|||
<if test="mobile != null and mobile != ''"> |
|||
AND d.MOBILE LIKE CONCAT('%', #{mobile}, '%') |
|||
</if> |
|||
WHERE |
|||
a.DEL_FLAG = '0' |
|||
AND a.PARENT_AGENCY_ID = #{orgId} |
|||
GROUP BY |
|||
a.GRID_ID |
|||
) c ON a.GRID_ID = c.GRID_ID |
|||
</select> |
|||
<select id="getAreaCode" resultType="java.lang.String"> |
|||
SELECT AREA_CODE |
|||
FROM screen_customer_agency |
|||
WHERE DEL_FLAG = '0' |
|||
AND AGENCY_ID = #{agencyId} |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,117 @@ |
|||
/** |
|||
* 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.epmet.dto.indexcollect; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 平阴区网格员基础信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Data |
|||
public class ScreenPyGridStaffDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格Id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 网格编码 |
|||
*/ |
|||
private String gridCode; |
|||
|
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String gridName; |
|||
|
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 工作人员Id |
|||
*/ |
|||
private String staffId; |
|||
|
|||
/** |
|||
* 网格员姓名 |
|||
*/ |
|||
private String staffName; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 是否离职,格式为Y:是、N:否 |
|||
*/ |
|||
private String isLeave; |
|||
|
|||
|
|||
/** |
|||
* 删除标识 0未删除;1已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
|
|||
} |
@ -0,0 +1,95 @@ |
|||
/** |
|||
* 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.epmet.dto.indexcollect; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 平阴历史得分主表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Data |
|||
public class ScreenPyHistoryScoreDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 起始时间 |
|||
*/ |
|||
private Date startTime; |
|||
|
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
private Date endTime; |
|||
|
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private Date releaseTime; |
|||
|
|||
/** |
|||
* 删除标识 0未删除;1已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,126 @@ |
|||
/** |
|||
* 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.epmet.dto.indexcollect; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 平阴历史得分明细表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Data |
|||
public class ScreenPyHistoryScoreDetailDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* screen_py_history_score.id |
|||
*/ |
|||
private String historyScoreId; |
|||
|
|||
/** |
|||
* 街道组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 街道名称 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
/** |
|||
* 网格活跃度 |
|||
*/ |
|||
private BigDecimal wghyd; |
|||
|
|||
/** |
|||
* 事件赋分 |
|||
*/ |
|||
private BigDecimal sjff; |
|||
|
|||
/** |
|||
* 雪亮工程 |
|||
*/ |
|||
private BigDecimal xlgc; |
|||
|
|||
/** |
|||
* 日核周调 |
|||
*/ |
|||
private BigDecimal rhzt; |
|||
|
|||
/** |
|||
* 亮点工作 |
|||
*/ |
|||
private BigDecimal ldgz; |
|||
|
|||
/** |
|||
* 其他工作 |
|||
*/ |
|||
private BigDecimal qtgz; |
|||
|
|||
/** |
|||
* 能力得分 |
|||
*/ |
|||
private BigDecimal nldf; |
|||
|
|||
/** |
|||
* 删除标识 0未删除;1已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,106 @@ |
|||
/** |
|||
* 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.epmet.dto.indexcollect; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 平阴政法能力权重配置 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Data |
|||
public class ScreenPyWeightConfigurationDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格活跃度 |
|||
*/ |
|||
private BigDecimal wghyd; |
|||
|
|||
/** |
|||
* 事件赋分 |
|||
*/ |
|||
private BigDecimal sjff; |
|||
|
|||
/** |
|||
* 雪亮工程 |
|||
*/ |
|||
private BigDecimal xlgc; |
|||
|
|||
/** |
|||
* 日核周调 |
|||
*/ |
|||
private BigDecimal rhzt; |
|||
|
|||
/** |
|||
* 亮点工作 |
|||
*/ |
|||
private BigDecimal ldgz; |
|||
|
|||
/** |
|||
* 其他工作 |
|||
*/ |
|||
private BigDecimal qtgz; |
|||
|
|||
/** |
|||
* 删除标识 0未删除;1已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
package com.epmet.dto.indexcollect.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class HistoryScoreComputeFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
public interface Compute extends CustomerClientShowGroup {} |
|||
|
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
@NotBlank(message = "组织Id不能为空", groups = Compute.class) |
|||
private String agencyId; |
|||
/** |
|||
* 计算类型 grid:网格活跃度 event:事件赋分 |
|||
*/ |
|||
@NotBlank(message = "计算类型不能为空", groups = Compute.class) |
|||
private String type; |
|||
/** |
|||
* 起始时间,yyyyMMdd |
|||
*/ |
|||
@NotBlank(message = "起始时间不能为空", groups = {Compute.class}) |
|||
private String startTime; |
|||
/** |
|||
* 终止时间,yyyyMMdd |
|||
*/ |
|||
@NotBlank(message = "终止时间不能为空", groups = {Compute.class}) |
|||
private String endTime; |
|||
|
|||
private String customerId; |
|||
private String userId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,106 @@ |
|||
package com.epmet.dto.indexcollect.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class HistoryScoreFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
public interface Add extends CustomerClientShowGroup {} |
|||
public interface Edit extends CustomerClientShowGroup {} |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@NotBlank(message = "id不能为空", groups = Edit.class) |
|||
private String id; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
@NotBlank(message = "标题不能为空", groups = Add.class) |
|||
private String title; |
|||
|
|||
/** |
|||
* 起始时间 |
|||
*/ |
|||
@NotNull(message = "起始时间不能为空", groups = {Add.class}) |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date startTime; |
|||
|
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
@NotNull(message = "截止时间不能为空", groups = {Add.class}) |
|||
@JsonFormat(pattern = "yyyy-MM-dd") |
|||
private Date endTime; |
|||
|
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
private List<Detail> detailList; |
|||
|
|||
private String customerId; |
|||
private String userId; |
|||
|
|||
|
|||
@Data |
|||
public static class Detail implements Serializable { |
|||
/** |
|||
* 街道组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 街道名称 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
/** |
|||
* 网格活跃度 |
|||
*/ |
|||
private BigDecimal wghyd; |
|||
|
|||
/** |
|||
* 事件赋分 |
|||
*/ |
|||
private BigDecimal sjff; |
|||
|
|||
/** |
|||
* 雪亮工程 |
|||
*/ |
|||
private BigDecimal xlgc; |
|||
|
|||
/** |
|||
* 日核周调 |
|||
*/ |
|||
private BigDecimal rhzt; |
|||
|
|||
/** |
|||
* 亮点工作 |
|||
*/ |
|||
private BigDecimal ldgz; |
|||
|
|||
/** |
|||
* 其他工作 |
|||
*/ |
|||
private BigDecimal qtgz; |
|||
|
|||
/** |
|||
* 能力得分 |
|||
*/ |
|||
private BigDecimal nldf; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,48 @@ |
|||
package com.epmet.dto.indexcollect.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
@Data |
|||
public class HistoryScoreListFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 起始时间 |
|||
*/ |
|||
//@JsonFormat(pattern = "yyyy-MM-dd")
|
|||
private String startTime; |
|||
|
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
//@JsonFormat(pattern = "yyyy-MM-dd")
|
|||
private String endTime; |
|||
|
|||
/** |
|||
* 当前页 |
|||
*/ |
|||
private Integer pageNo = 1; |
|||
|
|||
/** |
|||
* 每页记录数 |
|||
*/ |
|||
private Integer pageSize = 20; |
|||
|
|||
/** |
|||
* 是否分页【true分 false不分】 |
|||
*/ |
|||
private Boolean isPage = true; |
|||
|
|||
private String customerId; |
|||
private String userId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,58 @@ |
|||
package com.epmet.dto.indexcollect.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
@Data |
|||
public class WeightConfigurationFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
public interface Add extends CustomerClientShowGroup {} |
|||
public interface Edit extends CustomerClientShowGroup {} |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
@NotBlank(message = "标题不能为空", groups = Edit.class) |
|||
private String id; |
|||
|
|||
/** |
|||
* 网格活跃度 |
|||
*/ |
|||
private BigDecimal wghyd; |
|||
|
|||
/** |
|||
* 事件赋分 |
|||
*/ |
|||
private BigDecimal sjff; |
|||
|
|||
/** |
|||
* 雪亮工程 |
|||
*/ |
|||
private BigDecimal xlgc; |
|||
|
|||
/** |
|||
* 日核周调 |
|||
*/ |
|||
private BigDecimal rhzt; |
|||
|
|||
/** |
|||
* 亮点工作 |
|||
*/ |
|||
private BigDecimal ldgz; |
|||
|
|||
/** |
|||
* 其他工作 |
|||
*/ |
|||
private BigDecimal qtgz; |
|||
|
|||
private String customerId; |
|||
private String userId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.epmet.dto.indexcollect.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
@Data |
|||
public class WeightConfigurationListFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 当前页 |
|||
*/ |
|||
private Integer pageNo = 1; |
|||
|
|||
/** |
|||
* 每页记录数 |
|||
*/ |
|||
private Integer pageSize = 20; |
|||
|
|||
/** |
|||
* 是否分页【true分 false不分】 |
|||
*/ |
|||
private Boolean isPage; |
|||
|
|||
private String customerId; |
|||
private String userId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.epmet.dto.indexcollect.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
@Data |
|||
public class HistoryScoreComputeResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 分数 |
|||
*/ |
|||
private String score = "0"; |
|||
|
|||
} |
@ -0,0 +1,120 @@ |
|||
package com.epmet.dto.indexcollect.result; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class HistoryScoreDetailResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
public interface Add extends CustomerClientShowGroup { |
|||
} |
|||
|
|||
public interface Edit extends CustomerClientShowGroup { |
|||
} |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 起始时间 |
|||
*/ |
|||
private Date startTime; |
|||
|
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
private Date endTime; |
|||
|
|||
/** |
|||
* 时间区间 |
|||
*/ |
|||
private String time; |
|||
|
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private Date releaseTime; |
|||
|
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
private List<Detail> detailList; |
|||
|
|||
@Data |
|||
public static class Detail implements Serializable { |
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* screen_py_history_score.id |
|||
*/ |
|||
private String historyScoreId; |
|||
|
|||
/** |
|||
* 街道组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 街道名称 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
/** |
|||
* 网格活跃度 |
|||
*/ |
|||
private BigDecimal wghyd; |
|||
|
|||
/** |
|||
* 事件赋分 |
|||
*/ |
|||
private BigDecimal sjff; |
|||
|
|||
/** |
|||
* 雪亮工程 |
|||
*/ |
|||
private BigDecimal xlgc; |
|||
|
|||
/** |
|||
* 日核周调 |
|||
*/ |
|||
private BigDecimal rhzt; |
|||
|
|||
/** |
|||
* 亮点工作 |
|||
*/ |
|||
private BigDecimal ldgz; |
|||
|
|||
/** |
|||
* 其他工作 |
|||
*/ |
|||
private BigDecimal qtgz; |
|||
|
|||
/** |
|||
* 能力得分 |
|||
*/ |
|||
private BigDecimal nldf; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.epmet.dto.indexcollect.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
@Data |
|||
public class HistoryScoreListResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -4316054054019675419L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
/** |
|||
* 时间区间 |
|||
*/ |
|||
private String time; |
|||
/** |
|||
* 发布者 |
|||
*/ |
|||
private String updatedBy; |
|||
private String updatedById; |
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private String releaseTime; |
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.epmet.dto.indexcollect.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
@Data |
|||
public class HistoryScoreSjffResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 上报事件总得分 |
|||
*/ |
|||
private Integer eventScore; |
|||
/** |
|||
* 例行工作总得分 |
|||
*/ |
|||
private Integer projectScore; |
|||
/** |
|||
* 网格员总数 |
|||
*/ |
|||
private Integer gridStaffNum; |
|||
|
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.epmet.dto.indexcollect.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
@Data |
|||
public class WeightConfigurationListResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -4316054054019675419L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
/** |
|||
* 网格活跃度 |
|||
*/ |
|||
private BigDecimal wghyd; |
|||
/** |
|||
* 事件赋分 |
|||
*/ |
|||
private BigDecimal sjff; |
|||
/** |
|||
* 雪亮工程 |
|||
*/ |
|||
private BigDecimal xlgc; |
|||
/** |
|||
* 日核周调 |
|||
*/ |
|||
private BigDecimal rhzt; |
|||
/** |
|||
* 亮点工作 |
|||
*/ |
|||
private BigDecimal ldgz; |
|||
/** |
|||
* 其他工作 |
|||
*/ |
|||
private BigDecimal qtgz; |
|||
|
|||
} |
@ -0,0 +1,179 @@ |
|||
package com.epmet.dto.screen; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 平阴区事件上报中间表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-07-22 |
|||
*/ |
|||
@Data |
|||
public class EventreportPingyinDTO { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 上报区县代码,参照6位行政区划代码 |
|||
*/ |
|||
private String qxBm; |
|||
|
|||
/** |
|||
* 上报区县名称 |
|||
*/ |
|||
private String qxMc; |
|||
|
|||
/** |
|||
* 网格编码,参照《山东省社会治理网格化智能工作平台数据标准》 |
|||
*/ |
|||
private String gridCode; |
|||
|
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String gridName; |
|||
|
|||
/** |
|||
* 事件编号,可以使用区县系统中的事件唯一识别码 |
|||
*/ |
|||
private String eventCode; |
|||
|
|||
/** |
|||
* 事件名称 |
|||
*/ |
|||
private String eventName; |
|||
|
|||
/** |
|||
* 事件类别,参照《山东省社会治理网格化智能工作平台数据标准》10.19 |
|||
*/ |
|||
private String eventCategory; |
|||
|
|||
/** |
|||
* 上报网格员姓名 |
|||
*/ |
|||
private String gridUserName; |
|||
|
|||
/** |
|||
* 上报网格员的身份证号码 |
|||
*/ |
|||
private String gridUserCardid; |
|||
|
|||
/** |
|||
* 事件上报时间 |
|||
*/ |
|||
private Date reportTime; |
|||
|
|||
/** |
|||
* 事件发生时间 |
|||
*/ |
|||
private Date happenTime; |
|||
|
|||
/** |
|||
* 事件发生地点描述 |
|||
*/ |
|||
private String happenPlace; |
|||
|
|||
/** |
|||
* 事件简述,详细一些,文字数量不少于10字 |
|||
*/ |
|||
private String eventDescription; |
|||
|
|||
/** |
|||
* 事件办结方式,符合《标准》10.20 |
|||
*/ |
|||
private String waysOfResolving; |
|||
|
|||
/** |
|||
* 必填 是否化解,填写Y、N(Y 是 N 否) |
|||
*/ |
|||
private String successfulOrNo; |
|||
|
|||
/** |
|||
* 必填 是否办结,填写Y、N(Y 是 N 否) |
|||
*/ |
|||
private String successfulDefuse; |
|||
|
|||
/** |
|||
* 办结层级,符合《标准》10.21 |
|||
*/ |
|||
private String completeLevel; |
|||
|
|||
/** |
|||
* 办结时间,办结后填写 |
|||
*/ |
|||
private Date completeTime; |
|||
|
|||
/** |
|||
* 事件发生位置经度,wgs84坐标系,请勿用火星坐标系,不得跑出辖区 |
|||
*/ |
|||
private BigDecimal lng; |
|||
|
|||
/** |
|||
* 事件发生位置纬度,wgs84坐标系,请勿用火星坐标系,不得跑出辖区 |
|||
*/ |
|||
private BigDecimal lat; |
|||
|
|||
/** |
|||
* 事件主要当事人姓名 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 事件涉及人数 |
|||
*/ |
|||
private Integer numberInvolved; |
|||
|
|||
/** |
|||
* 事件涉及单位名称 |
|||
*/ |
|||
private String relatedUnites; |
|||
|
|||
/** |
|||
* 重点场所类别,符合《标准》10.25 |
|||
*/ |
|||
private String keyAreaType; |
|||
|
|||
/** |
|||
* 宗教活动规模,符合《标准》10.26 |
|||
*/ |
|||
private String religionScale; |
|||
|
|||
/** |
|||
* 宗教类别,符合《标准》10.27 |
|||
*/ |
|||
private String religionType; |
|||
|
|||
/** |
|||
* 重点场所是否变动,填写Y、N(Y 是 N 否) |
|||
*/ |
|||
private String isKeyareaState; |
|||
|
|||
/** |
|||
* 重点人员是否在当地,填写Y、N(Y 是 N 否) |
|||
*/ |
|||
private String isKeypeopleLocate; |
|||
|
|||
/** |
|||
* 重点人员现状描述 |
|||
*/ |
|||
private String keypeopleStatus; |
|||
|
|||
/** |
|||
* 例行工作编辑插入、更新时间,县市区填写 |
|||
*/ |
|||
private Date updateTime; |
|||
|
|||
/** |
|||
* 事件是否删除,Y:是、N:否 |
|||
*/ |
|||
private String isDel; |
|||
|
|||
/** |
|||
* 入库时间,自动生成,请勿设置 |
|||
*/ |
|||
private Date recoredInsertTime; |
|||
|
|||
} |
@ -0,0 +1,93 @@ |
|||
package com.epmet.dto.screen; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 平阴区网格员例行工作信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-07-22 |
|||
*/ |
|||
@Data |
|||
public class GridstaffWorkInfoPingyinDTO { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 上报区县代码,参照6位行政区划代码 |
|||
*/ |
|||
private String qxBm; |
|||
|
|||
/** |
|||
* 上报区县名称 |
|||
*/ |
|||
private String qxMc; |
|||
|
|||
/** |
|||
* 网格编码 |
|||
*/ |
|||
private String gridCode; |
|||
|
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String gridName; |
|||
|
|||
private String gridId; |
|||
|
|||
/** |
|||
* 例行工作类型,应符合10.27中的例行工作类型 |
|||
*/ |
|||
private String workType; |
|||
|
|||
/** |
|||
* 发生日期,格式为“YYYY-MM-DD” |
|||
*/ |
|||
private Date happenTime; |
|||
|
|||
/** |
|||
* 基础信息主键,出租房巡查、重点场所巡查、刑满释放人员、社区矫正、吸毒人员、信访人员重点青少年和精神障碍者必填 |
|||
*/ |
|||
private Integer baseInfoId; |
|||
|
|||
/** |
|||
* 有无变动(异常),Y:是、N:否 |
|||
*/ |
|||
private String workResult; |
|||
|
|||
/** |
|||
* 说明 |
|||
*/ |
|||
private String workContent; |
|||
|
|||
/** |
|||
* 例行工作编辑插入、更新时间,,县市区填写 |
|||
*/ |
|||
private Date updateTime; |
|||
|
|||
/** |
|||
* 例行工作是否删除,Y:是、N:否 |
|||
*/ |
|||
private String isDel; |
|||
|
|||
/** |
|||
* 入库时间,自动生成,请勿设置 |
|||
*/ |
|||
private Date recoredInsertTime; |
|||
|
|||
private String happenTimeString; |
|||
|
|||
private String title; |
|||
private String staffName; |
|||
private String mobile; |
|||
private String orgId; |
|||
private String pids; |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.dto.screen.form;/** |
|||
* @author ZhaoQiFeng |
|||
* @date 2022/12/8 |
|||
* @apiNote |
|||
*/ |
|||
|
|||
import com.epmet.dto.screen.EventreportPingyinDTO; |
|||
import com.epmet.dto.screen.GridstaffWorkInfoPingyinDTO; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/8 13:47 |
|||
*/ |
|||
@Data |
|||
public class SavePyEventDataFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 526763788231934112L; |
|||
/** |
|||
* 项目列表 |
|||
*/ |
|||
private List<EventreportPingyinDTO> projectList; |
|||
/** |
|||
* 例行工作列表 |
|||
*/ |
|||
private List<GridstaffWorkInfoPingyinDTO> workList; |
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.indexcollect.ScreenPyGridStaffDTO; |
|||
import com.epmet.service.evaluationindex.indexcoll.ScreenPyGridStaffService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 平阴区网格员基础信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Slf4j |
|||
@RestController |
|||
@RequestMapping("screenPyGridStaff") |
|||
public class ScreenPyGridStaffController { |
|||
|
|||
@Autowired |
|||
private ScreenPyGridStaffService screenPyStaffDataService; |
|||
|
|||
|
|||
@PostMapping("savelist") |
|||
public Result saveList(@RequestBody List<ScreenPyGridStaffDTO> dtoList) { |
|||
screenPyStaffDataService.saveList(dtoList); |
|||
return new Result(); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,154 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.alibaba.excel.EasyExcel; |
|||
import com.alibaba.excel.ExcelWriter; |
|||
import com.alibaba.excel.support.ExcelTypeEnum; |
|||
import com.alibaba.excel.write.metadata.WriteSheet; |
|||
import com.alibaba.fastjson.JSON; |
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.utils.DateUtils; |
|||
import com.epmet.commons.tools.utils.ExcelUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.utils.poi.excel.handler.CustomerTitleHandler; |
|||
import com.epmet.commons.tools.utils.poi.excel.handler.ExcelFillCellMergeStrategy; |
|||
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreComputeFormDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreFormDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreComputeResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; |
|||
import com.epmet.excel.HistoryScoreDetailExcel; |
|||
import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailService; |
|||
import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.IOException; |
|||
import java.io.PrintWriter; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 平阴历史得分主表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Slf4j |
|||
@RestController |
|||
@RequestMapping("screenPyHistoryScore") |
|||
public class ScreenPyHistoryScoreController { |
|||
|
|||
@Autowired |
|||
private ScreenPyHistoryScoreService screenPyHistoryScoreService; |
|||
@Autowired |
|||
private ScreenPyHistoryScoreDetailService screenPyHistoryScoreDetailService; |
|||
|
|||
|
|||
@RequestMapping("list") |
|||
public Result<PageData<HistoryScoreListResultDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreListFormDTO formDTO) { |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
formDTO.setUserId(tokenDto.getUserId()); |
|||
return new Result<PageData<HistoryScoreListResultDTO>>().ok(screenPyHistoryScoreService.list(formDTO)); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("add") |
|||
public Result save(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreFormDTO dto) { |
|||
ValidatorUtils.validateEntity(dto, HistoryScoreFormDTO.Add.class); |
|||
dto.setCustomerId(tokenDto.getCustomerId()); |
|||
dto.setUserId(tokenDto.getUserId()); |
|||
screenPyHistoryScoreService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("edit") |
|||
public Result update(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreFormDTO dto) { |
|||
ValidatorUtils.validateEntity(dto, HistoryScoreFormDTO.Edit.class); |
|||
dto.setCustomerId(tokenDto.getCustomerId()); |
|||
dto.setUserId(tokenDto.getUserId()); |
|||
screenPyHistoryScoreService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("deleteById") |
|||
public Result deleteById(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreFormDTO dto) { |
|||
ValidatorUtils.validateEntity(dto, HistoryScoreFormDTO.Edit.class); |
|||
dto.setCustomerId(tokenDto.getCustomerId()); |
|||
dto.setUserId(tokenDto.getUserId()); |
|||
screenPyHistoryScoreService.deleteById(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@RequestMapping("detail") |
|||
public Result<HistoryScoreDetailResultDTO> detail(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, HistoryScoreFormDTO.Edit.class); |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
return new Result<HistoryScoreDetailResultDTO>().ok(screenPyHistoryScoreService.detail(formDTO)); |
|||
} |
|||
|
|||
@PostMapping("export") |
|||
public void export(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreListFormDTO formDTO, HttpServletResponse response) throws IOException { |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
formDTO.setUserId(tokenDto.getUserId()); |
|||
|
|||
formDTO.setIsPage(false); |
|||
ExcelWriter excelWriter = null; |
|||
formDTO.setPageNo(NumConstant.ONE); |
|||
formDTO.setPageSize(NumConstant.FIVE_HUNDRED); |
|||
try { |
|||
String fileName = "历史得分" + DateUtils.format(new Date()) + ".xlsx"; |
|||
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), HistoryScoreDetailExcel.class).excelType(ExcelTypeEnum.XLSX).build(); |
|||
|
|||
PageData<HistoryScoreDetailResultDTO> data = null; |
|||
List<HistoryScoreDetailExcel> list = null; |
|||
do { |
|||
data = screenPyHistoryScoreDetailService.selectScoreDetailList(formDTO); |
|||
|
|||
for (HistoryScoreDetailResultDTO d : data.getList()){ |
|||
list = ConvertUtils.sourceToTarget(d.getDetailList(), HistoryScoreDetailExcel.class); |
|||
//一条主表记录一个sheet页
|
|||
WriteSheet writeSheet = EasyExcel.writerSheet("(" + d.getTitle() + ")").registerWriteHandler(new CustomerTitleHandler(d.getTime())).build(); |
|||
excelWriter.write(list, writeSheet); |
|||
} |
|||
formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); |
|||
} while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); |
|||
} catch (EpmetException e) { |
|||
response.reset(); |
|||
response.setCharacterEncoding("UTF-8"); |
|||
response.setHeader("content-type", "application/json; charset=UTF-8"); |
|||
PrintWriter printWriter = response.getWriter(); |
|||
Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); |
|||
printWriter.write(JSON.toJSONString(result)); |
|||
printWriter.close(); |
|||
} catch (Exception e) { |
|||
log.error("export exception", e); |
|||
} finally { |
|||
if (excelWriter != null) { |
|||
excelWriter.finish(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@RequestMapping("computescore") |
|||
public Result<HistoryScoreComputeResultDTO> computeScore(@LoginUser TokenDto tokenDto, @RequestBody HistoryScoreComputeFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, HistoryScoreComputeFormDTO.Compute.class); |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
return new Result<HistoryScoreComputeResultDTO>().ok(screenPyHistoryScoreService.computeScore(formDTO)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,70 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dto.indexcollect.form.WeightConfigurationFormDTO; |
|||
import com.epmet.dto.indexcollect.form.WeightConfigurationListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO; |
|||
import com.epmet.service.evaluationindex.indexcoll.ScreenPyWeightConfigurationService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* 平阴政法能力权重配置 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Slf4j |
|||
@RestController |
|||
@RequestMapping("screenPyWeightConfiguration") |
|||
public class ScreenPyWeightConfigurationController { |
|||
|
|||
@Autowired |
|||
private ScreenPyWeightConfigurationService screenPyWeightConfigurationService; |
|||
|
|||
|
|||
@RequestMapping("list") |
|||
public Result<PageData<WeightConfigurationListResultDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody WeightConfigurationListFormDTO formDTO) { |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
formDTO.setUserId(tokenDto.getUserId()); |
|||
return new Result<PageData<WeightConfigurationListResultDTO>>().ok(screenPyWeightConfigurationService.list(formDTO)); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("add") |
|||
public Result save(@LoginUser TokenDto tokenDto, @RequestBody WeightConfigurationFormDTO dto) { |
|||
ValidatorUtils.validateEntity(dto, WeightConfigurationFormDTO.Add.class); |
|||
dto.setCustomerId(tokenDto.getCustomerId()); |
|||
dto.setUserId(tokenDto.getUserId()); |
|||
screenPyWeightConfigurationService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("edit") |
|||
public Result update(@LoginUser TokenDto tokenDto, @RequestBody WeightConfigurationFormDTO dto) { |
|||
ValidatorUtils.validateEntity(dto, WeightConfigurationFormDTO.Edit.class); |
|||
dto.setCustomerId(tokenDto.getCustomerId()); |
|||
dto.setUserId(tokenDto.getUserId()); |
|||
screenPyWeightConfigurationService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("deleteById") |
|||
public Result deleteById(@LoginUser TokenDto tokenDto, @RequestBody WeightConfigurationFormDTO dto) { |
|||
ValidatorUtils.validateEntity(dto, WeightConfigurationFormDTO.Edit.class); |
|||
dto.setCustomerId(tokenDto.getCustomerId()); |
|||
dto.setUserId(tokenDto.getUserId()); |
|||
screenPyWeightConfigurationService.deleteById(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.epmet.dao.evaluationindex.indexcoll; /** |
|||
* 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/>.
|
|||
*/ |
|||
|
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyGridStaffEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 平阴区网格员基础信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Mapper |
|||
public interface ScreenPyGridStaffDao extends BaseDao<ScreenPyGridStaffEntity> { |
|||
|
|||
ScreenPyGridStaffEntity selectStaff(@Param("gridId") String gridId, @Param("staffId") String staffId); |
|||
|
|||
} |
@ -0,0 +1,44 @@ |
|||
package com.epmet.dao.evaluationindex.indexcoll; /** |
|||
* 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/>.
|
|||
*/ |
|||
|
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreComputeFormDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreSjffResultDTO; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 平阴历史得分主表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Mapper |
|||
public interface ScreenPyHistoryScoreDao extends BaseDao<ScreenPyHistoryScoreEntity> { |
|||
|
|||
List<HistoryScoreListResultDTO> selectHistoryScoreList(HistoryScoreListFormDTO formDTO); |
|||
|
|||
HistoryScoreSjffResultDTO sumEventScore(HistoryScoreComputeFormDTO formDTO); |
|||
|
|||
HistoryScoreSjffResultDTO sumProjectScore(HistoryScoreComputeFormDTO formDTO); |
|||
|
|||
HistoryScoreSjffResultDTO sumGridNum(HistoryScoreComputeFormDTO formDTO); |
|||
} |
@ -0,0 +1,40 @@ |
|||
package com.epmet.dao.evaluationindex.indexcoll; /** |
|||
* 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/>.
|
|||
*/ |
|||
|
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 平阴历史得分明细表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Mapper |
|||
public interface ScreenPyHistoryScoreDetailDao extends BaseDao<ScreenPyHistoryScoreDetailEntity> { |
|||
|
|||
void delByHistoryScoreId(@Param("historyScoreId") String historyScoreId, @Param("userId") String userId); |
|||
|
|||
List<HistoryScoreDetailResultDTO> selectScoreDetailList(HistoryScoreListFormDTO formDTO); |
|||
|
|||
} |
@ -0,0 +1,43 @@ |
|||
package com.epmet.dao.evaluationindex.indexcoll; /** |
|||
* 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/>.
|
|||
*/ |
|||
|
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.indexcollect.ScreenPyWeightConfigurationDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; |
|||
import com.epmet.dto.indexcollect.form.WeightConfigurationListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; |
|||
import com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreEntity; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyWeightConfigurationEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 平阴政法能力权重配置 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Mapper |
|||
public interface ScreenPyWeightConfigurationDao extends BaseDao<ScreenPyWeightConfigurationEntity> { |
|||
|
|||
List<WeightConfigurationListResultDTO> selectWeightConfigurationList(WeightConfigurationListFormDTO formDTO); |
|||
|
|||
ScreenPyWeightConfigurationDTO selectOneDTO(); |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao.evaluationindex.screen; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.evaluationindex.screen.ScreenPyEventDataEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 上报到市平台中间库的事件 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-12-08 |
|||
*/ |
|||
@Mapper |
|||
public interface ScreenPyEventDataDao extends BaseDao<ScreenPyEventDataEntity> { |
|||
|
|||
} |
@ -0,0 +1,84 @@ |
|||
/** |
|||
* 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.epmet.entity.evaluationindex.indexcoll; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 平阴区网格员基础信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("screen_py_grid_staff") |
|||
public class ScreenPyGridStaffEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格Id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 网格编码 |
|||
*/ |
|||
private String gridCode; |
|||
|
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String gridName; |
|||
|
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 工作人员Id |
|||
*/ |
|||
private String staffId; |
|||
|
|||
/** |
|||
* 网格员姓名 |
|||
*/ |
|||
private String staffName; |
|||
|
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
private String mobile; |
|||
|
|||
/** |
|||
* 是否离职,格式为Y:是、N:否 |
|||
*/ |
|||
private String isLeave; |
|||
|
|||
} |
@ -0,0 +1,94 @@ |
|||
/** |
|||
* 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.epmet.entity.evaluationindex.indexcoll; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 平阴历史得分明细表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("screen_py_history_score_detail") |
|||
public class ScreenPyHistoryScoreDetailEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* screen_py_history_score.id |
|||
*/ |
|||
private String historyScoreId; |
|||
|
|||
/** |
|||
* 街道组织Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 街道名称 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
/** |
|||
* 网格活跃度 |
|||
*/ |
|||
private BigDecimal wghyd; |
|||
|
|||
/** |
|||
* 事件赋分 |
|||
*/ |
|||
private BigDecimal sjff; |
|||
|
|||
/** |
|||
* 雪亮工程 |
|||
*/ |
|||
private BigDecimal xlgc; |
|||
|
|||
/** |
|||
* 日核周调 |
|||
*/ |
|||
private BigDecimal rhzt; |
|||
|
|||
/** |
|||
* 亮点工作 |
|||
*/ |
|||
private BigDecimal ldgz; |
|||
|
|||
/** |
|||
* 其他工作 |
|||
*/ |
|||
private BigDecimal qtgz; |
|||
|
|||
/** |
|||
* 能力得分 |
|||
*/ |
|||
private BigDecimal nldf; |
|||
|
|||
} |
@ -0,0 +1,64 @@ |
|||
/** |
|||
* 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.epmet.entity.evaluationindex.indexcoll; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 平阴历史得分主表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("screen_py_history_score") |
|||
public class ScreenPyHistoryScoreEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 起始时间 |
|||
*/ |
|||
private Date startTime; |
|||
|
|||
/** |
|||
* 截止时间 |
|||
*/ |
|||
private Date endTime; |
|||
|
|||
/** |
|||
* 发布时间 |
|||
*/ |
|||
private Date releaseTime; |
|||
|
|||
} |
@ -0,0 +1,74 @@ |
|||
/** |
|||
* 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.epmet.entity.evaluationindex.indexcoll; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 平阴政法能力权重配置 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("screen_py_weight_configuration") |
|||
public class ScreenPyWeightConfigurationEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格活跃度 |
|||
*/ |
|||
private BigDecimal wghyd; |
|||
|
|||
/** |
|||
* 事件赋分 |
|||
*/ |
|||
private BigDecimal sjff; |
|||
|
|||
/** |
|||
* 雪亮工程 |
|||
*/ |
|||
private BigDecimal xlgc; |
|||
|
|||
/** |
|||
* 日核周调 |
|||
*/ |
|||
private BigDecimal rhzt; |
|||
|
|||
/** |
|||
* 亮点工作 |
|||
*/ |
|||
private BigDecimal ldgz; |
|||
|
|||
/** |
|||
* 其他工作 |
|||
*/ |
|||
private BigDecimal qtgz; |
|||
|
|||
} |
@ -0,0 +1,70 @@ |
|||
package com.epmet.entity.evaluationindex.screen; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 上报到市平台中间库的事件 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-12-08 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("screen_py_event_data") |
|||
public class ScreenPyEventDataEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
///**
|
|||
// * 客户Id
|
|||
// */
|
|||
//private String customerId;
|
|||
|
|||
/** |
|||
* 上级组织Id |
|||
*/ |
|||
private String orgId; |
|||
|
|||
/** |
|||
* 所有上级ID,用英文逗号分开 |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 事件Id |
|||
*/ |
|||
private String eventId; |
|||
|
|||
/** |
|||
* 事件类别 上报事件:project;例行工作:work |
|||
*/ |
|||
private String eventType; |
|||
|
|||
/** |
|||
* 事件时间 |
|||
*/ |
|||
private Date eventCreateTime; |
|||
|
|||
/** |
|||
* 事件分类编码 |
|||
*/ |
|||
private String categoryCode; |
|||
|
|||
private String title; |
|||
|
|||
private String staffName; |
|||
|
|||
private String mobile; |
|||
|
|||
///**
|
|||
// * 父类事件分类编码
|
|||
// */
|
|||
//private String parentCategoryCode;
|
|||
|
|||
} |
@ -0,0 +1,57 @@ |
|||
package com.epmet.excel; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
|||
import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
|||
import com.alibaba.excel.annotation.write.style.HeadStyle; |
|||
import com.alibaba.excel.enums.poi.FillPatternTypeEnum; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 政法能力历史得分-导出 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44) |
|||
@HeadRowHeight(40) |
|||
@Data |
|||
public class HistoryScoreDetailExcel implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -12110233388005838L; |
|||
@ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "下级单位"}) |
|||
@ColumnWidth(15) |
|||
@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 44) |
|||
private String agencyName; |
|||
|
|||
@ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "网格活跃度"}) |
|||
@ColumnWidth(15) |
|||
private BigDecimal wghyd; |
|||
|
|||
@ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "事件赋值得分"}) |
|||
@ColumnWidth(20) |
|||
private BigDecimal sjff; |
|||
|
|||
@ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "雪亮工程"}) |
|||
@ColumnWidth(15) |
|||
private BigDecimal xlgc; |
|||
|
|||
@ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "日核周调"}) |
|||
@ColumnWidth(15) |
|||
private BigDecimal rhzt; |
|||
|
|||
@ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "亮点工作"}) |
|||
@ColumnWidth(15) |
|||
private BigDecimal ldgz; |
|||
|
|||
@ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "其他工作"}) |
|||
@ColumnWidth(15) |
|||
private BigDecimal qtgz; |
|||
|
|||
@ExcelProperty(value = {"平阴县街道(镇)政法能力得分排行", "${title}", "能力得分"}) |
|||
@ColumnWidth(15) |
|||
private BigDecimal nldf; |
|||
|
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.epmet.service.evaluationindex.indexcoll; |
|||
|
|||
import com.epmet.dto.indexcollect.ScreenPyGridStaffDTO; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 平阴区网格员基础信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
public interface ScreenPyGridStaffService { |
|||
|
|||
void saveList(List<ScreenPyGridStaffDTO> dtoList); |
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.epmet.service.evaluationindex.indexcoll; |
|||
|
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 平阴历史得分明细表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
public interface ScreenPyHistoryScoreDetailService { |
|||
|
|||
PageData<HistoryScoreDetailResultDTO> selectScoreDetailList(HistoryScoreListFormDTO formDTO); |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.service.evaluationindex.indexcoll; |
|||
|
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreComputeFormDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreFormDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreComputeResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; |
|||
import com.epmet.dto.result.IcMoveInListResultDTO; |
|||
|
|||
/** |
|||
* 平阴历史得分主表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
public interface ScreenPyHistoryScoreService { |
|||
|
|||
PageData<HistoryScoreListResultDTO> list(HistoryScoreListFormDTO formDTO); |
|||
|
|||
void save(HistoryScoreFormDTO dto); |
|||
|
|||
void update(HistoryScoreFormDTO dto); |
|||
|
|||
void deleteById(HistoryScoreFormDTO dto); |
|||
|
|||
HistoryScoreDetailResultDTO detail(HistoryScoreFormDTO formDTO); |
|||
|
|||
HistoryScoreComputeResultDTO computeScore(HistoryScoreComputeFormDTO formDTO); |
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.epmet.service.evaluationindex.indexcoll; |
|||
|
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.indexcollect.form.WeightConfigurationFormDTO; |
|||
import com.epmet.dto.indexcollect.form.WeightConfigurationListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO; |
|||
|
|||
/** |
|||
* 平阴政法能力权重配置 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
public interface ScreenPyWeightConfigurationService { |
|||
|
|||
PageData<WeightConfigurationListResultDTO> list(WeightConfigurationListFormDTO formDTO); |
|||
|
|||
void save(WeightConfigurationFormDTO dto); |
|||
|
|||
void update(WeightConfigurationFormDTO dto); |
|||
|
|||
void deleteById(WeightConfigurationFormDTO dto); |
|||
|
|||
} |
@ -0,0 +1,53 @@ |
|||
package com.epmet.service.evaluationindex.indexcoll.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.StrConstant; |
|||
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.dao.evaluationindex.indexcoll.ScreenPyGridStaffDao; |
|||
import com.epmet.dto.indexcollect.ScreenPyGridStaffDTO; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyGridStaffEntity; |
|||
import com.epmet.service.evaluationindex.indexcoll.ScreenPyGridStaffService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 平阴区网格员基础信息 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
|||
public class ScreenPyGridStaffServiceImpl extends BaseServiceImpl<ScreenPyGridStaffDao, ScreenPyGridStaffEntity> implements ScreenPyGridStaffService { |
|||
|
|||
@Override |
|||
public void saveList(List<ScreenPyGridStaffDTO> dtoList) { |
|||
dtoList.forEach(d -> { |
|||
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(StrConstant.PY_CUSTOMER, d.getStaffId()); |
|||
if (null == staffInfo) { |
|||
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", d.getStaffId())); |
|||
} |
|||
ScreenPyGridStaffEntity entity = baseDao.selectStaff(d.getGridId(), d.getStaffId()); |
|||
//存在就更新 不存在就新增
|
|||
if (null != entity) { |
|||
ScreenPyGridStaffEntity entity1 = ConvertUtils.sourceToTarget(d, ScreenPyGridStaffEntity.class); |
|||
entity1.setId(entity.getId()); |
|||
entity1.setPids(("".equals(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":") + staffInfo.getAgencyId()); |
|||
baseDao.updateById(entity1); |
|||
} else { |
|||
ScreenPyGridStaffEntity saveEntity = ConvertUtils.sourceToTarget(d, ScreenPyGridStaffEntity.class); |
|||
saveEntity.setId(IdWorker.getIdStr()); |
|||
saveEntity.setPids(("".equals(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds() + ":") + staffInfo.getAgencyId()); |
|||
insert(saveEntity); |
|||
} |
|||
}); |
|||
} |
|||
} |
@ -0,0 +1,40 @@ |
|||
package com.epmet.service.evaluationindex.indexcoll.impl; |
|||
|
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailDao; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailEntity; |
|||
import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailService; |
|||
import com.github.pagehelper.PageHelper; |
|||
import com.github.pagehelper.PageInfo; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 平阴历史得分明细表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
|||
public class ScreenPyHistoryScoreDetailServiceImpl extends BaseServiceImpl<ScreenPyHistoryScoreDetailDao, ScreenPyHistoryScoreDetailEntity> implements ScreenPyHistoryScoreDetailService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<HistoryScoreDetailResultDTO> selectScoreDetailList(HistoryScoreListFormDTO formDTO) { |
|||
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); |
|||
List<HistoryScoreDetailResultDTO> list = baseDao.selectScoreDetailList(formDTO); |
|||
PageInfo<HistoryScoreDetailResultDTO> pageInfo = new PageInfo<>(list); |
|||
return new PageData<>(list, pageInfo.getTotal()); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,203 @@ |
|||
package com.epmet.service.evaluationindex.indexcoll.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDao; |
|||
import com.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailDao; |
|||
import com.epmet.dao.evaluationindex.indexcoll.ScreenPyWeightConfigurationDao; |
|||
import com.epmet.dataaggre.dto.govorg.form.GridLivelyFormDTO; |
|||
import com.epmet.dataaggre.dto.govorg.result.GridLivelyResultDTO; |
|||
import com.epmet.dataaggre.feign.DataAggregatorOpenFeignClient; |
|||
import com.epmet.dto.indexcollect.ScreenPyHistoryScoreDetailDTO; |
|||
import com.epmet.dto.indexcollect.ScreenPyWeightConfigurationDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreComputeFormDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreFormDTO; |
|||
import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreComputeResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; |
|||
import com.epmet.dto.indexcollect.result.HistoryScoreSjffResultDTO; |
|||
import com.epmet.dto.result.IcMoveInListResultDTO; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailEntity; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreEntity; |
|||
import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailService; |
|||
import com.epmet.service.evaluationindex.indexcoll.ScreenPyHistoryScoreService; |
|||
import com.github.pagehelper.PageHelper; |
|||
import com.github.pagehelper.PageInfo; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.text.NumberFormat; |
|||
import java.util.ArrayList; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 平阴历史得分主表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@DataSource(DataSourceConstant.EVALUATION_INDEX_READ) |
|||
public class ScreenPyHistoryScoreServiceImpl implements ScreenPyHistoryScoreService { |
|||
|
|||
@Autowired |
|||
private ScreenPyHistoryScoreDao screenPyHistoryScoreDao; |
|||
@Autowired |
|||
private ScreenPyHistoryScoreDetailServiceImpl screenPyHistoryScoreDetailServiceImpl; |
|||
@Autowired |
|||
private ScreenPyHistoryScoreDetailDao screenPyHistoryScoreDetailDao; |
|||
@Autowired |
|||
private DataAggregatorOpenFeignClient dataAggregatorOpenFeignClient; |
|||
@Autowired |
|||
private ScreenPyWeightConfigurationDao screenPyWeightConfigurationDao; |
|||
|
|||
|
|||
@Override |
|||
public PageData<HistoryScoreListResultDTO> list(HistoryScoreListFormDTO formDTO) { |
|||
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); |
|||
List<HistoryScoreListResultDTO> list = screenPyHistoryScoreDao.selectHistoryScoreList(formDTO); |
|||
PageInfo<HistoryScoreListResultDTO> pageInfo = new PageInfo<>(list); |
|||
return new PageData<>(list, pageInfo.getTotal()); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(HistoryScoreFormDTO formDTO) { |
|||
//1.主表新增数据
|
|||
ScreenPyHistoryScoreEntity entity = ConvertUtils.sourceToTarget(formDTO, ScreenPyHistoryScoreEntity.class); |
|||
entity.setReleaseTime(new Date()); |
|||
screenPyHistoryScoreDao.insert(entity); |
|||
//2.明细表新增数据
|
|||
ScreenPyWeightConfigurationDTO wcDTO = screenPyWeightConfigurationDao.selectOneDTO(); |
|||
List<ScreenPyHistoryScoreDetailEntity> list = new ArrayList<>(); |
|||
formDTO.getDetailList().forEach(dto -> { |
|||
ScreenPyHistoryScoreDetailEntity detailEntity = ConvertUtils.sourceToTarget(dto, ScreenPyHistoryScoreDetailEntity.class); |
|||
detailEntity.setCustomerId(formDTO.getCustomerId()); |
|||
detailEntity.setHistoryScoreId(entity.getId()); |
|||
if (null != wcDTO) { |
|||
BigDecimal nldf = detailEntity.getWghyd().multiply(wcDTO.getWghyd()).add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())) |
|||
.add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())).add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())) |
|||
.add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())).add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())); |
|||
detailEntity.setNldf(nldf); |
|||
} |
|||
list.add(detailEntity); |
|||
}); |
|||
screenPyHistoryScoreDetailServiceImpl.insertBatch(list); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(HistoryScoreFormDTO formDTO) { |
|||
ScreenPyHistoryScoreEntity entity = screenPyHistoryScoreDao.selectById(formDTO.getId()); |
|||
if (entity == null) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息"); |
|||
} |
|||
//1.更新主表
|
|||
ScreenPyHistoryScoreEntity newEntity = ConvertUtils.sourceToTarget(formDTO, ScreenPyHistoryScoreEntity.class); |
|||
newEntity.setId(entity.getId()); |
|||
screenPyHistoryScoreDao.updateById(newEntity); |
|||
//2.更新字表 字表先删后增
|
|||
List<ScreenPyHistoryScoreDetailEntity> list = new ArrayList<>(); |
|||
ScreenPyWeightConfigurationDTO wcDTO = screenPyWeightConfigurationDao.selectOneDTO(); |
|||
formDTO.getDetailList().forEach(dto -> { |
|||
ScreenPyHistoryScoreDetailEntity detailEntity = ConvertUtils.sourceToTarget(dto, ScreenPyHistoryScoreDetailEntity.class); |
|||
detailEntity.setCustomerId(entity.getCustomerId()); |
|||
detailEntity.setHistoryScoreId(entity.getId()); |
|||
if (null != wcDTO) { |
|||
BigDecimal nldf = detailEntity.getWghyd().multiply(wcDTO.getWghyd()).add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())) |
|||
.add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())).add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())) |
|||
.add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())).add(detailEntity.getWghyd().multiply(wcDTO.getWghyd())); |
|||
detailEntity.setNldf(nldf); |
|||
} |
|||
list.add(detailEntity); |
|||
}); |
|||
screenPyHistoryScoreDetailDao.delByHistoryScoreId(formDTO.getId(), formDTO.getUserId()); |
|||
screenPyHistoryScoreDetailServiceImpl.insertBatch(list); |
|||
} |
|||
|
|||
@Override |
|||
public void deleteById(HistoryScoreFormDTO formDTO) { |
|||
ScreenPyHistoryScoreEntity entity = screenPyHistoryScoreDao.selectById(formDTO.getId()); |
|||
if (entity == null) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息"); |
|||
} |
|||
entity.setDelFlag("1"); |
|||
screenPyHistoryScoreDao.updateById(entity); |
|||
screenPyHistoryScoreDetailDao.delByHistoryScoreId(formDTO.getId(), formDTO.getUserId()); |
|||
} |
|||
|
|||
@Override |
|||
public HistoryScoreDetailResultDTO detail(HistoryScoreFormDTO formDTO) { |
|||
HistoryScoreDetailResultDTO resultDTO = new HistoryScoreDetailResultDTO(); |
|||
//1.主表数据
|
|||
ScreenPyHistoryScoreEntity entity = screenPyHistoryScoreDao.selectById(formDTO.getId()); |
|||
if (entity == null) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息"); |
|||
} |
|||
resultDTO = ConvertUtils.sourceToTarget(entity, HistoryScoreDetailResultDTO.class); |
|||
//2.字表数据
|
|||
LambdaQueryWrapper<ScreenPyHistoryScoreDetailEntity> wrapper = new LambdaQueryWrapper<>(); |
|||
wrapper.eq(ScreenPyHistoryScoreDetailEntity::getHistoryScoreId, formDTO.getId()); |
|||
wrapper.eq(ScreenPyHistoryScoreDetailEntity::getDelFlag, "0"); |
|||
wrapper.orderByDesc(ScreenPyHistoryScoreDetailEntity::getNldf); |
|||
List<ScreenPyHistoryScoreDetailEntity> list = screenPyHistoryScoreDetailDao.selectList(wrapper); |
|||
List<HistoryScoreDetailResultDTO.Detail> detailList = ConvertUtils.sourceToTarget(list, HistoryScoreDetailResultDTO.Detail.class); |
|||
resultDTO.setDetailList(detailList); |
|||
return resultDTO; |
|||
} |
|||
|
|||
@Override |
|||
public HistoryScoreComputeResultDTO computeScore(HistoryScoreComputeFormDTO formDTO) { |
|||
HistoryScoreComputeResultDTO resultDTO = new HistoryScoreComputeResultDTO(); |
|||
resultDTO.setAgencyId(formDTO.getAgencyId()); |
|||
//计算百分比使用,保留小数点后两位
|
|||
NumberFormat numberFormat = NumberFormat.getInstance(); |
|||
numberFormat.setMaximumFractionDigits(NumConstant.TWO); |
|||
if ("grid".equals(formDTO.getType())) { |
|||
/** |
|||
* 网格活跃度每周得分=(活跃网格数/本街镇网格数)x100+(正常网格数/本街镇网格数)x80 |
|||
* 1周内每个末级网格有五天及五天以上上传事件或开展例行工作的为活跃网格;有2天及2天以上,5天以下上传事件或开展例行工作的为正常运行网格;只有1天上传事件或开展例行工作的为僵尸网格 |
|||
* 本街镇网格数基于本街镇基础网格总数进行计算,不包含专属网格 |
|||
*/ |
|||
//1.获取街道下时间区间内的网格活跃度数据
|
|||
GridLivelyFormDTO form = ConvertUtils.sourceToTarget(formDTO, GridLivelyFormDTO.class); |
|||
form.setType("historyScore"); |
|||
Result<List<GridLivelyResultDTO>> result = dataAggregatorOpenFeignClient.grdiLively(form); |
|||
if (!result.success() || result.getData() == null) { |
|||
throw new RenException("统计街道下网格活跃度数据失败"); |
|||
} |
|||
GridLivelyResultDTO gridLively = result.getData().get(NumConstant.ZERO); |
|||
String score = (gridLively.getGridSumNum() <= 0) ? "0" : numberFormat.format(((float) gridLively.getGridLivelyNum() / (float) gridLively.getGridSumNum()) * 100 + (gridLively.getGridOrdinaryNum() / gridLively.getGridSumNum()) * 80); |
|||
resultDTO.setScore(score); |
|||
} else if ("event".equals(formDTO.getType())) { |
|||
/** |
|||
* 事件赋分= 街道下末级网格上报事件数量乘以对应的每项事件分值的累加和除以街道下有效未离职状态的网格员总数 |
|||
* 加上街道下末级网格例行工作数量乘以对应的每项事件分值的累加和除以街道下有效未离职状态的网格员总数 |
|||
*/ |
|||
//查询街道下时间区间内事件总分
|
|||
HistoryScoreSjffResultDTO dto1 = screenPyHistoryScoreDao.sumEventScore(formDTO); |
|||
//查询街道下时间区间内例行工作总分
|
|||
HistoryScoreSjffResultDTO dto2 = screenPyHistoryScoreDao.sumProjectScore(formDTO); |
|||
//查询街道下有效网格员数
|
|||
HistoryScoreSjffResultDTO dto3 = screenPyHistoryScoreDao.sumGridNum(formDTO); |
|||
String score = numberFormat.format(((float) dto1.getEventScore() / (float) dto3.getGridStaffNum()) + (dto2.getProjectScore() / dto3.getGridStaffNum())); |
|||
resultDTO.setScore(score); |
|||
} |
|||
return resultDTO; |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,74 @@ |
|||
package com.epmet.service.evaluationindex.indexcoll.impl; |
|||
|
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.dao.evaluationindex.indexcoll.ScreenPyWeightConfigurationDao; |
|||
import com.epmet.dto.indexcollect.form.WeightConfigurationFormDTO; |
|||
import com.epmet.dto.indexcollect.form.WeightConfigurationListFormDTO; |
|||
import com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO; |
|||
import com.epmet.entity.evaluationindex.indexcoll.ScreenPyWeightConfigurationEntity; |
|||
import com.epmet.service.evaluationindex.indexcoll.ScreenPyWeightConfigurationService; |
|||
import com.github.pagehelper.PageHelper; |
|||
import com.github.pagehelper.PageInfo; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 平阴政法能力权重配置 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
|||
public class ScreenPyWeightConfigurationServiceImpl extends BaseServiceImpl<ScreenPyWeightConfigurationDao, ScreenPyWeightConfigurationEntity> implements ScreenPyWeightConfigurationService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<WeightConfigurationListResultDTO> list(WeightConfigurationListFormDTO formDTO) { |
|||
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); |
|||
List<WeightConfigurationListResultDTO> list = baseDao.selectWeightConfigurationList(formDTO); |
|||
PageInfo<WeightConfigurationListResultDTO> pageInfo = new PageInfo<>(list); |
|||
return new PageData<>(list, pageInfo.getTotal()); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(WeightConfigurationFormDTO formDTO) { |
|||
//1.主表新增数据
|
|||
ScreenPyWeightConfigurationEntity entity = ConvertUtils.sourceToTarget(formDTO, ScreenPyWeightConfigurationEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(WeightConfigurationFormDTO formDTO) { |
|||
ScreenPyWeightConfigurationEntity entity = baseDao.selectById(formDTO.getId()); |
|||
if (entity == null) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息"); |
|||
} |
|||
ScreenPyWeightConfigurationEntity newEntity = ConvertUtils.sourceToTarget(formDTO, ScreenPyWeightConfigurationEntity.class); |
|||
newEntity.setId(entity.getId()); |
|||
baseDao.updateById(newEntity); |
|||
} |
|||
|
|||
@Override |
|||
public void deleteById(WeightConfigurationFormDTO formDTO) { |
|||
ScreenPyWeightConfigurationEntity entity = baseDao.selectById(formDTO.getId()); |
|||
if (entity == null) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "未查到相关信息", "未查到相关信息"); |
|||
} |
|||
entity.setDelFlag("1"); |
|||
baseDao.updateById(entity); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.epmet.service.evaluationindex.screen; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.dto.screen.form.SavePyEventDataFormDTO; |
|||
import com.epmet.entity.evaluationindex.screen.ScreenPyEventDataEntity; |
|||
|
|||
/** |
|||
* 上报到市平台中间库的事件 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-12-08 |
|||
*/ |
|||
public interface ScreenPyEventDataService extends BaseService<ScreenPyEventDataEntity> { |
|||
/** |
|||
* 保存同步到中间库的数据 |
|||
* |
|||
* @Param formDTO |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/8 11:14 |
|||
*/ |
|||
void saveData(SavePyEventDataFormDTO formDTO); |
|||
|
|||
} |
@ -0,0 +1,95 @@ |
|||
package com.epmet.service.evaluationindex.screen.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.constant.DataSourceConstant; |
|||
import com.epmet.dao.evaluationindex.screen.ScreenProjectDataDao; |
|||
import com.epmet.dao.evaluationindex.screen.ScreenPyEventDataDao; |
|||
import com.epmet.dto.screen.form.SavePyEventDataFormDTO; |
|||
import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; |
|||
import com.epmet.entity.evaluationindex.screen.ScreenPyEventDataEntity; |
|||
import com.epmet.service.evaluationindex.screen.ScreenPyEventDataService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import javax.annotation.Resource; |
|||
|
|||
/** |
|||
* 上报到市平台中间库的事件 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-12-08 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
|||
public class ScreenPyEventDataServiceImpl extends BaseServiceImpl<ScreenPyEventDataDao, ScreenPyEventDataEntity> implements ScreenPyEventDataService { |
|||
|
|||
@Resource |
|||
private ScreenProjectDataDao screenProjectDataDao; |
|||
/** |
|||
* 保存同步到中间库的数据 |
|||
* |
|||
* @param formDTO |
|||
* @Param formDTO |
|||
* @Return |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/12/8 11:14 |
|||
*/ |
|||
@Override |
|||
public void saveData(SavePyEventDataFormDTO formDTO) { |
|||
if (CollectionUtils.isNotEmpty(formDTO.getProjectList())) { |
|||
formDTO.getProjectList().forEach(item -> { |
|||
ScreenPyEventDataEntity entity = new ScreenPyEventDataEntity(); |
|||
entity.setEventId(item.getEventCode().replace("py_", "")); |
|||
entity.setEventType("project"); |
|||
entity.setEventCreateTime(item.getReportTime()); |
|||
entity.setCategoryCode(item.getEventCategory()); |
|||
ScreenProjectDataEntity project = screenProjectDataDao.selectById(entity.getEventId()); |
|||
if (null != project) { |
|||
entity.setOrgId(project.getOrgId()); |
|||
entity.setPids(project.getAllParentIds()); |
|||
entity.setTitle(project.getProjectTitle()); |
|||
entity.setStaffName(project.getLinkName()); |
|||
entity.setMobile(project.getLinkMobile()); |
|||
} |
|||
LambdaQueryWrapper<ScreenPyEventDataEntity> wrapper = new LambdaQueryWrapper<>(); |
|||
wrapper.eq(ScreenPyEventDataEntity::getEventId, entity.getEventId()); |
|||
wrapper.eq(ScreenPyEventDataEntity::getEventType, entity.getEventType()); |
|||
ScreenPyEventDataEntity event = baseDao.selectOne(wrapper); |
|||
if (null == event) { |
|||
baseDao.insert(entity); |
|||
} else { |
|||
entity.setId(event.getId()); |
|||
baseDao.updateById(entity); |
|||
} |
|||
}); |
|||
} |
|||
if (CollectionUtils.isNotEmpty(formDTO.getWorkList())) { |
|||
formDTO.getWorkList().forEach(item -> { |
|||
ScreenPyEventDataEntity entity = new ScreenPyEventDataEntity(); |
|||
entity.setEventId(item.getId()); |
|||
entity.setEventType("work"); |
|||
entity.setEventCreateTime(item.getHappenTime()); |
|||
entity.setCategoryCode(item.getWorkType()); |
|||
entity.setOrgId(item.getOrgId()); |
|||
entity.setPids(item.getPids()); |
|||
entity.setTitle(item.getTitle()); |
|||
entity.setStaffName(item.getStaffName()); |
|||
entity.setMobile(item.getMobile()); |
|||
LambdaQueryWrapper<ScreenPyEventDataEntity> wrapper = new LambdaQueryWrapper<>(); |
|||
wrapper.eq(ScreenPyEventDataEntity::getEventId, entity.getEventId()); |
|||
wrapper.eq(ScreenPyEventDataEntity::getEventType, entity.getEventType()); |
|||
ScreenPyEventDataEntity event = baseDao.selectOne(wrapper); |
|||
if (null == event) { |
|||
baseDao.insert(entity); |
|||
} else { |
|||
entity.setId(event.getId()); |
|||
baseDao.updateById(entity); |
|||
} |
|||
}); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,18 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.evaluationindex.indexcoll.ScreenPyGridStaffDao"> |
|||
|
|||
<select id="selectStaff" resultType="com.epmet.entity.evaluationindex.indexcoll.ScreenPyGridStaffEntity"> |
|||
SELECT |
|||
* |
|||
FROM |
|||
screen_py_grid_staff |
|||
WHERE |
|||
del_flag = '0' |
|||
AND staff_id = #{staffId} |
|||
AND grid_id = #{gridId} |
|||
LIMIT 1 |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,73 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDao"> |
|||
|
|||
|
|||
<select id="selectHistoryScoreList" resultType="com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO"> |
|||
SELECT |
|||
a.id, |
|||
a.title, |
|||
CONCAT(DATE_FORMAT(a.start_time,'%Y年%m月%d日'),'-',DATE_FORMAT(a.end_time,'%Y年%m月%d日')) `time`, |
|||
DATE_FORMAT(a.release_time,'%Y-%m-%d %H:%i') releaseTime, |
|||
a.updated_by updatedById, |
|||
b.real_name updatedBy |
|||
FROM |
|||
screen_py_history_score a |
|||
LEFT JOIN epmet_user.customer_staff b ON a.customer_id = b.customer_id AND a.updated_by = b.user_id |
|||
WHERE |
|||
a.del_flag = '0' |
|||
<if test="title != null and title != ''"> |
|||
AND a.title LIKE concat('%', #{title}, '%') |
|||
</if> |
|||
<if test="startTime != null and startTime.trim() != ''"> |
|||
AND DATE_FORMAT(a.start_time,'%Y-%m-%d') >= #{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime.trim() != ''"> |
|||
<![CDATA[AND DATE_FORMAT(a.end_time,'%Y-%m-%d') <= #{endTime}]]> |
|||
</if> |
|||
ORDER BY a.start_time DESC |
|||
</select> |
|||
|
|||
<select id="sumEventScore" resultType="com.epmet.dto.indexcollect.result.HistoryScoreSjffResultDTO"> |
|||
SELECT |
|||
SUM(b.score) eventScore |
|||
FROM |
|||
screen_py_event_data a |
|||
LEFT JOIN customer_patrol_work_type_dict b ON b.is_disable = 'enable' |
|||
AND a.category_code = b.category_code |
|||
WHERE |
|||
a.event_type = 'work' |
|||
AND PIDS LIKE CONCAT('%', #{agencyId}, '%')) |
|||
AND DATE_FORMAT(a.event_create_time, "%Y-%m-%d") >= #{startTime} |
|||
AND DATE_FORMAT(a.event_create_time, "%Y-%m-%d") <![CDATA[ <= ]]> #{endTime} |
|||
</select> |
|||
|
|||
<select id="sumProjectScore" resultType="com.epmet.dto.indexcollect.result.HistoryScoreSjffResultDTO"> |
|||
SELECT |
|||
SUM(b.score) projectScore |
|||
FROM |
|||
screen_py_event_data a |
|||
LEFT JOIN customer_project_category_dict b ON b.CUSTOMER_ID = #{customerId} |
|||
AND b.is_disable = 'enable' |
|||
AND a.category_code = b.category_code |
|||
WHERE |
|||
a.event_type = 'project' |
|||
AND PIDS LIKE CONCAT('%', #{agencyId}, '%') |
|||
AND DATE_FORMAT(a.event_create_time, "%Y-%m-%d") >= #{startTime} |
|||
AND DATE_FORMAT(a.event_create_time, "%Y-%m-%d") <![CDATA[ <= ]]> #{endTime} |
|||
</select> |
|||
|
|||
<select id="sumGridNum" resultType="com.epmet.dto.indexcollect.result.HistoryScoreSjffResultDTO"> |
|||
SELECT |
|||
COUNT(id) gridStaffNum |
|||
FROM |
|||
screen_py_grid_staff |
|||
WHERE |
|||
del_flag = '0' |
|||
AND is_leave = 'N' |
|||
AND pids LIKE CONCAT('%', #{agencyId}, '%') |
|||
</select> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,65 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.evaluationindex.indexcoll.ScreenPyHistoryScoreDetailDao"> |
|||
|
|||
<update id="delByHistoryScoreId" parameterType="java.lang.String"> |
|||
UPDATE |
|||
screen_py_history_score_detail |
|||
SET |
|||
updated_by = #{userId}, |
|||
updated_time = NOW(), |
|||
del_flag = '1' |
|||
WHERE |
|||
history_score_id = #{historyScoreId} |
|||
AND del_flag = '0' |
|||
</update> |
|||
|
|||
<resultMap id="selectCommunitySelfOrganizationListMap" type="com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO"> |
|||
<result property="id" column="id"/> |
|||
<result property="title" column="title"/> |
|||
<result property="time" column="time"/> |
|||
<collection property="detailList" ofType="com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO$Detail" |
|||
column="id" select="selectPerson"></collection> |
|||
</resultMap> |
|||
<select id="selectScoreDetailList" resultMap="selectCommunitySelfOrganizationListMap" parameterType="com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO"> |
|||
SELECT |
|||
id AS id, |
|||
title AS title, |
|||
CONCAT(DATE_FORMAT(start_time,'%Y年%m月%d日'), '-', DATE_FORMAT(end_time, '%Y年%m月%d日')) `time` |
|||
FROM screen_py_history_score |
|||
WHERE |
|||
del_flag = 0 |
|||
<if test="title != null and title != ''"> |
|||
AND title LIKE concat('%', #{title}, '%') |
|||
</if> |
|||
<if test="startTime != null and startTime.trim() != ''"> |
|||
AND DATE_FORMAT(start_time,'%Y-%m-%d') >= #{startTime} |
|||
</if> |
|||
<if test="endTime != null and endTime.trim() != ''"> |
|||
<![CDATA[AND DATE_FORMAT(end_time,'%Y-%m-%d') <= #{endTime}]]> |
|||
</if> |
|||
ORDER BY start_time DESC |
|||
</select> |
|||
<select id="selectPerson" resultType="com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO$Detail"> |
|||
SELECT |
|||
id, |
|||
history_score_id, |
|||
agency_id, |
|||
agency_name, |
|||
FORMAT(wghyd, 2)wghyd, |
|||
FORMAT(sjff, 2)sjff, |
|||
FORMAT(xlgc, 2)xlgc, |
|||
FORMAT(rhzt, 2)rhzt, |
|||
FORMAT(ldgz, 2)ldgz, |
|||
FORMAT(qtgz, 2)qtgz, |
|||
FORMAT(nldf, 2)nldf |
|||
FROM |
|||
screen_py_history_score_detail |
|||
WHERE |
|||
del_flag = '0' |
|||
AND history_score_id = #{id} |
|||
ORDER BY nldf DESC |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,43 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.evaluationindex.indexcoll.ScreenPyWeightConfigurationDao"> |
|||
|
|||
<select id="selectWeightConfigurationList" resultType="com.epmet.dto.indexcollect.result.WeightConfigurationListResultDTO"> |
|||
SELECT |
|||
id, |
|||
customer_id, |
|||
FORMAT(wghyd, 2)wghyd, |
|||
FORMAT(sjff, 2)sjff, |
|||
FORMAT(xlgc, 2)xlgc, |
|||
FORMAT(rhzt, 2)rhzt, |
|||
FORMAT(ldgz, 2)ldgz, |
|||
FORMAT(qtgz, 2)qtgz |
|||
FROM |
|||
screen_py_weight_configuration |
|||
WHERE |
|||
del_flag = '0' |
|||
ORDER BY |
|||
updated_time DESC |
|||
</select> |
|||
|
|||
<select id="selectOneDTO" resultType="com.epmet.dto.indexcollect.ScreenPyWeightConfigurationDTO"> |
|||
SELECT |
|||
id, |
|||
customer_id, |
|||
wghyd, |
|||
sjff, |
|||
xlgc, |
|||
rhzt, |
|||
ldgz, |
|||
qtgz |
|||
FROM |
|||
screen_py_weight_configuration |
|||
WHERE |
|||
del_flag = '0' |
|||
ORDER BY |
|||
updated_time DESC |
|||
LIMIT 1 |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,7 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.evaluationindex.screen.ScreenPyEventDataDao"> |
|||
|
|||
|
|||
</mapper> |
Loading…
Reference in new issue