Compare commits
5 Commits
5e9a139f9d
...
818bfd7095
| Author | SHA1 | Date |
|---|---|---|
|
|
818bfd7095 | 2 years ago |
|
|
e51f91b2a4 | 2 years ago |
|
|
dac82de576 | 2 years ago |
|
|
add5c1e421 | 2 years ago |
|
|
080e53d575 | 2 years ago |
84 changed files with 26544 additions and 346 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,62 @@ |
||||
package net.mingsoft.excel.listener; |
||||
|
||||
import com.alibaba.excel.context.AnalysisContext; |
||||
import com.alibaba.excel.event.AnalysisEventListener; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
public class DataListener<T> extends AnalysisEventListener<T> { |
||||
private final List<T> dataList = new ArrayList(); |
||||
|
||||
public DataListener() { |
||||
} |
||||
|
||||
public void invoke(T data, AnalysisContext analysisContext) { |
||||
this.dataList.add(data); |
||||
} |
||||
|
||||
public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
||||
} |
||||
|
||||
public List<T> getDataList() { |
||||
return this.dataList; |
||||
} |
||||
|
||||
public boolean equals(final Object o) { |
||||
if (o == this) { |
||||
return true; |
||||
} else if (!(o instanceof DataListener)) { |
||||
return false; |
||||
} else { |
||||
DataListener<?> other = (DataListener)o; |
||||
if (!other.canEqual(this)) { |
||||
return false; |
||||
} else if (!super.equals(o)) { |
||||
return false; |
||||
} else { |
||||
Object this$dataList = this.getDataList(); |
||||
Object other$dataList = other.getDataList(); |
||||
if (this$dataList == null) { |
||||
if (other$dataList != null) { |
||||
return false; |
||||
} |
||||
} else if (!this$dataList.equals(other$dataList)) { |
||||
return false; |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
|
||||
protected boolean canEqual(final Object other) { |
||||
return other instanceof DataListener; |
||||
} |
||||
|
||||
public int hashCode() { |
||||
int result = super.hashCode(); |
||||
Object $dataList = this.getDataList(); |
||||
result = result * 59 + ($dataList == null ? 43 : $dataList.hashCode()); |
||||
return result; |
||||
} |
||||
} |
||||
@ -0,0 +1,113 @@ |
||||
package net.mingsoft.excel.listener; |
||||
|
||||
import com.alibaba.excel.context.AnalysisContext; |
||||
import com.alibaba.excel.event.AnalysisEventListener; |
||||
import net.mingsoft.excel.support.ExcelImporter; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
public class ImportListener<T> extends AnalysisEventListener<T> { |
||||
private int batchCount = 3000; |
||||
private List<T> list = new ArrayList(); |
||||
private final ExcelImporter<T> importer; |
||||
|
||||
public void invoke(T data, AnalysisContext analysisContext) { |
||||
this.list.add(data); |
||||
if (this.list.size() >= this.batchCount) { |
||||
this.importer.save(this.list); |
||||
this.list.clear(); |
||||
} |
||||
|
||||
} |
||||
|
||||
public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
||||
this.importer.save(this.list); |
||||
this.list.clear(); |
||||
} |
||||
|
||||
public int getBatchCount() { |
||||
return this.batchCount; |
||||
} |
||||
|
||||
public List<T> getList() { |
||||
return this.list; |
||||
} |
||||
|
||||
public ExcelImporter<T> getImporter() { |
||||
return this.importer; |
||||
} |
||||
|
||||
public void setBatchCount(final int batchCount) { |
||||
this.batchCount = batchCount; |
||||
} |
||||
|
||||
public void setList(final List<T> list) { |
||||
this.list = list; |
||||
} |
||||
|
||||
public String toString() { |
||||
return "ImportListener(batchCount=" + this.getBatchCount() + ", list=" + this.getList() + ", importer=" + this.getImporter() + ")"; |
||||
} |
||||
|
||||
public ImportListener(final ExcelImporter<T> importer) { |
||||
this.importer = importer; |
||||
} |
||||
|
||||
public boolean equals(final Object o) { |
||||
if (o == this) { |
||||
return true; |
||||
} else if (!(o instanceof ImportListener)) { |
||||
return false; |
||||
} else { |
||||
ImportListener<?> other = (ImportListener)o; |
||||
if (!other.canEqual(this)) { |
||||
return false; |
||||
} else if (!super.equals(o)) { |
||||
return false; |
||||
} else if (this.getBatchCount() != other.getBatchCount()) { |
||||
return false; |
||||
} else { |
||||
label40: { |
||||
Object this$list = this.getList(); |
||||
Object other$list = other.getList(); |
||||
if (this$list == null) { |
||||
if (other$list == null) { |
||||
break label40; |
||||
} |
||||
} else if (this$list.equals(other$list)) { |
||||
break label40; |
||||
} |
||||
|
||||
return false; |
||||
} |
||||
|
||||
Object this$importer = this.getImporter(); |
||||
Object other$importer = other.getImporter(); |
||||
if (this$importer == null) { |
||||
if (other$importer != null) { |
||||
return false; |
||||
} |
||||
} else if (!this$importer.equals(other$importer)) { |
||||
return false; |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
} |
||||
} |
||||
|
||||
protected boolean canEqual(final Object other) { |
||||
return other instanceof ImportListener; |
||||
} |
||||
|
||||
public int hashCode() { |
||||
int result = super.hashCode(); |
||||
result = result * 59 + this.getBatchCount(); |
||||
Object $list = this.getList(); |
||||
result = result * 59 + ($list == null ? 43 : $list.hashCode()); |
||||
Object $importer = this.getImporter(); |
||||
result = result * 59 + ($importer == null ? 43 : $importer.hashCode()); |
||||
return result; |
||||
} |
||||
} |
||||
@ -0,0 +1,9 @@ |
||||
package net.mingsoft.excel.support; |
||||
|
||||
public class ExcelException extends RuntimeException { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public ExcelException(String message) { |
||||
super(message); |
||||
} |
||||
} |
||||
@ -0,0 +1,7 @@ |
||||
package net.mingsoft.excel.support; |
||||
|
||||
import java.util.List; |
||||
|
||||
public interface ExcelImporter<T> { |
||||
void save(List<T> data); |
||||
} |
||||
@ -0,0 +1,99 @@ |
||||
package net.mingsoft.excel.util; |
||||
|
||||
import com.alibaba.excel.EasyExcel; |
||||
import com.alibaba.excel.read.builder.ExcelReaderBuilder; |
||||
import com.alibaba.excel.read.builder.ExcelReaderSheetBuilder; |
||||
import com.alibaba.excel.read.listener.ReadListener; |
||||
import com.alibaba.excel.util.DateUtils; |
||||
import java.io.BufferedInputStream; |
||||
import java.io.IOException; |
||||
import java.io.InputStream; |
||||
import java.net.URLEncoder; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
|
||||
import net.mingsoft.excel.listener.DataListener; |
||||
import net.mingsoft.excel.listener.ImportListener; |
||||
import net.mingsoft.excel.support.ExcelException; |
||||
import net.mingsoft.excel.support.ExcelImporter; |
||||
import org.apache.commons.codec.Charsets; |
||||
import org.springframework.util.StringUtils; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
public class ExcelUtil { |
||||
public ExcelUtil() { |
||||
} |
||||
|
||||
public static <T> List<T> read(MultipartFile excel, Class<T> clazz) { |
||||
DataListener<T> dataListener = new DataListener(); |
||||
ExcelReaderBuilder builder = getReaderBuilder(excel, dataListener, clazz); |
||||
if (builder == null) { |
||||
return null; |
||||
} else { |
||||
builder.doReadAll(); |
||||
return dataListener.getDataList(); |
||||
} |
||||
} |
||||
|
||||
public static <T> List<T> read(MultipartFile excel, int sheetNo, Class<T> clazz) { |
||||
return read(excel, sheetNo, 1, clazz); |
||||
} |
||||
|
||||
public static <T> List<T> read(MultipartFile excel, int sheetNo, int headRowNumber, Class<T> clazz) { |
||||
DataListener<T> dataListener = new DataListener(); |
||||
ExcelReaderBuilder builder = getReaderBuilder(excel, dataListener, clazz); |
||||
if (builder == null) { |
||||
return null; |
||||
} else { |
||||
((ExcelReaderSheetBuilder)builder.sheet(sheetNo).headRowNumber(headRowNumber)).doRead(); |
||||
return dataListener.getDataList(); |
||||
} |
||||
} |
||||
|
||||
public static <T> void save(MultipartFile excel, ExcelImporter<T> importer, Class<T> clazz) { |
||||
ImportListener<T> importListener = new ImportListener(importer); |
||||
ExcelReaderBuilder builder = getReaderBuilder(excel, importListener, clazz); |
||||
if (builder != null) { |
||||
builder.doReadAll(); |
||||
} |
||||
|
||||
} |
||||
|
||||
public static <T> void export(HttpServletResponse response, List<T> dataList, Class<T> clazz) throws IOException { |
||||
try { |
||||
export(response, DateUtils.format(new Date(), "yyyyMMddHHmmss"), "导出数据", dataList, clazz); |
||||
} catch (Throwable var4) { |
||||
throw var4; |
||||
} |
||||
} |
||||
|
||||
public static <T> void export(HttpServletResponse response, String fileName, String sheetName, List<T> dataList, Class<T> clazz) throws IOException { |
||||
try { |
||||
response.setContentType("application/vnd.ms-excel"); |
||||
response.setCharacterEncoding(Charsets.UTF_8.name()); |
||||
fileName = URLEncoder.encode(fileName, Charsets.UTF_8.name()); |
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
||||
EasyExcel.write(response.getOutputStream(), clazz).sheet(sheetName).doWrite(dataList); |
||||
} catch (Throwable var6) { |
||||
throw var6; |
||||
} |
||||
} |
||||
|
||||
public static <T> ExcelReaderBuilder getReaderBuilder(MultipartFile excel, ReadListener<T> readListener, Class<T> clazz) { |
||||
String filename = excel.getOriginalFilename(); |
||||
if (StringUtils.isEmpty(filename)) { |
||||
throw new ExcelException("请上传文件!"); |
||||
} else if (!StringUtils.endsWithIgnoreCase(filename, ".xls") && !StringUtils.endsWithIgnoreCase(filename, ".xlsx")) { |
||||
throw new ExcelException("请上传正确的excel文件!"); |
||||
} else { |
||||
try { |
||||
InputStream inputStream = new BufferedInputStream(excel.getInputStream()); |
||||
return EasyExcel.read(inputStream, clazz, readListener); |
||||
} catch (IOException var6) { |
||||
var6.printStackTrace(); |
||||
return null; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,43 @@ |
||||
|
||||
package net.mingsoft.statistics.action; |
||||
|
||||
import java.util.MissingResourceException; |
||||
import net.mingsoft.base.util.BundleUtil; |
||||
|
||||
/** |
||||
* statistics基础控制层 |
||||
* @author 凉寂 |
||||
* 创建日期:2024-3-19 9:38:54<br/> |
||||
* 历史修订:<br/> |
||||
*/ |
||||
public class BaseAction extends net.mingsoft.basic.action.BaseAction{ |
||||
|
||||
/** |
||||
* 读取国际化资源文件(没有占位符号的),优先模块对应的资源文件,如果模块资源文件找不到就会优先基础层 |
||||
* @param key 国际化文件key |
||||
* @return 国际化字符串 |
||||
*/ |
||||
protected String getResString(String key) { |
||||
return this.getResString(key,""); |
||||
} |
||||
|
||||
/** |
||||
* 读取国际化资源文件,优先模块对应的资源文件,如果模块资源文件找不到就会优先基础层 |
||||
* @param key 国际化文件key |
||||
* @param params 拼接值 |
||||
* @return 国际化字符串 |
||||
*/ |
||||
protected String getResString(String key,String... params) { |
||||
String str = ""; |
||||
try { |
||||
str = super.getResString(key); |
||||
//替换占位
|
||||
for (int i = 0; i < params.length; i++) { |
||||
str = str.replace("{" + i + "}", params[i]); |
||||
} |
||||
} catch (MissingResourceException e) { |
||||
str = BundleUtil.getString(net.mingsoft.statistics.constant.Const.RESOURCES,key,params); |
||||
} |
||||
return str; |
||||
} |
||||
} |
||||
@ -0,0 +1,180 @@ |
||||
package net.mingsoft.statistics.action; |
||||
|
||||
import java.util.List; |
||||
import java.io.File; |
||||
import java.util.ArrayList; |
||||
import java.util.Map; |
||||
import java.util.regex.Matcher; |
||||
import java.util.regex.Pattern; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import cn.hutool.core.util.ObjectUtil; |
||||
import java.util.*; |
||||
|
||||
import net.mingsoft.base.entity.ResultData; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.validation.BindingResult; |
||||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
import org.springframework.ui.ModelMap; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.ModelAttribute; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.ResponseBody; |
||||
import org.springframework.web.bind.annotation.ModelAttribute; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.PostMapping; |
||||
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import java.util.stream.Collectors; |
||||
|
||||
import org.springframework.web.bind.annotation.*; |
||||
import net.mingsoft.statistics.biz.IPublishListBiz; |
||||
import net.mingsoft.statistics.entity.PublishListEntity; |
||||
import net.mingsoft.base.entity.BaseEntity; |
||||
import net.mingsoft.basic.util.BasicUtil; |
||||
import net.mingsoft.basic.util.StringUtil; |
||||
import net.mingsoft.basic.bean.EUListBean; |
||||
import net.mingsoft.basic.annotation.LogAnn; |
||||
import net.mingsoft.basic.constant.e.BusinessTypeEnum; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
|
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiImplicitParam; |
||||
import io.swagger.annotations.ApiImplicitParams; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
/** |
||||
* 发布量统计管理控制层 |
||||
* @author 凉寂 |
||||
* 创建日期:2024-3-19 9:38:54<br/> |
||||
* 历史修订:<br/> |
||||
*/ |
||||
@Api(tags = "后台-发布量统计接口") |
||||
@Controller("statisticsPublishListAction") |
||||
@RequestMapping("/${ms.manager.path}/statistics/publishList") |
||||
public class PublishListAction extends BaseAction{ |
||||
|
||||
|
||||
/** |
||||
* 注入发布量统计业务层 |
||||
*/ |
||||
@Autowired |
||||
private IPublishListBiz publishListBiz; |
||||
|
||||
/** |
||||
* 返回主界面index |
||||
*/ |
||||
@GetMapping("/index") |
||||
public String index(HttpServletResponse response,HttpServletRequest request) { |
||||
return "/statistics/publish-list/index"; |
||||
} |
||||
|
||||
/** |
||||
* 查询发布量统计列表 |
||||
* @param publishList 发布量统计实体 |
||||
*/ |
||||
@ApiOperation(value = "查询发布量统计列表接口") |
||||
@ApiImplicitParams({ |
||||
@ApiImplicitParam(name = "perYear", value = "按年份查询", paramType = "query"), |
||||
}) |
||||
@RequestMapping(value ="/list",method = {RequestMethod.GET,RequestMethod.POST}) |
||||
@ResponseBody |
||||
public ResultData list(@ModelAttribute @ApiIgnore PublishListEntity publishList,HttpServletResponse response, HttpServletRequest request,@ApiIgnore ModelMap model,BindingResult result) { |
||||
BasicUtil.startPage(); |
||||
List publishListList = null; |
||||
if ( publishList.getSqlWhere() != null){ |
||||
publishListList = publishListBiz.query(publishList); |
||||
} else { |
||||
LambdaQueryWrapper<PublishListEntity> wrapper = new LambdaQueryWrapper<>(publishList).orderByDesc(PublishListEntity::getCreateDate); |
||||
publishListList = publishListBiz.list(wrapper); |
||||
} |
||||
return ResultData.build().success(new EUListBean(publishListList,(int)BasicUtil.endPage(publishListList).getTotal())); |
||||
} |
||||
|
||||
/** |
||||
* 返回编辑界面publishList的form |
||||
*/ |
||||
@GetMapping("/form") |
||||
public String form(@ModelAttribute PublishListEntity publishList,HttpServletResponse response,HttpServletRequest request,ModelMap model) { |
||||
return "/statistics/publish-list/form"; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 获取发布量统计 |
||||
* @param publishList 发布量统计实体 |
||||
*/ |
||||
@ApiOperation(value = "获取发布量统计列表接口") |
||||
@ApiImplicitParam(name = "id", value = "主键ID", required =true,paramType="query") |
||||
@GetMapping("/get") |
||||
@ResponseBody |
||||
public ResultData get(@ModelAttribute @ApiIgnore PublishListEntity publishList,HttpServletResponse response, HttpServletRequest request,@ApiIgnore ModelMap model) { |
||||
if (publishList.getId()==null) { |
||||
return ResultData.build().error(); |
||||
} |
||||
PublishListEntity _publishList = (PublishListEntity)publishListBiz.getById(publishList.getId()); |
||||
return ResultData.build().success(_publishList); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 保存发布量统计 |
||||
* @param publishList 发布量统计实体 |
||||
*/ |
||||
@ApiOperation(value = "保存发布量统计列表接口") |
||||
@ApiImplicitParams({ |
||||
@ApiImplicitParam(name = "perYear", value = "按年份查询", required =true, paramType = "query"), |
||||
}) |
||||
@PostMapping("/save") |
||||
@ResponseBody |
||||
@LogAnn(title = "保存发布量统计", businessType = BusinessTypeEnum.INSERT) |
||||
@RequiresPermissions("statistics:publishList:save") |
||||
public ResultData save(@ModelAttribute @ApiIgnore PublishListEntity publishList, HttpServletResponse response, HttpServletRequest request) { |
||||
publishListBiz.save(publishList); |
||||
return ResultData.build().success(publishList); |
||||
} |
||||
|
||||
/** |
||||
* 删除发布量统计 |
||||
* |
||||
* @param publishLists 发布量统计实体 |
||||
*/ |
||||
@ApiOperation(value = "批量删除发布量统计列表接口") |
||||
@PostMapping("/delete") |
||||
@ResponseBody |
||||
@LogAnn(title = "删除发布量统计", businessType = BusinessTypeEnum.DELETE) |
||||
@RequiresPermissions("statistics:publishList:del") |
||||
public ResultData delete(@RequestBody List<PublishListEntity> publishLists,HttpServletResponse response, HttpServletRequest request) { |
||||
List<String> ids = (List)publishLists.stream().map((p) -> {return p.getId();}).collect(Collectors.toList()); |
||||
return this.publishListBiz.removeByIds(ids) ? ResultData.build().success() : ResultData.build().error(this.getResString("err.error", new String[]{this.getResString("id")})); |
||||
} |
||||
|
||||
/** |
||||
* 更新发布量统计列表 |
||||
* |
||||
* @param publishList 发布量统计实体 |
||||
*/ |
||||
@ApiOperation(value = "更新发布量统计列表接口") |
||||
@ApiImplicitParams({ |
||||
@ApiImplicitParam(name = "perYear", value = "按年份查询", required =true, paramType = "query"), |
||||
}) |
||||
@PostMapping("/update") |
||||
@ResponseBody |
||||
@LogAnn(title = "更新发布量统计", businessType = BusinessTypeEnum.UPDATE) |
||||
@RequiresPermissions("statistics:publishList:update") |
||||
public ResultData update(@ModelAttribute @ApiIgnore PublishListEntity publishList, HttpServletResponse response, |
||||
HttpServletRequest request) { |
||||
//先查询数据是否存在
|
||||
PublishListEntity _publishList = (PublishListEntity)publishListBiz.getById(publishList.getId()); |
||||
if(_publishList == null) { |
||||
return ResultData.build().error(getResString("err.not.exist",publishList.getId() )); |
||||
} |
||||
publishListBiz.updateById(publishList); |
||||
return ResultData.build().success(publishList); |
||||
} |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,16 @@ |
||||
package net.mingsoft.statistics.biz; |
||||
|
||||
import net.mingsoft.base.biz.IBaseBiz; |
||||
import net.mingsoft.statistics.entity.PublishListEntity; |
||||
|
||||
|
||||
/** |
||||
* 发布量统计业务 |
||||
* @author 凉寂 |
||||
* 创建日期:2024-3-19 9:38:54<br/> |
||||
* 历史修订:<br/> |
||||
*/ |
||||
public interface IPublishListBiz extends IBaseBiz<PublishListEntity> { |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,34 @@ |
||||
package net.mingsoft.statistics.biz.impl; |
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
import net.mingsoft.base.biz.impl.BaseBizImpl; |
||||
import net.mingsoft.base.dao.IBaseDao; |
||||
import java.util.*; |
||||
import net.mingsoft.statistics.entity.PublishListEntity; |
||||
import net.mingsoft.statistics.biz.IPublishListBiz; |
||||
import net.mingsoft.statistics.dao.IPublishListDao; |
||||
|
||||
/** |
||||
* 发布量统计管理持久化层 |
||||
* @author 凉寂 |
||||
* 创建日期:2024-3-19 9:38:54<br/> |
||||
* 历史修订:<br/> |
||||
*/ |
||||
@Service("statisticspublishListBizImpl") |
||||
public class PublishListBizImpl extends BaseBizImpl<IPublishListDao,PublishListEntity> implements IPublishListBiz { |
||||
|
||||
|
||||
@Autowired |
||||
private IPublishListDao publishListDao; |
||||
|
||||
|
||||
@Override |
||||
protected IBaseDao getDao() { |
||||
// TODO Auto-generated method stub
|
||||
return publishListDao; |
||||
} |
||||
|
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,18 @@ |
||||
package net.mingsoft.statistics.constant; |
||||
|
||||
import java.util.ResourceBundle; |
||||
|
||||
/** |
||||
* statistics定义 |
||||
* @author 凉寂 |
||||
* 创建日期:2024-3-19 9:38:54<br/> |
||||
* 历史修订:<br/> |
||||
*/ |
||||
public final class Const { |
||||
|
||||
/** |
||||
* 资源文件 |
||||
*/ |
||||
public final static String RESOURCES = "net.mingsoft.statistics.resources.resources"; |
||||
|
||||
} |
||||
@ -0,0 +1,14 @@ |
||||
package net.mingsoft.statistics.dao; |
||||
|
||||
import net.mingsoft.base.dao.IBaseDao; |
||||
import java.util.*; |
||||
import net.mingsoft.statistics.entity.PublishListEntity; |
||||
|
||||
/** |
||||
* 发布量统计持久层 |
||||
* @author 凉寂 |
||||
* 创建日期:2024-3-19 9:38:54<br/> |
||||
* 历史修订:<br/> |
||||
*/ |
||||
public interface IPublishListDao extends IBaseDao<PublishListEntity> { |
||||
} |
||||
@ -0,0 +1,18 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
||||
<mapper namespace="net.mingsoft.statistics.dao.IPublishListDao"> |
||||
|
||||
<resultMap id="resultMap" type="net.mingsoft.statistics.entity.PublishListEntity"> |
||||
<result column="PER_YEAR" property="perYear" /><!--按年份查询 --> |
||||
</resultMap> |
||||
|
||||
<select id="query" resultMap="resultMap"> |
||||
SELECT * FROM STATISTICS_PUBLISHPUBLISH_LIST |
||||
<where> |
||||
DEL=0 |
||||
<include refid="net.mingsoft.base.dao.IBaseDao.sqlWhere"></include> |
||||
</where> |
||||
ORDER BY ID DESC |
||||
</select> |
||||
|
||||
</mapper> |
||||
@ -0,0 +1,55 @@ |
||||
package net.mingsoft.statistics.entity; |
||||
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import net.mingsoft.base.entity.BaseEntity; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.baomidou.mybatisplus.annotation.SqlCondition; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableLogic; |
||||
|
||||
import java.util.Date; |
||||
/** |
||||
* 发布量统计实体 |
||||
* @author 凉寂 |
||||
* 创建日期:2024-3-19 9:38:54<br/> |
||||
* 历史修订:<br/> |
||||
*/ |
||||
@TableName("STATISTICS_PUBLISHPUBLISH_LIST") |
||||
public class PublishListEntity extends BaseEntity { |
||||
|
||||
private static final long serialVersionUID = 1710812334454L; |
||||
|
||||
|
||||
|
||||
|
||||
/** |
||||
* 按年份查询 |
||||
*/ |
||||
@DateTimeFormat(pattern = "yyyy") |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy") |
||||
|
||||
private Date perYear; |
||||
|
||||
|
||||
/** |
||||
* 设置按年份查询 |
||||
*/ |
||||
public void setPerYear(Date perYear) { |
||||
this.perYear = perYear; |
||||
} |
||||
|
||||
/** |
||||
* 获取按年份查询 |
||||
*/ |
||||
public Date getPerYear() { |
||||
return this.perYear; |
||||
} |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1 @@ |
||||
per.year=per year |
||||
@ -0,0 +1 @@ |
||||
per.year=\u6309\u5e74\u4efd\u67e5\u8be2 |
||||
@ -1,7 +1,7 @@ |
||||
spring: |
||||
datasource: |
||||
url: jdbc:mysql://localhost:3306/mcms?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&allowMultiQueries=true&useSSL=true |
||||
url: jdbc:mysql://localhost:3306/mcms?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&allowMultiQueries=true&useSSL=false |
||||
username: root |
||||
password: root |
||||
password: 123456 |
||||
filters: wall,mergeStat |
||||
type: com.alibaba.druid.pool.DruidDataSource |
||||
@ -0,0 +1,128 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8"> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||
<title>发布量统计</title> |
||||
<#include "../../include/head-file.ftl"> |
||||
</head> |
||||
<body style="overflow: hidden"> |
||||
<div id="index" v-cloak> |
||||
<div class="index-menu"> |
||||
<el-form :inline="true" :model="form" class="demo-form-inline"> |
||||
<el-form-item label="按年份查询"> |
||||
<el-date-picker |
||||
v-model="form.year" |
||||
type="year" |
||||
placeholder="选择年" |
||||
format="yyyy" |
||||
value-format="yyyy"> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
<el-form-item label="按时间查询"> |
||||
<el-date-picker |
||||
v-model="timeRange" |
||||
type="daterange" |
||||
range-separator="至" |
||||
start-placeholder="开始日期" |
||||
end-placeholder="结束日期" |
||||
format="yyyy-MM-dd" |
||||
value-format="yyyy-MM-dd"> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="handleSearch">查询</el-button> |
||||
<el-button type="primary" @click="handleReset">重置</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
<el-table :data="tableData" style="width: 100%" > |
||||
<el-table-column |
||||
align="center" |
||||
prop="dept" |
||||
label="科室部门" |
||||
> |
||||
</el-table-column> |
||||
<el-table-column |
||||
prop="num" |
||||
align="center" |
||||
label="发布量" |
||||
> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="page_box"> |
||||
<el-pagination |
||||
background |
||||
@size-change="handleSizeChange" |
||||
@current-change="handleCurrentChange" |
||||
:current-page="pageCurrent" |
||||
:page-sizes="[10, 20, 30, 40]" |
||||
:page-size="pageSize" |
||||
layout="total, sizes, prev, pager, next, jumper" |
||||
:total="total"> |
||||
</el-pagination> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
</body> |
||||
</html> |
||||
<script> |
||||
var indexVue = new Vue({ |
||||
el: '#index', |
||||
data() { |
||||
return { |
||||
form:{}, |
||||
timeRange:[], |
||||
tableData:[], |
||||
total:0, |
||||
pageSize:10, |
||||
pageCurrent:1 |
||||
} |
||||
}, |
||||
created() { |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
handleSearch(){ |
||||
console.log('form ===>',this.form) |
||||
}, |
||||
handleReset(){ |
||||
this.form = {} |
||||
this.timeRange = [] |
||||
}, |
||||
getData(){ |
||||
this.tableData = [ |
||||
{dept:'秘书科',num:110}, |
||||
{dept:'政工科',num:105}, |
||||
]; |
||||
this.total = this.tableData.length |
||||
}, |
||||
handleSizeChange(val){ |
||||
this.pageSize = val |
||||
this.getData() |
||||
}, |
||||
handleCurrentChange(val){ |
||||
this.pageCurrent = val |
||||
this.getData() |
||||
}, |
||||
}, |
||||
}) |
||||
</script> |
||||
<style> |
||||
#index .index-menu { |
||||
height: 100vh; |
||||
min-height: 100vh; |
||||
min-width: 140px; |
||||
} |
||||
.page_box{ |
||||
width: 100%; |
||||
padding: 30px 0; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
position: absolute; |
||||
bottom: 0; |
||||
border-top: 1px solid #ccc; |
||||
} |
||||
</style> |
||||
@ -0,0 +1,143 @@ |
||||
<!DOCTYPE html> |
||||
<html> |
||||
|
||||
<head> |
||||
<title>发布量统计</title> |
||||
<#include "../../include/head-file.ftl"> |
||||
|
||||
</head> |
||||
|
||||
<body> |
||||
<div id="form" v-loading="loading" v-cloak> |
||||
<el-header class="ms-header ms-tr" height="50px"> |
||||
<el-button type="primary" class="iconfont icon-baocun" size="mini" @click="save()" :loading="saveDisabled">保存</el-button> |
||||
<el-button size="mini" class="iconfont icon-fanhui" plain onclick="javascript:history.go(-1)">返回</el-button> |
||||
</el-header> |
||||
<el-main class="ms-container"> |
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="right" size="small"> |
||||
|
||||
<el-row |
||||
:gutter="0" |
||||
justify="start" align="top"> |
||||
<el-col span="12"> |
||||
<!--按年份查询--> |
||||
|
||||
<el-form-item label="按年份查询" prop="perYear"> |
||||
<el-date-picker |
||||
v-model="form.perYear" |
||||
placeholder="请选择按年份查询" :readonly="false" |
||||
:disabled="false" |
||||
:editable="true" |
||||
:clearable="true" |
||||
value-format="yyyy" |
||||
:style="{width:'100%'}" |
||||
type="date"> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col span="12"> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form> |
||||
</el-main> |
||||
</div> |
||||
</body> |
||||
|
||||
</html> |
||||
|
||||
<script> |
||||
var formVue = new Vue({ |
||||
el: '#form', |
||||
data:function() { |
||||
return { |
||||
loading:false, |
||||
saveDisabled: false, |
||||
//表单数据 |
||||
form: { |
||||
//按年份查询 |
||||
perYear:"", |
||||
|
||||
}, |
||||
rules:{ |
||||
|
||||
}, |
||||
|
||||
} |
||||
}, |
||||
watch:{ |
||||
|
||||
}, |
||||
components:{ |
||||
}, |
||||
computed:{ |
||||
}, |
||||
methods: { |
||||
|
||||
save:function() { |
||||
var that = this; |
||||
var url = ms.manager + "/statistics/publishList/save.do" |
||||
if (that.form.id > 0) { |
||||
url = ms.manager + "/statistics/publishList/update.do"; |
||||
} |
||||
this.$refs.form.validate(function(valid) { |
||||
if (valid) { |
||||
that.saveDisabled = true; |
||||
|
||||
var form = JSON.parse(JSON.stringify(that.form)); |
||||
ms.http.post(url, form).then(function (res) { |
||||
if (res.result) { |
||||
that.$notify({ |
||||
title: "成功", |
||||
message: "保存成功", |
||||
type: 'success' |
||||
}); |
||||
ms.util.openSystemUrl("/statistics/publishList/index.do"); |
||||
} else { |
||||
that.$notify({ |
||||
title: "错误", |
||||
message: res.msg, |
||||
type: 'warning' |
||||
}); |
||||
} |
||||
|
||||
that.saveDisabled = false; |
||||
}).catch(function (err) { |
||||
console.err(err); |
||||
that.saveDisabled = false; |
||||
}); |
||||
} else { |
||||
return false; |
||||
} |
||||
}) |
||||
}, |
||||
|
||||
//获取当前发布量统计 |
||||
get:function(id) { |
||||
var that = this; |
||||
this.loading = true |
||||
ms.http.get(ms.manager + "/statistics/publishList/get.do", {"id":id}).then(function (res) { |
||||
that.loading = false |
||||
if(res.result&&res.data) { |
||||
|
||||
that.form = res.data; |
||||
} |
||||
}); |
||||
}, |
||||
//按年份查询日期格式化 |
||||
perYearFormat:function(row, column, cellValue, index){ |
||||
return ms.util.date.fmt(new Date(row.PER_YEAR),'yyyy'); |
||||
}, |
||||
}, |
||||
created:function() { |
||||
var that = this; |
||||
|
||||
this.form.id = ms.util.getParameter("id"); |
||||
if (this.form.id) { |
||||
this.get(this.form.id); |
||||
} |
||||
} |
||||
}); |
||||
|
||||
</script> |
||||
<style> |
||||
</style> |
||||
@ -0,0 +1,128 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="UTF-8"> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||
<title>发布量统计</title> |
||||
<#include "../../include/head-file.ftl"> |
||||
</head> |
||||
<body style="overflow: hidden"> |
||||
<div id="index" v-cloak> |
||||
<div class="index-menu"> |
||||
<el-form :inline="true" :model="form" class="demo-form-inline"> |
||||
<el-form-item label="按年份查询"> |
||||
<el-date-picker |
||||
v-model="form.year" |
||||
type="year" |
||||
placeholder="选择年" |
||||
format="yyyy" |
||||
value-format="yyyy"> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
<el-form-item label="按时间查询"> |
||||
<el-date-picker |
||||
v-model="timeRange" |
||||
type="daterange" |
||||
range-separator="至" |
||||
start-placeholder="开始日期" |
||||
end-placeholder="结束日期" |
||||
format="yyyy-MM-dd" |
||||
value-format="yyyy-MM-dd"> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="handleSearch">查询</el-button> |
||||
<el-button type="primary" @click="handleReset">重置</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
<el-table :data="tableData" style="width: 100%" > |
||||
<el-table-column |
||||
align="center" |
||||
prop="dept" |
||||
label="科室部门" |
||||
> |
||||
</el-table-column> |
||||
<el-table-column |
||||
prop="num" |
||||
align="center" |
||||
label="发布量" |
||||
> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="page_box"> |
||||
<el-pagination |
||||
background |
||||
@size-change="handleSizeChange" |
||||
@current-change="handleCurrentChange" |
||||
:current-page="pageCurrent" |
||||
:page-sizes="[10, 20, 30, 40]" |
||||
:page-size="pageSize" |
||||
layout="total, sizes, prev, pager, next, jumper" |
||||
:total="total"> |
||||
</el-pagination> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
</body> |
||||
</html> |
||||
<script> |
||||
var indexVue = new Vue({ |
||||
el: '#index', |
||||
data() { |
||||
return { |
||||
form:{}, |
||||
timeRange:[], |
||||
tableData:[], |
||||
total:0, |
||||
pageSize:10, |
||||
pageCurrent:1 |
||||
} |
||||
}, |
||||
created() { |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
handleSearch(){ |
||||
console.log('form ===>',this.form) |
||||
}, |
||||
handleReset(){ |
||||
this.form = {} |
||||
this.timeRange = [] |
||||
}, |
||||
getData(){ |
||||
this.tableData = [ |
||||
{dept:'秘书科',num:110}, |
||||
{dept:'政工科',num:105}, |
||||
]; |
||||
this.total = this.tableData.length |
||||
}, |
||||
handleSizeChange(val){ |
||||
this.pageSize = val |
||||
this.getData() |
||||
}, |
||||
handleCurrentChange(val){ |
||||
this.pageCurrent = val |
||||
this.getData() |
||||
}, |
||||
}, |
||||
}) |
||||
</script> |
||||
<style> |
||||
#index .index-menu { |
||||
height: 100vh; |
||||
min-height: 100vh; |
||||
min-width: 140px; |
||||
} |
||||
.page_box{ |
||||
width: 100%; |
||||
padding: 30px 0; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
position: absolute; |
||||
bottom: 0; |
||||
border-top: 1px solid #ccc; |
||||
} |
||||
</style> |
||||
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 203 KiB |
|
After Width: | Height: | Size: 766 KiB |
@ -0,0 +1,9 @@ |
||||
var en_US ={ |
||||
form:{ |
||||
grid171081208000060549:{ |
||||
text:'栅格布局', |
||||
placeholder:'', |
||||
help:'', |
||||
}, |
||||
} |
||||
} |
||||
@ -0,0 +1,10 @@ |
||||
|
||||
var zh_CN ={ |
||||
form:{ |
||||
grid171081208000060549:{ |
||||
text:'栅格布局', |
||||
placeholder:'', |
||||
help:'', |
||||
}, |
||||
} |
||||
} |
||||
@ -0,0 +1,79 @@ |
||||
.header_box{ |
||||
height:500px; |
||||
background:#efefef; |
||||
padding-top: 15px; |
||||
} |
||||
.header_box .top_header{ |
||||
width:100%; |
||||
height: 32px; |
||||
background-color: rgb(237, 238, 245); |
||||
|
||||
} |
||||
.header_box .top_header .top_header_box{ |
||||
width:96%; |
||||
height:100%; |
||||
max-width:1300px; |
||||
margin:0 auto; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
} |
||||
.header_box .top_header .left_top{ |
||||
width: 50%; |
||||
height: 100%; |
||||
font-size: 16px; |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.header_box .top_header .right{ |
||||
justify-content: end; |
||||
} |
||||
.header_box .top_header .left_top .wea_box{ |
||||
display: flex; |
||||
} |
||||
.header_box .top_header .login_box{ |
||||
margin-left:10%; |
||||
} |
||||
.header_box .center_header{ |
||||
height: 75%; |
||||
width: 96%; |
||||
margin: 0 auto; |
||||
max-width: 1300px; |
||||
} |
||||
.header_box .center_header .top_cen{ |
||||
width: 100%; |
||||
height: 70%; |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.header_box .center_header .bot_cen{ |
||||
width: 100%; |
||||
height: 30%; |
||||
} |
||||
.header_box .center_header .bot_cen .search_cen{ |
||||
width: 100%; |
||||
height: 60%; |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.header_box .center_header .bot_cen .search_cen form{ |
||||
width: 100%; |
||||
display: flex; |
||||
} |
||||
.header_box .center_header .bot_cen .search_cen form .input1{ |
||||
width: 50%; |
||||
height: 45px; |
||||
padding: 0; |
||||
margin: 0; |
||||
border: none; |
||||
} |
||||
.header_box .center_header .bot_cen .search_cen form .bnts{ |
||||
width: 100px; |
||||
height: 46px; |
||||
background: #15396d; |
||||
border: none; |
||||
color: #fff; |
||||
font-size: 16px; |
||||
} |
||||
.header_box .bottom_header{ |
||||
height: 18.5%; |
||||
} |
||||
@ -0,0 +1,77 @@ |
||||
.header-nav{ |
||||
width: 100%; |
||||
height: 100%; |
||||
background-color: #15396d; |
||||
} |
||||
.header-nav ul{ |
||||
width:96%; |
||||
max-width:1300px; |
||||
height: 100%; |
||||
margin: 0 auto; |
||||
list-style: none; |
||||
position: relative; |
||||
} |
||||
|
||||
.header-nav ul li { |
||||
height: 96%; |
||||
cursor: pointer; |
||||
line-height:92px; |
||||
/* text-align: center; |
||||
font-weight: normal; |
||||
position: relative; */ |
||||
display: inline-block; |
||||
border-top: 0; |
||||
transition: all 0.5s; |
||||
border-bottom: 0; /*width:120px; *//* position:relative; */ |
||||
margin-right: 30px; |
||||
} |
||||
.header-nav ul li a { |
||||
color: #fff; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
text-decoration: none; |
||||
font-size:18px; |
||||
margin:0 15px 0 0; |
||||
} |
||||
.header-nav ul li:hover { |
||||
border-bottom: 4px solid #fff; |
||||
} |
||||
.son-cont{ |
||||
width: 100%; |
||||
overflow: hidden; |
||||
position: absolute; |
||||
top: 71px; |
||||
background: rgba(32, 31, 31, 0.4); |
||||
transition: all 0.5s; |
||||
line-height: 60px; |
||||
z-index:120; |
||||
} |
||||
.header-nav ul .son-none{ |
||||
width: 100%; |
||||
height: 0px; |
||||
position: absolute; |
||||
top: 93px; |
||||
left: 0; |
||||
background: rgba(32, 31, 31, 0.4); |
||||
transition: all 0.5s; |
||||
line-height: 60px; |
||||
z-index: 110; |
||||
} |
||||
.header-nav ul .son-none div{ |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
} |
||||
.header-nav ul li:hover .son-none{ |
||||
height: 60px; |
||||
} |
||||
.header-nav ul li:hover .nav-a{ |
||||
height: 60px; |
||||
transition: all 0.5s; |
||||
} |
||||
.nav-a { |
||||
display: block; |
||||
overflow: hidden; |
||||
height: 0; |
||||
} |
||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 597 B |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue