delete 删除无用文件

This commit is contained in:
liao
2023-08-25 14:28:58 +08:00
parent fbee49d021
commit cf594fee16
19 changed files with 2 additions and 1818 deletions
+2 -28
View File
@@ -12,10 +12,8 @@ CREATE TABLE laws_basic_info
standard_name_en varchar(50) DEFAULT NULL COMMENT '标准英文名称',
release_date datetime DEFAULT NULL COMMENT '发布日期',
implement_date datetime DEFAULT NULL COMMENT '实施日期',
implement_date_pro_car_max datetime DEFAULT NULL COMMENT '在产车实施日期(多选-最大时间',
implement_date_pro_car_min datetime DEFAULT NULL COMMENT '在产车实施日期(多选-最小时间',
implement_date_new_car_max datetime DEFAULT NULL COMMENT '新车型实施日期(多选-最大时间)',
implement_date_new_car_min datetime DEFAULT NULL COMMENT '新车型实施日期(多选-最小时间)',
implement_date_car_pro varchar(500) DEFAULT NULL COMMENT '在产车实施日期(多日期',
implement_date_car_new varchar(500) DEFAULT NULL COMMENT '新车型实施日期(多日期',
abolish_date datetime DEFAULT NULL COMMENT '废止日期',
standard_status varchar(50) DEFAULT NULL COMMENT '(外部)标准状态:起草/征求意见/报批/发布/即将实施/现行有效/废止',
@@ -37,27 +35,3 @@ CREATE TABLE laws_basic_info
PRIMARY KEY (id) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='基础信息';
DROP TABLE IF EXISTS laws_date_relation;
CREATE TABLE laws_date_relation
(
id varchar(36) NOT NULL COMMENT '主键ID',
relation_id varchar(36) DEFAULT NULL COMMENT '关联ID',
relation_field varchar(50) DEFAULT NULL COMMENT '关联字段',
relation_date datetime DEFAULT NULL COMMENT '关联日期',
PRIMARY KEY (id) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='多日期选择关联';
DROP TABLE IF EXISTS laws_file_relation;
CREATE TABLE laws_file_relation
(
id varchar(36) NOT NULL COMMENT '主键ID',
relation_id varchar(36) DEFAULT NULL COMMENT '关联ID',
relation_field varchar(50) DEFAULT NULL COMMENT '关联字段(关联文件relation_file、发布稿原文original_release、发布稿译文translation_release、修改单modification_list、报批单approval_form、送审稿review_draft、征求意见稿exposure_draft、草案draft',
relation_file varchar(50) DEFAULT NULL COMMENT '关联文件',
PRIMARY KEY (id) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='文件关联';
@@ -1,79 +0,0 @@
package com.jero.modules.laws.regulation.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.util.MessageUtils;
import com.jero.modules.laws.regulation.entity.LawsBasicInfo;
import com.jero.modules.laws.regulation.service.ILawsBasicInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* @Description: 基础信息
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
@Api(tags="基础信息")
@RestController
@RequestMapping("/laws/regulation/lawsBasicInfo")
@Slf4j
public class LawsBasicInfoController extends JeroController<LawsBasicInfo, ILawsBasicInfoService> {
@Autowired
private ILawsBasicInfoService lawsBasicInfoService;
@AutoLog(value = "标准法规库(国内标准)-分页列表查询")
@ApiOperation(value="标准法规库(国内标准)-分页列表查询", notes="标准法规库(国内标准)-分页列表查询")
@PostMapping(value = "/getDomesticStandardPage")
public Result<IPage<Map<String,Object>>> getDomesticStandardPage(@RequestBody Map<String,Object> parameter) {
return Result.OK(lawsBasicInfoService.getDomesticStandardPage(parameter));
}
@AutoLog(value = "标准法规库(海外标准)-分页列表查询")
@ApiOperation(value="标准法规库(海外标准)-分页列表查询", notes="标准法规库(海外标准)-分页列表查询")
@PostMapping(value = "/getForeignStandardPage")
public Result<IPage<Map<String,Object>>> getForeignStandardPage(@RequestBody Map<String,Object> parameter) {
return Result.OK(lawsBasicInfoService.getForeignStandardPage(parameter));
}
@AutoLog(value = "获取列表表头")
@ApiOperation(value="获取列表表头", notes="获取列表表头")
@GetMapping(value = "getListHeader")
public Result<List<Map<String,Object>>> getListHeader(@RequestParam(name="flag") String flag) {
return Result.OK(lawsBasicInfoService.getListHeader(flag));
}
@AutoLog(value = "获取表单模型")
@ApiOperation(value="获取表单模型", notes="获取表单模型")
@GetMapping(value = "getFormModel")
public Result<List<Map<String,Object>>> getFormModel(@RequestParam(name="flag") String flag) {
List<Map<String, Object>> list = lawsBasicInfoService.getFormModel(flag);
return Result.OK(list);
}
@AutoLog(value = "获取查询条件")
@ApiOperation(value="获取查询条件", notes="获取查询条件")
@GetMapping(value = "getQueryCondition")
public Result<List<Map<String,Object>>> getQueryCondition(@RequestParam(name="flag") String flag) {
List<Map<String,Object>> list = lawsBasicInfoService.getQueryCondition(flag);
return Result.OK(list);
}
@AutoLog(value = "新增数据")
@ApiOperation(value="新增数据", notes="新增数据")
@PostMapping(value = "/addData")
public Result<String> addData(@RequestBody Map<String,Object> parameterMap) {
lawsBasicInfoService.addData(parameterMap);
return Result.OK(MessageUtils.getMessage("message.ok"));
}
}
@@ -1,177 +0,0 @@
package com.jero.modules.laws.regulation.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.system.base.controller.JeroController;
import com.jero.modules.laws.regulation.entity.LawsDateRelation;
import com.jero.modules.laws.regulation.service.ILawsDateRelationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @Description: 多日期选择关联
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
@Api(tags="多日期选择关联")
@RestController
@RequestMapping("/laws/regulation/lawsDateRelation")
@Slf4j
public class LawsDateRelationController extends JeroController<LawsDateRelation, ILawsDateRelationService> {
@Autowired
private ILawsDateRelationService lawsDateRelationService;
/**
* 分页列表查询
*
* @param lawsDateRelation
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "多日期选择关联-分页列表查询")
@ApiOperation(value="多日期选择关联-分页列表查询", notes="多日期选择关联-分页列表查询")
@GetMapping(value = "/page")
public Result<IPage<LawsDateRelation>> queryPageList(LawsDateRelation lawsDateRelation,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
IPage<LawsDateRelation> pageList = lawsDateRelationService.queryPage(lawsDateRelation, pageNo, pageSize, req);
return Result.OK(pageList);
}
/**
* 列表查询
*
* @param lawsDateRelation
* @param req
* @return
*/
@AutoLog(value = "多日期选择关联-列表查询")
@ApiOperation(value="多日期选择关联-列表查询", notes="多日期选择关联-列表查询")
@GetMapping(value = "/list")
public Result<List<LawsDateRelation>> queryList(LawsDateRelation lawsDateRelation, HttpServletRequest req) {
List<LawsDateRelation> list = lawsDateRelationService.queryList(lawsDateRelation, req);
return Result.OK(list);
}
/**
* 添加
*
* @param lawsDateRelation
* @return
*/
@AutoLog(value = "多日期选择关联-添加")
@ApiOperation(value="多日期选择关联-添加", notes="多日期选择关联-添加")
@PostMapping(value = "/add")
public Result<T> add(@Validated @RequestBody LawsDateRelation lawsDateRelation) {
lawsDateRelationService.add(lawsDateRelation);
return Result.OK("操作成功!");
}
/**
* 编辑
*
* @param lawsDateRelation
* @return
*/
@AutoLog(value = "多日期选择关联-编辑")
@ApiOperation(value="多日期选择关联-编辑", notes="多日期选择关联-编辑")
@PostMapping(value = "/edit")
public Result<T> edit(@Validated @RequestBody LawsDateRelation lawsDateRelation) {
lawsDateRelationService.editById(lawsDateRelation);
return Result.OK("操作成功!");
}
/**
* 通过id删除
*
* @param map
* @return
*/
@AutoLog(value = "多日期选择关联-通过id删除")
@ApiOperation(value="多日期选择关联-通过id删除", notes="多日期选择关联-通过id删除")
@PostMapping(value = "/delete")
public Result<T> delete(@RequestBody Map<String, String> map) {
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
return Result.error("请选择数据!");
}
lawsDateRelationService.deleteById(map.get("id"));
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param map
* @return
*/
@AutoLog(value = "多日期选择关联-批量删除")
@ApiOperation(value="多日期选择关联-批量删除", notes="多日期选择关联-批量删除")
@PostMapping(value = "/deleteBatch")
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
return Result.error("请选择数据!");
}
this.lawsDateRelationService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "多日期选择关联-通过id查询")
@ApiOperation(value="多日期选择关联-通过id查询", notes="多日期选择关联-通过id查询")
@GetMapping(value = "/queryById")
public Result<LawsDateRelation> queryById(@RequestParam(name="id",required=true) String id) {
LawsDateRelation lawsDateRelation = lawsDateRelationService.queryById(id);
if(lawsDateRelation==null) {
return Result.error("未找到对应数据");
}
return Result.OK(lawsDateRelation);
}
/**
* 导出excel
*
* @param request
* @param lawsDateRelation
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, LawsDateRelation lawsDateRelation) {
return super.exportXls(request, lawsDateRelation, LawsDateRelation.class, "多日期选择关联");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<LawsDateRelation> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, LawsDateRelation.class);
}
}
@@ -1,177 +0,0 @@
package com.jero.modules.laws.regulation.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.system.base.controller.JeroController;
import com.jero.modules.laws.regulation.entity.LawsFileRelation;
import com.jero.modules.laws.regulation.service.ILawsFileRelationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @Description: 文件关联
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
@Api(tags="文件关联")
@RestController
@RequestMapping("/laws/regulation/lawsFileRelation")
@Slf4j
public class LawsFileRelationController extends JeroController<LawsFileRelation, ILawsFileRelationService> {
@Autowired
private ILawsFileRelationService lawsFileRelationService;
/**
* 分页列表查询
*
* @param lawsFileRelation
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "文件关联-分页列表查询")
@ApiOperation(value="文件关联-分页列表查询", notes="文件关联-分页列表查询")
@GetMapping(value = "/page")
public Result<IPage<LawsFileRelation>> queryPageList(LawsFileRelation lawsFileRelation,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
IPage<LawsFileRelation> pageList = lawsFileRelationService.queryPage(lawsFileRelation, pageNo, pageSize, req);
return Result.OK(pageList);
}
/**
* 列表查询
*
* @param lawsFileRelation
* @param req
* @return
*/
@AutoLog(value = "文件关联-列表查询")
@ApiOperation(value="文件关联-列表查询", notes="文件关联-列表查询")
@GetMapping(value = "/list")
public Result<List<LawsFileRelation>> queryList(LawsFileRelation lawsFileRelation, HttpServletRequest req) {
List<LawsFileRelation> list = lawsFileRelationService.queryList(lawsFileRelation, req);
return Result.OK(list);
}
/**
* 添加
*
* @param lawsFileRelation
* @return
*/
@AutoLog(value = "文件关联-添加")
@ApiOperation(value="文件关联-添加", notes="文件关联-添加")
@PostMapping(value = "/add")
public Result<T> add(@Validated @RequestBody LawsFileRelation lawsFileRelation) {
lawsFileRelationService.add(lawsFileRelation);
return Result.OK("操作成功!");
}
/**
* 编辑
*
* @param lawsFileRelation
* @return
*/
@AutoLog(value = "文件关联-编辑")
@ApiOperation(value="文件关联-编辑", notes="文件关联-编辑")
@PostMapping(value = "/edit")
public Result<T> edit(@Validated @RequestBody LawsFileRelation lawsFileRelation) {
lawsFileRelationService.editById(lawsFileRelation);
return Result.OK("操作成功!");
}
/**
* 通过id删除
*
* @param map
* @return
*/
@AutoLog(value = "文件关联-通过id删除")
@ApiOperation(value="文件关联-通过id删除", notes="文件关联-通过id删除")
@PostMapping(value = "/delete")
public Result<T> delete(@RequestBody Map<String, String> map) {
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
return Result.error("请选择数据!");
}
lawsFileRelationService.deleteById(map.get("id"));
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param map
* @return
*/
@AutoLog(value = "文件关联-批量删除")
@ApiOperation(value="文件关联-批量删除", notes="文件关联-批量删除")
@PostMapping(value = "/deleteBatch")
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
return Result.error("请选择数据!");
}
this.lawsFileRelationService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "文件关联-通过id查询")
@ApiOperation(value="文件关联-通过id查询", notes="文件关联-通过id查询")
@GetMapping(value = "/queryById")
public Result<LawsFileRelation> queryById(@RequestParam(name="id",required=true) String id) {
LawsFileRelation lawsFileRelation = lawsFileRelationService.queryById(id);
if(lawsFileRelation==null) {
return Result.error("未找到对应数据");
}
return Result.OK(lawsFileRelation);
}
/**
* 导出excel
*
* @param request
* @param lawsFileRelation
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, LawsFileRelation lawsFileRelation) {
return super.exportXls(request, lawsFileRelation, LawsFileRelation.class, "文件关联");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<LawsFileRelation> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, LawsFileRelation.class);
}
}
@@ -1,162 +0,0 @@
package com.jero.modules.laws.regulation.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
* @Description: 基础信息
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
@Data
@TableName("laws_basic_info")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="laws_basic_info对象", description="基础信息")
public class LawsBasicInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**主键ID*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键ID")
private java.lang.String id;
/**国家/地区*/
@Excel(name = "国家/地区", width = 15)
@ApiModelProperty(value = "国家/地区")
private java.lang.String countryRegion;
/**标准类别*/
@Excel(name = "标准类别", width = 15)
@ApiModelProperty(value = "标准类别")
private java.lang.String standardClass;
/**标准编号(唯一)*/
@Excel(name = "标准编号(唯一)", width = 15)
@ApiModelProperty(value = "标准编号(唯一)")
private java.lang.String standardNum;
/**标准名称*/
@Excel(name = "标准名称", width = 15)
@ApiModelProperty(value = "标准名称")
private java.lang.String standardName;
/**年代号*/
@Excel(name = "年代号", width = 15)
@ApiModelProperty(value = "年代号")
private java.lang.String yearNum;
/**标准体系(多选:挂接体系树-待定)*/
@Excel(name = "标准体系(多选:挂接体系树-待定)", width = 15)
@ApiModelProperty(value = "标准体系(多选:挂接体系树-待定)")
private java.lang.String standardSystem;
/**标准英文名称*/
@Excel(name = "标准英文名称", width = 15)
@ApiModelProperty(value = "标准英文名称")
private java.lang.String standardNameEn;
/**发布日期*/
@Excel(name = "发布日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "发布日期")
private java.util.Date releaseDate;
/**实施日期*/
@Excel(name = "实施日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "实施日期")
private java.util.Date implementDate;
/**在产车实施日期(多选-最大时间)*/
@Excel(name = "在产车实施日期(多选-最大时间)", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "在产车实施日期(多选-最大时间)")
private java.util.Date implementDateProCarMax;
/**在产车实施日期(多选-最小时间)*/
@Excel(name = "在产车实施日期(多选-最小时间)", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "在产车实施日期(多选-最小时间)")
private java.util.Date implementDateProCarMin;
/**新车型实施日期(多选-最大时间)*/
@Excel(name = "新车型实施日期(多选-最大时间)", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "新车型实施日期(多选-最大时间)")
private java.util.Date implementDateNewCarMax;
/**新车型实施日期(多选-最小时间)*/
@Excel(name = "新车型实施日期(多选-最小时间)", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "新车型实施日期(多选-最小时间)")
private java.util.Date implementDateNewCarMin;
/**废止日期*/
@Excel(name = "废止日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "废止日期")
private java.util.Date abolishDate;
/**(外部)标准状态:起草/征求意见/报批/发布/即将实施/现行有效/废止*/
@Excel(name = "(外部)标准状态:起草/征求意见/报批/发布/即将实施/现行有效/废止", width = 15)
@ApiModelProperty(value = "(外部)标准状态:起草/征求意见/报批/发布/即将实施/现行有效/废止")
private java.lang.String standardStatus;
/**责任部门*/
@Excel(name = "责任部门", width = 15)
@ApiModelProperty(value = "责任部门")
private java.lang.String dutyDepart;
/**责任部门负责人*/
@Excel(name = "责任部门负责人", width = 15)
@ApiModelProperty(value = "责任部门负责人")
private java.lang.String dutyDepartDirector;
/**零部件名称*/
@Excel(name = "零部件名称", width = 15)
@ApiModelProperty(value = "零部件名称")
private java.lang.String partName;
/**适用车型(多选:M1,M2,M3,N1,N2,N3*/
@Excel(name = "适用车型(多选:M1,M2,M3,N1,N2,N3", width = 15)
@ApiModelProperty(value = "适用车型(多选:M1,M2,M3,N1,N2,N3")
private java.lang.String adaptCarType;
/**代替标准号(多选)*/
@Excel(name = "代替标准号(多选)", width = 15)
@ApiModelProperty(value = "代替标准号(多选)")
private java.lang.String replacingStandardNum;
/**被代替标准号*/
@Excel(name = "被代替标准号", width = 15)
@ApiModelProperty(value = "被代替标准号")
private java.lang.String replacedStandardNum;
/**引用标准(多选)*/
@Excel(name = "引用标准(多选)", width = 15)
@ApiModelProperty(value = "引用标准(多选)")
private java.lang.String quotingStandard;
/**被引用标准*/
@Excel(name = "被引用标准", width = 15)
@ApiModelProperty(value = "被引用标准")
private java.lang.String quotedStandard;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "创建时间")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "更新时间")
private java.util.Date updateTime;
/**所属部门*/
@Excel(name = "所属部门", width = 15)
@ApiModelProperty(value = "所属部门")
private java.lang.String sysCode;
}
@@ -1,50 +0,0 @@
package com.jero.modules.laws.regulation.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
* @Description: 多日期选择关联
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
@Data
@TableName("laws_date_relation")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="laws_date_relation对象", description="多日期选择关联")
public class LawsDateRelation implements Serializable {
private static final long serialVersionUID = 1L;
/**主键ID*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键ID")
private java.lang.String id;
/**关联ID*/
@Excel(name = "关联ID", width = 15)
@ApiModelProperty(value = "关联ID")
private java.lang.String relationId;
/**关联字段*/
@Excel(name = "关联字段", width = 15)
@ApiModelProperty(value = "关联字段")
private java.lang.String relationField;
/**关联日期*/
@Excel(name = "关联日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "关联日期")
private java.util.Date relationDate;
}
@@ -1,46 +0,0 @@
package com.jero.modules.laws.regulation.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
/**
* @Description: 文件关联
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
@Data
@TableName("laws_file_relation")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="laws_file_relation对象", description="文件关联")
public class LawsFileRelation implements Serializable {
private static final long serialVersionUID = 1L;
/**主键ID*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键ID")
private java.lang.String id;
/**关联ID*/
@Excel(name = "关联ID", width = 15)
@ApiModelProperty(value = "关联ID")
private java.lang.String relationId;
/**关联字段(关联文件relation_file、发布稿原文original_release、发布稿译文translation_release、修改单modification_list、报批单approval_form、送审稿review_draft、征求意见稿exposure_draft、草案draft*/
@Excel(name = "关联字段(关联文件relation_file、发布稿原文original_release、发布稿译文translation_release、修改单modification_list、报批单approval_form、送审稿review_draft、征求意见稿exposure_draft、草案draft", width = 15)
@ApiModelProperty(value = "关联字段(关联文件relation_file、发布稿原文original_release、发布稿译文translation_release、修改单modification_list、报批单approval_form、送审稿review_draft、征求意见稿exposure_draft、草案draft")
private java.lang.String relationField;
/**关联文件*/
@Excel(name = "关联文件", width = 15)
@ApiModelProperty(value = "关联文件")
private java.lang.String relationFile;
}
@@ -1,14 +0,0 @@
package com.jero.modules.laws.regulation.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jero.modules.laws.regulation.entity.LawsBasicInfo;
/**
* @Description: 基础信息
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
public interface LawsBasicInfoMapper extends BaseMapper<LawsBasicInfo> {
}
@@ -1,14 +0,0 @@
package com.jero.modules.laws.regulation.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jero.modules.laws.regulation.entity.LawsDateRelation;
/**
* @Description: 多日期选择关联
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
public interface LawsDateRelationMapper extends BaseMapper<LawsDateRelation> {
}
@@ -1,14 +0,0 @@
package com.jero.modules.laws.regulation.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jero.modules.laws.regulation.entity.LawsFileRelation;
/**
* @Description: 文件关联
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
public interface LawsFileRelationMapper extends BaseMapper<LawsFileRelation> {
}
@@ -1,5 +0,0 @@
<?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.laws.regulation.mapper.LawsBasicInfoMapper">
</mapper>
@@ -1,10 +0,0 @@
<?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.laws.regulation.mapper.LawsDateRelationMapper">
<resultMap id="LawsDateRelationResultMap" type="com.jero.modules.laws.regulation.entity.LawsDateRelation">
<id column="id" property="id" />
<result column="relation_id" property="relationId" />
<result column="relation_field" property="relationField" />
<result column="relation_date" property="relationDate" />
</resultMap>
</mapper>
@@ -1,10 +0,0 @@
<?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.laws.regulation.mapper.LawsFileRelationMapper">
<resultMap id="LawsFileRelationResultMap" type="com.jero.modules.laws.regulation.entity.LawsFileRelation">
<id column="id" property="id" />
<result column="relation_id" property="relationId" />
<result column="relation_field" property="relationField" />
<result column="relation_file" property="relationFile" />
</resultMap>
</mapper>
@@ -1,58 +0,0 @@
package com.jero.modules.laws.regulation.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.laws.regulation.entity.LawsBasicInfo;
import java.util.List;
import java.util.Map;
/**
* @Description: 基础信息
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
public interface ILawsBasicInfoService extends IService<LawsBasicInfo> {
/**
* @Author: liao
* @Date: 2023/8/21 15:05
* @Description: 标准法规库(国内标准)-分页列表查询
**/
IPage<Map<String,Object>> getDomesticStandardPage(Map<String, Object> parameter);
/**
* @Author: liao
* @Date: 2023/8/21 15:05
* @Description: 标准法规库(海外标准)-分页列表查询
**/
IPage<Map<String,Object>> getForeignStandardPage(Map<String, Object> parameter);
/**
* @Author: liao
* @Date: 2023/8/23 9:37
* @Description: 获取列表表头
**/
List<Map<String, Object>> getListHeader(String flag);
/**
* @Author: liao
* @Date: 2023/8/23 11:20
* @Description: 获取表单模型
**/
List<Map<String, Object>> getFormModel(String flag);
/**
* @Author: liao
* @Date: 2023/8/23 14:54
* @Description: 获取查询条件
**/
List<Map<String, Object>> getQueryCondition(String flag);
/**
* @Author: liao
* @Date: 2023/8/24 9:27
* @Description: 新增数据
**/
void addData(Map<String, Object> parameterMap);
}
@@ -1,77 +0,0 @@
package com.jero.modules.laws.regulation.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.laws.regulation.entity.LawsDateRelation;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @Description: 多日期选择关联
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
public interface ILawsDateRelationService extends IService<LawsDateRelation> {
/**
* 分页查询
*
* @param lawsDateRelation
* @param pageNo
* @param pageSize
* @param req
* @return
*/
IPage<LawsDateRelation> queryPage(LawsDateRelation lawsDateRelation, Integer pageNo, Integer pageSize, HttpServletRequest req);
/**
* 列表查询
*
* @param lawsDateRelation
* @param req
* @return
*/
List<LawsDateRelation> queryList(LawsDateRelation lawsDateRelation, HttpServletRequest req);
/**
* 保存
*
* @param lawsDateRelation
* @return
*/
void add(LawsDateRelation lawsDateRelation);
/**
* 更新
*
* @param lawsDateRelation
* @return
*/
void editById(LawsDateRelation lawsDateRelation);
/**
* 通过id删除
*
* @param id
* @return
*/
void deleteById(String id);
/**
* 批量删除
*
* @param ids
* @return
*/
void deleteByIds(List<String> ids);
/**
* 通过id查询
*
* @param id
* @return
*/
LawsDateRelation queryById(String id);
}
@@ -1,77 +0,0 @@
package com.jero.modules.laws.regulation.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.laws.regulation.entity.LawsFileRelation;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @Description: 文件关联
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
public interface ILawsFileRelationService extends IService<LawsFileRelation> {
/**
* 分页查询
*
* @param lawsFileRelation
* @param pageNo
* @param pageSize
* @param req
* @return
*/
IPage<LawsFileRelation> queryPage(LawsFileRelation lawsFileRelation, Integer pageNo, Integer pageSize, HttpServletRequest req);
/**
* 列表查询
*
* @param lawsFileRelation
* @param req
* @return
*/
List<LawsFileRelation> queryList(LawsFileRelation lawsFileRelation, HttpServletRequest req);
/**
* 保存
*
* @param lawsFileRelation
* @return
*/
void add(LawsFileRelation lawsFileRelation);
/**
* 更新
*
* @param lawsFileRelation
* @return
*/
void editById(LawsFileRelation lawsFileRelation);
/**
* 通过id删除
*
* @param id
* @return
*/
void deleteById(String id);
/**
* 批量删除
*
* @param ids
* @return
*/
void deleteByIds(List<String> ids);
/**
* 通过id查询
*
* @param id
* @return
*/
LawsFileRelation queryById(String id);
}
@@ -1,594 +0,0 @@
package com.jero.modules.laws.regulation.service.impl;
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.enums.LanguageEnum;
import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.util.MessageUtils;
import com.jero.modules.document.enums.FieldTypeEnum;
import com.jero.modules.laws.common.mapper.LawsCommonMapper;
import com.jero.modules.laws.regulation.entity.LawsBasicInfo;
import com.jero.modules.laws.regulation.mapper.LawsBasicInfoMapper;
import com.jero.modules.laws.regulation.service.ILawsBasicInfoService;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.entity.SysCategoryTreeVO;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.service.ISysDictItemService;
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
import com.jero.modules.system.util.MyStringUtils;
import com.jero.modules.tag.entity.LawsArea;
import com.jero.modules.tag.entity.LawsTag;
import com.jero.modules.tag.enums.FileTableIdEnum;
import com.jero.modules.tag.mapper.LawsTagMapper;
import com.jero.modules.tag.service.ILawsAreaService;
import com.jero.modules.tag.service.ILawsTagService;
import com.spire.ms.System.Collections.ArrayList;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Description: 基础信息
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
@Service
@Transactional(rollbackFor = JeroBootException.class)
public class LawsBasicInfoServiceImpl extends ServiceImpl<LawsBasicInfoMapper, LawsBasicInfo> implements ILawsBasicInfoService {
@Autowired
private ILawsTagService lawsTagService;
@Autowired
private LawsTagMapper lawsTagMapper;
@Autowired
private SysCategoryServiceImpl sysCategoryService;
@Autowired
private ISysDictItemService sysDictItemService;
@Autowired
private IOSSFileService ossFileService;
@Autowired
private ILawsAreaService lawsAreaService;
@Autowired
private LawsCommonMapper lawsCommonMapper;
/**
* @Author: liao
* @Date: 2023/8/21 15:05
* @Description: 标准法规库(国内标准)-分页列表查询
**/
@Override
public IPage<Map<String,Object>> getDomesticStandardPage(Map<String, Object> parameter) {
String cut = MessageUtils.getLanguage().getValue();
// 获取需要查询的字段集合(拼接select后面的返回字段)
List<LawsTag> fieldList = getFieldList(FileTableIdEnum.DOMESTIC_REGULATIONS.getValue());
// 获取查询返回字段集合
List<String> selectField = getSelectField(fieldList);
// 封装查询条件(包含高级搜索)
String condition = getConditionStr(parameter);
int pageNo = Integer.parseInt(parameter.get("pageNo").toString());
int pageSize = Integer.parseInt(parameter.get("pageSize").toString());
IPage<Map<String,Object>> page = new Page<>(pageNo, pageSize);
IPage<Map<String,Object>> infoPage = lawsTagMapper.getInfoPage(page, " " + StringUtils.join(selectField, ","), condition);
// 树形数据字典(标签内容管理数据,相关表sys_category、sys_dict
List<SysCategory> categoryList = sysCategoryService.list();
//过滤出树形字段
List<LawsTag> treeFieldList = fieldList.stream()
.filter(e -> FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType()))
.collect(Collectors.toList());
//过滤出文件字段
List<LawsTag> lawsTagFileList = fieldList.stream()
.filter(e -> FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType()))
.collect(Collectors.toList());
// 文件类型字段名集合
List<String> fileList = lawsTagFileList.stream().map(LawsTag::getDbFieldName).collect(Collectors.toList());
// 查询返回结果集合
List<Map<String,Object>> records = infoPage.getRecords();
//数据字典(框架原来的数据字典)
List<SysDictItem> sysDictItems = sysDictItemService.selectItemsAll();
//下拉选处理数据字典
List<String> idList = new java.util.ArrayList<>();
List<String> fileIdLidt = new java.util.ArrayList<>();
for (Map<String,Object> record : records) {
Map<String, Object> record1 = (Map) record;
idList.add((String) record1.get("id"));
for (Map.Entry<String, Object> entry : record1.entrySet()) {
//下拉选处理数据字典
// sysDictItems框架原来的数据字典全部配置项数据、entry单独的一条国内法规数据、cut中英文、fieldList国内法规表的全部字段
dictItem(sysDictItems, entry, cut, fieldList,null);
treeDictItem(categoryList, entry, treeFieldList, cut,null);
if(fileList.contains(entry.getKey()) && StringUtils.isNotBlank((String)entry.getValue())){
fileIdLidt.add((String)entry.getValue());
}
}
}
// 列表显示的时候,将ids替换成names
if(!fileIdLidt.isEmpty()){
List<OSSFile> fileInfos = ossFileService.getFileInfos(StringUtils.join(fileIdLidt, ","));
if(!fileInfos.isEmpty()){
for (Map<String,Object> record : records) {
Map<String, Object> record1 = (Map) record;
idList.add((String) record1.get("id"));
for (Map.Entry<String, Object> entry : record1.entrySet()) {
String value = (String) entry.getValue();
if(fileList.contains(entry.getKey()) && StringUtils.isNotBlank(value)){
List<OSSFile> ossFileList = fileInfos.stream().filter(e -> value.equals(e.getConnectId())).collect(Collectors.toList());
if(!ossFileList.isEmpty()){
List<String> fileNameList = ossFileList.stream().map(OSSFile::getFileName).collect(Collectors.toList());
entry.setValue(StringUtils.join(fileNameList,","));
}
}
}
}
}
}
//收藏和订阅
//collectAndSubscribe(records, idList);
return infoPage;
}
/**
* @Author: liao
* @Date: 2023/8/21 15:05
* @Description: 标准法规库(海外标准)-分页列表查询
**/
@Override
public IPage<Map<String,Object>> getForeignStandardPage(Map<String, Object> parameter) {
return null;
}
/**
* @Author: liao
* @Date: 2023/8/23 9:37
* @Description: 获取列表表头
**/
@Override
public List<Map<String, Object>> getListHeader(String flag) {
LanguageEnum language = MessageUtils.getLanguage();
// 获取当前表字段集合
List<LawsTag> fieldList = getFieldList(flag);
// 筛选出用于列表显示的字段(isShowList **列表是否显示0否 1是*
fieldList = fieldList.stream().filter(lawsTag -> YesOrNoEnum.YES.getInteger()
.equals(lawsTag.getIsShowList())).collect(Collectors.toList());
List<Map<String, Object>> resultList = new java.util.ArrayList<>();
for (LawsTag lawsTag : fieldList) {
Map<String, Object> map = new HashMap<>();
// 字段属性为输入框(链接)的点击跳转标识
if(FieldTypeEnum.TEXT_LINK.getValue().equals(lawsTag.getFieldShowType())){
map.put("urlClick","true");
}
// 字段名
String dbFieldName = lawsTag.getDbFieldName();
// 字段名为标准号、标准名称的点击跳转标识
if ("standard_num".equals(dbFieldName) || "standard_name".equals(dbFieldName)) {
//跳转详情的标识
map.put("click", "true");
}
// 字段为发布日期、实施日期、新车型实施日期、在产车实施日期、标准状态的有排序箭头标识
// 注:先写两个做下记号,数据库里面有sort_flag字段做标识,后面可以删掉下面两个判断。
// 发布日期
if ("release_date".equals(lawsTag.getDbFieldName())) {
map.put("sort", "true"); //列表排序标识
}
// 实施日期
if ("implement_date".equals(lawsTag.getDbFieldName())) {
map.put("sort", "true"); //列表排序标识
}
// 用于排序传参以及列表表头显示
map.put("db_field_name", lawsTag.getDbFieldName()); //字段名
if (LanguageEnum.CN.equals(language)) {
map.put("db_field_txt", lawsTag.getDbFieldTxt());//字段中文名
} else {
map.put("db_field_txt", lawsTag.getDbFieldEnName());//字段英文名
}
resultList.add(map);
}
return resultList;
}
/**
* @Author: liao
* @Date: 2023/8/23 11:20
* @Description: 获取表单模型
**/
@Override
public List<Map<String, Object>> getFormModel(String flag) {
String cut = MessageUtils.getLanguage().getValue();
LawsArea lawsArea = new LawsArea();
lawsArea.setIsModel(flag);
// 区域管理
List<LawsArea> areaList = lawsAreaService.queryList(lawsArea);
// 字段字段集合
List<LawsTag> fieldList = getFieldList(flag);
// 文件类型字段集合
List<LawsTag> lawsTagFieldList = fieldList.stream().filter(lawsTag -> FieldTypeEnum.FILE.getValue()
.equals(lawsTag.getFieldShowType())).collect(Collectors.toList());
List<String> fieldFileList = lawsTagFieldList.stream().map(LawsTag::getDbFieldName).collect(Collectors.toList());
//过滤出字段为树形结构的
if (fieldList.size() != 0) {
//过滤出表单字段(is_show_form-->表单是否显示0否 1是)
fieldList = fieldList.stream()
.filter(e -> YesOrNoEnum.YES.getValue().equals(MyStringUtils.valueOf(e.getIsShowForm())))
.collect(Collectors.toList());
}
Map<String,Object> params = new HashedMap();
params.put("cut",cut);
// 获取树型字典
List<SysCategoryTreeVO> sysCategoryTree = sysCategoryService.getSysCategoryTree(null,params);
List<Map<String, Object>> resultTemp = new java.util.ArrayList<>();
for (LawsArea lawsAreaTemp : areaList) {
List<Map<String, Object>> Results = new java.util.ArrayList<>();
Map<String, Object> mapTemp = new HashMap<>();
String areaName = "";
// 获取展示区域名称
if (LanguageEnum.CN.getValue().equals(cut)) {
areaName = lawsAreaTemp.getShowArea();
} else {
areaName = lawsAreaTemp.getEnName();
}
// 获取该区域的所有字段
List<LawsTag> fieldListTemp = fieldList.stream().filter(e -> lawsAreaTemp.getId()
.equals(e.getShowArea())).collect(Collectors.toList());
for (LawsTag lawsTag : fieldListTemp) {
if (lawsAreaTemp.getId().equals(lawsTag.getShowArea())) {
String dictId = lawsTag.getDictId();
List<SysCategoryTreeVO> sysCategoryTreeVOList = new java.util.ArrayList<>();
// 如果字典标识字段不为空,则筛选出该字典的全部配置项集合
if (StringUtils.isNotBlank(dictId)) {
sysCategoryTreeVOList = sysCategoryTree.stream().filter(e -> dictId.equals(e.getDictId())).collect(Collectors.toList());
}
Map<String, Object> map = new HashMap<>();
mapPut(cut, map, "field_show_type", lawsTag.getFieldShowType(),
"dict_field", lawsTag.getDictField(), "db_field_name",
lawsTag.getDbFieldName(), "db_field_txt", lawsTag.getDbFieldTxt(),
"db_field_en_name", lawsTag.getDbFieldEnName(), "area", areaName, sysCategoryTreeVOList);
map.put("field_must_input", lawsTag.getFieldMustInput());//是否必填
map.put("db_length", lawsTag.getDbLength());//字段长度
if (fieldFileList.contains(lawsTag.getDbFieldName()) && lawsTag.getIsReadOnly() == 1) {
map.put("flag", "1");//固定文件标识
} else if (fieldFileList.contains(lawsTag.getDbFieldName()) && lawsTag.getIsReadOnly() == 0) {
map.put("flag", "0");//非固定文件字段
}
Results.add(map);
}
}
if (LanguageEnum.CN.getValue().equals(cut)) {
mapTemp.put(lawsAreaTemp.getShowArea(), Results);
} else {
mapTemp.put(lawsAreaTemp.getEnName(), Results);
}
resultTemp.add(mapTemp);
}
return resultTemp;
}
private void mapPut(String cut, Map<String, Object> map, String field_show_type,
String fieldShowType2, String dict_field, String dictField,
String db_field_name, String dbFieldName2, String db_field_txt,
String dbFieldTxt, String db_field_en_name, String dbFieldEnName,
String area, String showArea, List<SysCategoryTreeVO> sysCategoryTreeVOS) {
if(FieldTypeEnum.TEXT_LINK.getValue().equals(fieldShowType2)){
map.put("urlClick", "true");
}
map.put(field_show_type, fieldShowType2);//类型(判断是下拉还是输入框,等等)
map.put(dict_field, dictField);
map.put(db_field_name, dbFieldName2);//字段
if (StringUtils.isNotBlank(cut)) {
if (LanguageEnum.CN.getValue().equals(cut)) {
map.put(db_field_txt, dbFieldTxt);//字段中文名
} else {
map.put(db_field_txt, dbFieldEnName);//字段中文名
}
} else {
map.put(db_field_txt, dbFieldTxt);//字段中文名
}
map.put(area, showArea);//区域
map.put("tree", sysCategoryTreeVOS);//区域
}
/**
* @Author: liao
* @Date: 2023/8/22 13:41
* @Description: 属性字典处理中文
**/
private void treeDictItem(List<SysCategory> categoryList, Map.Entry<String, Object> entry, List<LawsTag> treeFieldList, String cut,String flag) {
List<String> treeFields = treeFieldList.stream().map(LawsTag::getDbFieldName).collect(Collectors.toList());
String key = entry.getKey();
if (treeFields.contains(entry.getKey())) {
String value = MyStringUtils.valueOf(entry.getValue());
if (StringUtils.isNotBlank(value)) {
List<String> idList = Arrays.asList(value.split(","));
List<SysCategory> sysCategoryList = categoryList.stream().filter(e -> idList.contains(e.getId())).collect(Collectors.toList());
List<String> nameList = sysCategoryList.stream().map(SysCategory::getName).collect(Collectors.toList());
List<String> nameEnList = sysCategoryList.stream().map(SysCategory::getEnName).collect(Collectors.toList());
if (LanguageEnum.CN.getValue().equals(cut)) {
entry.setValue(StringUtils.join(nameList, ","));
} else if(LanguageEnum.EN.getValue().equals(cut)){
entry.setValue(StringUtils.join(nameEnList, ","));
}else if("1".equals(flag)){
entry.setValue(StringUtils.join(nameEnList, ","));
}
}
}
}
/**
* @Author: liao
* @Date: 2023/8/22 13:42
* @Description: 属性字典处理中文
**/
private void dictItem(List<SysDictItem> sysDictItems, Map.Entry<String, Object> entry, String cut, List<LawsTag> fieldList,String flag) {
//通过dictField判断字段是否为下拉选(不为空则为下拉选)
List<LawsTag> lawsTagFieldList = fieldList.stream().filter(field ->
entry.getKey().equals(field.getDbFieldName())).collect(Collectors.toList());
//数据字典中文
List<String> dictItemsCh = new java.util.ArrayList<>();
List<String> dictItemsEn = new java.util.ArrayList<>();
for (LawsTag lawsTagField : lawsTagFieldList) {
if (FieldTypeEnum.PULL_SINGLE.getValue().equals(lawsTagField.getFieldShowType())
|| FieldTypeEnum.PULL_MORE.getValue().equals(lawsTagField.getFieldShowType())) {
String value = (String) entry.getValue();
if (StringUtils.isNotBlank(value) && lawsTagFieldList.size() != 0
&& StringUtils.isNotBlank(lawsTagFieldList.get(0).getDictField())) {
for (String itemValue : value.split(",")) {
//字段的数据字典
List<SysDictItem> dictItemList = sysDictItems.stream()
.filter(e -> StringUtils.isNotBlank(e.getDictCode()) && e.getDictCode().equals(lawsTagFieldList.get(0).getDictField()))
.collect(Collectors.toList());
if (dictItemList.size() != 0) {
List<SysDictItem> dictItems = dictItemList.stream()
.filter(e -> itemValue.equals(e.getItemValue()))
.collect(Collectors.toList());
if (dictItems.size() != 0) {
List<String> itemText = new java.util.ArrayList<>();
if (LanguageEnum.CN.getValue().equals(cut)) {
itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
} else if(LanguageEnum.EN.getValue().equals(cut)) {
itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList());
}else if("1".equals(flag)){
itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList());
}
dictItemsCh.addAll(itemText);
dictItemsEn.addAll(itemText);
}
}
}
}
}
}
if (lawsTagFieldList.size() != 0 && StringUtils.isNotBlank(lawsTagFieldList.get(0).getDictField())) {
if(FieldTypeEnum.PULL_SINGLE.getValue().equals(lawsTagFieldList.get(0).getFieldShowType())
|| FieldTypeEnum.PULL_MORE.getValue().equals(lawsTagFieldList.get(0).getFieldShowType())){
if (LanguageEnum.CN.getValue().equals(cut)) {
entry.setValue(StringUtils.join(dictItemsCh, ","));
} else if(LanguageEnum.EN.getValue().equals(cut)){
entry.setValue(StringUtils.join(dictItemsEn, ","));
}else if("1".equals(flag)){
entry.setValue(StringUtils.join(dictItemsEn, ","));
}
}
}
}
/**
* @Author: liao
* @Date: 2023/8/22 11:02
* @Description: 组装查询条件
**/
private String getConditionStr(Map<String, Object> parameter) {
//查询条件
StringBuilder conditionSb = new StringBuilder("where 1 = 1");
//过滤查询条件字段类型使用
List<Map<String, Object>> mapList = getQueryCondition(FileTableIdEnum.DOMESTIC_REGULATIONS.getValue());
//查询条件处理
for (Map.Entry<String, Object> entry : parameter.entrySet()) {
String key = entry.getKey();
if (!"pageNo".equals(key) && !"pageSize".equals(key)) {
String value = "";
if(ObjectUtils.isNotEmpty(entry.getValue())){
value = MyStringUtils.valueOf(entry.getValue());
}
if (StringUtils.isNotBlank(value)) {
for (Map<String, Object> map : mapList) {
String fieldName = (String) map.get("db_field_name");//字段
if (key.equals(fieldName)) {
//字段类型(判断是输入框还是下拉,等等)
String fieldType = (String) map.get("field_show_type");//字段类型
if (FieldTypeEnum.TEXT_STRING.getValue().equals(fieldType)
|| FieldTypeEnum.TEXT_NUMBER.getValue().equals(fieldType)
|| FieldTypeEnum.STANDARD.getValue().equals(fieldType)) {
if (value.contains("%")) {
// 字段内容可能包含%,是转义字符,做一下处理
value = value.replace("%", "/%");
}
conditionSb.append(" and " + key + " like concat(concat('%','" + value + "'),'%')");
} else if (FieldTypeEnum.PULL_SINGLE.getValue().equals(fieldType)
|| FieldTypeEnum.PULL_MORE.getValue().equals(fieldType)
|| FieldTypeEnum.TREE.getValue().equals(fieldType)) {
StringBuilder valueSb = new StringBuilder();
StringBuilder condition = new StringBuilder();
for (String valueTemp : value.split(",")) {
valueSb.append("'" + valueTemp + "',");
condition.append(" or " + key + " like binary concat(concat('%','" + valueTemp + "'),'%')");
}
condition.append(")");
String substring = valueSb.substring(0, valueSb.length() - 1);
//下拉单选或下拉多选
conditionSb.append(" and (" + key + " in(" + substring + ")" + condition);
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldType)) {
//日期(区分单日期还时间范围)
if (value.contains(",")) {
conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') >= '" + value.split(",")[0] + "'"
+ " and " + "date_format(" + key + ",'%Y-%m-%d') <= '" + value.split(",")[1] + "'");
} else {
conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') = '" + value + "'");
}
} else if (FieldTypeEnum.PERSON.getValue().equals(fieldType)) {
if (value.contains("%")) {
// 字段内容可能包含%,是转义字符,做一下处理
value = value.replace("%", "/%");
}
conditionSb.append(" and " + key + " like concat(concat('%','" + value + "'),'%')");
}
}
}
}
}
}
//处理列表表头排序
if (StringUtils.isNotBlank((String) parameter.get("orderByField"))) {
String orderByField = (String) parameter.get("orderByField");
conditionSb.append(" order by " + parameter.get("orderByField"));
orderBySort(parameter, conditionSb);
} else {
conditionSb.append(" order by create_time desc");
}
String condition = conditionSb.toString();
return condition;
}
/**
* @Author: liao
* @Date: 2023/8/23 14:55
* @Description: 获取查询条件
**/
@Override
public List<Map<String, Object>> getQueryCondition(String flag) {
String cut = MessageUtils.getLanguage().getValue();
List<LawsTag> fieldList = getFieldList(flag);
fieldList = fieldList.stream().filter(e -> YesOrNoEnum.YES.getValue()
.equals(MyStringUtils.valueOf(e.getIsQuery()))).collect(Collectors.toList());
//树形数据字典
Map<String,Object> params = new HashedMap();
params.put("cut",cut);
List<SysCategoryTreeVO> sysCategoryTree = sysCategoryService.getSysCategoryTree(null,params);
List<Map<String, Object>> list = new java.util.ArrayList<>();
for (LawsTag lawsTag : fieldList) {
Map<String, Object> map = new HashMap<>();
map.put("field_show_type", lawsTag.getFieldShowType());//类型(判断是下拉还是输入框,等等)
map.put("dict_field", lawsTag.getDictField());
map.put("db_field_name", lawsTag.getDbFieldName());//字段
if (LanguageEnum.CN.getValue().equals(cut)) {
map.put("db_field_txt", lawsTag.getDbFieldTxt());//字段中文名
} else {
map.put("db_field_txt", lawsTag.getDbFieldEnName());//字段英文名
}
// 树型结构的集合(后面写个通用的)
/*if ("technology_territory".equals(lawsTag.getDbFieldName())) {
List<SysCategoryTreeVO> sysCategoryTreeVOList = sysCategoryTree.stream()
.filter(sysCategoryTreeVO -> lawsTag.getDictId()
.equals(sysCategoryTreeVO.getDictId())).collect(Collectors.toList());
map.put("tree", sysCategoryTreeVOList);
} else {
map.put("tree", new java.util.ArrayList<>());
}*/
list.add(map);
}
return list;
}
/**
* @Author: liao
* @Date: 2023/8/24 9:27
* @Description: 新增数据
**/
@Override
public void addData(Map<String, Object> parameterMap) {
// 获取操作模块
String module = parameterMap.get("module").toString();
// 获取要操作的表名
String tableName = FileTableIdEnum.getTableName(module);
// 获取全部字段
List<LawsTag> fieldList = lawsCommonMapper.getFieldList(tableName);
}
/**
* @Author: liao
* @Date: 2023/8/21 17:33
* @Description: 获取查询返回字段集合
**/
private List<String> getSelectField(List<LawsTag> fieldList) {
// 筛选获取日期类型字段
List<String> dateFieldList = fieldList.stream().filter(lawsTag -> FieldTypeEnum.DATE_SINGLE
.equals(lawsTag.getFieldShowType())).collect(Collectors.toList())
.stream().map(LawsTag::getDbFieldName).collect(Collectors.toList());
// 只查询显示的字段
if (CollectionUtils.isNotEmpty(fieldList)) {
fieldList = fieldList.stream().filter(lawsTag -> YesOrNoEnum.YES.getValue()
.equals(lawsTag.getIsShowList().toString())).collect(Collectors.toList());
}
// 获取全部的字段列表
List<String> tempFieldList = fieldList.stream().map(LawsTag::getDbFieldName).collect(Collectors.toList());
// 创建一个新的用于返回的字段列表
List<String> selectField = new ArrayList();
// 查询主键
selectField.add("id");
tempFieldList.forEach(tempField -> {
String endField = null;
// 对日期格式和普通格式做处理
if (dateFieldList.contains(tempField)) {
// 如果是日期格式
String newField = "date_format(" + tempField + ", '%Y-%m-%d')";
endField = "case when " + newField + " is null then \"\" else " + newField + " end " + tempField;
selectField.add(endField);
} else {
// 如果是普通格式
endField = "case when " + tempField + " is null then \"\" else " + tempField + " end " + tempField;
selectField.add(endField);
}
});
return selectField;
}
/**
* @Author: liao
* @Date: 2023/8/21 17:56
* @Description: 根据table_name查询字段集合
**/
private List<LawsTag> getFieldList(String flag) {
return lawsTagMapper.getFieldList(FileTableIdEnum.getTableName(flag));
}
/**
* @Author: liao
* @Date: 2023/8/22 11:41
* @Description: 给拼装的查询条件排序
**/
private void orderBySort(Map<String, Object> parameter, StringBuilder conditionSb) {
if ("1".equals(parameter.get("orderBy"))) {
conditionSb.append(" asc");//正序
} else if ("2".equals(parameter.get("orderBy"))) {
conditionSb.append(" desc");//倒序
}
}
}
@@ -1,113 +0,0 @@
package com.jero.modules.laws.regulation.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.laws.regulation.entity.LawsDateRelation;
import com.jero.modules.laws.regulation.mapper.LawsDateRelationMapper;
import com.jero.modules.laws.regulation.service.ILawsDateRelationService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @Description: 多日期选择关联
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
@Service
@Transactional(rollbackFor = JeroBootException.class)
public class LawsDateRelationServiceImpl extends ServiceImpl<LawsDateRelationMapper, LawsDateRelation> implements ILawsDateRelationService {
/**
* 分页查询
*
* @param lawsDateRelation
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@Override
public IPage<LawsDateRelation> queryPage(LawsDateRelation lawsDateRelation, Integer pageNo, Integer pageSize,
HttpServletRequest req) {
QueryWrapper<LawsDateRelation> queryWrapper = QueryGenerator.initQueryWrapper(lawsDateRelation, req.getParameterMap());
Page<LawsDateRelation> page = new Page<>(pageNo, pageSize);
return page(page, queryWrapper);
}
/**
* 列表查询
*
* @param lawsDateRelation
* @param req
* @return
*/
@Override
public List<LawsDateRelation> queryList(LawsDateRelation lawsDateRelation, HttpServletRequest req) {
return list(QueryGenerator.initQueryWrapper(lawsDateRelation, req.getParameterMap()));
}
/**
* 保存
*
* @param lawsDateRelation
* @return
*/
@Override
public void add(LawsDateRelation lawsDateRelation) {
save(lawsDateRelation);
}
/**
* 更新
*
* @param lawsDateRelation
* @return
*/
@Override
public void editById(LawsDateRelation lawsDateRelation) {
saveOrUpdate(lawsDateRelation);
}
/**
* 通过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 LawsDateRelation queryById(String id) {
return getById(id);
}
}
@@ -1,113 +0,0 @@
package com.jero.modules.laws.regulation.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.laws.regulation.entity.LawsFileRelation;
import com.jero.modules.laws.regulation.mapper.LawsFileRelationMapper;
import com.jero.modules.laws.regulation.service.ILawsFileRelationService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @Description: 文件关联
* @Author: jero-boot
* @Date: 2023-08-11
* @Version: V1.0
*/
@Service
@Transactional(rollbackFor = JeroBootException.class)
public class LawsFileRelationServiceImpl extends ServiceImpl<LawsFileRelationMapper, LawsFileRelation> implements ILawsFileRelationService {
/**
* 分页查询
*
* @param lawsFileRelation
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@Override
public IPage<LawsFileRelation> queryPage(LawsFileRelation lawsFileRelation, Integer pageNo, Integer pageSize,
HttpServletRequest req) {
QueryWrapper<LawsFileRelation> queryWrapper = QueryGenerator.initQueryWrapper(lawsFileRelation, req.getParameterMap());
Page<LawsFileRelation> page = new Page<>(pageNo, pageSize);
return page(page, queryWrapper);
}
/**
* 列表查询
*
* @param lawsFileRelation
* @param req
* @return
*/
@Override
public List<LawsFileRelation> queryList(LawsFileRelation lawsFileRelation, HttpServletRequest req) {
return list(QueryGenerator.initQueryWrapper(lawsFileRelation, req.getParameterMap()));
}
/**
* 保存
*
* @param lawsFileRelation
* @return
*/
@Override
public void add(LawsFileRelation lawsFileRelation) {
save(lawsFileRelation);
}
/**
* 更新
*
* @param lawsFileRelation
* @return
*/
@Override
public void editById(LawsFileRelation lawsFileRelation) {
saveOrUpdate(lawsFileRelation);
}
/**
* 通过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 LawsFileRelation queryById(String id) {
return getById(id);
}
}