From 0426c93b34ae4adad191fe798edaa8da21173626 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Wed, 29 Jun 2022 11:44:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=9C=88=E6=8A=A5-=E5=8F=91?= =?UTF-8?q?=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dummy/enums/InventoryStateEnum.java | 2 +- .../LawsMonthlyReportManageEOController.java | 51 ++++++++++++++----- .../entity/LawsMonthlyReportManageEO.java | 5 ++ .../xml/LawsMonthlyReportManageEOMapper.xml | 3 +- .../ILawsMonthlyReportManageEOService.java | 11 ++++ .../LawsMonthlyReportManageEOServiceImpl.java | 13 +++-- 6 files changed, 66 insertions(+), 19 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/enums/InventoryStateEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/enums/InventoryStateEnum.java index b0db327e2..ab3e9e5bf 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/enums/InventoryStateEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/enums/InventoryStateEnum.java @@ -8,7 +8,7 @@ package com.jero.modules.dummy.enums; public enum InventoryStateEnum { ISSUE("已发布","1"), DRAFT("草稿","2"), - TO_BE_RELEASED("待发布","3"); + TO_BE_RELEASED("待发布","2"); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/controller/LawsMonthlyReportManageEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/controller/LawsMonthlyReportManageEOController.java index 65eb3aec2..1161aa631 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/controller/LawsMonthlyReportManageEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/controller/LawsMonthlyReportManageEOController.java @@ -1,25 +1,32 @@ package com.jero.modules.report.controller; -import java.util.Arrays; -import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import com.jero.common.api.vo.Result; -import com.jero.common.system.query.QueryGenerator; -import com.jero.modules.report.entity.LawsMonthlyReportManageEO; -import com.jero.modules.report.service.ILawsMonthlyReportManageEOService; 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 com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.system.base.controller.JeroController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; +import com.jero.common.system.query.QueryGenerator; +import com.jero.modules.report.entity.LawsMonthlyReportManageEO; +import com.jero.modules.report.service.ILawsMonthlyReportManageEOService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import com.jero.common.aspect.annotation.AutoLog; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; /** @@ -167,4 +174,20 @@ public class LawsMonthlyReportManageEOController extends JeroController issue(LawsMonthlyReportManageEO lawsMonthlyReportManageEO) { + try { + lawsMonthlyReportManageEOService.issue(lawsMonthlyReportManageEO); + } catch (Exception e) { + return Result.error("操作失败"); + } + return Result.error("操作成功"); + + } + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/entity/LawsMonthlyReportManageEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/entity/LawsMonthlyReportManageEO.java index 29a1486dd..9ff1f6ae8 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/entity/LawsMonthlyReportManageEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/entity/LawsMonthlyReportManageEO.java @@ -73,4 +73,9 @@ public class LawsMonthlyReportManageEO implements Serializable { @ApiModelProperty(value = "发布状态") private java.lang.String issueStatus; + /**文件id*/ + @Excel(name = "文件id", width = 15) + @ApiModelProperty(value = "文件id") + private java.lang.String fileId; + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/mapper/xml/LawsMonthlyReportManageEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/mapper/xml/LawsMonthlyReportManageEOMapper.xml index 7efe9bc88..c0ceb45de 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/mapper/xml/LawsMonthlyReportManageEOMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/mapper/xml/LawsMonthlyReportManageEOMapper.xml @@ -11,5 +11,6 @@ + - \ No newline at end of file + diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/ILawsMonthlyReportManageEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/ILawsMonthlyReportManageEOService.java index f11d64886..cc0d078a2 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/ILawsMonthlyReportManageEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/ILawsMonthlyReportManageEOService.java @@ -62,5 +62,16 @@ public interface ILawsMonthlyReportManageEOService extends IService queryList(); + /** + * 分页 + * @param page + * @param queryWrapper + * @return + */ IPage getPageInfo(Page page, QueryWrapper queryWrapper); + + void issue(LawsMonthlyReportManageEO lawsMonthlyReportManageEO); + + + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/impl/LawsMonthlyReportManageEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/impl/LawsMonthlyReportManageEOServiceImpl.java index 9117026fd..f8943eaa5 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/impl/LawsMonthlyReportManageEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/impl/LawsMonthlyReportManageEOServiceImpl.java @@ -3,16 +3,18 @@ package com.jero.modules.report.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jero.common.system.vo.LoginUser; import com.jero.modules.dummy.enums.InventoryStateEnum; import com.jero.modules.report.entity.LawsMonthlyReportManageEO; import com.jero.modules.report.mapper.LawsMonthlyReportManageEOMapper; import com.jero.modules.report.service.ILawsMonthlyReportManageEOService; import org.apache.shiro.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.List; + import java.util.Date; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.List; /** * @Description: 法规月报管理 @@ -97,10 +99,15 @@ public class LawsMonthlyReportManageEOServiceImpl extends ServiceImpl getPageInfo(Page page, QueryWrapper queryWrapper) { LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); queryWrapper.and(query->{ - query.in("create_by",sysUser.getUsername()).in("state", InventoryStateEnum.TO_BE_RELEASED.getValue()) + query.in("create_by",sysUser.getUsername()).in("issue_status", InventoryStateEnum.TO_BE_RELEASED.getValue()) .or().in("issue_status",InventoryStateEnum.ISSUE.getValue()); }); Page pageInfo = this.page(page, queryWrapper); return pageInfo; } + + @Override + public void issue(LawsMonthlyReportManageEO lawsMonthlyReportManageEO) { + this.updateById(lawsMonthlyReportManageEO); + } }