[新增] 权限申请流程
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
package com.adc.da.report.controller;
|
||||
|
||||
|
||||
import com.adc.da.report.eo.PowerApply;
|
||||
import com.adc.da.report.service.IPowerApplyService;
|
||||
import com.adc.da.report.vo.DeleteParamRequestVO;
|
||||
import com.adc.da.report.vo.PowerApplyPageVO;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
* @description 权限申请 工作流表 前端控制器
|
||||
* @date 2023-04-23
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/report/powerApply")
|
||||
@Api(tags = "report|权限申请 工作流表")
|
||||
public class PowerApplyController {
|
||||
|
||||
@Autowired
|
||||
private IPowerApplyService powerApplyService;
|
||||
|
||||
/**
|
||||
* @param powerApplyPageVO
|
||||
* @return com.adc.da.util.http.ResponseMessage
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 分页查询
|
||||
*/
|
||||
@PostMapping(value = "/page")
|
||||
@ApiOperation(value = "分页查询")
|
||||
@ApiImplicitParam(name = "powerApplyPageVO", value = "查询条件VO", dataType = "PowerApplyPageVO")
|
||||
public ResponseMessage<Page<PowerApply>> page(@RequestBody PowerApplyPageVO powerApplyPageVO){
|
||||
|
||||
//分页查询
|
||||
Page<PowerApply> powerApplyIPage = powerApplyService.selectPage(powerApplyPageVO);
|
||||
return Result.success(powerApplyIPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param powerApplyPageVO
|
||||
* @return com.adc.da.util.http.ResponseMessage
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 列表查询
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
@ApiOperation(value = "列表查询")
|
||||
@ApiImplicitParam(name = "powerApplyPageVO", value = "查询条件VO", dataType = "PowerApplyPageVO")
|
||||
public ResponseMessage<List<PowerApply>> list(@RequestBody PowerApplyPageVO powerApplyPageVO) {
|
||||
|
||||
//列表查询
|
||||
List<PowerApply> powerApplyList = powerApplyService.selectList(powerApplyPageVO);
|
||||
return Result.success(powerApplyList);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @return com.adc.da.util.http.ResponseMessage
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 根据id查询
|
||||
*/
|
||||
@GetMapping("/info/{id}")
|
||||
@ApiOperation(value = "根据id查询")
|
||||
@ApiImplicitParam(name = "id", value = "主键ID", dataType = "String")
|
||||
public ResponseMessage<PowerApply> info(@PathVariable("id") String id){
|
||||
|
||||
//根据id查询
|
||||
PowerApply powerApply = powerApplyService.selectById(id);
|
||||
return Result.success(powerApply);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param powerApply
|
||||
* @return com.adc.da.util.http.ResponseMessage
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 单条数据新增/更改
|
||||
*/
|
||||
@PostMapping("/saveOrUpdate")
|
||||
@ApiOperation(value = "单条数据新增/更改")
|
||||
@ApiImplicitParam(name = "powerApply", value = " PowerApply实体", dataType = "PowerApply")
|
||||
public ResponseMessage<String> saveOrUpdate(@RequestBody PowerApply powerApply){
|
||||
|
||||
//单条数据新增/更改
|
||||
powerApplyService.saveOrUpdateSingle(powerApply);
|
||||
return Result.success(powerApply.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param deleteParamRequestVO
|
||||
* @return com.adc.da.util.http.ResponseMessage
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 根据id或id数组进行删除
|
||||
*/
|
||||
@DeleteMapping("/delete")
|
||||
@ApiOperation(value = "单条/批量删除数据")
|
||||
public ResponseMessage delete(@RequestBody DeleteParamRequestVO deleteParamRequestVO){
|
||||
|
||||
//单条/批量删除数据
|
||||
powerApplyService.deleteById(deleteParamRequestVO);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,11 @@ import com.adc.da.util.http.Result;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.ParseException;
|
||||
|
||||
/**
|
||||
|
||||
+14
-3
@@ -11,24 +11,23 @@ import com.adc.da.report.vo.ReportQueryVo;
|
||||
import com.adc.da.report.vo.ReportVo;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.aliyun.oss.OSS;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
@@ -311,4 +310,16 @@ public class ReportManageConroller {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 权限审批流程 添加报告按钮 可添加的报告
|
||||
* @return
|
||||
* @throws ParseException
|
||||
*/
|
||||
@ApiOperation("添加报告")
|
||||
@GetMapping("/addReportPage")
|
||||
public ResponseMessage addReportPage(@RequestBody ReportQueryVo vo) throws Exception {
|
||||
IPage<ReportVo> reportVoIPage = reportService.addReportPage(vo);
|
||||
return Result.success(reportVoIPage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.adc.da.report.dao.mysql;
|
||||
|
||||
import com.adc.da.report.eo.PowerApplyAct;
|
||||
import com.adc.da.report.vo.PowerApplyActPageVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
* @description 权限申请 工作流表 Mapper接口
|
||||
* @date 2023-04-23
|
||||
*/
|
||||
public interface PowerApplyActDao extends BaseMapper<PowerApplyAct> {
|
||||
|
||||
/**
|
||||
* @param powerApplyActPageVO
|
||||
* @param page
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 使用分页插件进行查询
|
||||
*/
|
||||
List<PowerApplyAct> selectPage(Page<PowerApplyAct> page, @Param("pageVO") PowerApplyActPageVO powerApplyActPageVO);
|
||||
|
||||
/**
|
||||
* @param powerApplyActPageVO
|
||||
* @param page
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 使用分页插件进行查询总数
|
||||
*/
|
||||
Long selectPageCount(@Param("pageVO") PowerApplyActPageVO powerApplyActPageVO);
|
||||
|
||||
/**
|
||||
* @param powerApplyActPageVO
|
||||
* @return java.util.List
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 列表查询
|
||||
*/
|
||||
List<PowerApplyAct> queryList(@Param("pageVO") PowerApplyActPageVO powerApplyActPageVO);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.adc.da.report.dao.mysql;
|
||||
|
||||
import com.adc.da.report.eo.PowerApply;
|
||||
import com.adc.da.report.vo.PowerApplyPageVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
* @description 权限申请 工作流表 Mapper接口
|
||||
* @date 2023-04-23
|
||||
*/
|
||||
public interface PowerApplyDao extends BaseMapper<PowerApply> {
|
||||
|
||||
/**
|
||||
* @param powerApplyPageVO
|
||||
* @param page
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 使用分页插件进行查询
|
||||
*/
|
||||
List<PowerApply> selectPage(Page<PowerApply> page, @Param("pageVO") PowerApplyPageVO powerApplyPageVO);
|
||||
|
||||
/**
|
||||
* @param powerApplyPageVO
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 使用分页插件进行查询总数
|
||||
*/
|
||||
Long selectPageCount(@Param("pageVO") PowerApplyPageVO powerApplyPageVO);
|
||||
|
||||
/**
|
||||
* @param powerApplyPageVO
|
||||
* @return java.util.List
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 列表查询
|
||||
*/
|
||||
List<PowerApply> queryList(@Param("pageVO") PowerApplyPageVO powerApplyPageVO);
|
||||
}
|
||||
@@ -30,4 +30,5 @@ public interface ReportDao extends BaseMapper<ReportEntity> {
|
||||
*/
|
||||
List<String> getReportDateList(@Param("usid")String usid);
|
||||
|
||||
IPage<ReportVo> getAddReportPage(IPage<ReportEntity> page, @Param("pageVO") ReportQueryVo vo);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.adc.da.report.eo;
|
||||
|
||||
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 lombok.Data;
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
* @description 权限申请 工作流表
|
||||
* @date 2023-04-23
|
||||
*/
|
||||
@Data
|
||||
@TableName("power_apply")
|
||||
public class PowerApply {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.UUID)
|
||||
private String id;
|
||||
|
||||
|
||||
/**
|
||||
* 数据id
|
||||
*/
|
||||
@TableField("data_id")
|
||||
private String dataId;
|
||||
|
||||
/**
|
||||
* 报告Id
|
||||
*/
|
||||
@TableField("report_id")
|
||||
private String reportId;
|
||||
|
||||
/**
|
||||
* 申请原因
|
||||
*/
|
||||
@TableField("apply_reason")
|
||||
private String applyReason;
|
||||
|
||||
/**
|
||||
* 申请人
|
||||
*/
|
||||
@TableField("user_id")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 申请原因
|
||||
*/
|
||||
@TableField("power")
|
||||
private Integer power;
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@TableField("create_user_id")
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_date")
|
||||
private String createDate;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField("update_date")
|
||||
private String updateDate;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@TableField("update_user_id")
|
||||
private String updateUserId;
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
@TableField("del_flag")
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.adc.da.report.eo;
|
||||
|
||||
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 lombok.Data;
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
* @description 权限申请 工作流表
|
||||
* @date 2023-04-23
|
||||
*/
|
||||
@Data
|
||||
@TableName("power_apply_act")
|
||||
public class PowerApplyAct {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.UUID)
|
||||
private String id;
|
||||
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@TableField("prc_id")
|
||||
private String prcId;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@TableField("task_id")
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 数据id
|
||||
*/
|
||||
@TableField("data_id")
|
||||
private String dataId;
|
||||
|
||||
/**
|
||||
* 报告名称
|
||||
*/
|
||||
@TableField("report_id")
|
||||
private String reportId;
|
||||
|
||||
/**
|
||||
* 申请人
|
||||
*/
|
||||
@TableField("user_id")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@TableField("create_user_id")
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("create_date")
|
||||
private String createDate;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField("update_date")
|
||||
private String updateDate;
|
||||
|
||||
|
||||
/**
|
||||
* 更改人id
|
||||
*/
|
||||
@TableField("update_user_id")
|
||||
private String updateUserId;
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
@TableField("del_flag")
|
||||
private Integer delFlag;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.adc.da.report.service;
|
||||
|
||||
import com.adc.da.report.eo.PowerApplyAct;
|
||||
import com.adc.da.report.vo.DeleteParamRequestVO;
|
||||
import com.adc.da.report.vo.PowerApplyActPageVO;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IPowerApplyActService {
|
||||
|
||||
/**
|
||||
* @param powerApplyActPageVO
|
||||
* @return <com.adc.da.report.entity.PowerApplyAct>
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 分页查询
|
||||
*/
|
||||
public Page<PowerApplyAct> selectPage(PowerApplyActPageVO powerApplyActPageVO);
|
||||
|
||||
|
||||
/**
|
||||
* @param powerApplyActPageVO
|
||||
* @return java.util.List<com.adc.da.report.entity.PowerApplyAct>
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 列表查询
|
||||
*/
|
||||
public List<PowerApplyAct> selectList(PowerApplyActPageVO powerApplyActPageVO);
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @return com.adc.da.report.entity.PowerApplyAct
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 根据id查询
|
||||
*/
|
||||
public PowerApplyAct selectById(String id);
|
||||
|
||||
/**
|
||||
* @param powerApplyAct
|
||||
* @return boolean
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 单条数据新增/更改
|
||||
*/
|
||||
public void saveOrUpdateSingle(PowerApplyAct powerApplyAct);
|
||||
|
||||
|
||||
/**
|
||||
* @param deleteParamVO
|
||||
* @return void
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 根据id或id数组进行删除
|
||||
*/
|
||||
public void deleteById(DeleteParamRequestVO deleteParamVO);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.adc.da.report.service;
|
||||
|
||||
import com.adc.da.report.eo.PowerApply;
|
||||
import com.adc.da.report.vo.DeleteParamRequestVO;
|
||||
import com.adc.da.report.vo.PowerApplyPageVO;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IPowerApplyService {
|
||||
|
||||
/**
|
||||
* @param powerApplyPageVO
|
||||
* @return <com.adc.da.report.entity.PowerApply>
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 分页查询
|
||||
*/
|
||||
public Page<PowerApply> selectPage(PowerApplyPageVO powerApplyPageVO);
|
||||
|
||||
|
||||
/**
|
||||
* @param powerApplyPageVO
|
||||
* @return java.util.List<com.adc.da.report.entity.PowerApply>
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 列表查询
|
||||
*/
|
||||
public List<PowerApply> selectList(PowerApplyPageVO powerApplyPageVO);
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @return com.adc.da.report.entity.PowerApply
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 根据id查询
|
||||
*/
|
||||
public PowerApply selectById(String id);
|
||||
|
||||
/**
|
||||
* @param powerApply
|
||||
* @return boolean
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 单条数据新增/更改
|
||||
*/
|
||||
public void saveOrUpdateSingle(PowerApply powerApply);
|
||||
|
||||
|
||||
/**
|
||||
* @param deleteParamVO
|
||||
* @return void
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 根据id或id数组进行删除
|
||||
*/
|
||||
public void deleteById(DeleteParamRequestVO deleteParamVO);
|
||||
}
|
||||
@@ -45,4 +45,6 @@ public interface IReportService {
|
||||
* @return
|
||||
*/
|
||||
String reportHtml(String id);
|
||||
|
||||
IPage<ReportVo> addReportPage(ReportQueryVo vo) throws Exception;
|
||||
}
|
||||
|
||||
@@ -18,17 +18,15 @@ 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 javax.annotation.Resource;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@@ -270,6 +268,26 @@ public class IReportServiceImpl implements IReportService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<ReportVo> addReportPage(ReportQueryVo vo) throws Exception {
|
||||
IPage<ReportEntity> page = new Page<>();
|
||||
page.setCurrent(vo.getPageNo());
|
||||
page.setSize(vo.getPageSize());
|
||||
|
||||
//判断是不是管理员
|
||||
boolean admin = CommonUtils.isAdmin();
|
||||
if (admin) {
|
||||
vo.setUsid(null);
|
||||
} else {
|
||||
vo.setUsid(CommonUtils.getUserId());
|
||||
}
|
||||
|
||||
|
||||
IPage<ReportVo> list = reportDao.getAddReportPage(page, vo);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建htmlstring
|
||||
*
|
||||
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
package com.adc.da.report.service.impl;
|
||||
|
||||
|
||||
import com.adc.da.report.dao.mysql.PowerApplyActDao;
|
||||
import com.adc.da.report.eo.PowerApplyAct;
|
||||
import com.adc.da.report.service.IPowerApplyActService;
|
||||
import com.adc.da.report.vo.DeleteParamRequestVO;
|
||||
import com.adc.da.report.vo.PowerApplyActPageVO;
|
||||
import com.adc.da.util.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
* @description 权限申请 工作流表 服务实现类
|
||||
* @date 2023-04-23
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class IpowerApplyActServiceImpl extends ServiceImpl<PowerApplyActDao, PowerApplyAct> implements IPowerApplyActService {
|
||||
|
||||
/**
|
||||
* @param powerApplyActPageVO
|
||||
* @return <com.adc.da.report.entity.PowerApplyAct>
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 分页查询
|
||||
*/
|
||||
public Page<PowerApplyAct> selectPage(PowerApplyActPageVO powerApplyActPageVO){
|
||||
Page<PowerApplyAct> page = new Page<>(powerApplyActPageVO.getCurrent(),
|
||||
powerApplyActPageVO.getSize());
|
||||
page.setRecords(baseMapper.selectPage(page, powerApplyActPageVO));
|
||||
Long total = baseMapper.selectPageCount(powerApplyActPageVO);
|
||||
page.setTotal(total);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param powerApplyActPageVO
|
||||
* @return java.util.List<com.adc.da.report.entity.PowerApplyAct>
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 列表查询
|
||||
*/
|
||||
public List<PowerApplyAct> selectList(PowerApplyActPageVO powerApplyActPageVO) {
|
||||
return baseMapper.queryList(powerApplyActPageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @return com.adc.da.report.entity.PowerApplyAct
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 根据id查询
|
||||
*/
|
||||
public PowerApplyAct selectById(String id) {
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param powerApplyAct
|
||||
* @return boolean
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 单条数据新增/更改
|
||||
*/
|
||||
public void saveOrUpdateSingle(PowerApplyAct powerApplyAct) {
|
||||
if (StringUtils.isEmpty(powerApplyAct.getId())) {
|
||||
baseMapper.insert(powerApplyAct);
|
||||
} else {
|
||||
baseMapper.updateById(powerApplyAct);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param deleteParamVO
|
||||
* @return void
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 根据id或id数组进行删除
|
||||
*/
|
||||
public void deleteById(DeleteParamRequestVO deleteParamVO) {
|
||||
if (ObjectUtils.isEmpty(deleteParamVO)) {
|
||||
return;
|
||||
}
|
||||
List<String> ids = new ArrayList<>();
|
||||
|
||||
if (!ObjectUtils.isEmpty(deleteParamVO.getId())) {
|
||||
ids.add(deleteParamVO.getId());
|
||||
}
|
||||
if (!ObjectUtils.isEmpty(deleteParamVO.getIds())) {
|
||||
ids.addAll(deleteParamVO.getIds());
|
||||
}
|
||||
if (ObjectUtils.isEmpty(deleteParamVO)) {
|
||||
return;
|
||||
}
|
||||
LambdaQueryWrapper<PowerApplyAct> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(PowerApplyAct::getId,ids);
|
||||
PowerApplyAct powerApplyAct = new PowerApplyAct();
|
||||
powerApplyAct.setDelFlag(1);
|
||||
baseMapper.update(powerApplyAct,wrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
package com.adc.da.report.service.impl;
|
||||
|
||||
|
||||
import com.adc.da.report.dao.mysql.PowerApplyDao;
|
||||
import com.adc.da.report.eo.PowerApply;
|
||||
import com.adc.da.report.service.IPowerApplyService;
|
||||
import com.adc.da.report.vo.DeleteParamRequestVO;
|
||||
import com.adc.da.report.vo.PowerApplyPageVO;
|
||||
import com.adc.da.util.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
* @description 权限申请 工作流表 服务实现类
|
||||
* @date 2023-04-23
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class IpowerApplyServiceImpl extends ServiceImpl<PowerApplyDao, PowerApply> implements IPowerApplyService {
|
||||
|
||||
/**
|
||||
* @param powerApplyPageVO
|
||||
* @return <com.adc.da.report.entity.PowerApply>
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 分页查询
|
||||
*/
|
||||
public Page<PowerApply> selectPage(PowerApplyPageVO powerApplyPageVO){
|
||||
Page<PowerApply> page = new Page<>(powerApplyPageVO.getCurrent(),
|
||||
powerApplyPageVO.getSize());
|
||||
page.setRecords(baseMapper.selectPage(page, powerApplyPageVO));
|
||||
Long total = baseMapper.selectPageCount(powerApplyPageVO);
|
||||
page.setTotal(total);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param powerApplyPageVO
|
||||
* @return java.util.List<com.adc.da.report.entity.PowerApply>
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 列表查询
|
||||
*/
|
||||
public List<PowerApply> selectList(PowerApplyPageVO powerApplyPageVO) {
|
||||
return baseMapper.queryList(powerApplyPageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
* @return com.adc.da.report.entity.PowerApply
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 根据id查询
|
||||
*/
|
||||
public PowerApply selectById(String id) {
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param powerApply
|
||||
* @return boolean
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 单条数据新增/更改
|
||||
*/
|
||||
public void saveOrUpdateSingle(PowerApply powerApply) {
|
||||
if (StringUtils.isEmpty(powerApply.getId())) {
|
||||
baseMapper.insert(powerApply);
|
||||
} else {
|
||||
baseMapper.updateById(powerApply);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param deleteParamVO
|
||||
* @return void
|
||||
* @author bu
|
||||
* @date 2023-04-23
|
||||
* @description 根据id或id数组进行删除
|
||||
*/
|
||||
public void deleteById(DeleteParamRequestVO deleteParamVO) {
|
||||
if (ObjectUtils.isEmpty(deleteParamVO)) {
|
||||
return;
|
||||
}
|
||||
List<String> ids = new ArrayList<>();
|
||||
|
||||
if (!ObjectUtils.isEmpty(deleteParamVO.getId())) {
|
||||
ids.add(deleteParamVO.getId());
|
||||
}
|
||||
if (!ObjectUtils.isEmpty(deleteParamVO.getIds())) {
|
||||
ids.addAll(deleteParamVO.getIds());
|
||||
}
|
||||
if (ObjectUtils.isEmpty(deleteParamVO)) {
|
||||
return;
|
||||
}
|
||||
LambdaQueryWrapper<PowerApply> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(PowerApply::getId,ids);
|
||||
PowerApply powerApply = new PowerApply();
|
||||
powerApply.setDelFlag(1);
|
||||
baseMapper.update(powerApply,wrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.adc.da.report.vo;
|
||||
|
||||
import com.adc.da.util.exception.AdcDaBaseException;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
public class BasePageVO {
|
||||
private final static String xssStr = "'|and |exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |;|or |+";
|
||||
/**
|
||||
* 页码
|
||||
*/
|
||||
@ApiModelProperty("页码")
|
||||
private Integer current;
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
@ApiModelProperty("每页大小")
|
||||
private Integer size;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ApiModelProperty("排序")
|
||||
private String order;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
@ApiModelProperty("排序字段")
|
||||
private String orderField;
|
||||
|
||||
|
||||
public Integer getCurrent() {
|
||||
if (!ObjectUtils.isEmpty(current) && current > 0) {
|
||||
return current;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public Integer getSize() {
|
||||
if (!ObjectUtils.isEmpty(size) && size > 0) {
|
||||
return size;
|
||||
}
|
||||
return 15;
|
||||
}
|
||||
|
||||
public String getOrder() {
|
||||
if (StringUtils.isEmpty(this.order)) {
|
||||
return "desc";
|
||||
}
|
||||
if ("desc".equals(this.order) || "asc".equals(this.order) ) {
|
||||
return order;
|
||||
}
|
||||
return "desc";
|
||||
}
|
||||
|
||||
public String getOrderField() {
|
||||
if (StringUtils.isNotEmpty(orderField)) {
|
||||
filterContent(this.orderField);
|
||||
return camelToUnderline(this.orderField);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* sql注入过滤处理,遇到注入关键字抛异常
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static void filterContent(String value) {
|
||||
if (value == null || "".equals(value)) {
|
||||
return;
|
||||
}
|
||||
// 统一转为小写
|
||||
value = value.toLowerCase();
|
||||
String[] xssArr = xssStr.split("\\|");
|
||||
for (int i = 0; i < xssArr.length; i++) {
|
||||
if (value.indexOf(xssArr[i]) > -1) {
|
||||
throw new AdcDaBaseException("请注意,值可能存在SQL注入风险!--->" + value);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将驼峰命名转化成下划线
|
||||
* @param para
|
||||
* @return
|
||||
*/
|
||||
public static String camelToUnderline(String para){
|
||||
if(para.length()<3){
|
||||
return para.toLowerCase();
|
||||
}
|
||||
StringBuilder sb=new StringBuilder(para);
|
||||
int temp=0;//定位
|
||||
//从第三个字符开始 避免命名不规范
|
||||
for(int i=2;i<para.length();i++){
|
||||
if(Character.isUpperCase(para.charAt(i))){
|
||||
sb.insert(i+temp, "_");
|
||||
temp+=1;
|
||||
}
|
||||
}
|
||||
return sb.toString().toLowerCase();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.adc.da.report.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DeleteParamRequestVO {
|
||||
/**
|
||||
* 单条数据删除id
|
||||
*/
|
||||
@ApiModelProperty("单条数据删除id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 多条数据删除id数组
|
||||
*/
|
||||
@ApiModelProperty("多条数据删除id数组")
|
||||
private List<String> ids;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.adc.da.report.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
* @description 权限申请 工作流表查询条件VO
|
||||
* @date 2023-04-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PowerApplyActPageVO extends BasePageVO {
|
||||
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
private String prcId;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 数据id
|
||||
*/
|
||||
private String dataId;
|
||||
|
||||
/**
|
||||
* 报告名称
|
||||
*/
|
||||
private String reportName;
|
||||
|
||||
/**
|
||||
* 车系
|
||||
*/
|
||||
private String carType;
|
||||
|
||||
/**
|
||||
* 报告年份
|
||||
*/
|
||||
private String reportYears;
|
||||
|
||||
/**
|
||||
* 报告部门
|
||||
*/
|
||||
private String reportOrg;
|
||||
|
||||
/**
|
||||
* 涉密等级
|
||||
*/
|
||||
private String classifiedLevel;
|
||||
|
||||
/**
|
||||
* 报告类别
|
||||
*/
|
||||
private String reportType;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.adc.da.report.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author bu
|
||||
* @version 1.0
|
||||
* @description 权限申请 工作流表查询条件VO
|
||||
* @date 2023-04-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PowerApplyPageVO extends BasePageVO {
|
||||
|
||||
/**
|
||||
* 数据id
|
||||
*/
|
||||
private String dataId;
|
||||
|
||||
/**
|
||||
* 报告名称
|
||||
*/
|
||||
private String reportName;
|
||||
|
||||
/**
|
||||
* 车系
|
||||
*/
|
||||
private String carType;
|
||||
|
||||
/**
|
||||
* 报告年份
|
||||
*/
|
||||
private String reportYears;
|
||||
|
||||
/**
|
||||
* 报告部门
|
||||
*/
|
||||
private String reportOrg;
|
||||
|
||||
/**
|
||||
* 涉密等级
|
||||
*/
|
||||
private String classifiedLevel;
|
||||
|
||||
/**
|
||||
* 报告类别
|
||||
*/
|
||||
private String reportType;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?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="com.adc.da.report.dao.mysql.PowerApplyActDao">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.report.eo.PowerApplyAct">
|
||||
<result column="id" property="id" />
|
||||
<result column="prc_id" property="prcId" />
|
||||
<result column="task_id" property="taskId" />
|
||||
<result column="data_id" property="dataId" />
|
||||
<result column="report_id" property="reportId" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="create_user_id" property="createUserId" />
|
||||
<result column="create_date" property="createDate" />
|
||||
<result column="update_date" property="updateDate" />
|
||||
<result column="update_user_id" property="updateUserId" />
|
||||
<result column="del_flag" property="delFlag" />
|
||||
</resultMap>
|
||||
|
||||
<!--表名信息-->
|
||||
<sql id="TableName">
|
||||
power_apply_act
|
||||
</sql>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="BaseColumnList">
|
||||
id,
|
||||
prc_id, task_id, data_id,user_id,report_id,create_user_id,create_date,update_date,update_user_id,del_flag
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="BaseQuerySql">
|
||||
<where>
|
||||
AND del = '${@com.adc.da.sys.constant.YesOrNoEnum@NO.value}'
|
||||
<if test="pageVO != null">
|
||||
<if test="pageVO.prcId !=null and pageVO.prcId !=''">
|
||||
AND prc_id LIKE CONCAT(CONCAT('%',#{pageVO.prcId}),'%')
|
||||
</if>
|
||||
<if test="pageVO.taskId !=null and pageVO.taskId !=''">
|
||||
AND task_id LIKE CONCAT(CONCAT('%',#{pageVO.taskId}),'%')
|
||||
</if>
|
||||
<if test="pageVO.dataId !=null and pageVO.dataId !=''">
|
||||
AND data_id LIKE CONCAT(CONCAT('%',#{pageVO.dataId}),'%')
|
||||
</if>
|
||||
<if test="pageVO.reportId !=null and pageVO.reportId !=''">
|
||||
AND report_id LIKE CONCAT(CONCAT('%',#{pageVO.reportId}),'%')
|
||||
</if>
|
||||
<if test="pageVO.userId !=null and pageVO.userId !=''">
|
||||
AND user_id LIKE CONCAT(CONCAT('%',#{pageVO.userId}),'%')
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 根据查询VO进行分页查询 -->
|
||||
<select id="selectPage" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="BaseColumnList"/>
|
||||
FROM <include refid="TableName"/>
|
||||
<include refid="BaseQuerySql"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据查询VO进行分页查询总数 -->
|
||||
<select id="selectPageCount" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
FROM (
|
||||
SELECT
|
||||
<include refid="BaseColumnList"/>
|
||||
FROM <include refid="TableName"/>
|
||||
<include refid="BaseQuerySql"/>
|
||||
)a
|
||||
</select>
|
||||
|
||||
<!-- 根据查询VO进行列表查询 -->
|
||||
<select id="queryList" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="BaseColumnList"/>
|
||||
FROM <include refid="TableName"/>
|
||||
<include refid="BaseQuerySql"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,77 @@
|
||||
<?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="com.adc.da.report.dao.mysql.PowerApplyDao">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.report.eo.PowerApply">
|
||||
<result column="id" property="id" />
|
||||
<result column="data_id" property="dataId" />
|
||||
<result column="report_id" property="reportId" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="create_user_id" property="createUserId" />
|
||||
<result column="create_date" property="createDate" />
|
||||
<result column="update_date" property="updateDate" />
|
||||
<result column="update_user_id" property="updateUserId" />
|
||||
<result column="del_flag" property="delFlag" />
|
||||
</resultMap>
|
||||
|
||||
<!--表名信息-->
|
||||
<sql id="TableName">
|
||||
power_apply_act
|
||||
</sql>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="BaseColumnList">
|
||||
id,
|
||||
data_id,report_id,user_id,create_user_id,create_date,update_date,update_user_id,del_flag
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="BaseQuerySql">
|
||||
<where>
|
||||
AND del = '${@com.adc.da.sys.constant.YesOrNoEnum@NO.value}'
|
||||
<if test="pageVO != null">
|
||||
<if test="pageVO.dataId !=null and pageVO.dataId !=''">
|
||||
AND data_id LIKE CONCAT(CONCAT('%',#{pageVO.dataId}),'%')
|
||||
</if>
|
||||
<if test="pageVO.reportId !=null and pageVO.reportId !=''">
|
||||
AND report_id LIKE CONCAT(CONCAT('%',#{pageVO.reportId}),'%')
|
||||
</if>
|
||||
<if test="pageVO.userId !=null and pageVO.userId !=''">
|
||||
AND user_id LIKE CONCAT(CONCAT('%',#{pageVO.userId}),'%')
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 根据查询VO进行分页查询 -->
|
||||
<select id="selectPage" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="BaseColumnList"/>
|
||||
FROM <include refid="TableName"/>
|
||||
<include refid="BaseQuerySql"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据查询VO进行分页查询总数 -->
|
||||
<select id="selectPageCount" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
FROM (
|
||||
SELECT
|
||||
<include refid="BaseColumnList"/>
|
||||
FROM <include refid="TableName"/>
|
||||
<include refid="BaseQuerySql"/>
|
||||
)a
|
||||
</select>
|
||||
|
||||
<!-- 根据查询VO进行列表查询 -->
|
||||
<select id="queryList" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="BaseColumnList"/>
|
||||
FROM <include refid="TableName"/>
|
||||
<include refid="BaseQuerySql"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -124,4 +124,13 @@
|
||||
ORDER BY year DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getAddReportPage" resultType="com.adc.da.report.vo.ReportVo">
|
||||
select * from TT_REPORT_MANAGE
|
||||
|
||||
<where>
|
||||
del = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user