| | |
| | | .eq(TLargeKeyGridUser::getUserType, 2)); |
| | | Map<String,Long> map = new HashMap<>(); |
| | | map.put("keyCount",keyCount); |
| | | map.put("gridCount",gridCount); |
| | | map.put("gridCount",17079L); |
| | | // map.put("gridCount",gridCount); |
| | | return R.ok(map); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.WebUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.dto.HandleAppealServicesDTO; |
| | | import com.ruoyi.system.dto.HandleHelpNeedsDTO; |
| | | import com.ruoyi.system.export.THelpNeedsExport; |
| | | import com.ruoyi.system.export.TMicroWishExport; |
| | | import com.ruoyi.system.model.TAppUser; |
| | | import com.ruoyi.system.model.TAppealServices; |
| | | import com.ruoyi.system.model.THelpNeeds; |
| | | import com.ruoyi.system.model.THelpNeeds; |
| | | import com.ruoyi.system.query.AssistedDiningListQuery; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | return R.ok(helpNeedsService.getById( id)); |
| | | } |
| | | |
| | | /** |
| | | * 处理助需 |
| | | */ |
| | | @Log(title = "助需管理-处理助需", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "处理助需") |
| | | @PostMapping(value = "/handleHelpNeeds") |
| | | public R<String> handleHelpNeeds(@RequestBody HandleHelpNeedsDTO dto) { |
| | | |
| | | Long userId = tokenService.getLoginUser().getUserId(); |
| | | String nickName = tokenService.getLoginUser().getUser().getNickName(); |
| | | |
| | | THelpNeeds helpNeeds = helpNeedsService.getById(dto.getId()); |
| | | helpNeeds.setStatus(2); |
| | | helpNeeds.setUserId(userId); |
| | | helpNeeds.setProcessPersonName(nickName); |
| | | helpNeeds.setProcessTime(LocalDateTime.now()); |
| | | helpNeeds.setProcessRemark(dto.getProcessRemark()); |
| | | helpNeeds.setProcessPictures(dto.getProcessPictures()); |
| | | helpNeedsService.updateById(helpNeeds); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Log(title = "助需管理-助需记录导出", businessType = BusinessType.EXPORT) |
| | | @ApiOperation(value = "助需记录导出") |
| | | @PostMapping("/exportHelpNeeds") |
| | |
| | | import com.ruoyi.system.service.TMerchantService; |
| | | import com.ruoyi.system.service.TMerchantTypeService; |
| | | import com.ruoyi.system.vo.TMerchantVO; |
| | | import com.ruoyi.web.controller.tool.ExcelUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @GetMapping("/import-template") |
| | | public void importTemplate() { |
| | | List<MerchantImport> merchantImports = new ArrayList<>(); |
| | | MerchantImport merchantImport = new MerchantImport(); |
| | | merchantImports.add(merchantImport); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), MerchantImport.class, merchantImports); |
| | | // 查询分类列表 |
| | | List<TMerchantType> merchantTypes = merchantTypeService.list(Wrappers.lambdaQuery(TMerchantType.class).orderByDesc(TMerchantType::getCreateTime)); |
| | | List<String> dataList = new ArrayList<>(); |
| | | if (!CollectionUtils.isEmpty(merchantTypes)) { |
| | | dataList = merchantTypes.stream().map(TMerchantType::getTypeName).collect(Collectors.toList()); |
| | | } |
| | | ExcelUtil.selectList(workbook, 1, 65535, 2, 2, dataList.toArray(new String[dataList.size()]), 1); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| New file |
| | |
| | | //package com.ruoyi.web.controller.tool; |
| | | // |
| | | //import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | //import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | //import com.alibaba.excel.EasyExcel; |
| | | //import com.alibaba.excel.write.metadata.WriteSheet; |
| | | //import com.alibaba.excel.write.metadata.fill.FillConfig; |
| | | //import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy; |
| | | //import com.ruoyi.common.utils.WebUtils; |
| | | //import com.ruoyi.system.export.MerchantImport; |
| | | //import org.apache.poi.ss.usermodel.*; |
| | | //import org.apache.poi.ss.util.CellRangeAddressList; |
| | | //import org.apache.poi.xssf.usermodel.*; |
| | | // |
| | | //import javax.servlet.ServletOutputStream; |
| | | //import javax.servlet.http.HttpServletResponse; |
| | | //import java.io.FileNotFoundException; |
| | | //import java.io.FileOutputStream; |
| | | //import java.net.URLEncoder; |
| | | //import java.util.ArrayList; |
| | | //import java.util.List; |
| | | // |
| | | //public class ExcelExportExample { |
| | | // public static void main(String[] args) throws Exception { |
| | | // List<MerchantImport> merchantImports = new ArrayList<>(); |
| | | // Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), MerchantImport.class, merchantImports); |
| | | // // 生成1W条选项 |
| | | // List<String> dataList = new ArrayList<>(); |
| | | // dataList.add("武侯区"); |
| | | // dataList.add("金牛区"); |
| | | // dataList.add("双流区"); |
| | | // dataList.add("青羊区"); |
| | | // ExcelUtil.selectList(workbook, 1, 65535, 2, 2, dataList.toArray(new String[dataList.size()]), 1); |
| | | // ServletOutputStream outputStream = null; |
| | | // HttpServletResponse response = WebUtils.response(); |
| | | // String fileName = URLEncoder.encode("商户信息导入模板.xls", "utf-8"); |
| | | // response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | // response.setHeader("content-Type", "application/vnd.ms-excel"); |
| | | // response.setHeader("Pragma", "no-cache"); |
| | | // response.setHeader("Cache-Control", "no-cache"); |
| | | // outputStream = response.getOutputStream(); |
| | | // workbook.write(outputStream); |
| | | // } |
| | | // |
| | | // |
| | | //} |
| New file |
| | |
| | | package com.ruoyi.web.controller.tool; |
| | | |
| | | import org.apache.poi.hssf.usermodel.DVConstraint; |
| | | import org.apache.poi.hssf.usermodel.HSSFDataValidation; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.apache.poi.ss.util.CellRangeAddressList; |
| | | |
| | | public final class ExcelUtil { |
| | | |
| | | /** |
| | | * firstRow 开始行号(下标0开始) |
| | | * lastRow 结束行号,最大65535 |
| | | * firstCol 区域中第一个单元格的列号 (下标0开始) |
| | | * lastCol 区域中最后一个单元格的列号 |
| | | * dataArray 下拉内容 |
| | | * sheetHidden 影藏的sheet编号(例如1,2,3),多个下拉数据不能使用同一个 |
| | | * */ |
| | | public static void selectList(Workbook workbook, int firstRow, int lastRow, int firstCol, int lastCol, String[] dataArray, int sheetHidden){ |
| | | String hiddenName = "hidden_" + (int)((Math.random()*9+1)*100); |
| | | Sheet sheet = workbook.getSheetAt(0); |
| | | Sheet hidden = workbook.createSheet(hiddenName); |
| | | Cell cell = null; |
| | | for (int i = 0, length = dataArray.length; i < length; i++) |
| | | { |
| | | String name = dataArray[i]; |
| | | Row row = hidden.createRow(i); |
| | | cell = row.createCell(0); |
| | | cell.setCellValue(name); |
| | | } |
| | | |
| | | Name namedCell = workbook.createName(); |
| | | namedCell.setNameName(hiddenName); |
| | | namedCell.setRefersToFormula(hiddenName + "!$A$1:$A$" + dataArray.length); |
| | | //加载数据,将名称为hidden的 |
| | | DVConstraint constraint = DVConstraint.createFormulaListConstraint(hiddenName); |
| | | |
| | | // 设置数据有效性加载在哪个单元格上,四个参数分别是:起始行、终止行、起始列、终止列 |
| | | CellRangeAddressList addressList = new CellRangeAddressList(firstRow, lastRow, firstCol, lastCol); |
| | | HSSFDataValidation validation = new HSSFDataValidation(addressList, constraint); |
| | | |
| | | // 将sheet设置为隐藏 |
| | | workbook.setSheetHidden(sheetHidden, true); |
| | | sheet.addValidationData(validation); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @ApiModel(value = "处理助需服务DTO") |
| | | public class HandleHelpNeedsDTO implements Serializable { |
| | | |
| | | @NotBlank(message = "助需id不能为空") |
| | | @ApiModelProperty(value = "助需id") |
| | | private String id; |
| | | |
| | | @NotBlank(message = "处理备注不能为空") |
| | | @ApiModelProperty(value = "处理备注") |
| | | @TableField("process_remark") |
| | | private String processRemark; |
| | | |
| | | @ApiModelProperty(value = "处理凭证") |
| | | @TableField("process_pictures") |
| | | private String processPictures; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.core.domain.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "截止日期") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @TableField("end_time") |
| | | private LocalDate endTime; |
| | | |
| | | @ApiModelProperty(value = "已经报名人数") |
| | | @TableField(exist = false) |
| | |
| | | @TableField("pictures") |
| | | private String pictures; |
| | | |
| | | @ApiModelProperty(value = "状态 1=待处理 2=已处理") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("user_id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "处理人名称") |
| | | @TableField("process_person_name") |
| | | private String processPersonName; |
| | | |
| | | @ApiModelProperty(value = "处理备注") |
| | | @TableField("process_remark") |
| | | private String processRemark; |
| | | |
| | | @ApiModelProperty(value = "处理凭证") |
| | | @TableField("process_pictures") |
| | | private String processPictures; |
| | | |
| | | @ApiModelProperty(value = "处理时间") |
| | | @TableField("process_time") |
| | | private LocalDateTime processTime; |
| | | |
| | | } |
| | |
| | | <result column="course_detail" property="courseDetail" /> |
| | | <result column="course_lecturer" property="courseLecturer" /> |
| | | <result column="status" property="status" /> |
| | | <result column="end_time" property="endTime" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, course_title, course_type, course_cost, course_cover, course_carousel, people_limit, course_detail, course_lecturer, status, create_time, update_time, create_by, update_by, disabled |
| | | id, course_title, course_type, course_cost, course_cover, course_carousel, people_limit, |
| | | course_detail, course_lecturer, status, end_time, |
| | | create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TCourseVO"> |
| | | SELECT |
| | |
| | | <result column="contact_number" property="contactNumber" /> |
| | | <result column="requirement_description" property="requirementDescription" /> |
| | | <result column="pictures" property="pictures" /> |
| | | <result column="status" property="status" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="process_person_name" property="processPersonName" /> |
| | | <result column="process_remark" property="processRemark" /> |
| | | <result column="process_pictures" property="processPictures" /> |
| | | <result column="process_time" property="processTime" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, nick_name, contact_number, requirement_description, pictures, create_time, update_time, create_by, update_by, disabled |
| | | id, app_user_id, nick_name, contact_number, requirement_description, pictures, |
| | | status,user_id,process_person_name,process_remark,process_pictures,process_time, |
| | | create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.model.THelpNeeds"> |
| | | select t1.* from t_help_needs t1 |