法规月报-发布

This commit is contained in:
zhn
2022-06-29 11:44:12 +08:00
parent de03a8350d
commit 0426c93b34
6 changed files with 66 additions and 19 deletions
@@ -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");
@@ -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<LawsMont
return super.importExcel(request, response, LawsMonthlyReportManageEO.class);
}
@AutoLog(value = "发布")
@ApiOperation(value="发布", notes="发布")
@GetMapping(value = "/issue")
// @RequiresPermissions("dummyInventoryBase:issue")
public Result<?> issue(LawsMonthlyReportManageEO lawsMonthlyReportManageEO) {
try {
lawsMonthlyReportManageEOService.issue(lawsMonthlyReportManageEO);
} catch (Exception e) {
return Result.error("操作失败");
}
return Result.error("操作成功");
}
}
@@ -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;
}
@@ -11,5 +11,6 @@
<result column="name" property="name" />
<result column="language" property="language" />
<result column="issue_status" property="issueStatus" />
<result column="file_id" property="fileId" />
</resultMap>
</mapper>
</mapper>
@@ -62,5 +62,16 @@ public interface ILawsMonthlyReportManageEOService extends IService<LawsMonthlyR
*/
List<LawsMonthlyReportManageEO> queryList();
/**
* 分页
* @param page
* @param queryWrapper
* @return
*/
IPage<LawsMonthlyReportManageEO> getPageInfo(Page<LawsMonthlyReportManageEO> page, QueryWrapper<LawsMonthlyReportManageEO> queryWrapper);
void issue(LawsMonthlyReportManageEO lawsMonthlyReportManageEO);
}
@@ -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<LawsMonthl
public IPage<LawsMonthlyReportManageEO> getPageInfo(Page<LawsMonthlyReportManageEO> page, QueryWrapper<LawsMonthlyReportManageEO> 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<LawsMonthlyReportManageEO> pageInfo = this.page(page, queryWrapper);
return pageInfo;
}
@Override
public void issue(LawsMonthlyReportManageEO lawsMonthlyReportManageEO) {
this.updateById(lawsMonthlyReportManageEO);
}
}