一、后端
实体类:
package org.jeecg.modules.bidding.entity; import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.util.Date; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; import org.springframework.format.annotation.DateTimeFormat; import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecg.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; /** * @Description: 公告管理 * @Author: jeecg-boot * @Date: 2022-05-06 * @Version: V1.0 */ @Data @TableName("bid_notice") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) @ApiModel(value="bid_notice对象", description="公告管理") public class BidNotice implements Serializable { private static final long serialVersionUID = 1L; /**主键*/ @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "主键") private java.lang.String id; /**创建人*/ @ApiModelProperty(value = "创建人") private java.lang.String createBy; /**创建日期*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "创建日期") private java.util.Date createTime; /**更新人*/ @ApiModelProperty(value = "更新人") private java.lang.String updateBy; /**更新日期*/ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "更新日期") private java.util.Date updateTime; /**所属部门*/ @ApiModelProperty(value = "所属部门") private java.lang.String sysOrgCode; /**标题*/ @Excel(name = "标题", width = 15) @ApiModelProperty(value = "标题") private java.lang.String title; /**内容*/ @Excel(name = "内容", width = 15) @ApiModelProperty(value = "内容") private java.lang.String content; /**是否置顶*/ @Excel(name = "是否置顶", width = 15, dicCode = "notice_top") @Dict(dicCode = "notice_top") @ApiModelProperty(value = "是否置顶") private java.lang.String isTop; /**排序*/ @Excel(name = "排序", width = 15) @ApiModelProperty(value = "排序") private java.lang.Integer sort; /**状态*/ @Excel(name = "状态", width = 15, dicCode = "notice_status") @Dict(dicCode = "notice_status") @ApiModelProperty(value = "状态") private java.lang.String status; /**发布时间*/ @Excel(name = "发布时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "发布时间") private java.util.Date releaseDate; /**附件*/ @Excel(name = "附件", width = 15) @ApiModelProperty(value = "附件") private java.lang.String annex; /**访问量*/ @Excel(name = "访问量", width = 15) @ApiModelProperty(value = "访问量") private java.lang.Integer visit; }
控制层:
package org.jeecg.modules.bidding.controller; import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.bidding.entity.BidNotice; import org.jeecg.modules.bidding.service.IBidNoticeService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ImportParams; import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.jeecg.common.system.base.controller.JeecgController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; import com.alibaba.fastjson.JSON; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.aspect.annotation.AutoLog; /** * @Description: 公告管理 * @Author: jeecg-boot * @Date: 2022-05-06 * @Version: V1.0 */ @Api(tags="公告管理") @RestController @RequestMapping("/bidding/bidNotice") @Slf4j public class BidNoticeController extends JeecgController<BidNotice, IBidNoticeService> { @Autowired private IBidNoticeService bidNoticeService; /** * 分页