当前位置: 首页 > news >正文

免费网站电视剧全免费的appphp做的网站打包成exe

免费网站电视剧全免费的app,php做的网站打包成exe,vi设计对企业的意义,商标注册查询一览表EasyExcel导出数据#xff0c;解决慢sql#xff0c;漏数据#xff0c;重复数据问题#xff08;一#xff09; 大家思考一下#xff0c;在导出excel时是否会出现如下几个常见问题 慢sql问题漏数据#xff0c;缺数据问题数据重复 那到底该如何解决呢#xff1f;下面我…EasyExcel导出数据解决慢sql漏数据重复数据问题一 大家思考一下在导出excel时是否会出现如下几个常见问题 慢sql问题漏数据缺数据问题数据重复 那到底该如何解决呢下面我们一起来看看我的实现吧 代码示例 controller入口 分页查询2000条数据分批次导出。 /***下载自动续费* author youlu* date 2022/11/21 14:32* param response* return com.smy.ucc.common.JsonMessage*/GetMapping(/downloadRenewalSign)public void downloadRenewalSign(HttpServletResponse response, RenewalSignAdminReq req) throws Exception {this.checkDownloadParam(req);response.setContentType(application/vnd.openxmlformats-officedocument.spreadsheetml.sheet);response.setCharacterEncoding(utf-8);// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系String fileName URLEncoder.encode(橡树会员自动续费, UTF-8);response.setHeader(Content-disposition, attachment;filename fileName .xlsx);ExcelWriter excelWriter EasyExcel.write(response.getOutputStream(), RenewalSignAdminResp.class).build();WriteSheet writeSheet EasyExcel.writerSheet(自动续费).build();req.setStartCreateTime(DateUtil.parseDate(req.getStartCreateTimeStr() 00:00:00, yyyy-MM-dd HH:mm:ss));req.setEndCreateTime(DateUtil.parseDate(req.getEndCreateTimeStr() 23:59:59, yyyy-MM-dd HH:mm:ss));int pageSize 2000;boolean firstFlag true;while (true) {ListRenewalSignAdminResp data cbsRenewalService.queryRenewalSignListForDownload(req, firstFlag, pageSize);if (CollectionUtils.isEmpty(data)) {break;}Date lastCreateTime data.get(data.size() - 1).getCreateTime();String startId data.get(data.size() - 1).getId();//补偿同一时间段内并发的数据 where create_time ? and id ? and 其他筛选条件ListRenewalSignAdminResp otherDatas cbsRenewalService.queryRenewalSignListByCreateTimeAndId(req, lastCreateTime, startId);data.addAll(otherDatas);excelWriter.write(data, writeSheet);req.setStartCreateTime(lastCreateTime);if (firstFlag) {firstFlag false;}}excelWriter.finish();}实体 package com.smy.cbs.dto.renewal;import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.format.DateTimeFormat; import com.fasterxml.jackson.annotation.JsonFormat; import com.smy.cbs.easyexcel.write.RenewalStatusStringConverter; import com.smy.cbs.easyexcel.write.VipTypeStringConverter; import com.smy.cbs.enums.renewal.RenewalStatusEnum; import com.smy.cbs.enums.vip.VipType; import lombok.Getter; import lombok.Setter; import java.io.Serializable; import java.util.Date;/***自动签约返回参数* author youlu* date 2022/9/22 10:19* return*/ Getter Setter public class RenewalSignAdminResp implements Serializable {private static final long serialVersionUID 472574503670404785L;//id:调用框架生成ExcelProperty(value 签约号, index 0)private String id;//客户号ExcelProperty(value 客户号, index 1)private String custNo;/*** 会员类型1橡树会员、2自营会员* see VipType*/ExcelProperty(value 会员类型, index 2, converter VipTypeStringConverter.class)private String vipType;//续费周期ExcelProperty(value 续费周期, index 3)private Integer renewalPeriod;//签约时间ExcelProperty(value 签约时间, index 4)DateTimeFormat(yyyy-MM-dd HH:mm:ss)JsonFormat(pattern yyyy-MM-dd HH:mm:ss,locale zh,timezoneGMT8)private Date signTime;//解约时间ExcelProperty(value 解约时间, index 5)DateTimeFormat(yyyy-MM-dd HH:mm:ss)JsonFormat(pattern yyyy-MM-dd HH:mm:ss,locale zh,timezoneGMT8)private Date terminateTime;/*** 签约状态1待签约、2签约失败、3签约中、4已解约* see RenewalStatusEnum*/ExcelProperty(value 签约状态, index 6, converter RenewalStatusStringConverter.class)private String renewalStatus;//下次代扣时间JsonFormat(pattern yyyy-MM-dd HH:mm:ss,locale zh,timezoneGMT8)DateTimeFormat(yyyy-MM-dd HH:mm:ss)ExcelProperty(value 下次代扣时间, index 7)private Date nextRenewalTime;//自动续费次数ExcelProperty(value 自动续费次数, index 8)private Integer renewalNum;//投放qdExcelProperty(value 投放qd, index 9)private String qd;//创建人ExcelProperty(value 创建人, index 10)private String createUser;//修改人ExcelProperty(value 修改人, index 11)private String updateUser;//创建日期ExcelProperty(value 创建日期, index 12)DateTimeFormat(yyyy-MM-dd HH:mm:ss)JsonFormat(pattern yyyy-MM-dd HH:mm:ss,locale zh,timezoneGMT8)private Date createTime;//修改日期ExcelProperty(value 修改日期, index 13)DateTimeFormat(yyyy-MM-dd HH:mm:ss)JsonFormat(pattern yyyy-MM-dd HH:mm:ss,locale zh,timezoneGMT8)private Date updateTime;//ExcelProperty(value 签约商户, index 14)private String signMerchant;}这里要注意converter 的使用例如vipType在数据库中设定的是枚举值“1”,“2”,“3”,“4” 但是我们导出数据期望是其代表的含义描述因此要转换关注其convertToExcelData方法转换如下 package com.smy.cbs.easyexcel.write;import com.alibaba.excel.converters.Converter; import com.alibaba.excel.enums.CellDataTypeEnum; import com.alibaba.excel.metadata.CellData; import com.alibaba.excel.metadata.GlobalConfiguration; import com.alibaba.excel.metadata.property.ExcelContentProperty; import com.smy.cbs.enums.vip.VipType;/*** String and string converter** author youlu*/ public class VipTypeStringConverter implements ConverterString {Overridepublic Class supportJavaTypeKey() {return String.class;}Overridepublic CellDataTypeEnum supportExcelTypeKey() {return CellDataTypeEnum.STRING;}/*** 这里是读的时候会调用 不用管** param cellData* NotNull* param contentProperty* Nullable* param globalConfiguration* NotNull* return*/Overridepublic String convertToJavaData(CellData cellData, ExcelContentProperty contentProperty,GlobalConfiguration globalConfiguration) {return cellData.getStringValue();}/*** 这里是写的时候会调用 不用管** param value* NotNull* param contentProperty* Nullable* param globalConfiguration* NotNull* return*/Overridepublic CellData convertToExcelData(String value, ExcelContentProperty contentProperty,GlobalConfiguration globalConfiguration) {return new CellData(VipType.getVipTypeDescByCode(value));} }service|Dao层实现 Overridepublic ListRenewalSignAdminResp queryRenewalSignListForDownload(RenewalSignAdminReq req, boolean firstFlag, int pageSize) {return cbsRenewalSignInnerService.queryRenewalSignListForDownload(req, firstFlag, pageSize);}Overridepublic ListRenewalSignAdminResp queryRenewalSignListByCreateTimeAndId(RenewalSignAdminReq req, Date createTime, String startId) {return cbsRenewalSignInnerService.queryRenewalSignListByCreateTimeAndId(req,createTime, startId);}sql层查询 select idqueryRenewalSignListForDownload resultMapsignAdminMapselectinclude refidBase_Column_List /from t_renewal_signwherechoosewhen testfirstFlagand create_time gt; #{req.startCreateTime}/whenotherwiseand create_time gt; #{req.startCreateTime}/otherwise/chooseand create_time lt; #{req.endCreateTime}and renewal_status #{req.renewalStatus}if testreq.custNo ! null and req.custNo ! and cust_no #{req.custNo}/ifif testreq.id ! null and req.id ! and id #{req.id}/ifif testreq.vipType ! null and req.vipType ! and vip_type #{req.vipType}/if/whereorder by create_time , idlimit #{pageSize}/selectfirstFlag 用于区分是否是第一次查询order by create_time , id 的排序可以用于解决慢sql问题。 这个查询会存在漏数据的问题因此引进下面这条sql专门查询在相同时间点内生成的数据 select idqueryRenewalSignListByCreateTimeAndId resultMapsignAdminMapselectinclude refidBase_Column_List /from t_renewal_signwhereand create_time #{createTime}and id gt; #{startId}and renewal_status #{req.renewalStatus}if testreq.custNo ! null and req.custNo ! and cust_no #{req.custNo}/ifif testreq.id ! null and req.id ! and id #{req.id}/ifif testreq.vipType ! null and req.vipType ! and vip_type #{req.vipType}/if/where这条sql的意义就是补偿查询在相同时间点内生成的数据 这里解决了我们开头提到的所有问题。为什么呢下节我们一起来分析下…
http://www.zqtcl.cn/news/259834/

相关文章:

  • 备案网站建设方案模板怎么看网站域名
  • asp iis设置网站路径效果好网站建设哪家好
  • 河南做外贸网站的公司大连在哪个省的什么位置
  • 网站架构怎么做wordpress e-commerce themes
  • 哪些网站微信支付平台经营管理系统
  • 教育教学成果展示网站建设桂林网站开发公司
  • 唐山房产网站建设asp.net 网站压缩
  • 卫浴网站设计大型网站建设的必须条件
  • 肇庆制作企业网站seo网站建设课程
  • 没有公司自己做网站wordpress lms插件
  • 申请一个网站需要怎么做北京网络公司信息
  • 珠海市建设局网站分销系统价格多少
  • 杭州建网站企业seo营销工具
  • php旅游类网站开发wordpress 文章内
  • 企业管理外贸企业网站优化
  • 免费图纸网东莞百度快照优化排名
  • 南宁网站建设培训学校青海网站建设加q5299丶14602做词
  • 鱼台做网站多少钱wordpress pot
  • 招聘网站建设维护人员怎样自己开发一款软件
  • 上海网站制作怎么选泰安网红人物
  • 企业网站建设义乌南靖网站建设
  • 抖音电商网站建设如何制作app推广
  • 关键词的选择网站提示网站建设电销异议处理话术
  • 南京建设网站内容网站打开速度慢是否需要升级带宽
  • 内容类网站如何 流量厦门市建设局网站住房保障专栏
  • 朝城做网站公司网站内容建设要求age06
  • 云南省城乡建设培训中心网站备份wordpress网站
  • 快速建站公司地址vr哪家公司做得好
  • 网站空间怎么更换网站营销如何做
  • 制作单页网站要网址wordpress更新显示失败