Browse Source

积分记录添加导出

feature/dangjian
wanggongfeng 4 years ago
parent
commit
dc019b7ad1
  1. 7
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/controller/ActivePointLogController.java
  2. 41
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/excel/ActivePointLogExcel.java
  3. 3
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/ActivePointLogDao.xml

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

@ -25,6 +25,7 @@ import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
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.excel.ActivePointLogExcel;
@ -50,6 +51,9 @@ public class ActivePointLogController {
@Autowired
private ActivePointLogService activePointLogService;
@Autowired
private ActivePointLogDao activePointLogDao;
@GetMapping("page")
public Result<PageData<ActivePointLogDTO>> page(@RequestParam Map<String, Object> params) {
// PageData<ActivePointLogDTO> page = activePointLogService.page(params);
@ -89,7 +93,8 @@ public class ActivePointLogController {
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ActivePointLogDTO> list = activePointLogService.list(params);
// List<ActivePointLogDTO> list = activePointLogService.list(params);
List<ActivePointLogDTO> list = activePointLogDao.getPhrasePage(params);
ExcelUtils.exportExcelToTarget(response, null, list, ActivePointLogExcel.class);
}

41
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/excel/ActivePointLogExcel.java

@ -31,59 +31,46 @@ import java.util.Date;
@Data
public class ActivePointLogExcel {
@Excel(name = "行为id")
private String id;
@Excel(name = "用户id")
private String userId;
// @Excel(name = "行为id")
// private String id;
//
// @Excel(name = "用户id")
// private String userId;
@Excel(name = "用户姓名")
private String userName;
@Excel(name = "用户部门ID")
private String deptId;
// @Excel(name = "用户部门ID")
// private String deptId;
@Excel(name = "用户部门名称")
@Excel(name = "用户部门")
private String deptName;
@Excel(name = "用户电话")
private String mobile;
@Excel(name = "积分操作类型(0-减积分,1-加积分)")
private String operationType;
@Excel(name = "积分操作类型")
private String operationTypeName;
@Excel(name = "积分")
private Integer points;
@Excel(name = "操作编码")
private String operationCode;
// @Excel(name = "操作编码")
// private String operationCode;
@Excel(name = "操作描述")
private String operationDesc;
@Excel(name = "操作时间")
@Excel(name = "操作时间", format = "yyyy-MM-dd HH:mm:ss")
private Date operationTime;
@Excel(name = "剩余积分")
private String lavePoints;
@Excel(name = "删除标记 0:未删除,1:已删除")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
@Excel(name = "创建时间", format = "yyyy-MM-dd HH:mm:ss")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

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

@ -62,6 +62,9 @@
<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>
order by UPDATED_TIME desc
</select>

Loading…
Cancel
Save