Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
# 2022-5-24
|
||||
#标签内容增加排序字段
|
||||
ALTER TABLE `sys_dict`
|
||||
ADD COLUMN `order_num` int(11) NOT NULL COMMENT '排序';
|
||||
@@ -0,0 +1 @@
|
||||
ComplianceReportTemplate.docx : 法规清单 - 导出报告模板
|
||||
Binary file not shown.
+276
-281
@@ -52,7 +52,7 @@ public class SysCategoryController {
|
||||
private ISysCategoryService sysCategoryService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* 分页列表查询
|
||||
* @param sysCategory
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
@@ -62,9 +62,9 @@ public class SysCategoryController {
|
||||
// @RequiresPermissions("sys:category:list")
|
||||
@GetMapping(value = "/rootList")
|
||||
public Result<IPage<SysCategory>> queryPageList(SysCategory sysCategory,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
if(oConvertUtils.isEmpty(sysCategory.getPid())){
|
||||
sysCategory.setPid("0");
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class SysCategoryController {
|
||||
return result;
|
||||
}
|
||||
|
||||
// @RequiresPermissions("sys:category:list")
|
||||
// @RequiresPermissions("sys:category:list")
|
||||
@GetMapping(value = "/childList")
|
||||
public Result<List<SysCategory>> queryPageList(SysCategory sysCategory,HttpServletRequest req) {
|
||||
Result<List<SysCategory>> result = new Result<List<SysCategory>>();
|
||||
@@ -95,11 +95,11 @@ public class SysCategoryController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**标签内容-树形结构列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
/**标签内容-树形结构列表
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "标签内容-树形结构列表")
|
||||
@ApiOperation(value="标签内容-树形结构列表", notes="标签内容-树形结构列表")
|
||||
@PostMapping(value = "/queryPageList")
|
||||
@@ -110,7 +110,7 @@ public class SysCategoryController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* 添加
|
||||
* @param sysCategory
|
||||
* @return
|
||||
*/
|
||||
@@ -118,19 +118,14 @@ public class SysCategoryController {
|
||||
@PostMapping(value = "/add")
|
||||
public Result<SysCategory> add(@RequestBody SysCategory sysCategory) {
|
||||
Result<SysCategory> result = new Result<SysCategory>();
|
||||
try {
|
||||
sysCategory.setName(sysCategory.getName().replace(" ",""));
|
||||
sysCategoryService.addSysCategory(sysCategory);
|
||||
result.success("添加成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("操作失败");
|
||||
}
|
||||
sysCategory.setName(sysCategory.getName().replace(" ",""));
|
||||
sysCategoryService.addSysCategory(sysCategory);
|
||||
result.success("添加成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* 编辑
|
||||
* @param sysCategory
|
||||
* @return
|
||||
*/
|
||||
@@ -150,7 +145,7 @@ public class SysCategoryController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* 通过id删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@@ -169,11 +164,11 @@ public class SysCategoryController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* 逻辑删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
// @RequiresPermissions("sys:category:list")
|
||||
@GetMapping(value = "/logicDelete")
|
||||
public Result<SysCategory> logicDelete(@RequestParam(name="id",required=true) String id) {
|
||||
@@ -235,7 +230,7 @@ public class SysCategoryController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* 通过id查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@@ -253,126 +248,126 @@ public class SysCategoryController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
@RequiresPermissions("sys:category:export")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, SysCategory sysCategory) {
|
||||
// Step.1 组装查询条件查询数据
|
||||
QueryWrapper<SysCategory> queryWrapper = QueryGenerator.initQueryWrapper(sysCategory, request.getParameterMap());
|
||||
List<SysCategory> pageList = sysCategoryService.list(queryWrapper);
|
||||
// Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
// 过滤选中数据
|
||||
String selections = request.getParameter("selections");
|
||||
if(oConvertUtils.isEmpty(selections)) {
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
}else {
|
||||
List<String> selectionList = Arrays.asList(selections.split(","));
|
||||
List<SysCategory> exportList = pageList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList());
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
||||
}
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "分类字典列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, SysCategory.class);
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("分类字典列表数据", "导出人:"+user.getRealname(), "导出信息"));
|
||||
return mv;
|
||||
}
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
@RequiresPermissions("sys:category:export")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, SysCategory sysCategory) {
|
||||
// Step.1 组装查询条件查询数据
|
||||
QueryWrapper<SysCategory> queryWrapper = QueryGenerator.initQueryWrapper(sysCategory, request.getParameterMap());
|
||||
List<SysCategory> pageList = sysCategoryService.list(queryWrapper);
|
||||
// Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
// 过滤选中数据
|
||||
String selections = request.getParameter("selections");
|
||||
if(oConvertUtils.isEmpty(selections)) {
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
}else {
|
||||
List<String> selectionList = Arrays.asList(selections.split(","));
|
||||
List<SysCategory> exportList = pageList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList());
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
||||
}
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "分类字典列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, SysCategory.class);
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("分类字典列表数据", "导出人:"+user.getRealname(), "导出信息"));
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:import")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
List<SysCategory> listSysCategorys = ExcelImportUtil.importExcel(file.getInputStream(), SysCategory.class, params);
|
||||
//按照编码长度排序
|
||||
Collections.sort(listSysCategorys);
|
||||
log.info("排序后的list====>",listSysCategorys);
|
||||
for (SysCategory sysCategoryExcel : listSysCategorys) {
|
||||
String code = sysCategoryExcel.getCode();
|
||||
if(code.length()>3){
|
||||
String pCode = sysCategoryExcel.getCode().substring(0,code.length()-3);
|
||||
log.info("pCode====>",pCode);
|
||||
String pId=sysCategoryService.queryIdByCode(pCode);
|
||||
log.info("pId====>",pId);
|
||||
if(StringUtils.isNotBlank(pId)){
|
||||
sysCategoryExcel.setPid(pId);
|
||||
}
|
||||
}else{
|
||||
sysCategoryExcel.setPid("0");
|
||||
}
|
||||
sysCategoryService.save(sysCategoryExcel);
|
||||
}
|
||||
return Result.OK("文件导入成功!数据行数:" + listSysCategorys.size());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error("文件导入失败:"+e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.error("文件导入失败!");
|
||||
}
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:import")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
List<SysCategory> listSysCategorys = ExcelImportUtil.importExcel(file.getInputStream(), SysCategory.class, params);
|
||||
//按照编码长度排序
|
||||
Collections.sort(listSysCategorys);
|
||||
log.info("排序后的list====>",listSysCategorys);
|
||||
for (SysCategory sysCategoryExcel : listSysCategorys) {
|
||||
String code = sysCategoryExcel.getCode();
|
||||
if(code.length()>3){
|
||||
String pCode = sysCategoryExcel.getCode().substring(0,code.length()-3);
|
||||
log.info("pCode====>",pCode);
|
||||
String pId=sysCategoryService.queryIdByCode(pCode);
|
||||
log.info("pId====>",pId);
|
||||
if(StringUtils.isNotBlank(pId)){
|
||||
sysCategoryExcel.setPid(pId);
|
||||
}
|
||||
}else{
|
||||
sysCategoryExcel.setPid("0");
|
||||
}
|
||||
sysCategoryService.save(sysCategoryExcel);
|
||||
}
|
||||
return Result.OK("文件导入成功!数据行数:" + listSysCategorys.size());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error("文件导入失败:"+e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.error("文件导入失败!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 加载单个数据 用于回显
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
@RequestMapping(value = "/loadOne", method = RequestMethod.GET)
|
||||
public Result<SysCategory> loadOne(@RequestParam(name="field") String field,@RequestParam(name="val") String val) {
|
||||
Result<SysCategory> result = new Result<SysCategory>();
|
||||
try {
|
||||
|
||||
QueryWrapper<SysCategory> query = new QueryWrapper<SysCategory>();
|
||||
query.eq(field, val);
|
||||
List<SysCategory> ls = this.sysCategoryService.list(query);
|
||||
if(ls==null || ls.size()==0) {
|
||||
result.setMessage("查询无果");
|
||||
result.setSuccess(false);
|
||||
}else if(ls.size()>1) {
|
||||
result.setMessage("查询数据异常,["+field+"]存在多个值:"+val);
|
||||
result.setSuccess(false);
|
||||
}else {
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls.get(0));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
result.setMessage(e.getMessage());
|
||||
result.setSuccess(false);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载节点的子数据
|
||||
*/
|
||||
/**
|
||||
* 加载单个数据 用于回显
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
@RequestMapping(value = "/loadTreeChildren", method = RequestMethod.GET)
|
||||
@RequestMapping(value = "/loadOne", method = RequestMethod.GET)
|
||||
public Result<SysCategory> loadOne(@RequestParam(name="field") String field,@RequestParam(name="val") String val) {
|
||||
Result<SysCategory> result = new Result<SysCategory>();
|
||||
try {
|
||||
|
||||
QueryWrapper<SysCategory> query = new QueryWrapper<SysCategory>();
|
||||
query.eq(field, val);
|
||||
List<SysCategory> ls = this.sysCategoryService.list(query);
|
||||
if(ls==null || ls.size()==0) {
|
||||
result.setMessage("查询无果");
|
||||
result.setSuccess(false);
|
||||
}else if(ls.size()>1) {
|
||||
result.setMessage("查询数据异常,["+field+"]存在多个值:"+val);
|
||||
result.setSuccess(false);
|
||||
}else {
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls.get(0));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
result.setMessage(e.getMessage());
|
||||
result.setSuccess(false);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载节点的子数据
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
@RequestMapping(value = "/loadTreeChildren", method = RequestMethod.GET)
|
||||
public Result<List<TreeSelectModel>> loadTreeChildren(@RequestParam(name="pid") String pid) {
|
||||
Result<List<TreeSelectModel>> result = new Result<List<TreeSelectModel>>();
|
||||
try {
|
||||
@@ -387,51 +382,51 @@ public class SysCategoryController {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载一级节点/如果是同步 则所有数据
|
||||
*/
|
||||
/**
|
||||
* 加载一级节点/如果是同步 则所有数据
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
@RequestMapping(value = "/loadTreeRoot", method = RequestMethod.GET)
|
||||
public Result<List<TreeSelectModel>> loadTreeRoot(@RequestParam(name="async") Boolean async,@RequestParam(name="pcode") String pcode) {
|
||||
Result<List<TreeSelectModel>> result = new Result<List<TreeSelectModel>>();
|
||||
try {
|
||||
List<TreeSelectModel> ls = this.sysCategoryService.queryListByCode(pcode);
|
||||
if(!async) {
|
||||
loadAllCategoryChildren(ls);
|
||||
}
|
||||
result.setResult(ls);
|
||||
result.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
result.setMessage(e.getMessage());
|
||||
result.setSuccess(false);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@RequestMapping(value = "/loadTreeRoot", method = RequestMethod.GET)
|
||||
public Result<List<TreeSelectModel>> loadTreeRoot(@RequestParam(name="async") Boolean async,@RequestParam(name="pcode") String pcode) {
|
||||
Result<List<TreeSelectModel>> result = new Result<List<TreeSelectModel>>();
|
||||
try {
|
||||
List<TreeSelectModel> ls = this.sysCategoryService.queryListByCode(pcode);
|
||||
if(!async) {
|
||||
loadAllCategoryChildren(ls);
|
||||
}
|
||||
result.setResult(ls);
|
||||
result.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
result.setMessage(e.getMessage());
|
||||
result.setSuccess(false);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归求子节点 同步加载用到
|
||||
*/
|
||||
/**
|
||||
* 递归求子节点 同步加载用到
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
private void loadAllCategoryChildren(List<TreeSelectModel> ls) {
|
||||
for (TreeSelectModel tsm : ls) {
|
||||
private void loadAllCategoryChildren(List<TreeSelectModel> ls) {
|
||||
for (TreeSelectModel tsm : ls) {
|
||||
List<TreeSelectModel> temp = this.sysCategoryService.queryListByPid(tsm.getKey());
|
||||
if(temp!=null && temp.size()>0) {
|
||||
tsm.setChildren(temp);
|
||||
loadAllCategoryChildren(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验编码
|
||||
* @param pid
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
@GetMapping(value = "/checkCode")
|
||||
public Result<?> checkCode(@RequestParam(name="pid",required = false) String pid,@RequestParam(name="code",required = false) String code) {
|
||||
/**
|
||||
* 校验编码
|
||||
* @param pid
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
@GetMapping(value = "/checkCode")
|
||||
public Result<?> checkCode(@RequestParam(name="pid",required = false) String pid,@RequestParam(name="code",required = false) String code) {
|
||||
if(oConvertUtils.isEmpty(code)){
|
||||
return Result.error("错误,类型编码为空!");
|
||||
}
|
||||
@@ -445,28 +440,28 @@ public class SysCategoryController {
|
||||
return Result.error("编码不符合规范,须以\""+parent.getCode()+"\"开头!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分类字典树控件 加载节点
|
||||
* @param pid
|
||||
* @param pcode
|
||||
* @param condition
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
@RequestMapping(value = "/loadTreeData", method = RequestMethod.GET)
|
||||
public Result<List<TreeSelectModel>> loadDict(@RequestParam(name="pid",required = false) String pid,@RequestParam(name="pcode",required = false) String pcode, @RequestParam(name="condition",required = false) String condition) {
|
||||
Result<List<TreeSelectModel>> result = new Result<List<TreeSelectModel>>();
|
||||
//pid如果传值了 就忽略pcode的作用
|
||||
if(oConvertUtils.isEmpty(pid)){
|
||||
if(oConvertUtils.isEmpty(pcode)){
|
||||
/**
|
||||
* 分类字典树控件 加载节点
|
||||
* @param pid
|
||||
* @param pcode
|
||||
* @param condition
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
@RequestMapping(value = "/loadTreeData", method = RequestMethod.GET)
|
||||
public Result<List<TreeSelectModel>> loadDict(@RequestParam(name="pid",required = false) String pid,@RequestParam(name="pcode",required = false) String pcode, @RequestParam(name="condition",required = false) String condition) {
|
||||
Result<List<TreeSelectModel>> result = new Result<List<TreeSelectModel>>();
|
||||
//pid如果传值了 就忽略pcode的作用
|
||||
if(oConvertUtils.isEmpty(pid)){
|
||||
if(oConvertUtils.isEmpty(pcode)){
|
||||
result.setSuccess(false);
|
||||
result.setMessage("加载分类字典树参数有误.[null]!");
|
||||
return result;
|
||||
}else{
|
||||
if(ISysCategoryService.ROOT_PID_VALUE.equals(pcode)){
|
||||
if(ISysCategoryService.ROOT_PID_VALUE.equals(pcode)){
|
||||
pid = ISysCategoryService.ROOT_PID_VALUE;
|
||||
}else{
|
||||
pid = this.sysCategoryService.queryIdByCode(pcode);
|
||||
@@ -477,102 +472,102 @@ public class SysCategoryController {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<String, String> query = null;
|
||||
if(oConvertUtils.isNotEmpty(condition)) {
|
||||
query = JSON.parseObject(condition, Map.class);
|
||||
}
|
||||
List<TreeSelectModel> ls = sysCategoryService.queryListByPid(pid,query);
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Map<String, String> query = null;
|
||||
if(oConvertUtils.isNotEmpty(condition)) {
|
||||
query = JSON.parseObject(condition, Map.class);
|
||||
}
|
||||
List<TreeSelectModel> ls = sysCategoryService.queryListByPid(pid,query);
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类字典控件数据回显[表单页面]
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
@RequestMapping(value = "/loadDictItem", method = RequestMethod.GET)
|
||||
public Result<List<String>> loadDictItem(@RequestParam(name = "ids") String ids) {
|
||||
Result<List<String>> result = new Result<>();
|
||||
// 非空判断
|
||||
if (StringUtils.isBlank(ids)) {
|
||||
result.setSuccess(false);
|
||||
result.setMessage("ids 不能为空");
|
||||
return result;
|
||||
}
|
||||
String[] idArray = ids.split(",");
|
||||
LambdaQueryWrapper<SysCategory> query = new LambdaQueryWrapper<>();
|
||||
query.in(SysCategory::getId, Arrays.asList(idArray));
|
||||
// 查询数据
|
||||
List<SysCategory> list = this.sysCategoryService.list(query);
|
||||
// 取出name并返回
|
||||
List<String> textList = list.stream().map(SysCategory::getName).collect(Collectors.toList());
|
||||
result.setSuccess(true);
|
||||
result.setResult(textList);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 分类字典控件数据回显[表单页面]
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
@RequestMapping(value = "/loadDictItem", method = RequestMethod.GET)
|
||||
public Result<List<String>> loadDictItem(@RequestParam(name = "ids") String ids) {
|
||||
Result<List<String>> result = new Result<>();
|
||||
// 非空判断
|
||||
if (StringUtils.isBlank(ids)) {
|
||||
result.setSuccess(false);
|
||||
result.setMessage("ids 不能为空");
|
||||
return result;
|
||||
}
|
||||
String[] idArray = ids.split(",");
|
||||
LambdaQueryWrapper<SysCategory> query = new LambdaQueryWrapper<>();
|
||||
query.in(SysCategory::getId, Arrays.asList(idArray));
|
||||
// 查询数据
|
||||
List<SysCategory> list = this.sysCategoryService.list(query);
|
||||
// 取出name并返回
|
||||
List<String> textList = list.stream().map(SysCategory::getName).collect(Collectors.toList());
|
||||
result.setSuccess(true);
|
||||
result.setResult(textList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* [列表页面]加载分类字典数据 用于值的替换
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
@RequestMapping(value = "/loadAllData", method = RequestMethod.GET)
|
||||
public Result<List<DictModel>> loadAllData(@RequestParam(name="code",required = true) String code) {
|
||||
Result<List<DictModel>> result = new Result<List<DictModel>>();
|
||||
LambdaQueryWrapper<SysCategory> query = new LambdaQueryWrapper<SysCategory>();
|
||||
if(oConvertUtils.isNotEmpty(code) && !"0".equals(code)){
|
||||
query.likeRight(SysCategory::getCode,code);
|
||||
}
|
||||
List<SysCategory> list = this.sysCategoryService.list(query);
|
||||
if(list==null || list.size()==0) {
|
||||
result.setMessage("无数据,参数有误.[code]");
|
||||
result.setSuccess(false);
|
||||
return result;
|
||||
}
|
||||
List<DictModel> rdList = new ArrayList<DictModel>();
|
||||
for (SysCategory c : list) {
|
||||
rdList.add(new DictModel(c.getId(),c.getName()));
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(rdList);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* [列表页面]加载分类字典数据 用于值的替换
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
@RequestMapping(value = "/loadAllData", method = RequestMethod.GET)
|
||||
public Result<List<DictModel>> loadAllData(@RequestParam(name="code",required = true) String code) {
|
||||
Result<List<DictModel>> result = new Result<List<DictModel>>();
|
||||
LambdaQueryWrapper<SysCategory> query = new LambdaQueryWrapper<SysCategory>();
|
||||
if(oConvertUtils.isNotEmpty(code) && !"0".equals(code)){
|
||||
query.likeRight(SysCategory::getCode,code);
|
||||
}
|
||||
List<SysCategory> list = this.sysCategoryService.list(query);
|
||||
if(list==null || list.size()==0) {
|
||||
result.setMessage("无数据,参数有误.[code]");
|
||||
result.setSuccess(false);
|
||||
return result;
|
||||
}
|
||||
List<DictModel> rdList = new ArrayList<DictModel>();
|
||||
for (SysCategory c : list) {
|
||||
rdList.add(new DictModel(c.getId(),c.getName()));
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(rdList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据父级id批量查询子节点
|
||||
* @param parentIds
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
@GetMapping("/getChildListBatch")
|
||||
public Result getChildListBatch(@RequestParam("parentIds") String parentIds) {
|
||||
try {
|
||||
QueryWrapper<SysCategory> queryWrapper = new QueryWrapper<>();
|
||||
List<String> parentIdList = Arrays.asList(parentIds.split(","));
|
||||
queryWrapper.in("pid", parentIdList);
|
||||
List<SysCategory> list = sysCategoryService.list(queryWrapper);
|
||||
IPage<SysCategory> pageList = new Page<>(1, 10, list.size());
|
||||
pageList.setRecords(list);
|
||||
return Result.OK(pageList);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error("批量查询子节点失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 根据父级id批量查询子节点
|
||||
* @param parentIds
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
@GetMapping("/getChildListBatch")
|
||||
public Result getChildListBatch(@RequestParam("parentIds") String parentIds) {
|
||||
try {
|
||||
QueryWrapper<SysCategory> queryWrapper = new QueryWrapper<>();
|
||||
List<String> parentIdList = Arrays.asList(parentIds.split(","));
|
||||
queryWrapper.in("pid", parentIdList);
|
||||
List<SysCategory> list = sysCategoryService.list(queryWrapper);
|
||||
IPage<SysCategory> pageList = new Page<>(1, 10, list.size());
|
||||
pageList.setRecords(list);
|
||||
return Result.OK(pageList);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error("批量查询子节点失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 只查询技术领域的树形数据字典
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getSysCategoryTree")
|
||||
public Result getSysCategoryTree() {
|
||||
return Result.OK(sysCategoryService.getSysCategoryTree());
|
||||
}
|
||||
public Result getSysCategoryTree() {
|
||||
return Result.OK(sysCategoryService.getSysCategoryTree());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -387,6 +387,8 @@ public class SysDictController {
|
||||
@RequiresPermissions("dict:add")
|
||||
public Result<SysDict> add(@RequestBody SysDict sysDict) {
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
|
||||
sysDictService.setAddOrdderNum(sysDict);
|
||||
//校验--不能重复数据
|
||||
QueryWrapper<SysDict> queryWrapper = new QueryWrapper<>();
|
||||
//查询同一模块下,同名数据
|
||||
@@ -434,6 +436,7 @@ public class SysDictController {
|
||||
@RequiresPermissions("dict:edit")
|
||||
public Result<SysDict> edit(@RequestBody SysDict sysDict) {
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
sysDictService.setEditOrdderNum(sysDict);
|
||||
SysDict sysdict = sysDictService.getById(sysDict.getId());
|
||||
if (sysdict == null) {
|
||||
result.error500("未找到对应实体");
|
||||
|
||||
+3
@@ -125,4 +125,7 @@ public class SysDict implements Serializable {
|
||||
@Dict(dictTable = "sys_dict_item", dicText = "en_name", dicCode ="en_name")
|
||||
@ApiModelProperty(value = "属性类型英文名")
|
||||
private java.lang.String attributeTypeEnName;
|
||||
|
||||
/**排序*/
|
||||
private java.lang.Integer orderNum;
|
||||
}
|
||||
+2
-2
@@ -135,7 +135,7 @@
|
||||
|
||||
<select id="queryPageList" resultType="com.jero.modules.system.entity.SysDict">
|
||||
select d.id,d.create_by,d.create_time,d.update_by,d.update_time,
|
||||
d.dict_name,d.dict_code,d.description,d.del_flag,d.type,
|
||||
d.dict_name,d.dict_code,d.description,d.del_flag,d.type,d.order_num,
|
||||
d.dict_en_name,d.is_tag_dict,d.is_read_only,d.attribute_type,
|
||||
i.item_text as attribute_type_name,i.en_name as attribute_type_en_name
|
||||
from sys_dict as d
|
||||
@@ -166,6 +166,6 @@
|
||||
</choose>
|
||||
</if>
|
||||
|
||||
order by d.create_time desc
|
||||
order by d.order_num desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+4
@@ -169,4 +169,8 @@ public interface ISysDictService extends IService<SysDict> {
|
||||
String queryDictItemByName(String code, String itemName, String cut);
|
||||
|
||||
String queryDictItemByValue(String code, String itemName, String cut);
|
||||
|
||||
void setAddOrdderNum(SysDict sysDict);
|
||||
|
||||
void setEditOrdderNum(SysDict sysDict);
|
||||
}
|
||||
|
||||
+5
-7
@@ -10,10 +10,8 @@ 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.constant.CommonConstant;
|
||||
import com.jero.common.constant.FillRuleConstant;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.util.FillRuleUtil;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.system.entity.SysCategory;
|
||||
import com.jero.modules.system.entity.SysCategoryTreeVO;
|
||||
@@ -64,16 +62,16 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
|
||||
}
|
||||
@Override
|
||||
public void addSysCategory(SysCategory sysCategory) {
|
||||
String categoryCode = "";
|
||||
// String categoryCode = "";
|
||||
String categoryPid = ISysCategoryService.ROOT_PID_VALUE;
|
||||
String parentCode = null;
|
||||
// String parentCode = null;
|
||||
if(oConvertUtils.isNotEmpty(sysCategory.getPid())){
|
||||
categoryPid = sysCategory.getPid();
|
||||
|
||||
//PID 不是根节点 说明需要设置父节点 hasChild 为1
|
||||
if(!ISysCategoryService.ROOT_PID_VALUE.equals(categoryPid)){
|
||||
SysCategory parent = baseMapper.selectById(categoryPid);
|
||||
parentCode = parent.getCode();
|
||||
// parentCode = parent.getCode();
|
||||
if(parent!=null && !"1".equals(parent.getHasChild())){
|
||||
parent.setHasChild("1");
|
||||
baseMapper.updateById(parent);
|
||||
@@ -83,9 +81,9 @@ public class SysCategoryServiceImpl extends ServiceImpl<SysCategoryMapper, SysCa
|
||||
//update-begin--Author:baihailong Date:20191209 for:分类字典编码规则生成器做成公用配置
|
||||
JSONObject formData = new JSONObject();
|
||||
formData.put("pid",categoryPid);
|
||||
categoryCode = (String) FillRuleUtil.executeRule(FillRuleConstant.CATEGORY,formData);
|
||||
// categoryCode = (String) FillRuleUtil.executeRule(FillRuleConstant.CATEGORY,formData);
|
||||
//update-end--Author:baihailong Date:20191209 for:分类字典编码规则生成器做成公用配置
|
||||
sysCategory.setCode(categoryCode);
|
||||
// sysCategory.setCode(categoryCode);
|
||||
sysCategory.setPid(categoryPid);
|
||||
sysCategory.setItemValue(String.valueOf(RandomUtils.nextLong()));
|
||||
sysCategory.setIsTagDict(1);
|
||||
|
||||
+72
@@ -447,4 +447,76 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
return dictItemValue;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAddOrdderNum(SysDict sysDict) {
|
||||
Integer inputOrderNum = sysDict.getOrderNum();
|
||||
if(inputOrderNum != null) {
|
||||
//查询展示顺序相同的
|
||||
QueryWrapper<SysDict> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0)
|
||||
.orderByAsc("order_num");
|
||||
queryWrapper.eq("order_num", inputOrderNum);
|
||||
Integer orderNumCount = sysDictMapper.selectCount(queryWrapper);
|
||||
if (orderNumCount > 0) {//有重复展示顺序的,后面的号全+1
|
||||
//设置排序
|
||||
QueryWrapper<SysDict> orderNumQueryWrapper = new QueryWrapper<>();
|
||||
orderNumQueryWrapper.ge("order_num", inputOrderNum)
|
||||
.eq("del_flag", CommonConstant.DEL_FLAG_0)
|
||||
.orderByAsc("order_num");
|
||||
List<SysDict> geOrderNumList = list(orderNumQueryWrapper);
|
||||
|
||||
//判断相邻的序号,去掉不邻的
|
||||
for (int i = 0; i < geOrderNumList.size(); i++) {
|
||||
if (geOrderNumList.size() == 1) {
|
||||
break;
|
||||
} else if (geOrderNumList.get(i + 1).getOrderNum() - geOrderNumList.get(i).getOrderNum() > 1) {
|
||||
int deleteStart = geOrderNumList.get(i + 1).getOrderNum();
|
||||
geOrderNumList = geOrderNumList.stream().filter(e -> e.getOrderNum() < deleteStart).collect(Collectors.toList());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
geOrderNumList.stream().forEach(e -> e.setOrderNum(e.getOrderNum() + 1));
|
||||
saveOrUpdateBatch(geOrderNumList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEditOrdderNum(SysDict sysDict) {
|
||||
Integer inputOrderNum = sysDict.getOrderNum();
|
||||
if(inputOrderNum != null) {
|
||||
//查询展示顺序相同的
|
||||
QueryWrapper<SysDict> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0)
|
||||
.orderByAsc("order_num");
|
||||
Integer orderNumData = list(queryWrapper).stream().filter(e -> e.getId().equals(sysDict.getId()))
|
||||
.map(e -> e.getOrderNum()).collect(Collectors.toList()).get(0);
|
||||
queryWrapper.eq("order_num", inputOrderNum);
|
||||
Integer orderNumCount = sysDictMapper.selectCount(queryWrapper);
|
||||
if (orderNumCount > 0 && !orderNumData.equals(inputOrderNum)) {//有重复展示顺序的,后面的号全+1
|
||||
//设置排序
|
||||
QueryWrapper<SysDict> orderNumQueryWrapper = new QueryWrapper<>();
|
||||
orderNumQueryWrapper.ge("order_num", inputOrderNum)
|
||||
.eq("del_flag", CommonConstant.DEL_FLAG_0)
|
||||
.orderByAsc("order_num");
|
||||
List<SysDict> geOrderNumList = list(orderNumQueryWrapper);
|
||||
|
||||
//判断相邻的序号,去掉不邻的
|
||||
for (int i = 0; i < geOrderNumList.size(); i++) {
|
||||
if (geOrderNumList.size() == 1) {
|
||||
break;
|
||||
} else if (geOrderNumList.get(i + 1).getOrderNum() - geOrderNumList.get(i).getOrderNum() > 1) {
|
||||
int deleteStart = geOrderNumList.get(i + 1).getOrderNum();
|
||||
geOrderNumList = geOrderNumList.stream().filter(e -> e.getOrderNum() < deleteStart).collect(Collectors.toList());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
geOrderNumList.stream().forEach(e -> e.setOrderNum(e.getOrderNum() + 1));
|
||||
saveOrUpdateBatch(geOrderNumList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,6 +166,41 @@
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.62</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!--导出docx文件-->
|
||||
<dependency>
|
||||
<groupId>org.docx4j</groupId>
|
||||
<artifactId>docx4j</artifactId>
|
||||
<version>6.0.1</version>
|
||||
<!--排除冲突jar-->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.docx4j</groupId>
|
||||
<artifactId>docx4j-export-fo</artifactId>
|
||||
<version>6.0.1</version>
|
||||
<!--排除冲突jar-->
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
+20
-4
@@ -38,6 +38,8 @@ import com.jero.modules.document.utils.ReadWordUtil;
|
||||
import com.jero.modules.document.vo.QueryConditionVO;
|
||||
import com.jero.modules.domain.service.DomainUserRelService;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.home.entity.HomeDocumentDynamicEO;
|
||||
import com.jero.modules.home.service.IHomeDocumentDynamicEOService;
|
||||
import com.jero.modules.log.entity.BussLogEO;
|
||||
import com.jero.modules.log.service.IBussLogEOService;
|
||||
import com.jero.modules.message.websocket.WebSocket;
|
||||
@@ -163,6 +165,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
private WebSocket webSocket;
|
||||
@Resource
|
||||
private IFeishuService iFeishuService;
|
||||
@Autowired
|
||||
private IHomeDocumentDynamicEOService homeDocumentDynamicEOService;
|
||||
|
||||
@Value(value = "${jero.path.upload}")
|
||||
private String uploadpath;
|
||||
@@ -1960,6 +1964,17 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
mapTemp.put("domainId", map.get("technology_territory"));
|
||||
mapTemp.put("documentId", "");
|
||||
List<String> userIdList = domainUserRelService.queryDomainUserRelInfo(mapTemp);
|
||||
String title = (String) map.get("title");
|
||||
String serialNumber = (String) map.get("serial_number");
|
||||
String href = "<a href='/docManage/library/detail?id=" + idTemp +
|
||||
"&title=" + title +
|
||||
"&serial_number=" + serialNumber + "'" + " target='_blank'>" + serialNumber + "</a>";
|
||||
//文档动态, 文档库中新增了标准XXXX homeDocumentDynamicEOService
|
||||
HomeDocumentDynamicEO homeDocumentDynamicEO = new HomeDocumentDynamicEO();
|
||||
homeDocumentDynamicEO.setMsgContent("文档库中新增了标准" + href);
|
||||
homeDocumentDynamicEOService.save(homeDocumentDynamicEO);
|
||||
|
||||
|
||||
//给发送消息的用户
|
||||
if(userIdList.size() == 0){
|
||||
return;
|
||||
@@ -1967,10 +1982,10 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
|
||||
List<String> thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
if (userIdList.size() != 0) {
|
||||
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String title = (String) map.get("title");
|
||||
String serialNumber = (String) map.get("serial_number");
|
||||
String href = backUrl + "/docManage/library/detail?id=" + idTemp;
|
||||
|
||||
String hrefTemp = backUrl + "/docManage/library/detail?id=" + idTemp;
|
||||
String content = sysUser.getUsername() + " add " + serialNumber + ",Please pay attention to check.";
|
||||
String contentInfo = sysUser.getUsername() + " add " + href + ",Please pay attention to check.";
|
||||
//封装消息的实体类
|
||||
@@ -1979,11 +1994,12 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
sendWebsocket(idTemp, idTemp);
|
||||
//飞书
|
||||
try {
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), content, MessageTypeEnum.PUSH.getName(), href);
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), content, MessageTypeEnum.PUSH.getName(), hrefTemp);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
package com.jero.modules.home.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.home.entity.HomeDocumentDynamicEO;
|
||||
import com.jero.modules.home.service.IHomeDocumentDynamicEOService;
|
||||
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.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 io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档动态
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-05-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="文档动态")
|
||||
@RestController
|
||||
@RequestMapping("/home/homeDocumentDynamicEO")
|
||||
@Slf4j
|
||||
public class HomeDocumentDynamicEOController extends JeroController<HomeDocumentDynamicEO, IHomeDocumentDynamicEOService> {
|
||||
@Autowired
|
||||
private IHomeDocumentDynamicEOService homeDocumentDynamicEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param homeDocumentDynamicEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档动态-分页列表查询")
|
||||
@ApiOperation(value="文档动态-分页列表查询", notes="文档动态-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(HomeDocumentDynamicEO homeDocumentDynamicEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<HomeDocumentDynamicEO> queryWrapper = QueryGenerator.initQueryWrapper(homeDocumentDynamicEO, req.getParameterMap());
|
||||
Page<HomeDocumentDynamicEO> page = new Page<HomeDocumentDynamicEO>(pageNo, pageSize);
|
||||
IPage<HomeDocumentDynamicEO> pageList = homeDocumentDynamicEOService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档动态-列表查询")
|
||||
@ApiOperation(value="文档动态-列表查询", notes="文档动态-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<HomeDocumentDynamicEO>> queryList() {
|
||||
List<HomeDocumentDynamicEO> list = homeDocumentDynamicEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param homeDocumentDynamicEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档动态-添加")
|
||||
@ApiOperation(value="文档动态-添加", notes="文档动态-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody HomeDocumentDynamicEO homeDocumentDynamicEO) {
|
||||
homeDocumentDynamicEOService.add(homeDocumentDynamicEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param homeDocumentDynamicEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档动态-编辑")
|
||||
@ApiOperation(value="文档动态-编辑", notes="文档动态-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody HomeDocumentDynamicEO homeDocumentDynamicEO) {
|
||||
homeDocumentDynamicEOService.editById(homeDocumentDynamicEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档动态-通过id删除")
|
||||
@ApiOperation(value="文档动态-通过id删除", notes="文档动态-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
homeDocumentDynamicEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档动态-批量删除")
|
||||
@ApiOperation(value="文档动态-批量删除", notes="文档动态-批量删除")
|
||||
@GetMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.homeDocumentDynamicEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档动态-通过id查询")
|
||||
@ApiOperation(value="文档动态-通过id查询", notes="文档动态-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
HomeDocumentDynamicEO homeDocumentDynamicEO = homeDocumentDynamicEOService.queryById(id);
|
||||
if(homeDocumentDynamicEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(homeDocumentDynamicEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param homeDocumentDynamicEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HomeDocumentDynamicEO homeDocumentDynamicEO) {
|
||||
return super.exportXls(request, homeDocumentDynamicEO, HomeDocumentDynamicEO.class, "文档动态");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, HomeDocumentDynamicEO.class);
|
||||
}
|
||||
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.jero.modules.home.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
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 com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档动态
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-05-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("home_document_dynamic")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="home_document_dynamic对象", description="文档动态")
|
||||
public class HomeDocumentDynamicEO 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 msgContent;
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.jero.modules.home.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.modules.home.entity.HomeDocumentDynamicEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 文档动态
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-05-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface HomeDocumentDynamicEOMapper extends BaseMapper<HomeDocumentDynamicEO> {
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<?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.jero.modules.home.mapper.HomeDocumentDynamicEOMapper">
|
||||
<resultMap id="HomeDocumentDynamicEOResultMap" type="com.jero.modules.home.entity.HomeDocumentDynamicEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="msg_content" property="msgContent" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.jero.modules.home.service;
|
||||
|
||||
import com.jero.modules.home.entity.HomeDocumentDynamicEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 文档动态
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-05-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IHomeDocumentDynamicEOService extends IService<HomeDocumentDynamicEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param homeDocumentDynamicEO
|
||||
* @return
|
||||
*/
|
||||
void add(HomeDocumentDynamicEO homeDocumentDynamicEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param homeDocumentDynamicEO
|
||||
* @return
|
||||
*/
|
||||
void editById(HomeDocumentDynamicEO homeDocumentDynamicEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
HomeDocumentDynamicEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<HomeDocumentDynamicEO> queryList();
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package com.jero.modules.home.service.impl;
|
||||
|
||||
import com.jero.modules.home.entity.HomeDocumentDynamicEO;
|
||||
import com.jero.modules.home.mapper.HomeDocumentDynamicEOMapper;
|
||||
import com.jero.modules.home.service.IHomeDocumentDynamicEOService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 文档动态
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-05-24
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class HomeDocumentDynamicEOServiceImpl extends ServiceImpl<HomeDocumentDynamicEOMapper, HomeDocumentDynamicEO> implements IHomeDocumentDynamicEOService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param homeDocumentDynamicEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(HomeDocumentDynamicEO homeDocumentDynamicEO) {
|
||||
Date now = new Date();
|
||||
homeDocumentDynamicEO.setCreateTime(now);
|
||||
homeDocumentDynamicEO.setUpdateTime(now);
|
||||
save(homeDocumentDynamicEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param homeDocumentDynamicEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(HomeDocumentDynamicEO homeDocumentDynamicEO) {
|
||||
Date now = new Date();
|
||||
homeDocumentDynamicEO.setUpdateTime(now);
|
||||
saveOrUpdate(homeDocumentDynamicEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public HomeDocumentDynamicEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<HomeDocumentDynamicEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
}
|
||||
+10
@@ -159,4 +159,14 @@ public class ProjectCertificationDirectoryEOController extends JeroController<Pr
|
||||
return super.importExcel(request, response, ProjectCertificationDirectoryEO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据项目库id 查询当前登陆人在该项目中是什么角色
|
||||
* @param projectLibraryId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/queryUserPremissionByProjectLibraryId")
|
||||
public Result<?> queryUserPremissionByProjectLibraryId(@RequestParam(name="projectLibraryId",required=true) String projectLibraryId) {
|
||||
return projectCertificationDirectoryEOService.queryUserPremissionByProjectLibraryId(projectLibraryId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+17
-6
@@ -380,12 +380,7 @@ public class ProjectLawsInventoryEOController extends JeroController<ProjectLaws
|
||||
@AutoLog(value = "下载pdf报告")
|
||||
@ApiOperation(value="下载pdf报告", notes="下载pdf报告")
|
||||
@GetMapping(value = "/downloadReport")
|
||||
// public void downloadReport(@RequestParam Map<String,Object> params, HttpServletRequest req, HttpServletResponse resp) throws DocumentException {
|
||||
public void downloadReport(@RequestParam("cut")String cut,@RequestParam("id")String id, HttpServletRequest req, HttpServletResponse resp) throws DocumentException {
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("cut",cut);
|
||||
params.put("id",id);
|
||||
|
||||
public void downloadReport(@RequestParam Map<String,Object> params, HttpServletRequest req, HttpServletResponse resp) throws DocumentException {
|
||||
this.projectLawsInventoryEOService.downloadReport(params,req,resp);
|
||||
}
|
||||
|
||||
@@ -415,4 +410,20 @@ public class ProjectLawsInventoryEOController extends JeroController<ProjectLaws
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param params
|
||||
* cut:中英文标识
|
||||
* id:法规清单id
|
||||
* @param req
|
||||
* @param resp
|
||||
* @throws DocumentException
|
||||
*/
|
||||
@AutoLog(value = "下载docx报告")
|
||||
@ApiOperation(value="下载docx报告", notes="下载docx报告")
|
||||
@GetMapping(value = "/downloadDocxReport")
|
||||
public void downloadDocxReport(@RequestParam Map<String,Object> params, HttpServletRequest req, HttpServletResponse resp) throws DocumentException {
|
||||
this.projectLawsInventoryEOService.downloadDocxReport(params,req,resp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+7
@@ -71,4 +71,11 @@ public interface IProjectCertificationDirectoryEOService extends IService<Projec
|
||||
* @return
|
||||
*/
|
||||
Result<?> queryPageList(ProjectCertificationDirectoryEO projectCertificationDirectoryEO, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 根据项目库id 查询当前登陆人在该项目中是什么角色
|
||||
* @param projectLibraryId
|
||||
* @return
|
||||
*/
|
||||
Result<?> queryUserPremissionByProjectLibraryId(String projectLibraryId);
|
||||
}
|
||||
|
||||
+15
@@ -121,5 +121,20 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
|
||||
|
||||
Result<?> change(Map<String, Object> parmas);
|
||||
|
||||
/**
|
||||
* 下载pdf报告
|
||||
* @param params
|
||||
* @param req
|
||||
* @param resp
|
||||
* @throws DocumentException
|
||||
*/
|
||||
void downloadReport(Map<String, Object> params,HttpServletRequest req, HttpServletResponse resp)throws DocumentException;
|
||||
|
||||
/**
|
||||
* 下载docx报告
|
||||
* @param params
|
||||
* @param req
|
||||
* @param resp
|
||||
*/
|
||||
void downloadDocxReport(Map<String, Object> params, HttpServletRequest req, HttpServletResponse resp);
|
||||
}
|
||||
|
||||
+26
-16
@@ -145,38 +145,48 @@ public class ProjectCertificationDirectoryEOServiceImpl extends ServiceImpl<Proj
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> queryUserPremissionByProjectLibraryId(String projectLibraryId) {
|
||||
int roleCode = checkUserRole(projectLibraryId);
|
||||
return Result.OK(roleCode);
|
||||
}
|
||||
|
||||
public int checkUserRole(String projectLibraryId){
|
||||
int result = -1;
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
try{
|
||||
QueryWrapper<ProjectLawsInventoryEO> inventoryEOQueryWrapperRZ = new QueryWrapper<>();
|
||||
inventoryEOQueryWrapperRZ.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId);
|
||||
inventoryEOQueryWrapperRZ.lambda().eq(ProjectLawsInventoryEO::getHomologationEngineerId,currentUser.getId());
|
||||
Integer lawsInventoryCountRZ = projectLawsInventoryEOMapper.selectCount(inventoryEOQueryWrapperRZ);
|
||||
if(lawsInventoryCountRZ > 0){
|
||||
result = Integer.parseInt(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
QueryWrapper<ProjectLibraryBase> projectLibraryBaseQueryWrapper = new QueryWrapper<>();
|
||||
projectLibraryBaseQueryWrapper.lambda().eq(ProjectLibraryBase::getId,projectLibraryId);
|
||||
projectLibraryBaseQueryWrapper.lambda().eq(ProjectLibraryBase::getStudioEngineer,currentUser.getId());
|
||||
Integer projectLibrayBaseCount = projectLibraryBaseMapper.selectCount(projectLibraryBaseQueryWrapper);
|
||||
if(projectLibrayBaseCount > 0){
|
||||
result = Integer.parseInt(ProjectRoleEnum.STUDIO_ENGINEER.getValue());
|
||||
}else {
|
||||
QueryWrapper<ProjectLawsInventoryEO> inventoryEOQueryWrapperFG = new QueryWrapper<>();
|
||||
inventoryEOQueryWrapperFG.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId);
|
||||
inventoryEOQueryWrapperFG.lambda().eq(ProjectLawsInventoryEO::getRegulationOwnerId,currentUser.getId());
|
||||
Integer lawsInventoryCountFG = projectLawsInventoryEOMapper.selectCount(inventoryEOQueryWrapperFG);
|
||||
if(lawsInventoryCountFG > 0){
|
||||
result = Integer.parseInt(ProjectRoleEnum.REGULATI_ENGINEER.getValue());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QueryWrapper<ProjectLawsInventoryEO> inventoryEOQueryWrapperRZ = new QueryWrapper<>();
|
||||
inventoryEOQueryWrapperRZ.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId);
|
||||
inventoryEOQueryWrapperRZ.lambda().eq(ProjectLawsInventoryEO::getHomologationEngineerId,currentUser.getId());
|
||||
Integer lawsInventoryCountRZ = projectLawsInventoryEOMapper.selectCount(inventoryEOQueryWrapperRZ);
|
||||
if(lawsInventoryCountRZ > 0){
|
||||
result = Integer.parseInt(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue());
|
||||
}
|
||||
QueryWrapper<ProjectLawsInventoryEO> inventoryEOQueryWrapperFG = new QueryWrapper<>();
|
||||
inventoryEOQueryWrapperFG.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,projectLibraryId);
|
||||
inventoryEOQueryWrapperFG.lambda().eq(ProjectLawsInventoryEO::getRegulationOwnerId,currentUser.getId());
|
||||
Integer lawsInventoryCountFG = projectLawsInventoryEOMapper.selectCount(inventoryEOQueryWrapperFG);
|
||||
if(lawsInventoryCountFG > 0){
|
||||
result = Integer.parseInt(ProjectRoleEnum.REGULATI_ENGINEER.getValue());
|
||||
return result;
|
||||
}
|
||||
}catch (Exception ex){
|
||||
log.error("验证用户在该项目中的角色失败:" + ex.getMessage());
|
||||
throw new JeroBootException("验证用户在该项目中的角色失败!");
|
||||
}
|
||||
return result;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+377
-5
@@ -1,11 +1,12 @@
|
||||
package com.jero.modules.project.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
//import com.jero.modules.project.util.WordUtil;
|
||||
import cn.hutool.poi.word.DocUtil;
|
||||
import com.itextpdf.text.*;
|
||||
import com.itextpdf.text.Font;
|
||||
import com.itextpdf.text.pdf.*;
|
||||
import com.jero.modules.dummy.entity.DummyInventoryBaseEO;
|
||||
import com.jero.modules.dummy.entity.DummyInventoryInfoEOEn;
|
||||
import com.jero.modules.dummy.enums.DummyInventoryBaseFieldEnum;
|
||||
import com.jero.modules.dummy.service.impl.DummyInventoryBaseEOServiceImpl;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@@ -26,11 +27,8 @@ import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.DateUtils;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.dummy.entity.DummyInventoryBaseEO;
|
||||
import com.jero.modules.dummy.entity.DummyInventoryInfoEO;
|
||||
import com.jero.modules.dummy.enums.DummyInventoryBaseFieldEnum;
|
||||
import com.jero.modules.dummy.service.IDummyInventoryInfoEOService;
|
||||
import com.jero.modules.dummy.service.impl.DummyInventoryBaseEOServiceImpl;
|
||||
import com.jero.modules.dummy.util.ListDiff;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.message.websocket.WebSocket;
|
||||
@@ -43,6 +41,7 @@ import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
|
||||
import com.jero.modules.project.mapper.ProjectNameInfoEOMapper;
|
||||
import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper;
|
||||
import com.jero.modules.project.service.*;
|
||||
import com.jero.modules.project.util.WordUtil;
|
||||
import com.jero.modules.split.common.FileUnZip;
|
||||
import com.jero.modules.system.entity.SysAnnouncement;
|
||||
import com.jero.modules.system.entity.SysCategory;
|
||||
@@ -54,6 +53,9 @@ import com.jero.modules.system.service.ISysAnnouncementService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import com.jero.modules.wkflow.entity.ProcessHistoryEO;
|
||||
import com.jero.modules.wkflow.service.IProcessHistoryEOService;
|
||||
import com.jero.modules.wkflow.service.impl.ProcessHistoryEOServiceImpl;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
@@ -66,6 +68,18 @@ import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.aspectj.util.FileUtil;
|
||||
import org.docx4j.Docx4J;
|
||||
import org.docx4j.TraversalUtil;
|
||||
import org.docx4j.XmlUtils;
|
||||
import org.docx4j.finders.ClassFinder;
|
||||
import org.docx4j.finders.RangeFinder;
|
||||
import org.docx4j.openpackaging.exceptions.Docx4JException;
|
||||
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
|
||||
import org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart;
|
||||
import org.docx4j.wml.Body;
|
||||
import org.docx4j.wml.CTBookmark;
|
||||
import org.docx4j.wml.Tbl;
|
||||
import org.docx4j.wml.Tr;
|
||||
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
@@ -75,6 +89,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
@@ -166,6 +181,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
@Autowired
|
||||
private SysDictItemMapper sysDictItemMapper;
|
||||
|
||||
@Autowired
|
||||
private IProcessHistoryEOService processHistoryEOService;
|
||||
|
||||
@Autowired
|
||||
private IConditionAssessmentEOService conditionAssessmentEOService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -2383,6 +2404,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Result<?> change(Map<String, Object> parmas) {
|
||||
List<String> idList = Arrays.asList(parmas.get("ids").toString().split(","));
|
||||
if(CollectionUtils.isNotEmpty(idList)){
|
||||
@@ -2394,7 +2416,29 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
//清单、任务确认初始化。
|
||||
this.baseMapper.update(projectLawsInventoryEO,updateLawsInventoryWrapper);
|
||||
|
||||
//项目任务清单数据初始化。
|
||||
QueryWrapper<ProjectTaskInventoryEO> taskInventoryQueryWrapper = new QueryWrapper<>();
|
||||
taskInventoryQueryWrapper.lambda().in(ProjectTaskInventoryEO::getProjectLawsInventoryId,idList);
|
||||
List<ProjectTaskInventoryEO> projectTaskInventoryList = this.projectTaskInventoryEOService.getBaseMapper().selectList(taskInventoryQueryWrapper);
|
||||
|
||||
//删除流程历史
|
||||
if(CollectionUtils.isNotEmpty(projectTaskInventoryList)){
|
||||
List<String> actiProcInstIdList = new ArrayList<>();
|
||||
List<String> verifyPIdList = projectTaskInventoryList.stream().map(ProjectTaskInventoryEO::getVerifyPId).distinct().collect(Collectors.toList());
|
||||
List<String> prehomoPIdList = projectTaskInventoryList.stream().map(ProjectTaskInventoryEO::getPrehomoPId).distinct().collect(Collectors.toList());
|
||||
List<String> designPIdList = projectTaskInventoryList.stream().map(ProjectTaskInventoryEO::getDesignPId).distinct().collect(Collectors.toList());
|
||||
|
||||
actiProcInstIdList.addAll(verifyPIdList);
|
||||
actiProcInstIdList.addAll(prehomoPIdList);
|
||||
actiProcInstIdList.addAll(designPIdList);
|
||||
|
||||
actiProcInstIdList = actiProcInstIdList.stream().distinct().collect(Collectors.toList());;
|
||||
if(CollectionUtils.isNotEmpty(actiProcInstIdList)){
|
||||
QueryWrapper<ProcessHistoryEO> processHistoryDeleteWrapper = new QueryWrapper<>();
|
||||
processHistoryDeleteWrapper.lambda().in(ProcessHistoryEO::getActiProcInstId,actiProcInstIdList);
|
||||
processHistoryEOService.remove(processHistoryDeleteWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
List<ProjectTaskInventoryEO> projectTaskInventoryEOList = new ArrayList<>();
|
||||
idList.forEach(id -> {
|
||||
ProjectTaskInventoryEO projectTaskInventoryEO = new ProjectTaskInventoryEO();
|
||||
@@ -2403,6 +2447,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
projectTaskInventoryEO.setProjectLawsInventoryId(id);
|
||||
projectTaskInventoryEOList.add(projectTaskInventoryEO);
|
||||
});
|
||||
//项目任务清单数据初始化。
|
||||
this.projectTaskInventoryEOService.deleteByProjectLawsInventoryIds(idList);
|
||||
this.projectTaskInventoryEOService.saveBatch(projectTaskInventoryEOList);
|
||||
|
||||
@@ -2425,6 +2470,10 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
deleteTaskInventoryFeedbackWrapper.lambda().in(ProjectTaskInventoryFeedbackEO::getProjectTaskInventoryId,idList);
|
||||
this.projectTaskInventoryFeedbackEOService.remove(deleteTaskInventoryFeedbackWrapper);
|
||||
|
||||
//删除当前项目状态表
|
||||
QueryWrapper<ConditionAssessmentEO> deleteConditionAssessmentWrapper = new QueryWrapper<>();
|
||||
deleteConditionAssessmentWrapper.lambda().in(ConditionAssessmentEO::getProjectLawsInventoryId,idList);
|
||||
this.conditionAssessmentEOService.remove(deleteConditionAssessmentWrapper);
|
||||
}
|
||||
return Result.OK("变更成功!");
|
||||
}
|
||||
@@ -4118,4 +4167,327 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
}
|
||||
document.add(tableBase);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载docx报告
|
||||
* @param params
|
||||
* @param req
|
||||
* @param resp
|
||||
*/
|
||||
@Override
|
||||
public void downloadDocxReport(Map<String, Object> params, HttpServletRequest req, HttpServletResponse resp) {
|
||||
File templateFile = null;
|
||||
File exportFile = null;
|
||||
InputStream fin = null;
|
||||
ServletOutputStream out = null;
|
||||
|
||||
String id = (String) params.get("id");
|
||||
String cut = (String) params.get("cut");
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
//查询数据
|
||||
QueryWrapper<ProjectLawsInventoryEO> lawsInventoryQueryWrapper = new QueryWrapper<>();
|
||||
lawsInventoryQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getId,id);
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO = this.baseMapper.selectOne(lawsInventoryQueryWrapper);
|
||||
params.put("projectLawsInventoryEO",projectLawsInventoryEO);
|
||||
|
||||
QueryWrapper<ProjectTaskInventoryEO> taskInventoryQueryWrapper = new QueryWrapper<>();
|
||||
taskInventoryQueryWrapper.lambda().eq(ProjectTaskInventoryEO::getProjectLawsInventoryId,id);
|
||||
ProjectTaskInventoryEO projectTaskInventoryEO = projectTaskInventoryEOService.getBaseMapper().selectOne(taskInventoryQueryWrapper);
|
||||
params.put("projectTaskInventoryEO",projectTaskInventoryEO);
|
||||
|
||||
QueryWrapper<ProjectLibraryBase> libraryBaseQueryWrapper = new QueryWrapper<>();
|
||||
libraryBaseQueryWrapper.lambda().eq(ProjectLibraryBase::getId,projectLawsInventoryEO.getProjectLibraryId());
|
||||
ProjectLibraryBase projectLibraryBase = projectLibraryBaseMapper.selectOne(libraryBaseQueryWrapper);
|
||||
params.put("projectLibraryBase",projectLibraryBase);
|
||||
|
||||
QueryWrapper<ProjectNameInfoEO> projectNameQueryWrapper = new QueryWrapper<>();
|
||||
projectNameQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId());
|
||||
ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameQueryWrapper);
|
||||
params.put("projectNameInfoEO",projectNameInfoEO);
|
||||
|
||||
|
||||
final Map<String, String> dataMap = new HashMap<>();
|
||||
//对应 CR No
|
||||
dataMap.put("crNo", String.valueOf(new SimpleDateFormat("yyyyMMddHHmmssSSSS").format(new Date())));
|
||||
|
||||
String flowStatus = "";
|
||||
if(StringUtils.isNotEmpty(projectTaskInventoryEO.getVerifyStatus())){
|
||||
flowStatus = projectTaskInventoryEO.getVerifyStatus() + ",";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(projectTaskInventoryEO.getPrehomoStatus())){
|
||||
flowStatus += projectTaskInventoryEO.getPrehomoStatus() + ",";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(projectTaskInventoryEO.getVerifyStatus())){
|
||||
flowStatus += projectTaskInventoryEO.getVerifyStatus() + ",";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(flowStatus)){
|
||||
flowStatus = flowStatus.substring(0,flowStatus.length() - 1);
|
||||
}
|
||||
|
||||
//对应 crStatus
|
||||
dataMap.put("FLOW_STATUS", StringUtils.isNotEmpty(flowStatus) ? flowStatus : "");
|
||||
//对应 Regulation
|
||||
dataMap.put("REGULATION", StringUtils.isNotEmpty(projectLawsInventoryEO.getSerialNumber()) ? projectLawsInventoryEO.getSerialNumber() : "");
|
||||
//对应 Subject
|
||||
dataMap.put("SUBJECT", StringUtils.isNotEmpty(projectLawsInventoryEO.getTitle()) ? projectLawsInventoryEO.getTitle() : "");
|
||||
//对应 Project
|
||||
dataMap.put("PROJECT_NAME", StringUtils.isNotEmpty(projectNameInfoEO.getProjectName()) ? projectNameInfoEO.getProjectName() : "");
|
||||
|
||||
List<SysDictItem> regionDictList = sysDictItemServiceImpl.selectItemsByDictCode("region");
|
||||
String market = "";
|
||||
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
|
||||
market = regionDictList.stream()
|
||||
.filter(e -> projectLibraryBase.getTargetMarket().contains(e.getItemValue()))
|
||||
.map(SysDictItem::getItemText)
|
||||
.collect(Collectors.joining(","));
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
market = regionDictList.stream()
|
||||
.filter(e -> projectLibraryBase.getTargetMarket().contains(e.getItemValue()))
|
||||
.map(SysDictItem::getEnName)
|
||||
.collect(Collectors.joining(","));
|
||||
}
|
||||
//对应 Market
|
||||
dataMap.put("MARKET", StringUtils.isNotEmpty(market) ? market : "");
|
||||
//对应 nt 数字平台
|
||||
dataMap.put("NT", StringUtils.isNotEmpty(projectNameInfoEO.getDigitalPlatform()) ? projectNameInfoEO.getDigitalPlatform() : "");
|
||||
//对应 np 车型平台
|
||||
dataMap.put("NP", StringUtils.isNotEmpty(projectNameInfoEO.getVehiclePlatform()) ? projectNameInfoEO.getVehiclePlatform() : "");
|
||||
String processEndTimeStr = "";
|
||||
if(projectTaskInventoryEO.getProcessEndTime() != null){
|
||||
processEndTimeStr = sdf.format(projectTaskInventoryEO.getProcessEndTime());
|
||||
}
|
||||
dataMap.put("COMPLETION_DATE", StringUtils.isNotEmpty(processEndTimeStr) ? processEndTimeStr : "");
|
||||
|
||||
String dutyTerritory = projectLawsInventoryEO.getDutyTerritory();
|
||||
String finalDutyTerritory = dutyTerritory;
|
||||
List<SysDictItem> dutyTerritoryDictItemList = sysDictItemServiceImpl.selectItemsByDictCode("duty_territory");
|
||||
String dutyTerritoryName = "";
|
||||
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
|
||||
dutyTerritoryName = dutyTerritoryDictItemList.stream()
|
||||
.filter(e -> finalDutyTerritory.contains(e.getItemValue()))
|
||||
.map(SysDictItem::getItemText)
|
||||
.collect(Collectors.joining(","));
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
dutyTerritoryName = dutyTerritoryDictItemList.stream()
|
||||
.filter(e -> finalDutyTerritory.contains(e.getItemValue()))
|
||||
.map(SysDictItem::getEnName)
|
||||
.collect(Collectors.joining(","));
|
||||
}
|
||||
dataMap.put("RESPONSIBLE_FIELD", StringUtils.isNotEmpty(dutyTerritoryName) ? dutyTerritoryName : "");
|
||||
|
||||
String studioEngineer = projectLibraryBase.getStudioEngineer();
|
||||
QueryWrapper<SysUser> queryStudioUserWrapper = new QueryWrapper<>();
|
||||
queryStudioUserWrapper.lambda().eq(SysUser::getId,studioEngineer);
|
||||
SysUser studioUserInfo = sysUserMapper.selectOne(queryStudioUserWrapper);
|
||||
dataMap.put("STUDIO", StringUtils.isNotEmpty(studioUserInfo.getUsername()) ? studioUserInfo.getUsername() : "");
|
||||
|
||||
String engineeringInterfacePerson = projectLawsInventoryEO.getEngineeringInterfacePerson();
|
||||
QueryWrapper<SysUser> queryEngineeringInterfaceUserWrapper = new QueryWrapper<>();
|
||||
queryEngineeringInterfaceUserWrapper.lambda().eq(SysUser::getId,engineeringInterfacePerson);
|
||||
SysUser engineeringInterfaceInfo = sysUserMapper.selectOne(queryEngineeringInterfaceUserWrapper);
|
||||
dataMap.put("ENGINEERING", StringUtils.isNotEmpty(engineeringInterfaceInfo.getUsername()) ? engineeringInterfaceInfo.getUsername() : "");
|
||||
|
||||
String homologationEngineerId = projectLawsInventoryEO.getHomologationEngineerId();
|
||||
QueryWrapper<SysUser> queryHomologationEngineerUserWrapper = new QueryWrapper<>();
|
||||
queryHomologationEngineerUserWrapper.lambda().eq(SysUser::getId,homologationEngineerId);
|
||||
SysUser homologationEngineerInfo = sysUserMapper.selectOne(queryHomologationEngineerUserWrapper);
|
||||
dataMap.put("HOMOLOGATION", StringUtils.isNotEmpty(homologationEngineerInfo.getUsername()) ? homologationEngineerInfo.getUsername() : "");
|
||||
|
||||
String regulationOwnerId = projectLawsInventoryEO.getRegulationOwnerId();
|
||||
QueryWrapper<SysUser> queryRegulationOwnerUserWrapper = new QueryWrapper<>();
|
||||
queryRegulationOwnerUserWrapper.lambda().eq(SysUser::getId,regulationOwnerId);
|
||||
SysUser regulationOwnerInfo = sysUserMapper.selectOne(queryRegulationOwnerUserWrapper);
|
||||
dataMap.put("REGULATION", StringUtils.isNotEmpty(regulationOwnerInfo.getUsername()) ? regulationOwnerInfo.getUsername() : "");
|
||||
|
||||
templateFile = new File(exportPdfTempPath + "temp/ComplianceReportTemplate.docx");
|
||||
if(templateFile != null){
|
||||
try {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
//final String TEMP_FILE_PATH = System.getProperty("os.name").toLowerCase().contains("windows") ? System.getProperty("user.dir") + File.separator : "/home/admin/tempfile/";
|
||||
final String TEMP_FILE_PATH = exportPdfTempPath + "exportFile/";
|
||||
|
||||
File pathFile = new File(TEMP_FILE_PATH);
|
||||
if (!pathFile.exists()) {
|
||||
pathFile.mkdirs();
|
||||
}
|
||||
String outFile = TEMP_FILE_PATH + uuid + ".docx";
|
||||
exportFile = new File(outFile);
|
||||
FileOutputStream os = new FileOutputStream(outFile);
|
||||
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new FileInputStream(templateFile));
|
||||
|
||||
//验证符合性流程实例id
|
||||
String verifyPId = projectTaskInventoryEO.getVerifyPId();
|
||||
//Compliance Attachments 验证符合性流程里最后通过审批的“工程确认”中的附件
|
||||
setTableContent(1,wordMLPackage,params,verifyPId);
|
||||
//Validation Compliance Check Approvals(验证符合性确认的审批历史数据)
|
||||
setTableContent(4,wordMLPackage,params,verifyPId);
|
||||
|
||||
//设计符合性流程实例id
|
||||
String designPId = projectTaskInventoryEO.getDesignPId();
|
||||
//Design Compliance Check Approvals (设计符合性确认的审批历史数据)
|
||||
setTableContent(3,wordMLPackage,params,designPId);
|
||||
|
||||
WordUtil.replaceVariable(wordMLPackage, dataMap);
|
||||
Docx4J.save(wordMLPackage, os);
|
||||
|
||||
//将替换后的文档输出出去。
|
||||
fin = new FileInputStream(outFile);
|
||||
resp.setCharacterEncoding("utf-8");
|
||||
resp.setContentType("application/docx");
|
||||
|
||||
String filename = "";
|
||||
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
|
||||
filename = "法规清单报告";
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
filename = "Compliance List report";
|
||||
}
|
||||
// 设置浏览器以下载的方式处理该文件
|
||||
if (req.getHeader("User-Agent").toUpperCase().indexOf("MSIE") > 0) {
|
||||
filename = URLEncoder.encode(filename, "UTF-8");
|
||||
} else {
|
||||
filename = new String(filename.getBytes("UTF-8"), "ISO8859-1");
|
||||
}
|
||||
resp.setHeader("Content-Disposition", "attachment;filename=" + filename + ".docx");
|
||||
out = resp.getOutputStream();
|
||||
|
||||
// 缓冲区
|
||||
byte[] buffer = new byte[512];
|
||||
int bytesToRead = -1;
|
||||
|
||||
// 通过循环将读入的Word文件的内容输出到浏览器中
|
||||
while ((bytesToRead = fin.read(buffer)) != -1) {
|
||||
out.write(buffer, 0, bytesToRead);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (fin != null){
|
||||
fin.close();
|
||||
}
|
||||
if (out != null){
|
||||
out.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (exportFile != null){
|
||||
// 删除导出去的文件
|
||||
exportFile.delete();
|
||||
}
|
||||
}
|
||||
}else {
|
||||
throw new JeroBootException("路径 :" + exportPdfTempPath + "temp/ComplianceReportTemplate.docx" + " 中没有找到文件");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置表内容
|
||||
* @param tableIndex 表的下标
|
||||
* @param wordMLPackage
|
||||
* @param params
|
||||
* @param pId 流程实例id
|
||||
*/
|
||||
public void setTableContent(int tableIndex,WordprocessingMLPackage wordMLPackage, Map<String, Object> params,String pId){
|
||||
try{
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
List<Map<String , Object>> dataList = new ArrayList<>();
|
||||
// 设置数据
|
||||
if(StringUtils.isNotEmpty(pId)){
|
||||
if(tableIndex == 1){
|
||||
QueryWrapper<ProjectTaskInventoryFeedbackEO> taskFeedbackQueryWrapper = new QueryWrapper<>();
|
||||
taskFeedbackQueryWrapper.lambda().eq(ProjectTaskInventoryFeedbackEO::getActiProcInstId,pId);
|
||||
List<ProjectTaskInventoryFeedbackEO> projectTaskInventoryFeedbackEOList = projectTaskInventoryFeedbackEOService.getBaseMapper().selectList(taskFeedbackQueryWrapper);
|
||||
if(CollectionUtils.isNotEmpty(projectTaskInventoryFeedbackEOList)){
|
||||
List<String> fileIdList = projectTaskInventoryFeedbackEOList.stream().map(ProjectTaskInventoryFeedbackEO::getFileId).distinct().collect(Collectors.toList());
|
||||
String fileId = StringUtils.join(fileIdList,",");
|
||||
List<OSSFile> fileList = iOSSFileService.getFileInfos(fileId);
|
||||
if(CollectionUtils.isNotEmpty(fileList)){
|
||||
fileList.forEach(file -> {
|
||||
Map<String,Object> fileMap = new HashMap<>();
|
||||
fileMap.put("item.fileName", StringUtils.isNotEmpty(file.getFileName()) ? file.getFileName() : "");
|
||||
fileMap.put("item.filePath", StringUtils.isNotEmpty(file.getUrl()) ? file.getUrl() : "");
|
||||
/*fileMap.put("item.fileName", file.getFileName());
|
||||
fileMap.put("item.filePath", file.getUrl());*/
|
||||
dataList.add(fileMap);
|
||||
});
|
||||
}
|
||||
}
|
||||
}else if(tableIndex == 3){
|
||||
params.put("actiProcInstId",pId);
|
||||
List<ProcessHistoryEO> processHistoryEOList = processHistoryEOService.queryList(params);
|
||||
if(CollectionUtils.isNotEmpty(processHistoryEOList)){
|
||||
processHistoryEOList.forEach(processHistory -> {
|
||||
String createTime = sdf.format(processHistory.getCreateTime());
|
||||
|
||||
Map<String,Object> designMap = new HashMap<>();
|
||||
designMap.put("design.result", StringUtils.isNotEmpty(processHistory.getReviewResult()) ? processHistory.getReviewResult() : "");
|
||||
designMap.put("design.opinion", StringUtils.isNotEmpty(processHistory.getApprovalOpinion()) ? processHistory.getApprovalOpinion() : "");
|
||||
designMap.put("design.node", StringUtils.isNotEmpty(processHistory.getName()) ? processHistory.getName() : "");
|
||||
designMap.put("design.operator", StringUtils.isNotEmpty(processHistory.getAssignee()) ? processHistory.getAssignee() :"");
|
||||
designMap.put("design.dateTime", StringUtils.isNotEmpty(createTime) ? createTime : "");
|
||||
|
||||
/*designMap.put("design.result", processHistory.getReviewResult());
|
||||
designMap.put("design.opinion", processHistory.getApprovalOpinion());
|
||||
designMap.put("design.node", processHistory.getName());
|
||||
designMap.put("design.operator", processHistory.getAssignee());
|
||||
designMap.put("design.dateTime", createTime);*/
|
||||
dataList.add(designMap);
|
||||
});
|
||||
}
|
||||
}else if(tableIndex == 4){
|
||||
params.put("actiProcInstId",pId);
|
||||
List<ProcessHistoryEO> processHistoryEOList = processHistoryEOService.queryList(params);
|
||||
if(CollectionUtils.isNotEmpty(processHistoryEOList)){
|
||||
processHistoryEOList.forEach(processHistory -> {
|
||||
String createTime = sdf.format(processHistory.getCreateTime());
|
||||
|
||||
Map<String,Object> verifyMap = new HashMap<>();
|
||||
verifyMap.put("verify.result", StringUtils.isNotEmpty(processHistory.getReviewResult()) ? processHistory.getReviewResult() : "");
|
||||
verifyMap.put("verify.opinion", StringUtils.isNotEmpty(processHistory.getApprovalOpinion()) ? processHistory.getApprovalOpinion() : "");
|
||||
verifyMap.put("verify.node", StringUtils.isNotEmpty(processHistory.getName()) ? processHistory.getName() : "");
|
||||
verifyMap.put("verify.operator", StringUtils.isNotEmpty(processHistory.getAssignee()) ? processHistory.getAssignee() :"");
|
||||
verifyMap.put("verify.dateTime", StringUtils.isNotEmpty(createTime) ? createTime : "");
|
||||
|
||||
/*verifyMap.put("verify.result", processHistory.getReviewResult());
|
||||
verifyMap.put("verify.opinion", processHistory.getApprovalOpinion());
|
||||
verifyMap.put("verify.node", processHistory.getName());
|
||||
verifyMap.put("verify.operator", processHistory.getAssignee());
|
||||
verifyMap.put("verify.dateTime", createTime);*/
|
||||
dataList.add(verifyMap);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//构造循环列表的数据
|
||||
ClassFinder find = new ClassFinder(Tbl.class);
|
||||
new TraversalUtil(wordMLPackage.getMainDocumentPart().getContent(), find);
|
||||
Tbl table = (Tbl) find.results.get(tableIndex);
|
||||
//第二行约定为模板
|
||||
Tr dynamicTr = (Tr) table.getContent().get(1);
|
||||
//获取模板行的xml数据
|
||||
String dynamicTrXml = XmlUtils.marshaltoString(dynamicTr);
|
||||
|
||||
for (Map<String, Object> mapList : dataList) {
|
||||
Tr newTr = (Tr) XmlUtils.unmarshallFromTemplate(dynamicTrXml, mapList);//填充模板行数据
|
||||
table.getContent().add(newTr);
|
||||
}
|
||||
//删除模板行的占位行
|
||||
table.getContent().remove(1);
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static WordprocessingMLPackage getTemplate(String name)throws Docx4JException,FileNotFoundException {
|
||||
WordprocessingMLPackage template = WordprocessingMLPackage.load(new FileInputStream(new File(name)));
|
||||
return template;
|
||||
}
|
||||
}
|
||||
|
||||
+40
-17
@@ -109,7 +109,10 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
String yearNameId = projectLibraryBase.getYearNameId();
|
||||
String targetMarket = projectLibraryBase.getTargetMarket();
|
||||
QueryWrapper<ProjectLibraryBase> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("project_name_id",projectNameId).eq("year_name_id",yearNameId).eq("target_market",targetMarket);
|
||||
queryWrapper.eq("project_name_id",projectNameId)
|
||||
.eq("year_name_id",yearNameId)
|
||||
.eq("target_market",targetMarket)
|
||||
.ne("id",projectLibraryBase.getId());
|
||||
Integer count = projectLibraryBaseMapper.selectCount(queryWrapper);
|
||||
if (count > 0) {
|
||||
if(CutEnum.CN.getValue().equals(projectLibraryBase.getCut())) {
|
||||
@@ -258,6 +261,16 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
//认证进度
|
||||
Map<String,Object> certificationProgressMap = new HashMap<>();
|
||||
|
||||
//清单确认统计
|
||||
List<Map<String,Object>> listingToConfirmMapList = this.projectLawsInventoryEOMapper.getlistingToConfirmStatistics(id);
|
||||
listingToConfirmMap.put("listingToConfirmMapList",listingToConfirmMapList);
|
||||
result.put("listingToConfirmMap",listingToConfirmMap);
|
||||
|
||||
//任务确认统计
|
||||
List<Map<String,Object>> taskToConfirmMapList = this.projectLawsInventoryEOMapper.getTaskToConfirmStatistics(id);
|
||||
taskToConfirmMap.put("taskToConfirmMapList",taskToConfirmMapList);
|
||||
result.put("taskToConfirmMap",taskToConfirmMap);
|
||||
|
||||
QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrapper = new QueryWrapper<>();
|
||||
lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,id);
|
||||
lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.ACCEPTED.getValue());
|
||||
@@ -292,16 +305,6 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
currentProjectStatusMap.put("currentProjectStatusTotal",currentProjectStatusTotal);
|
||||
result.put("currentProjectStatusMap",currentProjectStatusMap);
|
||||
|
||||
//清单确认统计
|
||||
List<Map<String,Object>> listingToConfirmMapList = this.projectLawsInventoryEOMapper.getlistingToConfirmStatistics(id);
|
||||
listingToConfirmMap.put("listingToConfirmMapList",listingToConfirmMapList);
|
||||
result.put("listingToConfirmMap",listingToConfirmMap);
|
||||
|
||||
//任务确认统计
|
||||
List<Map<String,Object>> taskToConfirmMapList = this.projectLawsInventoryEOMapper.getTaskToConfirmStatistics(id);
|
||||
taskToConfirmMap.put("taskToConfirmMapList",taskToConfirmMapList);
|
||||
result.put("taskToConfirmMap",taskToConfirmMap);
|
||||
|
||||
//设计符合性
|
||||
List<Map<String,Object>> designComplianceMapList = this.projectTaskInventoryEOMapper.getDesignComplianceStatistice(projectLawsInventoryIdList);
|
||||
designComplianceMap.put("designComplianceMapList",designComplianceMapList);
|
||||
@@ -523,14 +526,34 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
* @param cut
|
||||
*/
|
||||
public void disposeData(List<Map<String,Object>> datas,String cut){
|
||||
List<SysDictItem> dictItemList = sysDictItemServiceImpl.selectItemsByDictCode("duty_territory");
|
||||
List<SysDictItem> dutyTerritoryList = sysDictItemServiceImpl.selectItemsByDictCode("duty_territory");
|
||||
if(CollectionUtils.isNotEmpty(datas)){
|
||||
for (Map<String, Object> data : datas) {
|
||||
List<SysDictItem> dutyTerritory = dictItemList.stream().filter(dict -> StringUtils.equals(dict.getItemValue(), data.get("dutyTerritory").toString())).collect(Collectors.toList());
|
||||
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
|
||||
data.put("dutyTerritory",dutyTerritory.get(0).getItemText());
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
data.put("dutyTerritory",dutyTerritory.get(0).getEnName());
|
||||
if(data.get("dutyTerritory") != null){
|
||||
String[] dutyTerritorieArr = data.get("dutyTerritory").toString().split(",");
|
||||
String dutyTerritories = "";
|
||||
for (String dutyTerritorie : dutyTerritorieArr) {
|
||||
List<String> collect = new ArrayList<>();
|
||||
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
|
||||
collect = dutyTerritoryList.stream()
|
||||
.filter(e -> StringUtils.equals(dutyTerritorie, e.getItemValue()))
|
||||
.map(SysDictItem::getItemText)
|
||||
.collect(Collectors.toList());
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
collect = dutyTerritoryList.stream()
|
||||
.filter(e -> StringUtils.equals(dutyTerritorie, e.getItemValue()))
|
||||
.map(SysDictItem::getEnName)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(collect)){
|
||||
dutyTerritories += collect.get(0) + ",";
|
||||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(dutyTerritories)){
|
||||
dutyTerritories = dutyTerritories.substring(0,dutyTerritories.length()-1);
|
||||
}
|
||||
data.put("dutyTerritory",dutyTerritories);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
package com.jero.modules.project.util;
|
||||
|
||||
|
||||
import org.docx4j.XmlUtils;
|
||||
import org.docx4j.jaxb.Context;
|
||||
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
|
||||
import org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart;
|
||||
import org.docx4j.wml.Document;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 关于文件操作的工具类
|
||||
*
|
||||
* @author kaizen
|
||||
* @date 2018-10-23 17:21:36
|
||||
*/
|
||||
public final class Docx4jUtils {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(Docx4jUtils.class);
|
||||
|
||||
/**
|
||||
* 替换变量并下载word文档
|
||||
*
|
||||
* @param inputStream
|
||||
* @param map
|
||||
* @param response
|
||||
* @param fileName
|
||||
*/
|
||||
public static void downloadDocUseDoc4j(InputStream inputStream, Map<String, String> map,
|
||||
HttpServletResponse response, String fileName) {
|
||||
|
||||
try {
|
||||
// 设置响应头
|
||||
fileName = URLEncoder.encode(fileName, "UTF-8");
|
||||
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=" + fileName + ".docx");
|
||||
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
||||
|
||||
OutputStream outs = response.getOutputStream();
|
||||
Docx4jUtils.replaceDocUseDoc4j(inputStream,map,outs);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换变量并输出word文档
|
||||
* @param inputStream
|
||||
* @param map
|
||||
* @param outputStream
|
||||
*/
|
||||
public static void replaceDocUseDoc4j(InputStream inputStream, Map<String, String> map,
|
||||
OutputStream outputStream) {
|
||||
try {
|
||||
WordprocessingMLPackage doc = WordprocessingMLPackage.load(inputStream);
|
||||
MainDocumentPart mainDocumentPart = doc.getMainDocumentPart();
|
||||
if (null != map && !map.isEmpty()) {
|
||||
// 将${}里的内容结构层次替换为一层
|
||||
Docx4jUtils .cleanDocumentPart(mainDocumentPart);
|
||||
// 替换文本内容
|
||||
mainDocumentPart.variableReplace((HashMap<String, String>) map);
|
||||
}
|
||||
|
||||
// 输出word文件
|
||||
doc.save(outputStream);
|
||||
outputStream.flush();
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* cleanDocumentPart
|
||||
*
|
||||
* @param documentPart
|
||||
*/
|
||||
public static boolean cleanDocumentPart(MainDocumentPart documentPart) throws Exception {
|
||||
if (documentPart == null) {
|
||||
return false;
|
||||
}
|
||||
Document document = documentPart.getContents();
|
||||
String wmlTemplate =
|
||||
XmlUtils.marshaltoString(document, true, false, Context.jc);
|
||||
document = (Document) XmlUtils.unwrap(DocxVariableClearUtils.doCleanDocumentPart(wmlTemplate, Context.jc));
|
||||
documentPart.setContents(document);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清扫 docx4j 模板变量字符,通常以${variable}形式
|
||||
* <p>
|
||||
* XXX: 主要在上传模板时处理一下, 后续
|
||||
*
|
||||
* @author liliang
|
||||
* @since 2018-11-07
|
||||
*/
|
||||
private static class DocxVariableClearUtils {
|
||||
|
||||
|
||||
/**
|
||||
* 去任意XML标签
|
||||
*/
|
||||
private static final Pattern XML_PATTERN = Pattern.compile("<[^>]*>");
|
||||
|
||||
private DocxVariableClearUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* start符号
|
||||
*/
|
||||
private static final char PREFIX = '$';
|
||||
|
||||
/**
|
||||
* 中包含
|
||||
*/
|
||||
private static final char LEFT_BRACE = '{';
|
||||
|
||||
/**
|
||||
* 结尾
|
||||
*/
|
||||
private static final char RIGHT_BRACE = '}';
|
||||
|
||||
/**
|
||||
* 未开始
|
||||
*/
|
||||
private static final int NONE_START = -1;
|
||||
|
||||
/**
|
||||
* 未开始
|
||||
*/
|
||||
private static final int NONE_START_INDEX = -1;
|
||||
|
||||
/**
|
||||
* 开始
|
||||
*/
|
||||
private static final int PREFIX_STATUS = 1;
|
||||
|
||||
/**
|
||||
* 左括号
|
||||
*/
|
||||
private static final int LEFT_BRACE_STATUS = 2;
|
||||
|
||||
/**
|
||||
* 右括号
|
||||
*/
|
||||
private static final int RIGHT_BRACE_STATUS = 3;
|
||||
|
||||
|
||||
/**
|
||||
* doCleanDocumentPart
|
||||
*
|
||||
* @param wmlTemplate
|
||||
* @param jc
|
||||
* @return
|
||||
* @throws JAXBException
|
||||
*/
|
||||
private static Object doCleanDocumentPart(String wmlTemplate, JAXBContext jc) throws JAXBException {
|
||||
// 进入变量块位置
|
||||
int curStatus = NONE_START;
|
||||
// 开始位置
|
||||
int keyStartIndex = NONE_START_INDEX;
|
||||
// 当前位置
|
||||
int curIndex = 0;
|
||||
char[] textCharacters = wmlTemplate.toCharArray();
|
||||
StringBuilder documentBuilder = new StringBuilder(textCharacters.length);
|
||||
documentBuilder.append(textCharacters);
|
||||
// 新文档
|
||||
StringBuilder newDocumentBuilder = new StringBuilder(textCharacters.length);
|
||||
// 最后一次写位置
|
||||
int lastWriteIndex = 0;
|
||||
for (char c : textCharacters) {
|
||||
switch (c) {
|
||||
case PREFIX:
|
||||
// TODO 不管其何状态直接修改指针,这也意味着变量名称里面不能有PREFIX
|
||||
keyStartIndex = curIndex;
|
||||
curStatus = PREFIX_STATUS;
|
||||
break;
|
||||
case LEFT_BRACE:
|
||||
if (curStatus == PREFIX_STATUS) {
|
||||
curStatus = LEFT_BRACE_STATUS;
|
||||
}
|
||||
break;
|
||||
case RIGHT_BRACE:
|
||||
if (curStatus == LEFT_BRACE_STATUS) {
|
||||
// 接上之前的字符
|
||||
newDocumentBuilder.append(documentBuilder.substring(lastWriteIndex, keyStartIndex));
|
||||
// 结束位置
|
||||
int keyEndIndex = curIndex + 1;
|
||||
// 替换
|
||||
String rawKey = documentBuilder.substring(keyStartIndex, keyEndIndex);
|
||||
// 干掉多余标签
|
||||
String mappingKey = XML_PATTERN.matcher(rawKey).replaceAll("");
|
||||
if (!mappingKey.equals(rawKey)) {
|
||||
char[] rawKeyChars = rawKey.toCharArray();
|
||||
// 保留原格式
|
||||
StringBuilder rawStringBuilder = new StringBuilder(rawKey.length());
|
||||
// 去掉变量引用字符
|
||||
for (char rawChar : rawKeyChars) {
|
||||
if (rawChar == PREFIX || rawChar == LEFT_BRACE || rawChar == RIGHT_BRACE) {
|
||||
continue;
|
||||
}
|
||||
rawStringBuilder.append(rawChar);
|
||||
}
|
||||
// FIXME 要求变量连在一起
|
||||
String variable = mappingKey.substring(2, mappingKey.length() - 1);
|
||||
int variableStart = rawStringBuilder.indexOf(variable);
|
||||
if (variableStart > 0) {
|
||||
rawStringBuilder = rawStringBuilder.replace(variableStart, variableStart + variable.length(), mappingKey);
|
||||
}
|
||||
newDocumentBuilder.append(rawStringBuilder.toString());
|
||||
} else {
|
||||
newDocumentBuilder.append(mappingKey);
|
||||
}
|
||||
lastWriteIndex = keyEndIndex;
|
||||
|
||||
curStatus = NONE_START;
|
||||
keyStartIndex = NONE_START_INDEX;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
curIndex++;
|
||||
}
|
||||
// 余部
|
||||
if (lastWriteIndex < documentBuilder.length()) {
|
||||
newDocumentBuilder.append(documentBuilder.substring(lastWriteIndex));
|
||||
}
|
||||
return XmlUtils.unmarshalString(newDocumentBuilder.toString(), jc);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+315
@@ -0,0 +1,315 @@
|
||||
package com.jero.modules.project.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.docx4j.Docx4J;
|
||||
import org.docx4j.TraversalUtil;
|
||||
import org.docx4j.XmlUtils;
|
||||
import org.docx4j.convert.out.FOSettings;
|
||||
import org.docx4j.convert.out.HTMLSettings;
|
||||
import org.docx4j.dml.wordprocessingDrawing.Inline;
|
||||
import org.docx4j.finders.ClassFinder;
|
||||
import org.docx4j.finders.RangeFinder;
|
||||
import org.docx4j.fonts.IdentityPlusMapper;
|
||||
import org.docx4j.fonts.Mapper;
|
||||
import org.docx4j.fonts.PhysicalFonts;
|
||||
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
|
||||
import org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage;
|
||||
import org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart;
|
||||
import org.docx4j.wml.Body;
|
||||
import org.docx4j.wml.CTBookmark;
|
||||
import org.docx4j.wml.Document;
|
||||
import org.docx4j.wml.Drawing;
|
||||
import org.docx4j.wml.ObjectFactory;
|
||||
import org.docx4j.wml.P;
|
||||
import org.docx4j.wml.R;
|
||||
import org.docx4j.wml.Tbl;
|
||||
import org.docx4j.wml.Text;
|
||||
import org.docx4j.wml.Tr;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
|
||||
public class WordUtil {
|
||||
private static final Logger log = LoggerFactory.getLogger(WordUtil.class);
|
||||
|
||||
public WordUtil() {
|
||||
}
|
||||
|
||||
public static void replaceVariable(String templatePath, Map<String, String> map, String outPath) throws Exception {
|
||||
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new File(templatePath));
|
||||
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
|
||||
Docx4jUtils.cleanDocumentPart(documentPart);
|
||||
documentPart.variableReplace((HashMap<String, String>) map);
|
||||
Docx4J.save(wordMLPackage, new File(outPath));
|
||||
}
|
||||
|
||||
public static void replaceVariable(InputStream inputStream, Map<String, String> map, OutputStream outputStream) throws Exception {
|
||||
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(inputStream);
|
||||
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
|
||||
Docx4jUtils.cleanDocumentPart(documentPart);
|
||||
documentPart.variableReplace((HashMap<String, String>) map);
|
||||
Docx4J.save(wordMLPackage, outputStream);
|
||||
}
|
||||
|
||||
public static void replaceVariable(WordprocessingMLPackage wordMLPackage, Map<String, String> map) throws Exception {
|
||||
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
|
||||
Docx4jUtils.cleanDocumentPart(documentPart);
|
||||
documentPart.variableReplace((HashMap<String, String>) map);
|
||||
}
|
||||
|
||||
public static void replaceTable(String templatePath, int tableNum, int rowNum, List<Map<String, Object>> dataList, String outPath) throws Exception {
|
||||
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new File(templatePath));
|
||||
MainDocumentPart mainDocumentPart = wordMLPackage.getMainDocumentPart();
|
||||
Docx4jUtils.cleanDocumentPart(mainDocumentPart);
|
||||
ClassFinder find = new ClassFinder(Tbl.class);
|
||||
new TraversalUtil(mainDocumentPart.getContent(), find);
|
||||
Tbl table = (Tbl)find.results.get(tableNum - 1);
|
||||
Tr dynamicTr = (Tr)table.getContent().get(rowNum - 1);
|
||||
String dynamicTrXml = XmlUtils.marshaltoString(dynamicTr);
|
||||
Iterator var11 = dataList.iterator();
|
||||
|
||||
while(var11.hasNext()) {
|
||||
Map<String, Object> dataMap = (Map)var11.next();
|
||||
Tr newTr = (Tr)XmlUtils.unmarshallFromTemplate(dynamicTrXml, dataMap);
|
||||
table.getContent().add(newTr);
|
||||
}
|
||||
|
||||
table.getContent().remove(rowNum - 1);
|
||||
Docx4J.save(wordMLPackage, new File(outPath));
|
||||
}
|
||||
|
||||
public static void replaceTable(InputStream inputStream, int tableNum, int rowNum, List<Map<String, Object>> dataList, OutputStream outputStream) throws Exception {
|
||||
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(inputStream);
|
||||
MainDocumentPart mainDocumentPart = wordMLPackage.getMainDocumentPart();
|
||||
Docx4jUtils.cleanDocumentPart(mainDocumentPart);
|
||||
ClassFinder find = new ClassFinder(Tbl.class);
|
||||
new TraversalUtil(mainDocumentPart.getContent(), find);
|
||||
Tbl table = (Tbl)find.results.get(tableNum - 1);
|
||||
Tr dynamicTr = (Tr)table.getContent().get(rowNum - 1);
|
||||
String dynamicTrXml = XmlUtils.marshaltoString(dynamicTr);
|
||||
Iterator var11 = dataList.iterator();
|
||||
|
||||
while(var11.hasNext()) {
|
||||
Map<String, Object> dataMap = (Map)var11.next();
|
||||
Tr newTr = (Tr)XmlUtils.unmarshallFromTemplate(dynamicTrXml, dataMap);
|
||||
table.getContent().add(newTr);
|
||||
}
|
||||
|
||||
table.getContent().remove(rowNum - 1);
|
||||
Docx4J.save(wordMLPackage, outputStream);
|
||||
}
|
||||
|
||||
public static void replaceTable(WordprocessingMLPackage wordMLPackage, int tableNum, int rowNum, List<Map<String, Object>> dataList) throws Exception {
|
||||
MainDocumentPart mainDocumentPart = wordMLPackage.getMainDocumentPart();
|
||||
Docx4jUtils.cleanDocumentPart(mainDocumentPart);
|
||||
ClassFinder find = new ClassFinder(Tbl.class);
|
||||
new TraversalUtil(mainDocumentPart.getContent(), find);
|
||||
Tbl table = (Tbl)find.results.get(tableNum - 1);
|
||||
Tr dynamicTr = (Tr)table.getContent().get(rowNum - 1);
|
||||
String dynamicTrXml = XmlUtils.marshaltoString(dynamicTr);
|
||||
Iterator var9 = dataList.iterator();
|
||||
|
||||
while(var9.hasNext()) {
|
||||
Map<String, Object> dataMap = (Map)var9.next();
|
||||
Tr newTr = (Tr)XmlUtils.unmarshallFromTemplate(dynamicTrXml, dataMap);
|
||||
table.getContent().add(newTr);
|
||||
}
|
||||
|
||||
table.getContent().remove(rowNum - 1);
|
||||
}
|
||||
|
||||
public static void replacePicture(WordprocessingMLPackage wordMLPackage, String bookmarkName, InputStream inputStream) throws Exception {
|
||||
try {
|
||||
MainDocumentPart mainDocumentPart = wordMLPackage.getMainDocumentPart();
|
||||
Document wmlDoc = (Document)mainDocumentPart.getJaxbElement();
|
||||
Body body = wmlDoc.getBody();
|
||||
List<Object> paragraphs = body.getContent();
|
||||
RangeFinder rt = new RangeFinder("CTBookmark", "CTMarkupRange");
|
||||
new TraversalUtil(paragraphs, rt);
|
||||
Iterator var8 = rt.getStarts().iterator();
|
||||
|
||||
while(var8.hasNext()) {
|
||||
CTBookmark bm = (CTBookmark)var8.next();
|
||||
if (bm.getName().equals(bookmarkName)) {
|
||||
byte[] bytes = IOUtils.toByteArray(inputStream);
|
||||
BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(wordMLPackage, bytes);
|
||||
Inline inline = imagePart.createImageInline("", "", 0, 1, true);
|
||||
P p = (P)((P)bm.getParent());
|
||||
ObjectFactory factory = new ObjectFactory();
|
||||
R run = factory.createR();
|
||||
Drawing drawing = factory.createDrawing();
|
||||
drawing.getAnchorOrInline().add(inline);
|
||||
run.getContent().add(drawing);
|
||||
p.getContent().add(run);
|
||||
}
|
||||
}
|
||||
} catch (Exception var17) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void replaceForTemplate(String templatePath, Map<String, String> map, int tableNum, List<Map<String, Object>> dataList, String outPath) throws Exception {
|
||||
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new File(templatePath));
|
||||
MainDocumentPart mainDocumentPart = wordMLPackage.getMainDocumentPart();
|
||||
Docx4jUtils.cleanDocumentPart(mainDocumentPart);
|
||||
ClassFinder find = new ClassFinder(Tbl.class);
|
||||
new TraversalUtil(mainDocumentPart.getContent(), find);
|
||||
Tbl table = (Tbl)find.results.get(tableNum - 1);
|
||||
Tr dynamicTr = (Tr)table.getContent().get(1);
|
||||
String dynamicTrXml = XmlUtils.marshaltoString(dynamicTr);
|
||||
Iterator var11 = dataList.iterator();
|
||||
|
||||
while(var11.hasNext()) {
|
||||
Map<String, Object> dataMap = (Map)var11.next();
|
||||
Tr newTr = (Tr)XmlUtils.unmarshallFromTemplate(dynamicTrXml, dataMap);
|
||||
table.getContent().add(newTr);
|
||||
}
|
||||
|
||||
table.getContent().remove(1);
|
||||
wordMLPackage.getMainDocumentPart().variableReplace((HashMap<String, String>) map);
|
||||
Docx4J.save(wordMLPackage, new File(outPath));
|
||||
}
|
||||
|
||||
public static void replaceForTemplate(InputStream inputStream, Map<String, String> map, int tableNum, List<Map<String, Object>> dataList, OutputStream outputStream) throws Exception {
|
||||
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(inputStream);
|
||||
MainDocumentPart mainDocumentPart = wordMLPackage.getMainDocumentPart();
|
||||
Docx4jUtils.cleanDocumentPart(mainDocumentPart);
|
||||
ClassFinder find = new ClassFinder(Tbl.class);
|
||||
new TraversalUtil(mainDocumentPart.getContent(), find);
|
||||
Tbl table = (Tbl)find.results.get(tableNum - 1);
|
||||
Tr dynamicTr = (Tr)table.getContent().get(1);
|
||||
String dynamicTrXml = XmlUtils.marshaltoString(dynamicTr);
|
||||
Iterator var11 = dataList.iterator();
|
||||
|
||||
while(var11.hasNext()) {
|
||||
Map<String, Object> dataMap = (Map)var11.next();
|
||||
Tr newTr = (Tr)XmlUtils.unmarshallFromTemplate(dynamicTrXml, dataMap);
|
||||
table.getContent().add(newTr);
|
||||
}
|
||||
|
||||
table.getContent().remove(1);
|
||||
wordMLPackage.getMainDocumentPart().variableReplace((HashMap<String, String>) map);
|
||||
Docx4J.save(wordMLPackage, outputStream);
|
||||
}
|
||||
|
||||
public static void toPDF(InputStream inputStream, OutputStream outputStream) throws Exception {
|
||||
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(inputStream);
|
||||
Mapper fontMapper = new IdentityPlusMapper();
|
||||
wordMLPackage.setFontMapper(fontMapper);
|
||||
fontMapper.put("隶书", PhysicalFonts.get("LiSu"));
|
||||
fontMapper.put("宋体", PhysicalFonts.get("SimSun"));
|
||||
fontMapper.put("微软雅黑", PhysicalFonts.get("Microsoft Yahei"));
|
||||
fontMapper.put("黑体", PhysicalFonts.get("SimHei"));
|
||||
fontMapper.put("楷体", PhysicalFonts.get("KaiTi"));
|
||||
fontMapper.put("新宋体", PhysicalFonts.get("NSimSun"));
|
||||
fontMapper.put("华文行楷", PhysicalFonts.get("STXingkai"));
|
||||
fontMapper.put("华文仿宋", PhysicalFonts.get("STFangsong"));
|
||||
fontMapper.put("宋体扩展", PhysicalFonts.get("simsun-extB"));
|
||||
fontMapper.put("仿宋", PhysicalFonts.get("FangSong"));
|
||||
fontMapper.put("仿宋_GB2312", PhysicalFonts.get("FangSong_GB2312"));
|
||||
fontMapper.put("幼圆", PhysicalFonts.get("YouYuan"));
|
||||
fontMapper.put("华文宋体", PhysicalFonts.get("STSong"));
|
||||
fontMapper.put("华文中宋", PhysicalFonts.get("STZhongsong"));
|
||||
FOSettings foSettings = Docx4J.createFOSettings();
|
||||
foSettings.setWmlPackage(wordMLPackage);
|
||||
Docx4J.toFO(foSettings, outputStream, 1);
|
||||
}
|
||||
|
||||
public static void toPDF(WordprocessingMLPackage wordMLPackage, OutputStream outputStream) throws Exception {
|
||||
Mapper fontMapper = new IdentityPlusMapper();
|
||||
wordMLPackage.setFontMapper(fontMapper);
|
||||
fontMapper.put("隶书", PhysicalFonts.get("LiSu"));
|
||||
fontMapper.put("宋体", PhysicalFonts.get("SimSun"));
|
||||
fontMapper.put("微软雅黑", PhysicalFonts.get("Microsoft Yahei"));
|
||||
fontMapper.put("黑体", PhysicalFonts.get("SimHei"));
|
||||
fontMapper.put("楷体", PhysicalFonts.get("KaiTi"));
|
||||
fontMapper.put("新宋体", PhysicalFonts.get("NSimSun"));
|
||||
fontMapper.put("华文行楷", PhysicalFonts.get("STXingkai"));
|
||||
fontMapper.put("华文仿宋", PhysicalFonts.get("STFangsong"));
|
||||
fontMapper.put("宋体扩展", PhysicalFonts.get("simsun-extB"));
|
||||
fontMapper.put("仿宋", PhysicalFonts.get("FangSong"));
|
||||
fontMapper.put("仿宋_GB2312", PhysicalFonts.get("FangSong_GB2312"));
|
||||
fontMapper.put("幼圆", PhysicalFonts.get("YouYuan"));
|
||||
fontMapper.put("华文宋体", PhysicalFonts.get("STSong"));
|
||||
fontMapper.put("华文中宋", PhysicalFonts.get("STZhongsong"));
|
||||
FOSettings foSettings = Docx4J.createFOSettings();
|
||||
foSettings.setWmlPackage(wordMLPackage);
|
||||
Docx4J.toFO(foSettings, outputStream, 1);
|
||||
}
|
||||
|
||||
public static void toHTML(InputStream inputStream, OutputStream outputStream) throws Exception {
|
||||
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(inputStream);
|
||||
HTMLSettings htmlSettings = Docx4J.createHTMLSettings();
|
||||
String folder = "optimages";
|
||||
htmlSettings.setImageDirPath(folder);
|
||||
htmlSettings.setImageTargetUri("images");
|
||||
htmlSettings.setWmlPackage(wordMLPackage);
|
||||
Docx4J.toHTML(htmlSettings, outputStream, 0);
|
||||
}
|
||||
|
||||
public static void toHTML(WordprocessingMLPackage wordMLPackage, OutputStream outputStream) throws Exception {
|
||||
HTMLSettings htmlSettings = Docx4J.createHTMLSettings();
|
||||
String folder = "optimages";
|
||||
htmlSettings.setImageDirPath(folder);
|
||||
htmlSettings.setImageTargetUri("images");
|
||||
htmlSettings.setWmlPackage(wordMLPackage);
|
||||
Docx4J.toHTML(htmlSettings, outputStream, 0);
|
||||
}
|
||||
|
||||
private static void addImageInlineToPackage(WordprocessingMLPackage wordMLPackage, byte[] bytes) throws Exception {
|
||||
BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(wordMLPackage, bytes);
|
||||
int docPrId = 1;
|
||||
int cNvPrId = 2;
|
||||
Inline inline = imagePart.createImageInline("Filename hint", "Alternative text", docPrId, cNvPrId, false);
|
||||
ObjectFactory factory = new ObjectFactory();
|
||||
P paragraph = factory.createP();
|
||||
R run = factory.createR();
|
||||
paragraph.getContent().add(run);
|
||||
Drawing drawing = factory.createDrawing();
|
||||
run.getContent().add(drawing);
|
||||
drawing.getAnchorOrInline().add(inline);
|
||||
wordMLPackage.getMainDocumentPart().addObject(paragraph);
|
||||
}
|
||||
|
||||
private static void addImageInlineAndTextToPackage(WordprocessingMLPackage wordMLPackage, byte[] bytes, String text) throws Exception {
|
||||
BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(wordMLPackage, bytes);
|
||||
int docPrId = 1;
|
||||
int cNvPrId = 2;
|
||||
Inline inline = imagePart.createImageInline("Filename hint", "Alternative text", docPrId, cNvPrId, false);
|
||||
ObjectFactory factory = new ObjectFactory();
|
||||
P paragraph = factory.createP();
|
||||
R run = factory.createR();
|
||||
paragraph.getContent().add(run);
|
||||
if (text != null) {
|
||||
Text txt = factory.createText();
|
||||
txt.setValue(text);
|
||||
txt.setSpace("preserve");
|
||||
run.getContent().add(txt);
|
||||
}
|
||||
|
||||
Drawing drawing = factory.createDrawing();
|
||||
run.getContent().add(drawing);
|
||||
drawing.getAnchorOrInline().add(inline);
|
||||
wordMLPackage.getMainDocumentPart().addObject(paragraph);
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
File file = new File("d:" + File.separator + "opt" + File.separator + "template" + File.separator + "请假条_template.docx");
|
||||
InputStream is = new FileInputStream(file);
|
||||
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(is);
|
||||
File png = new File("d:" + File.separator + "opt" + File.separator + "template" + File.separator + "badge.png");
|
||||
byte[] bytes = FileCopyUtils.copyToByteArray(new FileInputStream(png));
|
||||
addImageInlineToPackage(wordMLPackage, bytes);
|
||||
addImageInlineAndTextToPackage(wordMLPackage, bytes, "这是图3,name.png,看图片的嵌入方式");
|
||||
wordMLPackage.save(new File("d:/opt/测试" + System.currentTimeMillis() + ".docx"));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -25,6 +25,6 @@ public interface OnlCgformAreaMapper extends BaseMapper<OnlCgformArea> {
|
||||
"a.is_model,i.item_text as is_model_name,i.en_name as is_model_en_name,a.show_area,a.sort,a.en_name\n" +
|
||||
"from onl_cgform_area as a left join sys_dict_item as i \n" +
|
||||
"on a.is_model=i.item_value \n" +
|
||||
"where i.dict_id=1493096744092102657 order by a.create_time desc")
|
||||
"where i.dict_id=1493096744092102657 order by a.sort desc")
|
||||
IPage<OnlCgformArea> queryPageList(IPage page, @Param("params") Map<String,Object> params);
|
||||
}
|
||||
|
||||
+1
-1
@@ -70,6 +70,6 @@
|
||||
<if test="params.showArea != null and params.showArea != '' ">
|
||||
and f.show_area like concat('%',#{params.showArea},'%')
|
||||
</if>
|
||||
order by f.create_time desc
|
||||
order by f.order_num desc
|
||||
</select>
|
||||
</mapper>
|
||||
+58
@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 区域管理表
|
||||
@@ -43,6 +44,34 @@ public class OnlCgformAreaServiceImpl extends ServiceImpl<OnlCgformAreaMapper, O
|
||||
*/
|
||||
@Override
|
||||
public void add(OnlCgformArea onlCgformArea) {
|
||||
Integer inputSort = onlCgformArea.getSort();
|
||||
//查询展示顺序相同的
|
||||
QueryWrapper<OnlCgformArea> queryWrapper= new QueryWrapper<>();
|
||||
queryWrapper.orderByAsc("sort");
|
||||
queryWrapper.eq("sort", inputSort);
|
||||
Integer orderNumCount = onlCgformAreaMapper.selectCount(queryWrapper);
|
||||
if(orderNumCount > 0) {//有重复展示顺序的,后面的号全+1
|
||||
//设置排序
|
||||
QueryWrapper<OnlCgformArea> orderNumQueryWrapper = new QueryWrapper<>();
|
||||
orderNumQueryWrapper.ge("sort", inputSort)
|
||||
.orderByAsc("sort");
|
||||
List<OnlCgformArea> geSortList = list(orderNumQueryWrapper);
|
||||
|
||||
//判断相邻的序号,去掉不邻的
|
||||
for(int i = 0 ; i <= geSortList.size() ; i++) {
|
||||
if (geSortList.size()==1){
|
||||
break;
|
||||
}else if (geSortList.get(i + 1).getSort() - geSortList.get(i).getSort() > 1) {
|
||||
int deleteStart = geSortList.get(i+1).getSort();
|
||||
geSortList = geSortList.stream().filter(e->e.getSort() < deleteStart).collect(Collectors.toList());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
geSortList.stream().forEach(e -> e.setSort(e.getSort() + 1));
|
||||
saveOrUpdateBatch(geSortList);
|
||||
}
|
||||
|
||||
Date now = new Date();
|
||||
onlCgformArea.setCreateTime(now);
|
||||
onlCgformArea.setUpdateTime(now);
|
||||
@@ -71,6 +100,35 @@ public class OnlCgformAreaServiceImpl extends ServiceImpl<OnlCgformAreaMapper, O
|
||||
*/
|
||||
@Override
|
||||
public void editById(OnlCgformArea onlCgformArea) {
|
||||
Integer inputSort = onlCgformArea.getSort();
|
||||
//查询展示顺序相同的
|
||||
QueryWrapper<OnlCgformArea> queryWrapper= new QueryWrapper<>();
|
||||
queryWrapper.orderByAsc("sort");
|
||||
Integer orderNumData = list(queryWrapper).stream().filter(e->e.getId().equals(onlCgformArea.getId()))
|
||||
.map(e -> e.getSort()).collect(Collectors.toList()).get(0);
|
||||
queryWrapper.eq("sort", inputSort);
|
||||
Integer orderNumCount = onlCgformAreaMapper.selectCount(queryWrapper);
|
||||
if(orderNumCount > 0 && !orderNumData.equals(inputSort)) {//有重复展示顺序的,后面的号全+1
|
||||
//设置排序
|
||||
QueryWrapper<OnlCgformArea> orderNumQueryWrapper = new QueryWrapper<>();
|
||||
orderNumQueryWrapper.ge("sort", inputSort)
|
||||
.orderByAsc("sort");
|
||||
List<OnlCgformArea> geSortList = list(orderNumQueryWrapper);
|
||||
|
||||
//判断相邻的序号,去掉不邻的
|
||||
for(int i = 0 ; i <= geSortList.size() ; i++) {
|
||||
if (geSortList.size()==1){
|
||||
break;
|
||||
}else if (geSortList.get(i + 1).getSort() - geSortList.get(i).getSort() > 1) {
|
||||
int deleteStart = geSortList.get(i+1).getSort();
|
||||
geSortList = geSortList.stream().filter(e->e.getSort() < deleteStart).collect(Collectors.toList());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
geSortList.stream().forEach(e -> e.setSort(e.getSort() + 1));
|
||||
saveOrUpdateBatch(geSortList);
|
||||
}
|
||||
Date now = new Date();
|
||||
onlCgformArea.setUpdateTime(now);
|
||||
saveOrUpdate(onlCgformArea);
|
||||
|
||||
+69
@@ -2,6 +2,7 @@ package com.jero.modules.tag.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -28,6 +29,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 标签管理
|
||||
@@ -57,11 +59,43 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
*/
|
||||
@Override
|
||||
public void add(OnlCgformTag onlCgformTag) {
|
||||
|
||||
//校验--逻辑删除
|
||||
Integer count=queryExitData(onlCgformTag);
|
||||
if (count > 0) {
|
||||
onlCgformTag.setIsDelete(CommonConstant.DEL_FLAG_0);
|
||||
} else {
|
||||
Integer inputOrderNum = onlCgformTag.getOrderNum();
|
||||
//查询展示顺序相同的
|
||||
QueryWrapper<OnlCgformTag> queryWrapper= new QueryWrapper<>();
|
||||
queryWrapper.eq("is_model",onlCgformTag.getIsModel())
|
||||
.eq("is_delete",CommonConstant.DEL_FLAG_0)
|
||||
.orderByAsc("order_num");
|
||||
queryWrapper.eq("order_num", inputOrderNum);
|
||||
Integer orderNumCount = onlCgformTagMapper.selectCount(queryWrapper);
|
||||
if(orderNumCount > 0) {//有重复展示顺序的,后面的号全+1
|
||||
//设置排序
|
||||
QueryWrapper<OnlCgformTag> orderNumQueryWrapper = new QueryWrapper<>();
|
||||
orderNumQueryWrapper.ge("order_num", inputOrderNum)
|
||||
.eq("is_model", onlCgformTag.getIsModel())
|
||||
.eq("is_delete", CommonConstant.DEL_FLAG_0)
|
||||
.orderByAsc("order_num");
|
||||
List<OnlCgformTag> geOrderNumList = list(orderNumQueryWrapper);
|
||||
|
||||
//判断相邻的序号,去掉不邻的
|
||||
for(int i = 0 ; i < geOrderNumList.size() ; i++) {
|
||||
if (geOrderNumList.size() == 1){
|
||||
break;
|
||||
}else if (geOrderNumList.get(i + 1).getOrderNum() - geOrderNumList.get(i).getOrderNum() > 1) {
|
||||
int deleteStart = geOrderNumList.get(i+1).getOrderNum();
|
||||
geOrderNumList = geOrderNumList.stream().filter(e->e.getOrderNum() < deleteStart).collect(Collectors.toList());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
geOrderNumList.stream().forEach(e -> e.setOrderNum(e.getOrderNum() + 1));
|
||||
saveOrUpdateBatch(geOrderNumList);
|
||||
}
|
||||
//处理DBLength为null的情况,默认为100
|
||||
if (onlCgformTag.getDbLength() == null){
|
||||
onlCgformTag.setDbLength(100);
|
||||
@@ -112,6 +146,7 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
save(onlCgformTag);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
@@ -120,6 +155,40 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
*/
|
||||
@Override
|
||||
public void editById(OnlCgformTag onlCgformTag) {
|
||||
Integer inputOrderNum = onlCgformTag.getOrderNum();
|
||||
//查询展示顺序相同的
|
||||
QueryWrapper<OnlCgformTag> queryWrapper= new QueryWrapper<>();
|
||||
queryWrapper.eq("is_model",onlCgformTag.getIsModel())
|
||||
.eq("is_delete",CommonConstant.DEL_FLAG_0)
|
||||
.orderByAsc("order_num");
|
||||
Integer orderNumData = list(queryWrapper).stream().filter(e->e.getId().equals(onlCgformTag.getId()))
|
||||
.map(e -> e.getOrderNum()).collect(Collectors.toList()).get(0);
|
||||
queryWrapper.eq("order_num", inputOrderNum);
|
||||
Integer orderNumCount = onlCgformTagMapper.selectCount(queryWrapper);
|
||||
if(orderNumCount > 0 && !orderNumData.equals(inputOrderNum)) {//有重复展示顺序的,后面的号全+1
|
||||
//设置排序
|
||||
QueryWrapper<OnlCgformTag> orderNumQueryWrapper = new QueryWrapper<>();
|
||||
orderNumQueryWrapper.ge("order_num", inputOrderNum)
|
||||
.eq("is_model", onlCgformTag.getIsModel())
|
||||
.eq("is_delete", CommonConstant.DEL_FLAG_0)
|
||||
.orderByAsc("order_num");
|
||||
List<OnlCgformTag> geOrderNumList = list(orderNumQueryWrapper);
|
||||
|
||||
//判断相邻的序号,去掉不邻的
|
||||
for(int i = 0 ; i < geOrderNumList.size() ; i++) {
|
||||
if (geOrderNumList.size()==1){
|
||||
break;
|
||||
}else if (geOrderNumList.get(i + 1).getOrderNum() - geOrderNumList.get(i).getOrderNum() > 1) {
|
||||
int deleteStart = geOrderNumList.get(i+1).getOrderNum();
|
||||
geOrderNumList = geOrderNumList.stream().filter(e->e.getOrderNum() < deleteStart).collect(Collectors.toList());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
geOrderNumList.stream().forEach(e -> e.setOrderNum(e.getOrderNum() + 1));
|
||||
saveOrUpdateBatch(geOrderNumList);
|
||||
}
|
||||
|
||||
//字段名称设置成拼音+下划线,存入数据库
|
||||
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(onlCgformTag.getDbFieldTxt());
|
||||
onlCgformTag.setDbFieldName(pinYin.replace(" ","_"));
|
||||
|
||||
@@ -887,4 +887,7 @@ module.exports = {
|
||||
myNews:'My News',
|
||||
monthlyReportRegulations:'Monthly report regulations',
|
||||
Pending:'Pending',
|
||||
custom:'Custom',
|
||||
notSelected:'Not selected',
|
||||
ExportReport:'Export Report',
|
||||
}
|
||||
@@ -892,4 +892,7 @@ module.exports = {
|
||||
myNews:'我的消息',
|
||||
monthlyReportRegulations:'法规月报',
|
||||
Pending:'待处理',
|
||||
custom:'自定义',
|
||||
notSelected:'未选择',
|
||||
ExportReport:'导出报告',
|
||||
}
|
||||
@@ -95,6 +95,7 @@
|
||||
this.$route.path == '/handshakeProcess' ||
|
||||
this.$route.path == '/historicalVersion' ||
|
||||
this.$route.path == '/dashboard/analysis' ||
|
||||
this.$route.path == '/customContentList' ||
|
||||
this.$route.path == '/processDetails') {
|
||||
return false
|
||||
} else {
|
||||
|
||||
@@ -12,16 +12,116 @@
|
||||
<img src="../../../assets/jspg.png" class="img" alt="">
|
||||
<div class="text">我的收藏</div>
|
||||
</div>
|
||||
<div class="box-content">
|
||||
<div class="box-content" @click="customClick()">
|
||||
<img src="../../../assets/zdy.png" class="img" alt="">
|
||||
<div class="text">自定义</div>
|
||||
<div class="text">{{$t('custom')}}</div>
|
||||
</div>
|
||||
<a-modal
|
||||
:title="$t('custom')"
|
||||
:width="1180"
|
||||
:visible="visible"
|
||||
:confirm-loading="confirmLoading"
|
||||
:maskClosable="false"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<div class="selected">{{$t('selected')}}:</div>
|
||||
<div class="box-model">
|
||||
<div style="display: inline-block" v-for="(item,index) in dataSource">
|
||||
<div class="box-top" v-if="item.state == 1" @click="statusClick(item,index)">
|
||||
<div class="box-content">
|
||||
<img src="../../../assets/jspg.png" class="img" alt="">
|
||||
<div class="text">{{item.iconName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="xian"></div>
|
||||
<div class="selected">{{$t('notSelected')}}:</div>
|
||||
<div class="box-model">
|
||||
<div style="display: inline-block" v-for="(item,index) in dataSource">
|
||||
<div class="box-top" v-if="!item.state || item.state == 2" @click="statusClick(item,index)">
|
||||
<div class="box-content">
|
||||
<img src="../../../assets/jspg.png" class="img" alt="">
|
||||
<div class="text">{{item.iconName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { postAction, getAction } from '../../../api/manage'
|
||||
|
||||
export default {
|
||||
name: 'customContent'
|
||||
name: 'customContent',
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
url: {
|
||||
list: '/home/homeFunctionModuleEO/list',
|
||||
add: '/home/homeFunctionModuleEO/add'
|
||||
},
|
||||
dataSource: [
|
||||
{
|
||||
iconName: '我的收藏',
|
||||
id: 1
|
||||
},
|
||||
{
|
||||
iconName: '我的收藏1',
|
||||
id: 2
|
||||
},
|
||||
{
|
||||
iconName: '我的收藏1',
|
||||
id: 3
|
||||
}
|
||||
],
|
||||
topList: [],
|
||||
footerList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
customClick() {
|
||||
this.visible = true
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
getAction(this.url.list, {}).then((res) => {
|
||||
if (res.success) {
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
handleOk() {
|
||||
this.confirmLoading = true
|
||||
postAction(this.url.add, this.dataSource).then((res) => {
|
||||
if (res.success) {
|
||||
this.visible = false
|
||||
this.confirmLoading = false
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
this.confirmLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
this.visible = false
|
||||
},
|
||||
statusClick(item, index) {
|
||||
if (item.state == 1) {
|
||||
this.dataSource[index].state = 2
|
||||
} else {
|
||||
this.dataSource[index].state = 1
|
||||
}
|
||||
this.dataSource = [...this.dataSource]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -34,6 +134,8 @@
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
margin-right: 30px;
|
||||
cursor: pointer;
|
||||
|
||||
.img {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
@@ -48,4 +150,45 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.selected {
|
||||
font-size: 16px;
|
||||
font-family: Blue Sky Noto;
|
||||
font-weight: 400;
|
||||
color: #040B29;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.box-model {
|
||||
width: 100%;
|
||||
|
||||
.box-top {
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
margin-right: 30px;
|
||||
cursor: pointer;
|
||||
margin-bottom: 30px;
|
||||
|
||||
.img {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 16px;
|
||||
font-family: Blue Sky Noto;
|
||||
font-weight: 400;
|
||||
color: #040B29;
|
||||
margin-top: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.xian {
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background: #CED0D8;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
</style>
|
||||
@@ -2,26 +2,78 @@
|
||||
<div class="documentDynamics-box">
|
||||
<div class="header-text">
|
||||
<div class="header-text-left">{{this.$t('documentDynamics')}}</div>
|
||||
<div class="header-text-right">
|
||||
<div class="header-text-right" @click="moreClick">
|
||||
{{$t('more')}}
|
||||
<img src="../../../assets/gengduo.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="documentDynamics-box-content">
|
||||
<div class="documentDynamics-text" v-for="item in 8">
|
||||
<div class="documentDynamics-box-content" v-if="dataSource.length > 0">
|
||||
<div class="documentDynamics-text" v-for="(item,index) in dataSource"
|
||||
:key="index"
|
||||
@click="magClick(item)">
|
||||
<div class="yuan"></div>
|
||||
<div class="text">文档库中新增了新的标准 GB 7258 机动车文件</div>
|
||||
<img src="../../../assets/new.png" alt="">
|
||||
<div class="time">2022-04-04 12:00:00</div>
|
||||
<div class="text">{{item.msgContent}}</div>
|
||||
<!-- <img src="../../../assets/new.png" alt="">-->
|
||||
<div class="time">{{item.createTime}}</div>
|
||||
</div>
|
||||
<div class="solid"></div>
|
||||
</div>
|
||||
<div v-else style="height: 240px;position: relative">
|
||||
<JNoData />
|
||||
</div>
|
||||
<JLoading :loading="loading">{{$t('dataLoading')}}</JLoading>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction, putAction, deleteAction } from '@/api/manage'
|
||||
export default {
|
||||
name: 'documentDynamics'
|
||||
name: 'documentDynamics',
|
||||
data(){
|
||||
return{
|
||||
pageSize: 8,
|
||||
pageNo: 1,
|
||||
dataSource: [],
|
||||
loading:false,
|
||||
url: {
|
||||
list: '/home/homeDocumentDynamicEO/page',
|
||||
readAllMsg: 'sys/sysAnnouncementSend/read'
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods:{
|
||||
getList() {
|
||||
let query = {
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize
|
||||
}
|
||||
this.loading = true
|
||||
getAction(this.url.list, query).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.records || []
|
||||
this.loading = false
|
||||
} else {
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
magClick(row) {
|
||||
getAction(this.url.readAllMsg, { ids: row.id }).then((res) => {
|
||||
})
|
||||
this.$router.push({
|
||||
path: '/system/MessageDetails',
|
||||
query: row
|
||||
})
|
||||
},
|
||||
moreClick() {
|
||||
this.$router.push({
|
||||
path: '/customContentList'
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -45,6 +97,7 @@
|
||||
font-weight: 400;
|
||||
color: #9B9DA9;
|
||||
margin-top: 6px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<a-card :bordered="false">
|
||||
<!-- 查询区域 -->
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="8" style="line-height: 48px">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text" :title="$t('MessageContent')">
|
||||
<span>{{this.$t('MessageContent')}}</span>
|
||||
</div>
|
||||
<a-input class="box-input"
|
||||
:placeholder="$t('pleaseEnter')+$t('MessageContent')"
|
||||
v-model="queryParam.msgContent">
|
||||
</a-input>
|
||||
</div>
|
||||
</a-col>
|
||||
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
|
||||
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<div class="table-operator">
|
||||
<div @click="handleDel" class="operator-text">
|
||||
<a-icon type="delete"/>
|
||||
{{$t('BatchDelete')}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
ref="table"
|
||||
rowKey="id"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:scroll="{x: 1600}"
|
||||
:pagination="ipagination"
|
||||
:loading="loading"
|
||||
@change="handleTableChange">
|
||||
<span slot="msgContent" slot-scope="text,scope">
|
||||
<a :style="{'color':scope.readFlag == 0 ? 'red':'#00A0E9'}" :title="text" @click="msgContentClick(scope)">
|
||||
{{text}}
|
||||
</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction, putAction, deleteAction } from '@/api/manage'
|
||||
import { JeroListMixin } from '@/mixins/JeroListMixin'
|
||||
|
||||
export default {
|
||||
name: 'customContentList',
|
||||
mixins: [JeroListMixin],
|
||||
data() {
|
||||
return {
|
||||
queryParam: {},
|
||||
selectedRowKeys: [],
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('MessageContent'),
|
||||
align: 'center',
|
||||
dataIndex: 'msgContent',
|
||||
ellipsis: true,
|
||||
scopedSlots: { customRender: 'msgContent' }
|
||||
},
|
||||
{
|
||||
title: this.$t('NotificationTime'),
|
||||
align: 'center',
|
||||
width: 200,
|
||||
dataIndex: 'sendTime'
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: '/home/homeDocumentDynamicEO/page',
|
||||
deleteUrl: '/home/homeDocumentDynamicEO/deleteBatch'
|
||||
},
|
||||
loading: false,
|
||||
openPath: '',
|
||||
formData: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSelectChange(value) {
|
||||
this.selectedRowKeys = value
|
||||
},
|
||||
msgContentClick(row) {
|
||||
getAction(this.url.readAllMsg, { ids: row.id }).then((res) => {
|
||||
})
|
||||
this.$router.push({
|
||||
path: '/system/MessageDetails',
|
||||
query: row
|
||||
})
|
||||
},
|
||||
handleDel() {
|
||||
var that = this
|
||||
if (this.selectedRowKeys.length > 0) {
|
||||
that.$confirm({
|
||||
content: that.$t('ConfirmBatchDeletion'),
|
||||
onOk: function() {
|
||||
let selectedRowKeys = JSON.parse(JSON.stringify(that.selectedRowKeys))
|
||||
deleteAction(that.url.deleteUrl, { ids: selectedRowKeys.join(',') }).then((res) => {
|
||||
if (res.success) {
|
||||
that.selectedRowKeys = []
|
||||
that.$message.success(that.$t('OperationSuccessful'))
|
||||
that.loadData()
|
||||
} else {
|
||||
that.$message.success(that.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.warning(this.$t('PleaseSelectData'))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
|
||||
.ant-card-body .table-operator {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.anty-row-operator button {
|
||||
margin: 0 5px
|
||||
}
|
||||
|
||||
.ant-btn-danger {
|
||||
background-color: #ffffff
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp {
|
||||
height: 100%
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp .ant-modal-body {
|
||||
height: calc(100% - 110px) !important;
|
||||
overflow-y: auto
|
||||
}
|
||||
|
||||
.ant-modal-cust-warp .ant-modal-content {
|
||||
height: 90% !important;
|
||||
overflow-y: hidden
|
||||
}
|
||||
|
||||
.box-title-text {
|
||||
line-height: 1.4;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.title-text {
|
||||
width: 66px;
|
||||
color: #000F16;
|
||||
display: inline-block;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
margin-right: 16px;
|
||||
margin-top: 3px;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.box-input {
|
||||
display: inline-block;
|
||||
width: 70%;
|
||||
height: 38px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.box-button {
|
||||
height: 38px;
|
||||
/*margin-top: 2px;*/
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.box-input .ant-select-selection {
|
||||
height: 38px;
|
||||
line-height: 38px;
|
||||
}
|
||||
|
||||
.box-input .ant-select-selection__rendered {
|
||||
line-height: 38px;
|
||||
}
|
||||
</style>
|
||||
+16
-2
@@ -52,7 +52,7 @@
|
||||
<div class="Virtual-detail-right">
|
||||
<ProjectDetailsName v-if="textTitle === '项目详情'"/>
|
||||
<listOfRegulations v-else-if="textTitle === '法规清单'"/>
|
||||
<TaskList v-else-if="textTitle === '任务清单'"/>
|
||||
<TaskList :isDisplayNum="isDisplayNum" v-else-if="textTitle === '任务清单'"/>
|
||||
<ParameterItemCollectionList v-else-if="textTitle === '认证参数收集'" :paramsManifest='paramsManifest'/>
|
||||
<nonConformance v-else-if="textTitle === '未符合项'"/>
|
||||
</div>
|
||||
@@ -73,6 +73,7 @@
|
||||
import updateLog from '@/components/UpdateLog/index'
|
||||
import historicalVersionList from '@/views/projectManagement/components/historicalVersionList'
|
||||
import commentList from '@/views/projectManagement/components/commentList'
|
||||
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'ProjectDetails',
|
||||
@@ -90,15 +91,18 @@
|
||||
return {
|
||||
title: this.$t('projectDetails'),
|
||||
textTitle: '认证参数收集',
|
||||
isDisplayNum: '',
|
||||
url: {
|
||||
logList: '/project/projectLawsInventoryLogEO/page',
|
||||
historicalVersionUrl: ''
|
||||
historicalVersionUrl: '',
|
||||
queryUserPremissionByProjectLibraryId: '/project/projectCertificationDirectoryEO/queryUserPremissionByProjectLibraryId'
|
||||
},
|
||||
paramsManifest: {}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.textColor()
|
||||
this.getTaskId()
|
||||
// 清单信息
|
||||
this.paramsManifest = JSON.parse(localStorage.getItem('paramsManifest'))
|
||||
},
|
||||
@@ -130,6 +134,16 @@
|
||||
},
|
||||
commentClick() {
|
||||
this.$refs.commentListRef.getData()
|
||||
},
|
||||
getTaskId() {
|
||||
let query = {
|
||||
projectLibraryId: this.$route.query.id
|
||||
}
|
||||
getAction(this.url.queryUserPremissionByProjectLibraryId, query).then((res) => {
|
||||
if (res.success) {
|
||||
this.isDisplayNum = res.result
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<div class="doc-detail">
|
||||
<div class="Virtual-detail-header" style="position: fixed;top: 0">
|
||||
<div class="Virtual-detail-title">
|
||||
<!-- <span style="line-height: 74px;display: inline-block;float: left">-->
|
||||
<!-- <a-icon type="left-circle" theme="filled" style="margin-right: 6px;font-size: 30px;color: #21c9cc;"/>-->
|
||||
<!-- </span>-->
|
||||
<!-- <span style="line-height: 74px;display: inline-block;float: left">-->
|
||||
<!-- <a-icon type="left-circle" theme="filled" style="margin-right: 6px;font-size: 30px;color: #21c9cc;"/>-->
|
||||
<!-- </span>-->
|
||||
<span>
|
||||
{{this.title}}
|
||||
</span>
|
||||
@@ -51,7 +51,7 @@
|
||||
<div class="Virtual-detail-right">
|
||||
<ProjectDetailsName v-if="textTitle === '项目详情'"/>
|
||||
<listOfRegulations v-else-if="textTitle === '法规清单'"/>
|
||||
<TaskList v-else-if="textTitle === '任务清单'"/>
|
||||
<TaskList :isDisplayNum="isDisplayNum" v-else-if="textTitle === '任务清单'"/>
|
||||
<TaskParameterCollection v-else-if="textTitle === '认证参数收集'"/>
|
||||
<nonConformance v-else-if="textTitle === '未符合项'"/>
|
||||
</div>
|
||||
@@ -72,6 +72,7 @@
|
||||
import updateLog from '@/components/UpdateLog/index'
|
||||
import historicalVersionList from '../components/historicalVersionList'
|
||||
import commentList from '../components/commentList'
|
||||
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'ProjectDetails',
|
||||
@@ -88,15 +89,18 @@
|
||||
data() {
|
||||
return {
|
||||
title: this.$t('projectDetails'),
|
||||
isDisplayNum:'',
|
||||
textTitle: '项目详情',
|
||||
url: {
|
||||
logList: '/project/projectLawsInventoryLogEO/page',
|
||||
historicalVersionUrl: ''
|
||||
historicalVersionUrl: '',
|
||||
queryUserPremissionByProjectLibraryId: '/project/projectCertificationDirectoryEO/queryUserPremissionByProjectLibraryId'
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.textColor()
|
||||
this.getTaskId()
|
||||
},
|
||||
methods: {
|
||||
textColor() {
|
||||
@@ -119,13 +123,23 @@
|
||||
text[num].classList.add('Virtual-detail-left-text-color')
|
||||
},
|
||||
UpdateLogClick() {
|
||||
this.$refs.updateLogRef.getList({projectLibraryId: this.$route.query.id})
|
||||
this.$refs.updateLogRef.getList({ projectLibraryId: this.$route.query.id })
|
||||
},
|
||||
historicalVersionClick() {
|
||||
this.$refs.historicalVersionListRef.getList()
|
||||
},
|
||||
commentClick() {
|
||||
this.$refs.commentListRef.getData()
|
||||
},
|
||||
getTaskId() {
|
||||
let query = {
|
||||
projectLibraryId: this.$route.query.id
|
||||
}
|
||||
getAction(this.url.queryUserPremissionByProjectLibraryId, query).then((res) => {
|
||||
if (res.success) {
|
||||
this.isDisplayNum = res.result
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
</div>
|
||||
</a-table>
|
||||
</div>
|
||||
<certificationDirectory :url="url" ref="certificationDirectoryRef"/>
|
||||
<certificationDirectory :isDisplayNum="isDisplayNum" :url="url" ref="certificationDirectoryRef"/>
|
||||
<TaskListModel @TaskListModelList="TaskListModelList" ref="TaskListModelRef"/>
|
||||
</a-card>
|
||||
</template>
|
||||
@@ -141,6 +141,7 @@
|
||||
certificationDirectory,
|
||||
TaskListModel
|
||||
},
|
||||
props:['isDisplayNum'],
|
||||
data() {
|
||||
return {
|
||||
columns: [
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
style="height: 100%;overflow: auto;padding-bottom: 53px;">
|
||||
<div style="margin-bottom: 60px">
|
||||
<div class="table-operator">
|
||||
<div class="operator-text" @click="addData">
|
||||
<div class="operator-text" v-if="isDisplayNum == 2" @click="addData">
|
||||
<a-icon type="plus"/>
|
||||
{{$t('add')}}
|
||||
</div>
|
||||
@@ -73,13 +73,14 @@
|
||||
certificationDirectoryAdd,
|
||||
viewFileModel
|
||||
},
|
||||
props: ['isDisplayNum'],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
queryParam: {},
|
||||
confirmLoading: false,
|
||||
selectedRowKeys: [],
|
||||
columns: [
|
||||
columnsAll: [
|
||||
{
|
||||
title: this.$t('directoryName'),
|
||||
dataIndex: 'directoryName',
|
||||
@@ -143,6 +144,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
columns() {
|
||||
let columnResult = JSON.parse(JSON.stringify(this.columnsAll))
|
||||
if (this.isDisplayNum != 2) {
|
||||
for (var i = 0; i < columnResult.length; i++) {
|
||||
if (columnResult[i].title === this.$t('operation')) {
|
||||
columnResult.splice(i, 1)
|
||||
i--
|
||||
}
|
||||
}
|
||||
}
|
||||
return columnResult
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
|
||||
@@ -78,9 +78,11 @@
|
||||
getData() {
|
||||
getAction(this.url.getProjectDetailsStatistics, { id: this.$route.query.id }).then((res) => {
|
||||
if (res.success) {
|
||||
let certificationProgressMap = res.result.certificationProgressMap.certificationProgressMapList || []
|
||||
this.certificationProgressTotal = res.result.certificationProgressMap.certificationProgressTotal
|
||||
this.dataEcharts(certificationProgressMap)
|
||||
if (res.result) {
|
||||
let certificationProgressMap = res.result.certificationProgressMap ? res.result.certificationProgressMap.certificationProgressMapList : []
|
||||
this.certificationProgressTotal = res.result.certificationProgressMap ? res.result.certificationProgressMap.certificationProgressTotal : 0
|
||||
this.dataEcharts(certificationProgressMap)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
+16
-10
@@ -79,10 +79,11 @@
|
||||
getData() {
|
||||
getAction(this.url.getProjectDetailsStatistics, { id: this.$route.query.id }).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = [{}]
|
||||
let dataSource = res.result.currentProjectStatusMap.currentProjectStatusMapList || []
|
||||
this.mainLeftEcharts(dataSource)
|
||||
this.currentProjectStatusTotal = res.result.currentProjectStatusMap.currentProjectStatusTotal
|
||||
if (res.result) {
|
||||
let dataSource = res.result.currentProjectStatusMap ? res.result.currentProjectStatusMap.currentProjectStatusMapList : []
|
||||
this.mainLeftEcharts(dataSource)
|
||||
this.currentProjectStatusTotal = res.result.currentProjectStatusMap ? res.result.currentProjectStatusMap.currentProjectStatusTotal : 0
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -125,8 +126,8 @@
|
||||
let query = {
|
||||
title: params.seriesName,
|
||||
projectLibraryId: this.$route.query.id,
|
||||
operatorType:'queryCurrentProjectStatusStatistics',
|
||||
conditionAssessment:params.data.value
|
||||
operatorType: 'queryCurrentProjectStatusStatistics',
|
||||
conditionAssessment: params.data.color
|
||||
}
|
||||
this.$refs.responsibilityListRef.getData(query)
|
||||
})
|
||||
@@ -135,32 +136,37 @@
|
||||
let data = []
|
||||
let color = []
|
||||
if (dataSource && dataSource.length > 0) {
|
||||
this.dataSource = [{}]
|
||||
dataSource.forEach(res => {
|
||||
if (res.color == '4') {
|
||||
data.push({
|
||||
value: res.conditionAssessmentCount,
|
||||
name: this.$t('blue')
|
||||
name: this.$t('blue'),
|
||||
color: res.color
|
||||
})
|
||||
color.push('#00B3BE')
|
||||
this.dataSource[0].blueCount = res.conditionAssessmentCount
|
||||
} else if (res.color == '1') {
|
||||
data.push({
|
||||
value: res.conditionAssessmentCount,
|
||||
name: this.$t('red')
|
||||
name: this.$t('red'),
|
||||
color: res.color
|
||||
})
|
||||
color.push('#E83030')
|
||||
this.dataSource[0].redCount = res.conditionAssessmentCount
|
||||
} else if (res.color == '2') {
|
||||
data.push({
|
||||
value: res.conditionAssessmentCount,
|
||||
name: this.$t('yellow')
|
||||
name: this.$t('yellow'),
|
||||
color: res.color
|
||||
})
|
||||
color.push('#FDA71C')
|
||||
this.dataSource[0].yellowCount = res.conditionAssessmentCount
|
||||
} else if (res.color == '3') {
|
||||
data.push({
|
||||
value: res.conditionAssessmentCount,
|
||||
name: this.$t('green')
|
||||
name: this.$t('green'),
|
||||
color: res.color
|
||||
})
|
||||
this.dataSource[0].greenCount = res.conditionAssessmentCount
|
||||
color.push('#26BD4B')
|
||||
|
||||
@@ -54,16 +54,20 @@
|
||||
getData() {
|
||||
getAction(this.url.getProjectDetailsStatistics, { id: this.$route.query.id }).then((res) => {
|
||||
if (res.success) {
|
||||
let listingToConfirmMap = res.result.listingToConfirmMap.listingToConfirmMapList || []
|
||||
let taskToConfirmMap = res.result.taskToConfirmMap.taskToConfirmMapList || []
|
||||
let designComplianceMap = res.result.designComplianceMap.designComplianceMapList || []
|
||||
let prehomoMap = res.result.prehomoMap.prehomoMapList || []
|
||||
let verifyComplianceMap = res.result.verifyComplianceMap.verifyComplianceMapList || []
|
||||
this.dataEcharts(listingToConfirmMap, 1)
|
||||
this.dataEcharts(taskToConfirmMap, 2)
|
||||
this.dataEchartsOne(designComplianceMap, 1)
|
||||
this.dataEchartsOne(prehomoMap, 2)
|
||||
this.dataEchartsOne(verifyComplianceMap, 3)
|
||||
if (res.result){
|
||||
|
||||
let listingToConfirmMap = res.result.listingToConfirmMap ? res.result.listingToConfirmMap.listingToConfirmMapList : []
|
||||
let taskToConfirmMap = res.result.taskToConfirmMap ? res.result.taskToConfirmMap.taskToConfirmMapList : []
|
||||
let designComplianceMap = res.result.designComplianceMap ? res.result.designComplianceMap.designComplianceMapList : []
|
||||
let prehomoMap = res.result.prehomoMap ? res.result.prehomoMap.prehomoMapList : []
|
||||
let verifyComplianceMap = res.result.verifyComplianceMap ? res.result.verifyComplianceMap.verifyComplianceMapList : []
|
||||
this.dataEcharts(listingToConfirmMap, 1)
|
||||
this.dataEcharts(taskToConfirmMap, 2)
|
||||
this.dataEchartsOne(designComplianceMap, 1)
|
||||
this.dataEchartsOne(prehomoMap, 2)
|
||||
this.dataEchartsOne(verifyComplianceMap, 3)
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -5,35 +5,35 @@
|
||||
</div>
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="8">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text" :title="$t('standard')">
|
||||
<span>{{ $t('standard') }}</span>
|
||||
<a-row :gutter="24">
|
||||
<a-col :md="6" :sm="8">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text" :title="$t('standard')">
|
||||
<span>{{ $t('standard') }}</span>
|
||||
</div>
|
||||
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('standard')"
|
||||
v-model="queryParam.serialNumber"></j-input>
|
||||
</div>
|
||||
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('standard')"
|
||||
v-model="queryParam.serialNumber"></j-input>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text" :title="$t('title')">
|
||||
<span>{{ $t('title') }}</span>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text" :title="$t('title')">
|
||||
<span>{{ $t('title') }}</span>
|
||||
</div>
|
||||
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('title')"
|
||||
v-model="queryParam.title"></j-input>
|
||||
</div>
|
||||
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('title')"
|
||||
v-model="queryParam.title"></j-input>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text" style="width: 44px" :title="$t('subtitle')">
|
||||
<span>{{ $t('subtitle') }}</span>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text" style="width: 44px" :title="$t('subtitle')">
|
||||
<span>{{ $t('subtitle') }}</span>
|
||||
</div>
|
||||
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('subtitle')"
|
||||
v-model="queryParam.subtitle"></j-input>
|
||||
</div>
|
||||
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('subtitle')"
|
||||
v-model="queryParam.subtitle"></j-input>
|
||||
</div>
|
||||
</a-col>
|
||||
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
|
||||
</a-col>
|
||||
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
|
||||
<a-col :md="6" :sm="24">
|
||||
<globalAdvancedQuery ref="globalAdvancedQueryRef"
|
||||
@handleSuperQuery="handleSuperQuery"
|
||||
@@ -43,7 +43,7 @@
|
||||
@click="searchReset">{{ $t('reset') }}</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-row>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<div class="table-operator" style="overflow:hidden;">
|
||||
@@ -88,6 +88,10 @@
|
||||
<a-icon type="user"/>
|
||||
{{ $t('bringInRelevantPersonnel') }}
|
||||
</div>
|
||||
<div class="operator-text-title" @click="ExportReportClick">
|
||||
<a-icon type="user"/>
|
||||
{{ $t('ExportReport') }}
|
||||
</div>
|
||||
</template>
|
||||
<div class="operator-text" style="position: relative">
|
||||
<span style="position: absolute;left: -13px;top: -4px">...</span>{{ $t('more') }}
|
||||
@@ -653,7 +657,7 @@
|
||||
queryParam: {},
|
||||
url: {
|
||||
addModelList: '/project/projectLawsInventoryEO/queryPageDummy',
|
||||
queryConditionInventory:'/project/projectLawsInventoryEO/queryConditionInventory',
|
||||
queryConditionInventory: '/project/projectLawsInventoryEO/queryConditionInventory',
|
||||
list: '/project/projectLawsInventoryEO/list',
|
||||
addModel: 'project/projectLawsInventoryEO/add',
|
||||
editModel: '/project/projectLawsInventoryEO/edit',
|
||||
@@ -667,7 +671,8 @@
|
||||
exportData: '/project/projectLawsInventoryEO/exportData',
|
||||
setBatch: '/project/projectLawsInventoryEO/setBatch',//批量设置
|
||||
copyUrl: '/project/projectLawsInventoryEO/copyInfoByIds',//复制
|
||||
transferUrl: '/project/projectLawsInventoryEO/getPageInfoDummy'//调取
|
||||
transferUrl: '/project/projectLawsInventoryEO/getPageInfoDummy',//调取
|
||||
ExportReportUrl: '/project/projectLawsInventoryEO/downloadDocxReport'
|
||||
},
|
||||
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
|
||||
loading: false,
|
||||
@@ -735,6 +740,16 @@
|
||||
handleModule() {
|
||||
downloadFile(this.url.exportTemplate, this.$t('listOfRegulations') + this.$t('importTemplate') + '.xls', {})
|
||||
},
|
||||
ExportReportClick() {
|
||||
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
|
||||
if (selectedRowKeys && selectedRowKeys.length == 0) {
|
||||
this.$message.warning(this.$t('pleaseSelectData'))
|
||||
} else if (selectedRowKeys.length > 1) {
|
||||
this.$message.warning(this.$t('OnlyOneSelected'))
|
||||
} else {
|
||||
downloadFile(this.url.ExportReportUrl, this.$t('listOfRegulations') + this.$t('ExportReport') + '.docx', { id: selectedRowKeys.join(',') })
|
||||
}
|
||||
},
|
||||
handleExport() {
|
||||
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
|
||||
let query = {
|
||||
@@ -824,7 +839,7 @@
|
||||
changeInterface() {
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
width:760,
|
||||
width: 760,
|
||||
content: _this.$t('NoteConfirmTheChange'),
|
||||
onOk() {
|
||||
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys))
|
||||
|
||||
@@ -228,7 +228,6 @@
|
||||
background-color: #ffffff
|
||||
}
|
||||
|
||||
z
|
||||
.ant-modal-cust-warp {
|
||||
height: 100%
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
<user-recycle-bin-modal :visible.sync="recycleBinVisible" @ok="modalFormOk"/>
|
||||
<!-- 角色配置 -->
|
||||
<a-modal v-model="rolevisible" :title="$t('RoleAssignment')" width='650px' :footer="null">
|
||||
<role-assignment v-if='rolevisible'></role-assignment>
|
||||
<role-assignment v-if='rolevisible' :selectedRowKeysArray='selectedRowKeys'></role-assignment>
|
||||
</a-modal>
|
||||
</a-card>
|
||||
</template>
|
||||
@@ -251,16 +251,15 @@
|
||||
},
|
||||
methods: {
|
||||
onSelectChange(val,value) {
|
||||
console.log(val)
|
||||
console.log(value)
|
||||
this.selectedRowKeys = val
|
||||
this.selectedRowKeysvalue = value
|
||||
},
|
||||
rolehandleOk() {
|
||||
console.log('角色配置得弹框控制')
|
||||
},
|
||||
RoleAssignment: function(){
|
||||
this.rolevisible = true
|
||||
if(this.selectedRowKeys.length == 0) {
|
||||
this.$message.warning(this.$t('selectLeastOne'))
|
||||
} else {
|
||||
this.rolevisible = true
|
||||
}
|
||||
},
|
||||
getAvatarView: function(avatar) {
|
||||
return getFileAccessHttpUrl(avatar)
|
||||
|
||||
@@ -12,15 +12,11 @@
|
||||
<a-row :gutter='24'>
|
||||
<a-col :span='24'>
|
||||
<a-form-item :label="$t('RoleAssignment')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-select
|
||||
mode="multiple"
|
||||
style="width: 100%"
|
||||
:placeholder="$t('selectUserRole')"
|
||||
optionFilterProp="children"
|
||||
v-model="selectedRole"
|
||||
:getPopupContainer="(target) => target.parentNode">
|
||||
<a-select-option v-for="(role,roleindex) in roleList" :key="roleindex.toString()" :value="role.id">
|
||||
{{ role.roleName }}
|
||||
<a-select mode="multiple" :placeholder="$t('PleaseSelect')+$t('controlVerification')" v-model:value="selectedRole">
|
||||
<a-select-option v-for="(role,roleindex) in roleList" :key="role.id" :value="role.id">
|
||||
<span style="display: inline-block;width: 100%">
|
||||
{{ role.roleName }}
|
||||
</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
@@ -54,7 +50,7 @@ export default {
|
||||
loading: false,
|
||||
editId: '',
|
||||
newVisible: false,
|
||||
selectedRole: '',
|
||||
selectedRole: undefined,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 7 }
|
||||
@@ -71,12 +67,13 @@ export default {
|
||||
confirmLoading: false,
|
||||
selectedRowKeys: [],
|
||||
roleList: [],
|
||||
defaultValue: undefined
|
||||
}
|
||||
},
|
||||
props: {
|
||||
selectedRowKeysArray: {
|
||||
type: String,
|
||||
default: '',
|
||||
type: Array,
|
||||
default: [],
|
||||
require: true
|
||||
}
|
||||
},
|
||||
@@ -86,8 +83,7 @@ export default {
|
||||
methods: {
|
||||
loadData() {
|
||||
this.loading = true
|
||||
let params = {}
|
||||
getAction(`sys/role/queryall`, params).then(res => {
|
||||
getAction(`sys/role/queryall`, {}).then(res => {
|
||||
if (res.success) {
|
||||
this.roleList = [...res.result]
|
||||
}
|
||||
@@ -95,24 +91,13 @@ export default {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
searchQuery() {
|
||||
this.loadData()
|
||||
},
|
||||
searchReset() {
|
||||
this.form = {}
|
||||
this.loadData()
|
||||
},
|
||||
handleCancel() {
|
||||
this.$emit('areaVisibleTaskCutOffTimeflag', false)
|
||||
},
|
||||
handleTableChange(val) {
|
||||
},
|
||||
//保存
|
||||
handleSubmit() {
|
||||
console.log(this.selectedRole,'llllllll')
|
||||
let _this = this
|
||||
let param = {ids: this.selectedRowKeysArray, deadline: `${this.pickerDate}`, }
|
||||
postAction('/params/collectManifest/updateDeadlineBatch', param).then((res) => {
|
||||
let param = {ids: this.selectedRowKeysArray.join(','), selectedroles: `${this.selectedRole.join(',')}` }
|
||||
postAction('/sys/user/setRole', param).then((res) => {
|
||||
if (res.success) {
|
||||
this.$emit('areaVisibleTaskCutOffTimeflag', false)
|
||||
this.$message.success(res.message)
|
||||
@@ -120,13 +105,7 @@ export default {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
onChange(val) {
|
||||
this.pickerDate = moment(val).format('YYYY-MM-DD HH:mm:ss')
|
||||
},
|
||||
onOk(val) {
|
||||
this.pickerDate = moment(val).format('YYYY-MM-DD HH:mm:ss')
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user