update 项目库代码
This commit is contained in:
+38
-106
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.aspect.annotation.AutoLog;
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
|
import com.jero.common.aspect.annotation.DictPoint;
|
||||||
import com.jero.common.constant.CommonConstant;
|
import com.jero.common.constant.CommonConstant;
|
||||||
import com.jero.common.exception.JeroBootException;
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.common.system.base.controller.JeroController;
|
import com.jero.common.system.base.controller.JeroController;
|
||||||
@@ -24,6 +25,8 @@ import com.jero.modules.projectLibrary.vo.RiskOverviewVo;
|
|||||||
import com.jero.modules.system.entity.SysUser;
|
import com.jero.modules.system.entity.SysUser;
|
||||||
import com.jero.modules.system.service.ISysDictService;
|
import com.jero.modules.system.service.ISysDictService;
|
||||||
import com.jero.modules.system.service.ISysUserService;
|
import com.jero.modules.system.service.ISysUserService;
|
||||||
|
import com.jero.modules.system.vo.IdMapBody;
|
||||||
|
import com.jero.modules.system.vo.IdsMapBody;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -45,13 +48,13 @@ import java.util.Map;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 项目库
|
* @Description: 项目库
|
||||||
* @Author: jero-boot
|
* @Author: jero-boot
|
||||||
* @Date: 2023-09-11
|
* @Date: 2023-09-11
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Api(tags="项目库")
|
@Api(tags = "项目库")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/projectLibrary/lawsProjectLibrary")
|
@RequestMapping("/projectLibrary/lawsProjectLibrary")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -72,22 +75,21 @@ public class LawsProjectLibraryController extends JeroController<LawsProjectLibr
|
|||||||
*/
|
*/
|
||||||
@RequiresPermissions("vehicleItemLibrary:search")
|
@RequiresPermissions("vehicleItemLibrary:search")
|
||||||
@AutoLog(value = "项目库-分页列表查询")
|
@AutoLog(value = "项目库-分页列表查询")
|
||||||
@ApiOperation(value="项目库-分页列表查询", notes="项目库-分页列表查询")
|
@ApiOperation(value = "项目库-分页列表查询", notes = "项目库-分页列表查询")
|
||||||
@GetMapping(value = "/page")
|
@GetMapping(value = "/page")
|
||||||
public Result<IPage<LawsProjectLibrary>> queryPageList(LawsProjectLibrary lawsProjectLibrary,
|
public Result<IPage<LawsProjectLibrary>> queryPageList(LawsProjectLibrary lawsProjectLibrary,
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
HttpServletRequest req) {
|
HttpServletRequest req) {
|
||||||
lawsProjectLibrary.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
|
||||||
IPage<LawsProjectLibrary> pageList = lawsProjectLibraryService.queryPage(lawsProjectLibrary, pageNo, pageSize, req);
|
IPage<LawsProjectLibrary> pageList = lawsProjectLibraryService.queryPage(lawsProjectLibrary, pageNo, pageSize, req);
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DictPoint
|
||||||
@AutoLog(value = "项目库-列表查询")
|
@AutoLog(value = "项目库-列表查询")
|
||||||
@ApiOperation(value="项目库-列表查询", notes="项目库-列表查询")
|
@ApiOperation(value = "项目库-列表查询", notes = "项目库-列表查询")
|
||||||
@GetMapping(value = "/queryList")
|
@GetMapping(value = "/queryList")
|
||||||
public Result<List<LawsProjectLibrary>> queryList(LawsProjectLibrary lawsProjectLibrary, HttpServletRequest req) {
|
public Result<List<LawsProjectLibrary>> queryList(LawsProjectLibrary lawsProjectLibrary, HttpServletRequest req) {
|
||||||
lawsProjectLibrary.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
|
||||||
List<LawsProjectLibrary> queryList = lawsProjectLibraryService.queryList(lawsProjectLibrary, req);
|
List<LawsProjectLibrary> queryList = lawsProjectLibraryService.queryList(lawsProjectLibrary, req);
|
||||||
return Result.OK(queryList);
|
return Result.OK(queryList);
|
||||||
}
|
}
|
||||||
@@ -97,12 +99,12 @@ public class LawsProjectLibraryController extends JeroController<LawsProjectLibr
|
|||||||
*/
|
*/
|
||||||
@RequiresPermissions("vehicleItemLibrary:add")
|
@RequiresPermissions("vehicleItemLibrary:add")
|
||||||
@AutoLog(value = "项目库-添加")
|
@AutoLog(value = "项目库-添加")
|
||||||
@ApiOperation(value="项目库-添加", notes="项目库-添加")
|
@ApiOperation(value = "项目库-添加", notes = "项目库-添加")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public Result<T> add(@Validated @RequestBody LawsProjectLibrary lawsProjectLibrary) {
|
public Result<T> add(@Validated @RequestBody LawsProjectLibrary lawsProjectLibrary) {
|
||||||
lawsProjectLibrary.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
lawsProjectLibrary.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
||||||
lawsProjectLibraryService.add(lawsProjectLibrary);
|
lawsProjectLibraryService.add(lawsProjectLibrary);
|
||||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
return Result.OK(ResultCommon.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -110,11 +112,11 @@ public class LawsProjectLibraryController extends JeroController<LawsProjectLibr
|
|||||||
*/
|
*/
|
||||||
@RequiresPermissions("vehicleItemLibrary:edit")
|
@RequiresPermissions("vehicleItemLibrary:edit")
|
||||||
@AutoLog(value = "项目库-编辑")
|
@AutoLog(value = "项目库-编辑")
|
||||||
@ApiOperation(value="项目库-编辑", notes="项目库-编辑")
|
@ApiOperation(value = "项目库-编辑", notes = "项目库-编辑")
|
||||||
@PostMapping(value = "/edit")
|
@PostMapping(value = "/edit")
|
||||||
public Result<T> edit(@RequestBody LawsProjectLibrary lawsProjectLibrary) {
|
public Result<T> edit(@RequestBody LawsProjectLibrary lawsProjectLibrary) {
|
||||||
lawsProjectLibraryService.editById(lawsProjectLibrary);
|
lawsProjectLibraryService.editById(lawsProjectLibrary);
|
||||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
return Result.OK(ResultCommon.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -122,14 +124,15 @@ public class LawsProjectLibraryController extends JeroController<LawsProjectLibr
|
|||||||
*/
|
*/
|
||||||
@RequiresPermissions("vehicleItemLibrary:delete")
|
@RequiresPermissions("vehicleItemLibrary:delete")
|
||||||
@AutoLog(value = "项目库-通过id删除")
|
@AutoLog(value = "项目库-通过id删除")
|
||||||
@ApiOperation(value="项目库-通过id删除", notes="项目库-通过id删除")
|
@ApiOperation(value = "项目库-通过id删除", notes = "项目库-通过id删除")
|
||||||
@PostMapping(value = "/delete")
|
@PostMapping(value = "/delete")
|
||||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
public Result<T> delete(@RequestBody IdMapBody body) {
|
||||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
String id = body.getId();
|
||||||
|
if (StringUtils.isEmpty(id)) {
|
||||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
||||||
}
|
}
|
||||||
lawsProjectLibraryService.deleteById(map.get("id"));
|
lawsProjectLibraryService.deleteById(id);
|
||||||
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
|
return Result.OK(ResultCommon.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -137,25 +140,27 @@ public class LawsProjectLibraryController extends JeroController<LawsProjectLibr
|
|||||||
*/
|
*/
|
||||||
@RequiresPermissions("vehicleItemLibrary:batchDel")
|
@RequiresPermissions("vehicleItemLibrary:batchDel")
|
||||||
@AutoLog(value = "项目库-批量删除")
|
@AutoLog(value = "项目库-批量删除")
|
||||||
@ApiOperation(value="项目库-批量删除", notes="项目库-批量删除")
|
@ApiOperation(value = "项目库-批量删除", notes = "项目库-批量删除")
|
||||||
@PostMapping(value = "/deleteBatch")
|
@PostMapping(value = "/deleteBatch")
|
||||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
public Result<T> deleteBatch(@RequestBody IdsMapBody body) {
|
||||||
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
|
String ids = body.getIds();
|
||||||
|
if (StringUtils.isEmpty(ids)) {
|
||||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
||||||
}
|
}
|
||||||
this.lawsProjectLibraryService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
this.lawsProjectLibraryService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||||
return Result.OK(MessageUtils.getMessage(ResultCommon.SUCCESSFULLY_DELETED_IN_BULK));
|
return Result.OK(ResultCommon.SUCCESSFULLY_DELETED_IN_BULK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
*/
|
*/
|
||||||
|
@DictPoint
|
||||||
@AutoLog(value = "项目库-通过id查询")
|
@AutoLog(value = "项目库-通过id查询")
|
||||||
@ApiOperation(value="项目库-通过id查询", notes="项目库-通过id查询")
|
@ApiOperation(value = "项目库-通过id查询", notes = "项目库-通过id查询")
|
||||||
@GetMapping(value = "/queryById")
|
@GetMapping(value = "/queryById")
|
||||||
public Result<LawsProjectLibrary> queryById(@RequestParam(name="id",required=true) String id) {
|
public Result<LawsProjectLibrary> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
LawsProjectLibrary lawsProjectLibrary = lawsProjectLibraryService.queryById(id);
|
LawsProjectLibrary lawsProjectLibrary = lawsProjectLibraryService.queryById(id);
|
||||||
if(lawsProjectLibrary==null) {
|
if (lawsProjectLibrary == null) {
|
||||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||||
}
|
}
|
||||||
return Result.OK(lawsProjectLibrary);
|
return Result.OK(lawsProjectLibrary);
|
||||||
@@ -165,20 +170,19 @@ public class LawsProjectLibraryController extends JeroController<LawsProjectLibr
|
|||||||
* 项目风险性总览
|
* 项目风险性总览
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "项目库详情-项目风险性总览")
|
@AutoLog(value = "项目库详情-项目风险性总览")
|
||||||
@ApiOperation(value="项目库详情-项目风险性总览", notes="项目库详情-项目风险性总览")
|
@ApiOperation(value = "项目库详情-项目风险性总览", notes = "项目库详情-项目风险性总览")
|
||||||
@GetMapping(value = "/riskOverview")
|
@GetMapping(value = "/riskOverview")
|
||||||
public Result<RiskOverviewVo> riskOverview(@RequestParam(name="id",required=true) String id) {
|
public Result<RiskOverviewVo> riskOverview(@RequestParam(name = "id", required = true) String id) {
|
||||||
LawsProjectLibrary lawsProjectLibrary = lawsProjectLibraryService.queryById(id);
|
LawsProjectLibrary lawsProjectLibrary = lawsProjectLibraryService.queryById(id);
|
||||||
if(lawsProjectLibrary==null) {
|
if (lawsProjectLibrary == null) {
|
||||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<LawsAssess> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<LawsAssess> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(LawsAssess::getProjectId, id);
|
wrapper.eq(LawsAssess::getProjectId, id);
|
||||||
wrapper.eq(LawsAssess::getDelFlag, CommonConstant.DEL_FLAG_0.toString());
|
|
||||||
List<LawsAssess> list = lawsAssessService.list(wrapper);
|
List<LawsAssess> list = lawsAssessService.list(wrapper);
|
||||||
List<String> collect = list.stream().map(LawsAssess::getId).collect(Collectors.toList());
|
List<String> collect = list.stream().map(LawsAssess::getId).collect(Collectors.toList());
|
||||||
if (collect.isEmpty()){
|
if (collect.isEmpty()) {
|
||||||
return Result.OK(new RiskOverviewVo(0,0,0,0));
|
return Result.OK(new RiskOverviewVo(0, 0, 0, 0));
|
||||||
}
|
}
|
||||||
LambdaQueryWrapper<LawsAssessResults> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<LawsAssessResults> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.in(LawsAssessResults::getAssessId, collect);
|
queryWrapper.in(LawsAssessResults::getAssessId, collect);
|
||||||
@@ -187,7 +191,7 @@ public class LawsProjectLibraryController extends JeroController<LawsProjectLibr
|
|||||||
int b = Math.toIntExact(assessResults.stream().filter(LawsAssessResults -> "2".equals(LawsAssessResults.getAssessResults())).count());
|
int b = Math.toIntExact(assessResults.stream().filter(LawsAssessResults -> "2".equals(LawsAssessResults.getAssessResults())).count());
|
||||||
int c = Math.toIntExact(assessResults.stream().filter(LawsAssessResults -> "3".equals(LawsAssessResults.getAssessResults())).count());
|
int c = Math.toIntExact(assessResults.stream().filter(LawsAssessResults -> "3".equals(LawsAssessResults.getAssessResults())).count());
|
||||||
int d = Math.toIntExact(assessResults.stream().filter(LawsAssessResults -> "4".equals(LawsAssessResults.getAssessResults())).count());
|
int d = Math.toIntExact(assessResults.stream().filter(LawsAssessResults -> "4".equals(LawsAssessResults.getAssessResults())).count());
|
||||||
return Result.OK(new RiskOverviewVo(a,b,c,d));
|
return Result.OK(new RiskOverviewVo(a, b, c, d));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -195,82 +199,10 @@ public class LawsProjectLibraryController extends JeroController<LawsProjectLibr
|
|||||||
*/
|
*/
|
||||||
@RequiresPermissions("vehicleItemLibrary:export")
|
@RequiresPermissions("vehicleItemLibrary:export")
|
||||||
@AutoLog(value = "项目库-导出excel")
|
@AutoLog(value = "项目库-导出excel")
|
||||||
@ApiOperation(value="项目库-导出excel", notes="项目库-导出excel")
|
@ApiOperation(value = "项目库-导出excel", notes = "项目库-导出excel")
|
||||||
@GetMapping(value = "/exportXls")
|
@GetMapping(value = "/exportXls")
|
||||||
public ModelAndView exportXls(HttpServletRequest request, LawsProjectLibrary lawsProjectLibrary, HttpServletResponse response) {
|
public ModelAndView exportXls(HttpServletRequest request, LawsProjectLibrary lawsProjectLibrary, HttpServletResponse response) {
|
||||||
String outFileName = "内部工作组人员表" + System.currentTimeMillis() + ".xlsx";
|
return super.exportXls(request,lawsProjectLibrary,LawsProjectLibrary.class,"内部工作组人员表");
|
||||||
String ENCODING = "UTF-8";
|
|
||||||
ExcelWriter writer = ExcelUtil.getWriter(true);
|
|
||||||
|
|
||||||
// 通过工具类创建writer并且进行别名
|
|
||||||
assembleWriter(writer);
|
|
||||||
|
|
||||||
//获取数据
|
|
||||||
List<LawsProjectLibrary> dos = null;
|
|
||||||
String selections = request.getParameter("selections");
|
|
||||||
if (StringUtils.isNotBlank(selections)){
|
|
||||||
dos = lawsProjectLibraryService.listByIds(Arrays.asList(selections.split(",")));
|
|
||||||
}else {
|
|
||||||
lawsProjectLibrary.setDelFlag(CommonConstant.DEL_FLAG_0.toString());
|
|
||||||
QueryWrapper<LawsProjectLibrary> queryWrapper = QueryGenerator.initQueryWrapper(lawsProjectLibrary, request.getParameterMap());
|
|
||||||
dos = lawsProjectLibraryService.list(queryWrapper);
|
|
||||||
}
|
|
||||||
if (dos.isEmpty()){
|
|
||||||
throw new JeroBootException(ResultCommon.PLEASE_SELECT_DATA);
|
|
||||||
}
|
|
||||||
this.translate(dos);
|
|
||||||
|
|
||||||
//导出表头只保留别名中的字段
|
|
||||||
writer.setOnlyAlias(true);
|
|
||||||
//表格高度
|
|
||||||
writer.setDefaultRowHeight(18);
|
|
||||||
//表格宽度
|
|
||||||
writer.setColumnWidth(-1, 20);
|
|
||||||
//放入数据
|
|
||||||
writer.write(dos, true);
|
|
||||||
try {
|
|
||||||
// 获取我们的输出流
|
|
||||||
final OutputStream output = response.getOutputStream();
|
|
||||||
response.setContentType("application/vnd.ms-excel;charset=utf-8");
|
|
||||||
response.setHeader("Content-Disposition", "attachment;filename=" + outFileName + ";filename*=utf-8"
|
|
||||||
+ URLEncoder.encode(outFileName, ENCODING));
|
|
||||||
writer.flush(output, true);
|
|
||||||
writer.close();
|
|
||||||
// 这里可以自行关闭资源或者写一个关闭资源的工具类
|
|
||||||
IoUtil.close(output);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("导出失败:", e);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 翻译项目来源、项目负责人、项目健康状态
|
|
||||||
*/
|
|
||||||
private void translate(List<LawsProjectLibrary> dos){
|
|
||||||
for (LawsProjectLibrary aDo : dos) {
|
|
||||||
String projectSource = aDo.getProjectSource();
|
|
||||||
String projectHealth = aDo.getProjectHealth();
|
|
||||||
String projectLeader = aDo.getProjectLeader();
|
|
||||||
|
|
||||||
String project_source = sysDictService.queryDictTextByKey("project_source", projectSource);
|
|
||||||
aDo.setProjectSource(project_source);
|
|
||||||
|
|
||||||
String project_health = sysDictService.queryDictTextByKey("project_health", projectHealth);
|
|
||||||
aDo.setProjectHealth(project_health);
|
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(projectLeader)) {
|
|
||||||
SysUser sysUser = sysUserService.getById(projectLeader);
|
|
||||||
aDo.setProjectLeader(sysUser.calcNameWorkNo());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void assembleWriter(ExcelWriter writer) {
|
|
||||||
writer.addHeaderAlias("projectSource", "项目来源");
|
|
||||||
writer.addHeaderAlias("projectName", "项目名称");
|
|
||||||
writer.addHeaderAlias("projectLeader", "项目负责人");
|
|
||||||
writer.addHeaderAlias("workNumber", "工作令编号");
|
|
||||||
writer.addHeaderAlias("projectHealth", "项目健康状态");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+13
-12
@@ -3,13 +3,11 @@ package com.jero.modules.projectLibrary.entity;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.jero.common.aspect.annotation.Dict;
|
import com.jero.common.aspect.annotation.Dict;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@@ -40,30 +38,32 @@ public class LawsProjectLibrary implements Serializable {
|
|||||||
|
|
||||||
/**项目来源(1-本地新增、2-PMS)*/
|
/**项目来源(1-本地新增、2-PMS)*/
|
||||||
@Dict(dicCode = "project_source")
|
@Dict(dicCode = "project_source")
|
||||||
|
@Excel(name = "项目来源", width = 15, dicCode = "project_source")
|
||||||
@ApiModelProperty(value = "项目来源(1-本地新增、2-PMS)")
|
@ApiModelProperty(value = "项目来源(1-本地新增、2-PMS)")
|
||||||
private String projectSource;
|
private String projectSource;
|
||||||
@TableField(exist = false)
|
|
||||||
private String projectSource_dictText;
|
|
||||||
|
|
||||||
/**项目名称*/
|
/**项目名称*/
|
||||||
@NotBlank(message = "projectName not null")
|
@NotBlank(message = "projectName not null")
|
||||||
|
@Excel(name = "项目名称", width = 15)
|
||||||
@ApiModelProperty(value = "项目名称")
|
@ApiModelProperty(value = "项目名称")
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
/**工作令编号*/
|
|
||||||
@ApiModelProperty(value = "工作令编号")
|
|
||||||
private String workNumber;
|
|
||||||
|
|
||||||
/**项目负责人*/
|
/**项目负责人*/
|
||||||
@ApiModelProperty(value = "项目负责人")
|
@ApiModelProperty(value = "项目负责人")
|
||||||
|
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
|
||||||
|
@Excel(name = "项目负责人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "id")
|
||||||
private String projectLeader;
|
private String projectLeader;
|
||||||
|
|
||||||
|
/**工作令编号*/
|
||||||
|
@ApiModelProperty(value = "工作令编号")
|
||||||
|
@Excel(name = "工作令编号", width = 15)
|
||||||
|
private String workNumber;
|
||||||
|
|
||||||
/**项目健康度(1-预警、2-风险、3-正常)*/
|
/**项目健康度(1-预警、2-风险、3-正常)*/
|
||||||
@Dict(dicCode = "project_health")
|
@Dict(dicCode = "project_health")
|
||||||
|
@Excel(name = "项目健康度", width = 15, dicCode = "project_health")
|
||||||
@ApiModelProperty(value = "项目健康度(1-预警、2-风险、3-正常)")
|
@ApiModelProperty(value = "项目健康度(1-预警、2-风险、3-正常)")
|
||||||
private String projectHealth;
|
private String projectHealth;
|
||||||
@TableField(exist = false)
|
|
||||||
private String projectHealth_dictText;
|
|
||||||
|
|
||||||
/**创建人*/
|
/**创建人*/
|
||||||
@ApiModelProperty(value = "创建人")
|
@ApiModelProperty(value = "创建人")
|
||||||
@@ -90,6 +90,7 @@ public class LawsProjectLibrary implements Serializable {
|
|||||||
private String orgCode;
|
private String orgCode;
|
||||||
|
|
||||||
/**删除状态(0-正常,1-删除)*/
|
/**删除状态(0-正常,1-删除)*/
|
||||||
|
@TableLogic
|
||||||
@ApiModelProperty(value = "删除状态(0-正常,1-删除)")
|
@ApiModelProperty(value = "删除状态(0-正常,1-删除)")
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
|
|||||||
+1
-51
@@ -44,7 +44,6 @@ public class LawsProjectLibraryServiceImpl extends ServiceImpl<LawsProjectLibrar
|
|||||||
QueryWrapper<LawsProjectLibrary> queryWrapper = QueryGenerator.initQueryWrapper(lawsProjectLibrary, req.getParameterMap());
|
QueryWrapper<LawsProjectLibrary> queryWrapper = QueryGenerator.initQueryWrapper(lawsProjectLibrary, req.getParameterMap());
|
||||||
Page<LawsProjectLibrary> page = new Page<>(pageNo, pageSize);
|
Page<LawsProjectLibrary> page = new Page<>(pageNo, pageSize);
|
||||||
Page<LawsProjectLibrary> libraryPage = page(page, queryWrapper);
|
Page<LawsProjectLibrary> libraryPage = page(page, queryWrapper);
|
||||||
this.voluation(libraryPage.getRecords());
|
|
||||||
return libraryPage;
|
return libraryPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,31 +51,14 @@ public class LawsProjectLibraryServiceImpl extends ServiceImpl<LawsProjectLibrar
|
|||||||
public List<LawsProjectLibrary> queryList(LawsProjectLibrary lawsProjectLibrary, HttpServletRequest req) {
|
public List<LawsProjectLibrary> queryList(LawsProjectLibrary lawsProjectLibrary, HttpServletRequest req) {
|
||||||
QueryWrapper<LawsProjectLibrary> queryWrapper = QueryGenerator.initQueryWrapper(lawsProjectLibrary, req.getParameterMap());
|
QueryWrapper<LawsProjectLibrary> queryWrapper = QueryGenerator.initQueryWrapper(lawsProjectLibrary, req.getParameterMap());
|
||||||
List<LawsProjectLibrary> list = list(queryWrapper);
|
List<LawsProjectLibrary> list = list(queryWrapper);
|
||||||
this.voluation(list);
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 赋值姓名+工号
|
|
||||||
*/
|
|
||||||
private void voluation(List<LawsProjectLibrary> pageRecords){
|
|
||||||
for (LawsProjectLibrary pageRecord : pageRecords) {
|
|
||||||
String projectLeader = pageRecord.getProjectLeader();
|
|
||||||
if (StringUtils.isNotBlank(projectLeader)){
|
|
||||||
SysUser user = sysUserService.getById(projectLeader);
|
|
||||||
pageRecord.setNameWorkNo(user.calcNameWorkNo());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void add(LawsProjectLibrary lawsProjectLibrary) {
|
public void add(LawsProjectLibrary lawsProjectLibrary) {
|
||||||
Date now = new Date();
|
|
||||||
lawsProjectLibrary.setCreateTime(now);
|
|
||||||
lawsProjectLibrary.setUpdateTime(now);
|
|
||||||
save(lawsProjectLibrary);
|
save(lawsProjectLibrary);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,8 +67,6 @@ public class LawsProjectLibraryServiceImpl extends ServiceImpl<LawsProjectLibrar
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void editById(LawsProjectLibrary lawsProjectLibrary) {
|
public void editById(LawsProjectLibrary lawsProjectLibrary) {
|
||||||
Date now = new Date();
|
|
||||||
lawsProjectLibrary.setUpdateTime(now);
|
|
||||||
saveOrUpdate(lawsProjectLibrary);
|
saveOrUpdate(lawsProjectLibrary);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,8 +76,7 @@ public class LawsProjectLibraryServiceImpl extends ServiceImpl<LawsProjectLibrar
|
|||||||
@Override
|
@Override
|
||||||
public void deleteById(String id) {
|
public void deleteById(String id) {
|
||||||
LawsProjectLibrary projectLibrary = getById(id);
|
LawsProjectLibrary projectLibrary = getById(id);
|
||||||
projectLibrary.setDelFlag(CommonConstant.DEL_FLAG_1.toString());
|
removeById(id);
|
||||||
updateById(projectLibrary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -118,39 +97,10 @@ public class LawsProjectLibraryServiceImpl extends ServiceImpl<LawsProjectLibrar
|
|||||||
public LawsProjectLibrary queryById(String id) {
|
public LawsProjectLibrary queryById(String id) {
|
||||||
LawsProjectLibrary library = getById(id);
|
LawsProjectLibrary library = getById(id);
|
||||||
String projectLeader = library.getProjectLeader();
|
String projectLeader = library.getProjectLeader();
|
||||||
String projectSource = library.getProjectSource();
|
|
||||||
String projectHealth = library.getProjectHealth();
|
|
||||||
if (StringUtils.isNotBlank(projectLeader)){
|
if (StringUtils.isNotBlank(projectLeader)){
|
||||||
SysUser user = sysUserService.getById(projectLeader);
|
SysUser user = sysUserService.getById(projectLeader);
|
||||||
library.setNameWorkNo(user.calcNameWorkNo());
|
library.setNameWorkNo(user.calcNameWorkNo());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(projectSource)){
|
|
||||||
switch (projectSource) {
|
|
||||||
case "1":
|
|
||||||
library.setProjectSource_dictText("本地新增");
|
|
||||||
break;
|
|
||||||
case "2":
|
|
||||||
library.setProjectSource_dictText("PMS");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
library.setProjectSource_dictText("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(projectHealth)){
|
|
||||||
switch (projectHealth) {
|
|
||||||
case "1":
|
|
||||||
library.setProjectHealth_dictText("预警");
|
|
||||||
break;
|
|
||||||
case "2":
|
|
||||||
library.setProjectHealth_dictText("风险");
|
|
||||||
break;
|
|
||||||
case "3":
|
|
||||||
library.setProjectHealth_dictText("正常");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
library.setProjectHealth_dictText("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return library;
|
return library;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user