From b3460656577f4b55ef8d629269703ed79b4ff6f4 Mon Sep 17 00:00:00 2001 From: yjz <3131811435@qq.com> Date: Thu, 26 Oct 2023 16:12:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AF=B9?= =?UTF-8?q?=E6=AF=94):=20=E5=8A=9F=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jero/common/util/BeanCopyUtils.java | 33 ++ .../com/jero/common/util/SnowflakeUtils.java | 16 + .../mapper/LawsCustomCompareCellDao.xml | 39 ++ .../common/LawsCustomCompareCommon.java | 40 ++ .../LawsCustomCompareCellController.java | 18 + .../LawsCustomCompareInfoController.java | 213 +++++++ ...wsCustomCompareInfoStandardController.java | 18 + .../LawsCustomCompareInventoryController.java | 18 + .../entity/LawsCustomCompareCell.java | 40 ++ .../entity/LawsCustomCompareInfo.java | 34 ++ .../entity/LawsCustomCompareInfoStandard.java | 31 + .../entity/LawsCustomCompareInventory.java | 39 ++ .../mapper/LawsCustomCompareCellMapper.java | 12 + .../mapper/LawsCustomCompareInfoMapper.java | 42 ++ .../LawsCustomCompareInfoStandardMapper.java | 12 + .../LawsCustomCompareInventoryMapper.java | 12 + .../xml/LawsCustomCompareCellMapper.xml | 5 + .../xml/LawsCustomCompareInfoMapper.xml | 51 ++ .../xml/LawsCustomCompareInfoStandard.xml | 5 + .../xml/LawsCustomCompareInventoryMapper.xml | 5 + .../ILawsCustomCompareCellService.java | 15 + .../ILawsCustomCompareInfoService.java | 94 +++ ...ILawsCustomCompareInfoStandardService.java | 15 + .../ILawsCustomCompareInventoryService.java | 15 + .../LawsCustomCompareCellServiceImpl.java | 21 + .../LawsCustomCompareInfoServiceImpl.java | 538 ++++++++++++++++++ ...sCustomCompareInfoStandardServiceImpl.java | 21 + ...LawsCustomCompareInventoryServiceImpl.java | 21 + .../vo/LawsCustomCompareInfoVO.java | 42 ++ .../laws/customcompare/vo/StandardSaveVO.java | 21 + .../laws/customcompare/vo/StandardVO.java | 56 ++ .../laws/customcompare/vo/TableDetailVO.java | 27 + .../impl/DocumentSplitServiceImpl.java | 8 - 33 files changed, 1569 insertions(+), 8 deletions(-) create mode 100644 laws-base/laws-base-core/src/main/java/com/jero/common/util/BeanCopyUtils.java create mode 100644 laws-base/laws-base-core/src/main/java/com/jero/common/util/SnowflakeUtils.java create mode 100644 laws-module-system/src/main/resources/mapper/LawsCustomCompareCellDao.xml create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/common/LawsCustomCompareCommon.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareCellController.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoController.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoStandardController.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInventoryController.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareCell.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareInfo.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareInfoStandard.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareInventory.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareCellMapper.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareInfoMapper.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareInfoStandardMapper.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareInventoryMapper.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareCellMapper.xml create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInfoMapper.xml create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInfoStandard.xml create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInventoryMapper.xml create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareCellService.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInfoService.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInfoStandardService.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInventoryService.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareCellServiceImpl.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoServiceImpl.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoStandardServiceImpl.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInventoryServiceImpl.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/LawsCustomCompareInfoVO.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/StandardSaveVO.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/StandardVO.java create mode 100644 laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/TableDetailVO.java diff --git a/laws-base/laws-base-core/src/main/java/com/jero/common/util/BeanCopyUtils.java b/laws-base/laws-base-core/src/main/java/com/jero/common/util/BeanCopyUtils.java new file mode 100644 index 00000000..63bb9dde --- /dev/null +++ b/laws-base/laws-base-core/src/main/java/com/jero/common/util/BeanCopyUtils.java @@ -0,0 +1,33 @@ +package com.jero.common.util; + +import org.springframework.beans.BeanUtils; + +import java.util.List; +import java.util.stream.Collectors; + +public class BeanCopyUtils { + private BeanCopyUtils() { + } + + /** 1、单个对象*/ + public static V copyBean(Object source, Class clazz) { + /** 创建目标对象 实现属性拷贝*/ + V result = null; + try { + result = clazz.newInstance(); + /** 拷贝*/ + BeanUtils.copyProperties(source, result); + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + /** 2、集合*/ + public static List copyBeanList(List list, Class clazz) { + /** 创建目标对象 实现属性拷贝*/ + return list.stream() + .map(o -> copyBean(o, clazz)) + .collect(Collectors.toList()); + } +} \ No newline at end of file diff --git a/laws-base/laws-base-core/src/main/java/com/jero/common/util/SnowflakeUtils.java b/laws-base/laws-base-core/src/main/java/com/jero/common/util/SnowflakeUtils.java new file mode 100644 index 00000000..190178fa --- /dev/null +++ b/laws-base/laws-base-core/src/main/java/com/jero/common/util/SnowflakeUtils.java @@ -0,0 +1,16 @@ +package com.jero.common.util; + +import cn.hutool.core.lang.Snowflake; +import cn.hutool.core.util.IdUtil; + +public class SnowflakeUtils { + + private SnowflakeUtils(){ + + } + + public static long snowflake(){ + Snowflake snowflake = IdUtil.getSnowflake(1, 1); + return snowflake.nextId(); + } +} diff --git a/laws-module-system/src/main/resources/mapper/LawsCustomCompareCellDao.xml b/laws-module-system/src/main/resources/mapper/LawsCustomCompareCellDao.xml new file mode 100644 index 00000000..96f19740 --- /dev/null +++ b/laws-module-system/src/main/resources/mapper/LawsCustomCompareCellDao.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + insert into laws-sinotruk-demo.laws_custom_compare_cell(id, info_id, standard_id, feature_id, compare_item_id, content, file_id, create_by, create_time, update_by, update_time, del_flag) + values + + (#{entity.id}, #{entity.infoId}, #{entity.standardId}, #{entity.featureId}, #{entity.compareItemId}, #{entity.content}, #{entity.fileId}, #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.delFlag}) + + + + + insert into laws-sinotruk-demo.laws_custom_compare_cell(id, info_id, standard_id, feature_id, compare_item_id, content, file_id, create_by, create_time, update_by, update_time, del_flag) + values + + (#{entity.id}, #{entity.infoId}, #{entity.standardId}, #{entity.featureId}, #{entity.compareItemId}, #{entity.content}, #{entity.fileId}, #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime}, #{entity.delFlag}) + + on duplicate key update + id = values(id) , info_id = values(info_id) , standard_id = values(standard_id) , feature_id = values(feature_id) , compare_item_id = values(compare_item_id) , content = values(content) , file_id = values(file_id) , create_by = values(create_by) , create_time = values(create_time) , update_by = values(update_by) , update_time = values(update_time) , del_flag = values(del_flag) + + + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/common/LawsCustomCompareCommon.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/common/LawsCustomCompareCommon.java new file mode 100644 index 00000000..6e6335bb --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/common/LawsCustomCompareCommon.java @@ -0,0 +1,40 @@ +package com.jero.modules.laws.customcompare.common; + +/** + * @Author: yjz + * @Date: 2023/10/13/11:46 + * @Description: + */ +public class LawsCustomCompareCommon { + private LawsCustomCompareCommon(){ + } + + /** + * 是否公开(1:是,0:否) + */ + public static final String IS_SHOW_1 = "1"; + /** + * 是否公开(1:是,0:否) + */ + public static final String IS_SHOW_0 = "0"; + /** + * 标准类型(1:国内,2:海外,3:企业) + */ + public static final String STANDARD_TYPE1 = "1"; + /** + * 标准类型(1:国内,2:海外,3:企业) + */ + public static final String STANDARD_TYPE2 = "2"; + /** + * 标准类型(1:国内,2:海外,3:企业) + */ + public static final String STANDARD_TYPE3 = "3"; + /** + * 清单维护类型(1:特点,2:对比项) + */ + public static final String INVENTORY_TYPE_1 = "1"; + /** + * 清单维护类型(1:特点,2:对比项) + */ + public static final String INVENTORY_TYPE_2 = "2"; +} \ No newline at end of file diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareCellController.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareCellController.java new file mode 100644 index 00000000..480f18a0 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareCellController.java @@ -0,0 +1,18 @@ +package com.jero.modules.laws.customcompare.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 自定义对比单元格内容表 + * + * @author yjz + * @since 2023-10-24 17:59:27 + */ +@RestController +@RequestMapping("/customCompare/lawsCustomCompareCell") +public class LawsCustomCompareCellController { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoController.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoController.java new file mode 100644 index 00000000..9d566a0e --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoController.java @@ -0,0 +1,213 @@ +package com.jero.modules.laws.customcompare.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.util.MessageUtils; +import com.jero.modules.laws.common.constant.ResultCommon; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareCell; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInfo; +import com.jero.modules.laws.customcompare.service.ILawsCustomCompareCellService; +import com.jero.modules.laws.customcompare.service.ILawsCustomCompareInfoService; +import com.jero.modules.laws.customcompare.service.ILawsCustomCompareInventoryService; +import com.jero.modules.laws.customcompare.vo.LawsCustomCompareInfoVO; +import com.jero.modules.laws.customcompare.vo.StandardSaveVO; +import com.jero.modules.laws.customcompare.vo.StandardVO; +import com.jero.modules.laws.customcompare.vo.TableDetailVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.formula.functions.T; +import org.springframework.context.annotation.Lazy; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +/** + * 自定义对比 + * + * @author yjz + * @since 2023-10-24 17:45:51 + */ +@Api(tags="自定义对比") +@Slf4j +@RestController +@RequestMapping("/customCompare/lawsCustomCompareInfo") +public class LawsCustomCompareInfoController { + + private final ILawsCustomCompareInfoService lawsCustomCompareInfoService; + private final ILawsCustomCompareCellService lawsCustomCompareCellService; + private final ILawsCustomCompareInventoryService lawsCustomCompareInventoryService; + + public LawsCustomCompareInfoController(ILawsCustomCompareInfoService lawsCustomCompareInfoService, + @Lazy ILawsCustomCompareCellService lawsCustomCompareCellService, + @Lazy ILawsCustomCompareInventoryService lawsCustomCompareInventoryService) { + this.lawsCustomCompareInfoService = lawsCustomCompareInfoService; + this.lawsCustomCompareCellService = lawsCustomCompareCellService; + this.lawsCustomCompareInventoryService = lawsCustomCompareInventoryService; + } + + /** + * 自定义对比-分页列表查询 + * @return + */ + @AutoLog(value = "自定义对比-分页列表查询") + @ApiOperation(value="自定义对比-分页列表查询", notes="自定义对比-分页列表查询") + @GetMapping(value = "/queryByPage") + public Result> queryByPage(LawsCustomCompareInfoVO lawsCustomCompareInfoVO, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) { + return Result.OK(lawsCustomCompareInfoService.queryByPage(lawsCustomCompareInfoVO, pageNo, pageSize)); + } + + /** + * 自定义对比-标准检索 + * @return + */ + @AutoLog(value = "自定义对比-标准检索分页列表查询") + @ApiOperation(value="自定义对比-标准检索分页列表查询", notes="自定义对比-标准检索分页列表查询") + @GetMapping(value = "/queryStandard") + public Result> queryStandard(StandardVO standardVO, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) { + return Result.OK(lawsCustomCompareInfoService.queryStandard(standardVO, pageNo, pageSize)); + } + + /** + * 自定义对比-删除标准列表 + * @return + */ + @AutoLog(value = "自定义对比-删除标准列表") + @ApiOperation(value="自定义对比-删除标准列表", notes="自定义对比-删除标准列表") + @GetMapping(value = "/delStandard") + public Result delStandard(String infoId, String standardId) { + lawsCustomCompareInfoService.delStandard(infoId, standardId); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } + + /** + * 自定义对比-标准列表查询 + * @return + */ + @AutoLog(value = "自定义对比-标准列表分页查询") + @ApiOperation(value="自定义对比-标准列表分页查询", notes="自定义对比-标准列表分页查询") + @GetMapping(value = "/queryStandardByInfoId") + public Result> queryStandardList(String id, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) { + return Result.OK(lawsCustomCompareInfoService.queryStandardByInfoId(id, pageNo, pageSize)); + } + + /** + * 自定义对比-表格详情 + * @return + */ + @AutoLog(value = "自定义对比-表格详情") + @ApiOperation(value="自定义对比-表格详情", notes="自定义对比-表格详情") + @GetMapping(value = "/queryTableDetail") + public Result queryTableDetail(String id) { + return Result.OK(lawsCustomCompareInfoService.queryTableDetail(id)); + } + + /** + * 自定义对比-清单维护 + * @return + */ + @AutoLog(value = "自定义对比-清单维护列表查询") + @ApiOperation(value="自定义对比-清单维护列表查询", notes="自定义对比-清单维护列表查询") + @GetMapping(value = "/queryInventory") + public Result> queryInventoryByInfoId(String id) { + return Result.OK(lawsCustomCompareInfoService.queryInventory(id)); + } + + /** + * 自定义对比-标准检索保存 + * @return + */ + @AutoLog(value = "自定义对比-标准检索保存") + @ApiOperation(value="自定义对比-标准检索保存", notes="自定义对比-标准检索保存") + @GetMapping(value = "/saveStandard") + public Result> saveStandard(StandardSaveVO standardSaveVO) { + lawsCustomCompareInfoService.saveStandard(standardSaveVO); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } + + /** + * 自定义对比-单元格内容保存 + * @return + */ + @AutoLog(value = "自定义对比-单元格内容保存") + @ApiOperation(value="自定义对比-单元格内容保存", notes="自定义对比-单元格内容保存") + @PostMapping(value = "/saveCell") + public Result> saveCell(LawsCustomCompareCell lawsCustomCompareCell) { + lawsCustomCompareCellService.save(lawsCustomCompareCell); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } + + /** + * 自定义对比-通过id查询 + * @return + */ + @AutoLog(value = "自定义对比-通过id查询") + @ApiOperation(value="自定义对比-通过id查询", notes="自定义对比-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(String id) { + return Result.OK(lawsCustomCompareInfoService.queryById(id)); + } + + /** + * 自定义对比-保存 + * @return + */ + @AutoLog(value = "自定义对比-保存") + @ApiOperation(value="自定义对比-保存", notes="自定义对比-保存") + @PostMapping(value = "/save") + public Result save(@RequestBody LawsCustomCompareInfo lawsCustomCompareInfo) { + lawsCustomCompareInfoService.saveOrUpdate(lawsCustomCompareInfo); + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } + + /** + * 自定义对比-根据id删除 + * @return + */ + @AutoLog(value = "自定义对比-根据id删除") + @ApiOperation(value="自定义对比-根据id删除", notes="自定义对比-根据id删除") + @PostMapping(value = "/delById") + public Result delById(@RequestBody Map map) { + if (map.containsKey("id")){ + lawsCustomCompareInfoService.delById((String) map.get("id")); + } + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } + + /** + * 自定义对比-根据id删除特点/对比项 + * @return + */ + @AutoLog(value = "自定义对比-根据id删除特点/对比项") + @ApiOperation(value="自定义对比-根据id删除特点/对比项", notes="自定义对比-根据id删除特点/对比项") + @PostMapping(value = "/delInventoryById") + public Result delInventoryById(@RequestBody Map map) { + if (map.containsKey("id")){ + lawsCustomCompareInventoryService.removeById((String) map.get("id")); + } + return Result.OK(MessageUtils.getMessage(ResultCommon.OK)); + } + + /** + * 自定义对比-导出 + * @param request + * @param response + */ + @AutoLog(value = "自定义对比-导出") + @ApiOperation(value = "自定义对比-导出") + @GetMapping("/exportExcel") + public void exportExcel(String id,HttpServletRequest request, HttpServletResponse response) { + lawsCustomCompareInfoService.exportExcel(id, request, response); + } +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoStandardController.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoStandardController.java new file mode 100644 index 00000000..c9d2d345 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoStandardController.java @@ -0,0 +1,18 @@ +package com.jero.modules.laws.customcompare.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 自定义对比_标准 关联表 + * + * @author yjz + * @since 2023-10-24 17:57:06 + */ +@RestController +@RequestMapping("/customCompare/lawsCustomCompareInfoStandard") +public class LawsCustomCompareInfoStandardController { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInventoryController.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInventoryController.java new file mode 100644 index 00000000..d45a329c --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInventoryController.java @@ -0,0 +1,18 @@ +package com.jero.modules.laws.customcompare.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 自定义对比清单维护表 + * + * @author yjz + * @since 2023-10-24 17:57:49 + */ +@RestController +@RequestMapping("/customCompare/lawsCustomCompareInventory") +public class LawsCustomCompareInventoryController { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareCell.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareCell.java new file mode 100644 index 00000000..ffe7b2e8 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareCell.java @@ -0,0 +1,40 @@ +package com.jero.modules.laws.customcompare.entity; + + +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; +import com.jero.modules.laws.documenttool.entity.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 自定义对比单元格内容表 + * + * @author yjz + * @since 2023-10-24 17:59:27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class LawsCustomCompareCell extends BaseEntity { + /**自定义对比id*/ + @ApiModelProperty(value = "自定义对比id") + private String infoId; + /**标准id*/ + @ApiModelProperty(value = "标准id") + private String standardId; + /**特点id*/ + @ApiModelProperty(value = "特点id") + private String featureId; + /**对比项id*/ + @ApiModelProperty(value = "对比项id") + private String compareItemId; + /**单元格内容*/ + @ApiModelProperty(value = "单元格内容") + private String content; + /**文件id*/ + @ApiModelProperty(value = "文件id") + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String fileId; +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareInfo.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareInfo.java new file mode 100644 index 00000000..8f64b627 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareInfo.java @@ -0,0 +1,34 @@ +package com.jero.modules.laws.customcompare.entity; + +import com.baomidou.mybatisplus.annotation.FieldStrategy; +import com.baomidou.mybatisplus.annotation.TableField; +import com.jero.modules.laws.documenttool.entity.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 自定义对比表 + * + * @author yjz + * @since 2023-10-24 17:45:58 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class LawsCustomCompareInfo extends BaseEntity { + /**清单名称*/ + @ApiModelProperty(value = "清单名称") + private String listName; + /**是否公开(1:是,0:否)*/ + @ApiModelProperty(value = "是否公开(1:是,0:否)") + private String isShow; + /**操作人*/ + @ApiModelProperty(value = "操作人") + @TableField(exist = false) + private String author; + /**文件id*/ + @ApiModelProperty(value = "文件id") + @TableField(updateStrategy = FieldStrategy.IGNORED) + private String fileId; +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareInfoStandard.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareInfoStandard.java new file mode 100644 index 00000000..5cca9933 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareInfoStandard.java @@ -0,0 +1,31 @@ +package com.jero.modules.laws.customcompare.entity; + + +import com.jero.modules.laws.documenttool.entity.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 自定义对比_标准 关联表 + * + * @author yjz + * @since 2023-10-24 17:57:06 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class LawsCustomCompareInfoStandard extends BaseEntity { + /**自定义对比id*/ + @ApiModelProperty(value = "自定义对比id") + private String infoId; + /**标准id*/ + @ApiModelProperty(value = "标准id") + private String standardId; + /**标准号*/ + @ApiModelProperty(value = "标准号") + private String standardNumber; + /**标准类型(1:国内,2:海外,3:企业)*/ + @ApiModelProperty(value = "标准类型(1:国内,2:海外,3:企业)") + private String standardType; +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareInventory.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareInventory.java new file mode 100644 index 00000000..c5436012 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/entity/LawsCustomCompareInventory.java @@ -0,0 +1,39 @@ +package com.jero.modules.laws.customcompare.entity; + + +import com.jero.common.aspect.annotation.Dict; +import com.jero.modules.laws.documenttool.entity.BaseEntity; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 自定义对比清单维护表 + * + * @author yjz + * @since 2023-10-24 17:57:49 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class LawsCustomCompareInventory extends BaseEntity { + /**自定义对比id*/ + @ApiModelProperty(value = "自定义对比id") + private String infoId; + /**单元格文本*/ + @ApiModelProperty(value = "单元格文本") + private String cellTitle; + /**清单维护类型(1:特点,2:对比项)*/ + @ApiModelProperty(value = "清单维护类型(1:特点,2:对比项)") + @Dict(dicCode = "inventory_type") + private String inventoryType; + /**排序*/ + @ApiModelProperty(value = "排序") + private Integer orderNum; + /**对比分析结果*/ + @ApiModelProperty(value = "对比分析结果") + private String compareResult; + /**颜色*/ + @ApiModelProperty(value = "颜色") + private String colour; +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareCellMapper.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareCellMapper.java new file mode 100644 index 00000000..afb73821 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareCellMapper.java @@ -0,0 +1,12 @@ +package com.jero.modules.laws.customcompare.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareCell; + +/** + * @Author: 31318 + * @Date: 2023/10/24/18:02 + * @Description: + */ +public interface LawsCustomCompareCellMapper extends BaseMapper { +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareInfoMapper.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareInfoMapper.java new file mode 100644 index 00000000..a880c955 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareInfoMapper.java @@ -0,0 +1,42 @@ +package com.jero.modules.laws.customcompare.mapper; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.jero.modules.laws.customcompare.vo.LawsCustomCompareInfoVO; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInfo; +import com.jero.modules.laws.customcompare.vo.StandardVO; +import org.apache.ibatis.annotations.Param; + +/** + * @Author: 31318 + * @Date: 2023/10/24/17:50 + * @Description: + */ +public interface LawsCustomCompareInfoMapper extends BaseMapper { + + /** + * 自定义对比-分页列表查询 + * @param page + * @param queryWrapper + * @return + */ + IPage queryByPage(Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + /** + * 自定义对比-标准检索 + * @param page + * @param queryWrapper + * @return + */ + IPage queryStandard(Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + /** + * 自定义对比-自定义对比-通过id查询 + * @param queryWrapper + * @return + */ + LawsCustomCompareInfoVO queryById(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareInfoStandardMapper.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareInfoStandardMapper.java new file mode 100644 index 00000000..8ee9bdc0 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareInfoStandardMapper.java @@ -0,0 +1,12 @@ +package com.jero.modules.laws.customcompare.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInfoStandard; + +/** + * @Author: 31318 + * @Date: 2023/10/24/18:02 + * @Description: + */ +public interface LawsCustomCompareInfoStandardMapper extends BaseMapper { +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareInventoryMapper.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareInventoryMapper.java new file mode 100644 index 00000000..3fda3d78 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/LawsCustomCompareInventoryMapper.java @@ -0,0 +1,12 @@ +package com.jero.modules.laws.customcompare.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInventory; + +/** + * @Author: 31318 + * @Date: 2023/10/24/18:02 + * @Description: + */ +public interface LawsCustomCompareInventoryMapper extends BaseMapper { +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareCellMapper.xml b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareCellMapper.xml new file mode 100644 index 00000000..5e9163c6 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareCellMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInfoMapper.xml b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInfoMapper.xml new file mode 100644 index 00000000..648373e3 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInfoMapper.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + select i.id, + list_name, + group_concat(s.standard_number order by s.create_by) referenceStandard, + (select group_concat(os.country_or_region order by s.create_by) + from laws_custom_compare_info_standard s + left join laws_overseas_standard os on s.standard_id = os.id and s.standard_type = '2' and os.del_flag = 0 + where s.del_flag = 0 + ) referenceCountry, + is_show, + concat(u.realname, '(', u.username, ')') author, + i.create_by, + i.create_time, + i.update_by, + i.update_time, + i.del_flag + from laws_custom_compare_info i + left join laws_custom_compare_info_standard s on i.id = s.info_id + left join sys_user u on i.create_by = u.username + ${ew.customSqlSegment} + group by i.id + + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInfoStandard.xml b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInfoStandard.xml new file mode 100644 index 00000000..5b89041f --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInfoStandard.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInventoryMapper.xml b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInventoryMapper.xml new file mode 100644 index 00000000..590de37e --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/mapper/xml/LawsCustomCompareInventoryMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareCellService.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareCellService.java new file mode 100644 index 00000000..2fb5f391 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareCellService.java @@ -0,0 +1,15 @@ +package com.jero.modules.laws.customcompare.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareCell; + +/** + * 自定义对比单元格内容表(LawsCustomCompareCell)表服务接口 + * + * @author yjz + * @since 2023-10-24 17:59:28 + */ +public interface ILawsCustomCompareCellService extends IService { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInfoService.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInfoService.java new file mode 100644 index 00000000..f524a644 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInfoService.java @@ -0,0 +1,94 @@ +package com.jero.modules.laws.customcompare.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInfo; +import com.jero.modules.laws.customcompare.vo.LawsCustomCompareInfoVO; +import com.jero.modules.laws.customcompare.vo.StandardSaveVO; +import com.jero.modules.laws.customcompare.vo.StandardVO; +import com.jero.modules.laws.customcompare.vo.TableDetailVO; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Map; + +/** + * 自定义对比(LawsCustomCompareInfo)表服务接口 + * + * @author yjz + * @since 2023-10-24 17:45:58 + */ +public interface ILawsCustomCompareInfoService extends IService { + + /** + * 自定义对比-分页列表查询 + * @param lawsCustomCompareInfoVO + * @param pageNo + * @param pageSize + * @return + */ + IPage queryByPage(LawsCustomCompareInfoVO lawsCustomCompareInfoVO, Integer pageNo, Integer pageSize); + + /** + * 自定义对比-标准检索 + * @param standardVO + * @param pageNo + * @param pageSize + * @return + */ + IPage queryStandard(StandardVO standardVO, Integer pageNo, Integer pageSize); + + /** + * 自定义对比-通过id查询 + * @param id + * @return + */ + LawsCustomCompareInfoVO queryById(String id); + + /** + * 自定义对比-标准检索保存 + * @param standardSaveVO + */ + void saveStandard(StandardSaveVO standardSaveVO); + + /** + * 自定义对比-表格详情 + * @param id + * @return + */ + TableDetailVO queryTableDetail(String id); + + /** + * 自定义对比-根据id删除 + * @param id + */ + void delById(String id); + + /** + * 自定义对比-清单维护列表查询 + * @param id + */ + Map queryInventory(String id); + + /** + * 自定义对比-标准列表分页查询 + * @param id + * @return + */ + IPage queryStandardByInfoId(String id,Integer pageNo, Integer pageSize); + + /** + * 自定义对比-删除标准列表 + * @param infoId + * @param standardId + */ + void delStandard(String infoId, String standardId); + + /** + * 自定义对比-导出 + * @param request + * @param response + */ + void exportExcel(String id, HttpServletRequest request, HttpServletResponse response); +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInfoStandardService.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInfoStandardService.java new file mode 100644 index 00000000..338567f7 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInfoStandardService.java @@ -0,0 +1,15 @@ +package com.jero.modules.laws.customcompare.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInfoStandard; + +/** + * 自定义对比_标准 关联表(LawsCustomCompareInfoStandard)表服务接口 + * + * @author yjz + * @since 2023-10-24 17:57:09 + */ +public interface ILawsCustomCompareInfoStandardService extends IService { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInventoryService.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInventoryService.java new file mode 100644 index 00000000..0bf05429 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInventoryService.java @@ -0,0 +1,15 @@ +package com.jero.modules.laws.customcompare.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInventory; + +/** + * 自定义对比清单维护表(LawsCustomCompareInventory)表服务接口 + * + * @author yjz + * @since 2023-10-24 17:57:49 + */ +public interface ILawsCustomCompareInventoryService extends IService { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareCellServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareCellServiceImpl.java new file mode 100644 index 00000000..b4db1efd --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareCellServiceImpl.java @@ -0,0 +1,21 @@ +package com.jero.modules.laws.customcompare.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareCell; +import com.jero.modules.laws.customcompare.mapper.LawsCustomCompareCellMapper; +import com.jero.modules.laws.customcompare.service.ILawsCustomCompareCellService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * 自定义对比单元格内容表(LawsCustomCompareCell)表服务实现类 + * + * @author yjz + * @since 2023-10-24 17:59:28 + */ +@Service +@Transactional +public class LawsCustomCompareCellServiceImpl extends ServiceImpl implements ILawsCustomCompareCellService { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoServiceImpl.java new file mode 100644 index 00000000..46e5b3fe --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoServiceImpl.java @@ -0,0 +1,538 @@ +package com.jero.modules.laws.customcompare.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +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.vo.LoginUser; +import com.jero.common.util.BeanCopyUtils; +import com.jero.common.util.FileUtils; +import com.jero.common.util.SnowflakeUtils; +import com.jero.common.util.ZipUtil; +import com.jero.modules.laws.customcompare.common.LawsCustomCompareCommon; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareCell; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInfo; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInfoStandard; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInventory; +import com.jero.modules.laws.customcompare.mapper.LawsCustomCompareInfoMapper; +import com.jero.modules.laws.customcompare.service.ILawsCustomCompareCellService; +import com.jero.modules.laws.customcompare.service.ILawsCustomCompareInfoService; +import com.jero.modules.laws.customcompare.service.ILawsCustomCompareInfoStandardService; +import com.jero.modules.laws.customcompare.service.ILawsCustomCompareInventoryService; +import com.jero.modules.laws.customcompare.vo.LawsCustomCompareInfoVO; +import com.jero.modules.laws.customcompare.vo.StandardSaveVO; +import com.jero.modules.laws.customcompare.vo.StandardVO; +import com.jero.modules.laws.customcompare.vo.TableDetailVO; +import com.jero.modules.laws.standard.entity.LawsDomesticStandard; +import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard; +import com.jero.modules.laws.standard.entity.LawsOverseasStandard; +import com.jero.modules.laws.standard.service.ILawsDomesticStandardService; +import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService; +import com.jero.modules.laws.standard.service.ILawsOverseasStandardService; +import com.jero.modules.system.entity.SysDict; +import com.jero.modules.system.entity.SysDictItem; +import com.jero.modules.system.service.ISysDictItemService; +import com.jero.modules.system.service.ISysDictService; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.apache.shiro.SecurityUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +/** + * + * + * @author yjz + * @since 2023-10-24 17:45:59 + */ +@Service +@Transactional +public class LawsCustomCompareInfoServiceImpl extends ServiceImpl implements ILawsCustomCompareInfoService { + private final LawsCustomCompareInfoMapper lawsCustomCompareInfoMapper; + private final ILawsCustomCompareInfoStandardService lawsCustomCompareInfoStandardService; + private final ILawsCustomCompareInventoryService lawsCustomCompareInventoryService; + private final ILawsCustomCompareCellService lawsCustomCompareCellService; + private final ILawsDomesticStandardService lawsDomesticStandardService; + private final ILawsOverseasStandardService lawsOverseasStandardService; + private final ILawsEnterpriseStandardService lawsEnterpriseStandardService; + private final ISysDictService sysDictService; + private final ISysDictItemService sysDictItemService; + + public LawsCustomCompareInfoServiceImpl(LawsCustomCompareInfoMapper lawsCustomCompareInfoMapper, + ILawsCustomCompareInfoStandardService lawsCustomCompareInfoStandardService, + ILawsCustomCompareInventoryService lawsCustomCompareInventoryService, + ILawsCustomCompareCellService lawsCustomCompareCellService, + ILawsDomesticStandardService lawsDomesticStandardService, + ILawsOverseasStandardService lawsOverseasStandardService, + ILawsEnterpriseStandardService lawsEnterpriseStandardService, + ISysDictService sysDictService, + ISysDictItemService sysDictItemService) { + this.lawsCustomCompareInfoMapper = lawsCustomCompareInfoMapper; + this.lawsCustomCompareInfoStandardService = lawsCustomCompareInfoStandardService; + this.lawsCustomCompareInventoryService = lawsCustomCompareInventoryService; + this.lawsCustomCompareCellService = lawsCustomCompareCellService; + this.lawsDomesticStandardService = lawsDomesticStandardService; + this.lawsOverseasStandardService = lawsOverseasStandardService; + this.lawsEnterpriseStandardService = lawsEnterpriseStandardService; + this.sysDictService = sysDictService; + this.sysDictItemService = sysDictItemService; + } + + @Value("${jero.path.exportExcelTempPath}") + private String exportExcelTempPath; + + @Override + public IPage queryByPage(LawsCustomCompareInfoVO lawsCustomCompareInfoVO, Integer pageNo, Integer pageSize) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.like(StringUtils.isNotBlank(lawsCustomCompareInfoVO.getListName()), "list_name", lawsCustomCompareInfoVO.getListName()); + queryWrapper.like(StringUtils.isNotBlank(lawsCustomCompareInfoVO.getReferenceStandard()), "referenceStandard", lawsCustomCompareInfoVO.getReferenceStandard()); + if (StringUtils.isNotBlank(lawsCustomCompareInfoVO.getListName())){ + List list = Arrays.asList(lawsCustomCompareInfoVO.getListName().split(",")); + queryWrapper.and(qw -> list.forEach(v -> qw.or(iqw -> iqw.eq("referenceCountry", v)))); + } + queryWrapper.like(StringUtils.isNotBlank(lawsCustomCompareInfoVO.getAuthor()), "username", lawsCustomCompareInfoVO.getAuthor()); + queryWrapper.like(StringUtils.isNotBlank(lawsCustomCompareInfoVO.getIsShow()), "is_show", lawsCustomCompareInfoVO.getIsShow()); + + // 数据权限,默认只能查看公开的数据和操作人是当前登录人数据,管理员查看所有 + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List roleIds = Arrays.asList(loginUser.getRoleIds().split(",")); + if (!roleIds.contains("admin")){ + queryWrapper.eq("i.create_by", loginUser.getId()); + queryWrapper.eq("is_show", LawsCustomCompareCommon.IS_SHOW_1); + } + return lawsCustomCompareInfoMapper.queryByPage(new Page<>(pageNo, pageSize), queryWrapper); + } + + @Override + public IPage queryStandard(StandardVO standardVO, Integer pageNo, Integer pageSize) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + // 标准编号/标准名称 + if (StringUtils.isNotBlank(standardVO.getStandardNumberOrName())){ + queryWrapper.and(qw -> qw + .like("standard_number", standardVO.getStandardNumberOrName()) + .or() + .like("standard_name", standardVO.getStandardNumberOrName())); + } + if (StringUtils.isNotBlank(standardVO.getIds())){ + List list = Arrays.asList(standardVO.getIds().split(",")); + queryWrapper.in("id", list); + } + queryWrapper.eq(StringUtils.isNotBlank(standardVO.getStandardState()), "standard_state", standardVO.getStandardState()); + queryWrapper.apply(StringUtils.isNotBlank(standardVO.getReleaseDateBegin()), + "date_format (create_time,'%Y-%m-%d') >= date_format ({0},'%Y-%m-%d')", standardVO.getReleaseDateBegin()) + .apply(StringUtils.isNotBlank(standardVO.getReleaseDatesEnd()), + "date_format (create_time,'%Y-%m-%d') <= date_format ({0},'%Y-%m-%d')", standardVO.getReleaseDatesEnd()); + return lawsCustomCompareInfoMapper.queryStandard(new Page<>(pageNo, pageSize), queryWrapper); + } + + @Override + public LawsCustomCompareInfoVO queryById(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("id", id); + return lawsCustomCompareInfoMapper.queryById(queryWrapper); + } + + @Override + public void saveStandard(StandardSaveVO standardSaveVO) { + // 自定义对比表 + LawsCustomCompareInfo lawsCustomCompareInfo = standardSaveVO.getLawsCustomCompareInfo(); + // 自定义对比_标准 关联表 + LawsCustomCompareInfoStandard lawsCustomCompareInfoStandard = standardSaveVO.getLawsCustomCompareInfoStandard(); + String id = String.valueOf(SnowflakeUtils.snowflake()); + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + // 自定义对比数据不存在则新增 + if (StringUtils.isBlank(lawsCustomCompareInfo.getId())){ + lawsCustomCompareInfo.setId(id); + lawsCustomCompareInfo.setAuthor(sysUser.getId()); + } + saveOrUpdate(lawsCustomCompareInfo); + + // 处理关联表数据 + // 删除旧数据 + lawsCustomCompareInfoStandardService.remove( + new LambdaQueryWrapper() + .eq(LawsCustomCompareInfoStandard::getInfoId, lawsCustomCompareInfo.getId())); + lawsCustomCompareInfoStandard.setInfoId(lawsCustomCompareInfo.getId()); + // 添加新数据 + lawsCustomCompareInfoStandardService.save(lawsCustomCompareInfoStandard); + } + + @Override + public TableDetailVO queryTableDetail(String id) { + TableDetailVO tableDetailVO = new TableDetailVO(); + // 处理表头 + setCountryMap(id, tableDetailVO); + // 处理特点/对比项 + setRanksMap(id, tableDetailVO); + // 处理单元格 + setList(id, tableDetailVO); + return tableDetailVO; + } + + @Override + public void delById(String id) { + // 删除自定义对比表 + removeById(id); + // 删除自定义对比_标准 关联表 + lawsCustomCompareInfoStandardService.remove( + new LambdaQueryWrapper() + .eq(LawsCustomCompareInfoStandard::getInfoId, id)); + // 删除自定义对比清单维护表 + lawsCustomCompareInventoryService.remove( + new LambdaQueryWrapper() + .eq(LawsCustomCompareInventory::getInfoId, id)); + // 删除自定义对比单元格内容表 + lawsCustomCompareCellService.remove( + new LambdaQueryWrapper() + .eq(LawsCustomCompareCell::getInfoId, id)); + } + + @Override + public Map queryInventory(String id) { + List list = lawsCustomCompareInventoryService.list( + new LambdaQueryWrapper() + .eq(LawsCustomCompareInventory::getInfoId, id)); + + Map map = new HashMap<>(); + // 特点 + List feature = list.stream() + .filter(v -> LawsCustomCompareCommon.INVENTORY_TYPE_1.equals(v.getInventoryType())) + .collect(Collectors.toList()); + // 对比项 + List compareItem = list.stream() + .filter(v -> LawsCustomCompareCommon.INVENTORY_TYPE_2.equals(v.getInventoryType())) + .collect(Collectors.toList()); + + List sysDictItemList = getDicItem("inventory_type"); + + Optional featureDicItem = sysDictItemList.stream() + .filter(v -> LawsCustomCompareCommon.INVENTORY_TYPE_1.equals(v.getItemValue())) + .findFirst(); + + Optional compareItemDicItem = sysDictItemList.stream() + .filter(v -> LawsCustomCompareCommon.INVENTORY_TYPE_1.equals(v.getItemValue())) + .findFirst(); + + featureDicItem.ifPresent(v -> map.put(v.getItemText(), feature)); + compareItemDicItem.ifPresent(v -> map.put(v.getItemText(), compareItem)); + return map; + } + + @Override + public IPage queryStandardByInfoId(String id, Integer pageNo, Integer pageSize){ + // 自定义对比_标准 关联表 + List list = lawsCustomCompareInfoStandardService.list( + new LambdaQueryWrapper() + .eq(LawsCustomCompareInfoStandard::getInfoId, id) + .orderByAsc(LawsCustomCompareInfoStandard::getCreateTime)); + if (!list.isEmpty()){ + // 查询标准数据 + List standardIdList = list.stream().map(LawsCustomCompareInfoStandard::getStandardId).collect(Collectors.toList()); + StandardVO standardVO = new StandardVO(); + standardVO.setIds(String.join(",", standardIdList)); + return queryStandard(standardVO, pageNo, pageSize); + } + return new Page<>(); + } + + @Override + public void delStandard(String infoId, String standardId) { + // 删除自定义对比_标准 关联表数据 + lawsCustomCompareInfoStandardService.remove( + new LambdaQueryWrapper() + .eq(LawsCustomCompareInfoStandard::getInfoId, infoId) + .eq(LawsCustomCompareInfoStandard::getStandardId, standardId)); + } + + @Override + public void exportExcel(String id, HttpServletRequest request, HttpServletResponse response) { + // 获取清单数据 + TableDetailVO tableDetailVO = queryTableDetail(id); + // 获取国家/地区内容和标准内容 + Map> countryMap = tableDetailVO.getCountryMap(); + // 内容整合 + List standardVOS = new ArrayList<>(); + countryMap.forEach((k, v) -> standardVOS.addAll(v)); + + Map> ranksMap = tableDetailVO.getRanksMap(); + // 获取特点内容 + List featureList = ranksMap.get("特点"); + // 获取对比项内容 + List compareList = ranksMap.get("对比项"); + + // 获取单元格内容 + List list = tableDetailVO.getList(); + + try (Workbook workbook = new XSSFWorkbook()){ + String fileName = "清单详情.xlsx"; + // sheet页 + XSSFSheet sheet = (XSSFSheet) workbook.createSheet("清单详情"); + // 列宽 + sheet.setDefaultColumnWidth(20); + + // 创建表头内容 + createTableHeader(sheet, countryMap, featureList); + // 创建第二行内容 + createTableSecondRow(sheet, standardVOS, featureList); + // 创建单元格内容 + createTableCellContent(sheet, standardVOS, featureList, compareList, list); + + // excel临时保存到本地并在同级创建文件夹 + generateExcel(workbook, fileName); + // 生成zip文件返回文件流 + ZipUtil.toZip(exportExcelTempPath, response.getOutputStream(), response, true); + //删除指定文件夹 + FileUtils.deleteFolders(exportExcelTempPath); + }catch (Exception e){ + throw new JeroBootException("导出失败!"); + } + } + + private void createTableCellContent(XSSFSheet sheet, List standardVOS, List featureList, List compareList, List list) { + for (int i = 2; i < compareList.size() + 2; i++) { + // 创建行 + Row indexRow = sheet.createRow(i); + // 创建列 + Cell indexCell = indexRow.createCell(0); + if (i == 2){ + // 特点列 + createFeatureColumn(standardVOS, featureList, indexRow, indexCell); + }else { + // 普通列 + createOrdinaryColumn(standardVOS, featureList, compareList, list, i, indexRow, indexCell); + } + } + } + + private static void createOrdinaryColumn(List standardVOS, List featureList, List compareList, List list, int i, Row indexRow, Cell indexCell) { + indexCell.setCellValue(compareList.get(i).getCellTitle()); + + int index = 0; + for (StandardVO standardVO : standardVOS) { + for (LawsCustomCompareInventory lawsCustomCompareInventory : featureList) { + index += 1; + // 创建列 + Cell cell1 = indexRow.createCell(index); + Optional cellOptional = list.stream() + .filter(v -> Objects.equals(lawsCustomCompareInventory.getId(), v.getFeatureId()) + && Objects.equals(standardVO.getId(), v.getCompareItemId())) + .findFirst(); + cellOptional.ifPresent(v -> cell1.setCellValue(v.getContent())); + } + } + } + + private static void createFeatureColumn(List standardVOS, List featureList, Row indexRow, Cell indexCell) { + indexCell.setCellValue("特点/对比项"); + // 计算列数量 + int cellSize = featureList.size() * standardVOS.size(); + for (int j = 1; j <= cellSize; j++) { + // 创建列 + Cell cell = indexRow.createCell(j); + int index = j % featureList.size(); + if (index == 0){ + cell.setCellValue(featureList.get(featureList.size() - 1).getCellTitle()); + }else { + cell.setCellValue(featureList.get(index - 1).getCellTitle()); + } + } + } + + private void createTableSecondRow(XSSFSheet sheet, List standardVOS, List featureList) { + // 创建第二行 + Row row = sheet.createRow(1); + // 创建列 + Cell cell = row.createCell(0); + cell.setCellValue("标准号"); + + // 计算第二行文字内容和需要合并的单元格 + // 下标 + AtomicInteger index2 = new AtomicInteger(); + for (StandardVO standardVO : standardVOS) { + index2.addAndGet(1); + // 创建列 + Cell indexCell = row.createCell(index2.get()); + indexCell.setCellValue(standardVO.getStandardNumber()); + + // 特点数量 + int featureSize = featureList.size(); + // 合并单元格(参数说明:起始行,结束行,起始列,结束列) + CellRangeAddress region = new CellRangeAddress(1, 1, index2.get(), index2.get() + featureSize - 1); + sheet.addMergedRegion(region); + } + } + + private void createTableHeader(XSSFSheet sheet, Map> countryMap, List featureList) { + // 创建第一行 + Row headerRow = sheet.createRow(0); + // 创建列 + Cell cell = headerRow.createCell(0); + cell.setCellValue("国家/地区"); + + if (!countryMap.isEmpty()){ + // 下标 + AtomicInteger index = new AtomicInteger(); + countryMap.forEach((k, v) -> { + index.addAndGet(1); + // 标准数量 + int standardSize = v.size(); + // 特点数量 + int featureSize = featureList.size(); + // 单元格合并数量 + int merge = standardSize * featureSize; + // 首先先填充内容,再合并单元格 + Cell indexCell = headerRow.createCell(index.get()); + indexCell.setCellValue(k); + // 合并单元格(参数说明:起始行,结束行,起始列,结束列) + CellRangeAddress region = new CellRangeAddress(0, 0, index.get(), index.get() + merge - 1); + sheet.addMergedRegion(region); + }); + } + } + + private void generateExcel(Workbook workbook, String fileName) throws IOException { + File saveFile = new File(exportExcelTempPath); + // 导出路径 没有则创建 + if (!saveFile.exists()) { + saveFile.mkdirs(); + } + // 生成excel文件路径 + String excelPath = exportExcelTempPath + File.separator + fileName; + // 写出excel文件 + try (FileOutputStream fos = new FileOutputStream(excelPath)){ + workbook.write(fos); + }catch (Exception e){ + throw new JeroBootException(e.getMessage()); + } + } + + private void setList(String id, TableDetailVO tableDetailVO) { + List cellList = lawsCustomCompareCellService.list( + new LambdaQueryWrapper() + .eq(LawsCustomCompareCell::getInfoId, id)); + tableDetailVO.setList(cellList); + } + + private void setRanksMap(String id, TableDetailVO tableDetailVO) { + List inventoryList = lawsCustomCompareInventoryService.list( + new LambdaQueryWrapper() + .eq(LawsCustomCompareInventory::getInfoId, id) + .orderByAsc(LawsCustomCompareInventory::getCreateTime)); + if (!inventoryList.isEmpty()){ + List sysDictItemList = getDicItem("inventory_type"); + Map> ranksMap = inventoryList.stream() + .map(v -> { + // 字典翻译 + Optional sysDictIte = sysDictItemList.stream() + .filter(o -> v.getInventoryType() + .equals(o.getItemValue())).map(SysDictItem::getItemText).findFirst(); + sysDictIte.ifPresent(v::setInventoryType); + return v; + }) + .collect(Collectors.groupingBy(LawsCustomCompareInventory::getInventoryType)); + if (!ranksMap.containsKey("特点")){ + ranksMap.put("特点", new ArrayList<>()); + } + if (!ranksMap.containsKey("对比项")){ + ranksMap.put("对比项", new ArrayList<>()); + } + tableDetailVO.setRanksMap(ranksMap); + }else{ + Map> map = new HashMap<>(); + map.put("特点", new ArrayList<>()); + map.put("对比项", new ArrayList<>()); + tableDetailVO.setRanksMap(map); + } + } + + private void setCountryMap(String id, TableDetailVO tableDetailVO) { + List infoStandardList = lawsCustomCompareInfoStandardService.list( + new LambdaQueryWrapper() + .eq(LawsCustomCompareInfoStandard::getInfoId, id) + .orderByAsc(LawsCustomCompareInfoStandard::getCreateTime)); + if (!infoStandardList.isEmpty()){ + // 国内 + List domesticIds = infoStandardList.stream() + .filter(v -> LawsCustomCompareCommon.STANDARD_TYPE1.equals(v.getStandardType())) + .map(LawsCustomCompareInfoStandard::getStandardId) + .collect(Collectors.toList()); + List lawsDomesticStandards = lawsDomesticStandardService.listByIds(domesticIds); + + // 海外 + List overseasIds= infoStandardList.stream() + .filter(v -> LawsCustomCompareCommon.STANDARD_TYPE2.equals(v.getStandardType())) + .map(LawsCustomCompareInfoStandard::getStandardId) + .collect(Collectors.toList()); + List lawsOverseasStandards = lawsOverseasStandardService.listByIds(overseasIds); + + // 企业 + List enterpriseIds = infoStandardList.stream() + .filter(v -> LawsCustomCompareCommon.STANDARD_TYPE3.equals(v.getStandardType())) + .map(LawsCustomCompareInfoStandard::getStandardId) + .collect(Collectors.toList()); + List lawsEnterpriseStandards = lawsEnterpriseStandardService.listByIds(enterpriseIds); + + // 处理数据 + List standardVOList = new ArrayList<>(); + List domesticStandardVOList = BeanCopyUtils.copyBeanList(lawsDomesticStandards, StandardVO.class); + List overseasStandardVOList = BeanCopyUtils.copyBeanList(lawsOverseasStandards, StandardVO.class); + List enterpriseStandardVOList = BeanCopyUtils.copyBeanList(lawsEnterpriseStandards, StandardVO.class); + standardVOList.addAll(domesticStandardVOList); + standardVOList.addAll(overseasStandardVOList); + standardVOList.addAll(enterpriseStandardVOList); + // 获取字典 + List sysDictItemList = getDicItem("country_or_region"); + + // 按国家/地区分组 + Map> countryMap = standardVOList.stream() + .map(v -> { + v.setInfoId(id); + // 字典翻译 + String countryOrRegion = v.getCountryOrRegion(); + if (StringUtils.isNotBlank(countryOrRegion)){ + List list = Arrays.asList(countryOrRegion.split(",")); + List sysDictItems = sysDictItemList.stream() + .filter(o -> list + .contains(o.getItemValue())).map(SysDictItem::getItemText).collect(Collectors.toList()); + if (!sysDictItems.isEmpty()){ + v.setCountryOrRegion(String.join(",", sysDictItems)); + } + } + return v; + }) + .collect(Collectors.groupingBy(StandardVO::getCountryOrRegion)); + tableDetailVO.setCountryMap(countryMap); + } + } + + private List getDicItem(String dicCode) { + SysDict sysDict = sysDictService.getOne( + new LambdaQueryWrapper() + .eq(SysDict::getDictCode, dicCode), false); + if (Objects.isNull(sysDict)){ + return new ArrayList<>(); + } + List sysDictItemList = sysDictItemService.list( + new LambdaQueryWrapper() + .eq(SysDictItem::getDictId, sysDict.getId())); + return Optional.of(sysDictItemList).orElse(new ArrayList<>()); + } +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoStandardServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoStandardServiceImpl.java new file mode 100644 index 00000000..e27d1251 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInfoStandardServiceImpl.java @@ -0,0 +1,21 @@ +package com.jero.modules.laws.customcompare.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInfoStandard; +import com.jero.modules.laws.customcompare.mapper.LawsCustomCompareInfoStandardMapper; +import com.jero.modules.laws.customcompare.service.ILawsCustomCompareInfoStandardService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * 自定义对比_标准 关联表(LawsCustomCompareInfoStandard)表服务实现类 + * + * @author yjz + * @since 2023-10-24 17:57:09 + */ +@Service +@Transactional +public class LawsCustomCompareInfoStandardServiceImpl extends ServiceImpl implements ILawsCustomCompareInfoStandardService { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInventoryServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInventoryServiceImpl.java new file mode 100644 index 00000000..59253100 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/impl/LawsCustomCompareInventoryServiceImpl.java @@ -0,0 +1,21 @@ +package com.jero.modules.laws.customcompare.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInventory; +import com.jero.modules.laws.customcompare.mapper.LawsCustomCompareInventoryMapper; +import com.jero.modules.laws.customcompare.service.ILawsCustomCompareInventoryService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * 自定义对比清单维护表 + * + * @author yjz + * @since 2023-10-24 17:57:49 + */ +@Service +@Transactional +public class LawsCustomCompareInventoryServiceImpl extends ServiceImpl implements ILawsCustomCompareInventoryService { + +} + diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/LawsCustomCompareInfoVO.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/LawsCustomCompareInfoVO.java new file mode 100644 index 00000000..bb1d07bc --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/LawsCustomCompareInfoVO.java @@ -0,0 +1,42 @@ +package com.jero.modules.laws.customcompare.vo; + +import com.jero.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @Author: yjz + * @Date: 2023/10/25/9:09 + * @Description: + */ +@Data +public class LawsCustomCompareInfoVO { + /**id*/ + @ApiModelProperty(value = "id") + private String id; + /**清单名称*/ + @ApiModelProperty(value = "清单名称") + private String listName; + /**涉及标准*/ + @ApiModelProperty(value = "涉及标准") + private String referenceStandard; + /**涉及国家*/ + @ApiModelProperty(value = "涉及国家") + @Dict(dicCode = "country_or_region") + private String referenceCountry; + /**比对时间*/ + @ApiModelProperty(value = "比对时间") + private Date createTime; + /**是否公开(1:是,0:否)*/ + @ApiModelProperty(value = "是否公开(1:是,0:否)") + @Dict(dicCode = "yn") + private String isShow; + /**操作人*/ + @ApiModelProperty(value = "操作人") + private String createBy; + /**操作人翻译*/ + @ApiModelProperty(value = "操作人翻译") + private String author; +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/StandardSaveVO.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/StandardSaveVO.java new file mode 100644 index 00000000..ae1c4d1b --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/StandardSaveVO.java @@ -0,0 +1,21 @@ +package com.jero.modules.laws.customcompare.vo; + +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInfo; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInfoStandard; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author: 31318 + * @Date: 2023/10/25/15:25 + * @Description: + */ +@Data +public class StandardSaveVO { + /**自定义对比表*/ + @ApiModelProperty(value = "自定义对比表") + private LawsCustomCompareInfo lawsCustomCompareInfo; + /**自定义对比_标准 关联表*/ + @ApiModelProperty(value = "自定义对比_标准 关联表") + private LawsCustomCompareInfoStandard lawsCustomCompareInfoStandard; +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/StandardVO.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/StandardVO.java new file mode 100644 index 00000000..8f787779 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/StandardVO.java @@ -0,0 +1,56 @@ +package com.jero.modules.laws.customcompare.vo; + +import com.jero.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @Author: yjz + * @Date: 2023/10/25/14:04 + * @Description: + */ +@Data +public class StandardVO { + /**id*/ + @ApiModelProperty(value = "id") + private String id; + /**标准号*/ + @ApiModelProperty(value = "标准号") + private String standardNumber; + /**标准名称*/ + @ApiModelProperty(value = "标准名称") + private String standardName; + /**标准状态*/ + @ApiModelProperty(value = "标准状态") + @Dict(dicCode = "standard_state") + private String standardState; + /**国家/地区*/ + @ApiModelProperty(value = "国家/地区") + @Dict(dicCode = "country_or_region") + private String countryOrRegion; + /**发布日期*/ + @ApiModelProperty(value = "发布日期") + private Date releaseDate; + /**标准类型(1:国内,2:海外,3:企业)*/ + @ApiModelProperty(value = "标准类型(1:国内,2:海外,3:企业)") + @Dict(dicCode = "standard_source") + private String standardType; + + /**自定义对比id 表格详情用*/ + @ApiModelProperty(value = "自定义对比id 表格详情用") + private String infoId; + /**标准编号/标准名称 搜索用*/ + @ApiModelProperty(value = "标准编号/标准名称 搜索用") + private String standardNumberOrName; + /**发布日期开始 搜索用*/ + @ApiModelProperty(value = "发布日期开始 搜索用") + private String releaseDateBegin; + /**发布日期结束 搜索用*/ + @ApiModelProperty(value = "发布日期结束 搜索用") + private String releaseDatesEnd; + /**ids 搜索用*/ + @ApiModelProperty(value = "ids 搜索用") + private String ids; +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/TableDetailVO.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/TableDetailVO.java new file mode 100644 index 00000000..9c0d3002 --- /dev/null +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/vo/TableDetailVO.java @@ -0,0 +1,27 @@ +package com.jero.modules.laws.customcompare.vo; + +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareCell; +import com.jero.modules.laws.customcompare.entity.LawsCustomCompareInventory; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +/** + * @Author: 31318 + * @Date: 2023/10/25/15:56 + * @Description: + */ +@Data +public class TableDetailVO { + /**表头*/ + @ApiModelProperty(value = "表头") + private Map> countryMap; + /**清单维护*/ + @ApiModelProperty(value = "清单维护") + private Map> ranksMap; + /**单元格*/ + @ApiModelProperty(value = "单元格") + private List list; +} diff --git a/laws-modules/src/main/java/com/jero/modules/laws/documenttool/service/impl/DocumentSplitServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/documenttool/service/impl/DocumentSplitServiceImpl.java index 7b31c327..2f7b8768 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/documenttool/service/impl/DocumentSplitServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/documenttool/service/impl/DocumentSplitServiceImpl.java @@ -695,14 +695,6 @@ public class DocumentSplitServiceImpl implements IDocumentSplitService { // 写出excel文件 try (FileOutputStream fos = new FileOutputStream(excelPath)){ workbook.write(fos); - - // 同级创建文件夹 - /** - * File savePaperFile = new File(exportExcelTempPath+ File.separator + "外部资源"); - * if (!savePaperFile.exists()) { - * savePaperFile.mkdirs(); - * } - */ }catch (Exception e){ throw new JeroBootException(e.getMessage()); }