Commit b1c5ea74 authored by 廖旭伟's avatar 廖旭伟

申述分布情况统计

parent 202f4a32
...@@ -4,6 +4,7 @@ import com.mortals.framework.dao.ICRUDDao; ...@@ -4,6 +4,7 @@ import com.mortals.framework.dao.ICRUDDao;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity; import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.perform.model.vo.AppealInfo; import com.mortals.xhx.module.perform.model.vo.AppealInfo;
import com.mortals.xhx.module.perform.model.vo.AppealSummaryQuery;
import java.util.List; import java.util.List;
/** /**
...@@ -19,4 +20,11 @@ public interface PerformAttendAppealDao extends ICRUDDao<PerformAttendAppealEnt ...@@ -19,4 +20,11 @@ public interface PerformAttendAppealDao extends ICRUDDao<PerformAttendAppealEnt
String SQLID_GET_STATLIST = "getStatList"; String SQLID_GET_STATLIST = "getStatList";
List<AppealInfo> getStatList(PerformAttendAppealEntity query, PageInfo pageInfo); List<AppealInfo> getStatList(PerformAttendAppealEntity query, PageInfo pageInfo);
/**
* 申述分布情况统计
* @param query
* @return
*/
List<PerformAttendAppealEntity> getAppealSummaryList(AppealSummaryQuery query);
} }
...@@ -4,6 +4,7 @@ package com.mortals.xhx.module.perform.dao.ibatis; ...@@ -4,6 +4,7 @@ package com.mortals.xhx.module.perform.dao.ibatis;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.ParamDto; import com.mortals.framework.model.ParamDto;
import com.mortals.xhx.module.perform.model.vo.AppealInfo; import com.mortals.xhx.module.perform.model.vo.AppealInfo;
import com.mortals.xhx.module.perform.model.vo.AppealSummaryQuery;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.perform.dao.PerformAttendAppealDao; import com.mortals.xhx.module.perform.dao.PerformAttendAppealDao;
...@@ -31,4 +32,9 @@ public class PerformAttendAppealDaoImpl extends BaseCRUDDaoMybatis<PerformAttend ...@@ -31,4 +32,9 @@ public class PerformAttendAppealDaoImpl extends BaseCRUDDaoMybatis<PerformAttend
return getSqlSession().selectList(SQLID_GET_STATLIST, queryParam, rowBounds); return getSqlSession().selectList(SQLID_GET_STATLIST, queryParam, rowBounds);
} }
} }
@Override
public List<PerformAttendAppealEntity> getAppealSummaryList(AppealSummaryQuery query) {
return getSqlSession().selectList(getSqlId("getAppealSummaryList"),query);
}
} }
package com.mortals.xhx.module.perform.model.vo;
import lombok.Data;
/**
* 申述分布情况统计
*/
@Data
public class AppealSummaryQuery {
/** 汇总方式 1按年,2按月,3按天*/
private Integer summaryType;
/** 开始 核查时间 */
private String checkTimeStart;
/** 结束 核查时间 */
private String checkTimeEnd;
}
...@@ -6,6 +6,7 @@ import com.mortals.framework.service.ICRUDService; ...@@ -6,6 +6,7 @@ import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity; import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.perform.dao.PerformAttendAppealDao; import com.mortals.xhx.module.perform.dao.PerformAttendAppealDao;
import com.mortals.xhx.module.perform.model.vo.AppealInfo; import com.mortals.xhx.module.perform.model.vo.AppealInfo;
import com.mortals.xhx.module.perform.model.vo.AppealSummaryQuery;
import java.util.List; import java.util.List;
...@@ -26,4 +27,10 @@ public interface PerformAttendAppealService extends ICRUDService<PerformAttendAp ...@@ -26,4 +27,10 @@ public interface PerformAttendAppealService extends ICRUDService<PerformAttendAp
Rest<List<AppealInfo>> stat(PerformAttendAppealEntity appeal, Context context); Rest<List<AppealInfo>> stat(PerformAttendAppealEntity appeal, Context context);
/**
* 申述分布情况统计
* @param query
* @return
*/
List<PerformAttendAppealEntity> getAppealSummaryList(AppealSummaryQuery query);
} }
\ No newline at end of file
...@@ -2,34 +2,34 @@ package com.mortals.xhx.module.perform.service.impl; ...@@ -2,34 +2,34 @@ package com.mortals.xhx.module.perform.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol; import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.common.code.*; import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.*; import com.mortals.xhx.module.check.model.*;
import com.mortals.xhx.module.check.service.*; import com.mortals.xhx.module.check.service.*;
import com.mortals.xhx.module.perform.model.PerformAttendAppealQuery;
import com.mortals.xhx.module.perform.model.vo.AppealInfo;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.perform.dao.PerformAttendAppealDao; import com.mortals.xhx.module.perform.dao.PerformAttendAppealDao;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity; import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.perform.service.PerformAttendAppealService;
import org.springframework.beans.factory.annotation.Autowired;
import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesEntity; import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesEntity;
import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesQuery; import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesQuery;
import com.mortals.xhx.module.perform.model.PerformAttendAppealQuery;
import com.mortals.xhx.module.perform.model.vo.AppealInfo;
import com.mortals.xhx.module.perform.model.vo.AppealSummaryQuery;
import com.mortals.xhx.module.perform.service.PerformAttendAppealFilesService; import com.mortals.xhx.module.perform.service.PerformAttendAppealFilesService;
import com.mortals.xhx.module.perform.service.PerformAttendAppealService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
import lombok.extern.slf4j.Slf4j;
/** /**
* PerformAttendAppealService * PerformAttendAppealService
* 绩效记录申诉信息 service实现 * 绩效记录申诉信息 service实现
...@@ -176,6 +176,25 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf ...@@ -176,6 +176,25 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf
return Rest.ok(statList); return Rest.ok(statList);
} }
@Override
public List<PerformAttendAppealEntity> getAppealSummaryList(AppealSummaryQuery query) {
if (query == null) {
query = new AppealSummaryQuery();
query.setSummaryType(SummaryTopTypeEnum..getValue());
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
query.setCheckTimeStart(DateUtils.getCurrDateTime("yyyy")+"-01-01");
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
query.setCheckTimeStart(DateUtils.getCurrDateTime("yyyy-MM")+"-01");
}
if (query.getSummaryType() == SummaryTopTypeEnum..getValue()) {
query.setCheckTimeStart(DateUtils.getCurrStrDate());
}
query.setCheckTimeEnd(DateUtils.getCurrStrDate());
return dao.getAppealSummaryList(query);
}
@Override @Override
protected void saveAfter(PerformAttendAppealEntity entity, Context context) throws AppException { protected void saveAfter(PerformAttendAppealEntity entity, Context context) throws AppException {
......
package com.mortals.xhx.module.perform.web; package com.mortals.xhx.module.perform.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.OrderCol; import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.EnabledEnum; import com.mortals.xhx.common.code.EnabledEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.perform.model.vo.AppealInfo; import com.mortals.xhx.module.perform.model.vo.AppealInfo;
import com.mortals.xhx.module.perform.model.vo.AppealSummaryQuery;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -125,5 +129,36 @@ public class PerformAttendAppealController extends BaseCRUDJsonBodyMappingContro ...@@ -125,5 +129,36 @@ public class PerformAttendAppealController extends BaseCRUDJsonBodyMappingContro
return jsonObject.toJSONString(); return jsonObject.toJSONString();
} }
/**
* 申述分布情况统计
* @param query
* @return
*/
@PostMapping({"perform/summary"})
@UnAuth
public Rest<Object> getAppealSummaryList(@RequestBody AppealSummaryQuery query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询申述分布情况统计";
int code = 1;
try {
List<PerformAttendAppealEntity> result = this.getService().getAppealSummaryList(query);
model.put("data", result);
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model);
ret.setDict(model.remove("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
} }
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.perform.dao.ibatis.PerformAttendAppealDaoImpl">
<!-- 申述分布情况统计 -->
<select id="getAppealSummaryList" parameterType="com.mortals.xhx.module.perform.model.vo.AppealSummaryQuery" resultType="com.mortals.xhx.module.perform.model.PerformAttendAppealEntity">
SELECT
performType,
SUM(score) AS score
FROM
mortals_xhx_perform_attend_appeal
WHERE
processStatus = 2
AND appealResult = 1
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
GROUP BY
performType
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment