Browse Source

积分记录添加导出

feature/dangjian
wanggongfeng 5 years ago
parent
commit
3c5fb74959
  1. 62
      esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/result/ActivePointTotalResultDTO.java
  2. 16
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/ActivePointLogController.java
  3. 10
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/dao/ActivePointLogDao.java
  4. 50
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/excel/ActivePointLogTotalExcel.java
  5. 3
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/ActivePointLogService.java
  6. 9
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/ActivePointLogServiceImpl.java
  7. 29
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/ActivePointLogDao.xml

62
esua-epdc/epdc-module/epdc-points/epdc-points-client/src/main/java/com/elink/esua/epdc/dto/result/ActivePointTotalResultDTO.java

@ -0,0 +1,62 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 积分记录表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2021-09-23
*/
@Data
public class ActivePointTotalResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 用户姓名
*/
private String userName;
/**
* 积分操作类型0-减积分1-加积分
*/
// private String operationType;
// private String operationTypeName;
/**
* 积分
*/
private Integer points;
/**
* 操作描述
*/
private String operationDesc;
}

16
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/ActivePointLogController.java

@ -28,7 +28,9 @@ import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dao.ActivePointLogDao;
import com.elink.esua.epdc.dto.ActivePointLogDTO;
import com.elink.esua.epdc.dto.form.PointLogFormDTO;
import com.elink.esua.epdc.dto.result.ActivePointTotalResultDTO;
import com.elink.esua.epdc.excel.ActivePointLogExcel;
import com.elink.esua.epdc.excel.ActivePointLogTotalExcel;
import com.elink.esua.epdc.service.ActivePointLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -98,6 +100,20 @@ public class ActivePointLogController {
ExcelUtils.exportExcelToTarget(response, null, list, ActivePointLogExcel.class);
}
/**
* 统计导出
* @param params
* @param response
* @throws Exception
*/
@GetMapping("exportTotal")
public void exportTotal(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ActivePointTotalResultDTO> list = activePointLogService.exportTotal(params);
ExcelUtils.exportExcelToTarget(response, null, list, ActivePointLogTotalExcel.class);
}
/***
* 积分操作
* @param formDTO

10
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/dao/ActivePointLogDao.java

@ -20,6 +20,7 @@ package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.ActivePointLogDTO;
import com.elink.esua.epdc.dto.form.PointLogFormDTO;
import com.elink.esua.epdc.dto.result.ActivePointTotalResultDTO;
import com.elink.esua.epdc.entity.ActivePointLogEntity;
import org.apache.ibatis.annotations.Mapper;
@ -82,4 +83,13 @@ public interface ActivePointLogDao extends BaseDao<ActivePointLogEntity> {
*/
Integer getTotal(Map<String, Object> params);
/**
* 条件查询
*
* @param params
* @return
*/
List<ActivePointTotalResultDTO> exportTotal(Map<String, Object> params);
}

50
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/excel/ActivePointLogTotalExcel.java

@ -0,0 +1,50 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 积分记录表
*
* @author elink elink@elink-cn.com
* @since v1.0.0 2021-09-23
*/
@Data
public class ActivePointLogTotalExcel {
@Excel(name = "用户姓名")
private String userName;
@Excel(name = "操作描述")
private String operationDesc;
@Excel(name = "积分")
private Integer points;
}

3
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/ActivePointLogService.java

@ -21,6 +21,7 @@ import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.ActivePointLogDTO;
import com.elink.esua.epdc.dto.form.PointLogFormDTO;
import com.elink.esua.epdc.dto.result.ActivePointTotalResultDTO;
import com.elink.esua.epdc.entity.ActivePointLogEntity;
import java.util.List;
@ -125,4 +126,6 @@ public interface ActivePointLogService extends BaseService<ActivePointLogEntity>
* @return
*/
Integer getTotal(Map<String, Object> params);
List<ActivePointTotalResultDTO> exportTotal(Map<String, Object> params);
}

9
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/ActivePointLogServiceImpl.java

@ -32,6 +32,7 @@ import com.elink.esua.epdc.dto.ActivePointLogDTO;
import com.elink.esua.epdc.dto.form.PointLogFormDTO;
import com.elink.esua.epdc.dto.form.PointRuleFormDTO;
import com.elink.esua.epdc.dto.form.UserPointsFormDTO;
import com.elink.esua.epdc.dto.result.ActivePointTotalResultDTO;
import com.elink.esua.epdc.dto.result.EpdcUserInfoResultDTO;
import com.elink.esua.epdc.dto.result.UserPointInfo;
import com.elink.esua.epdc.entity.ActivePointLogEntity;
@ -231,4 +232,12 @@ public class ActivePointLogServiceImpl extends BaseServiceImpl<ActivePointLogDao
Integer total = baseDao.getTotal(params);
return total;
}
@Override
public List<ActivePointTotalResultDTO> exportTotal(Map<String, Object> params) {
List<ActivePointTotalResultDTO> list = baseDao.exportTotal(params);
return list;
}
}

29
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/ActivePointLogDao.xml

@ -135,5 +135,34 @@
and OPERATION_DESC like '%' #{operationDesc} '%'
</if>
</select>
<select id="exportTotal" resultType="com.elink.esua.epdc.dto.result.ActivePointTotalResultDTO">
select
USER_NAME,
sum(POINTS) as POINTS,
OPERATION_DESC
from epdc_active_point_log
where DEL_FLAG = '0'
<if test="operationType != null and operationType != ''">
and OPERATION_TYPE = #{operationType}
</if>
<if test="userName != null and userName != ''">
and USER_NAME like '%' #{userName} '%'
</if>
<if test="deptId != null and deptId != ''">
and FIND_IN_SET( #{deptId}, ALL_DEPT_IDS )
</if>
<if test="mobile != null and mobile != ''">
and MOBILE like '%' #{mobile} '%'
</if>
<if test="operationDesc != null and operationDesc != ''">
and OPERATION_DESC like '%' #{operationDesc} '%'
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( OPERATION_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
group by USER_NAME,OPERATION_DESC
</select>
</mapper>

Loading…
Cancel
Save