diff --git a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql index 642a31268..7dfc766b0 100644 --- a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql +++ b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql @@ -210,3 +210,68 @@ WHERE SELECT id as temp_id FROM `laws_weilai`.`project_task_inventory` WHERE certification_progress IS NULL ) temp ); + + +-- 认证虚拟清单基础表 2023-03-03 未同步生产环境 +CREATE TABLE `auth_dummy_inventory_base` ( + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', + `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新日期', + `sys_org_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所属部门', + `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '虚拟清单名称', + `use_explain` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '使用说明', + `state` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '状态', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '认证虚拟清单基础表' ROW_FORMAT = Dynamic; + +-- 认证虚拟清单详情表 2023-03-03 未同步生产环境 +CREATE TABLE `auth_dummy_inventory_info` ( + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', + `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新日期', + `sys_org_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所属部门', + `category` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类别', + `inspection_item` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '检验项目', + `config_item` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '配置项', + `wvta_id` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'WVTA ID', + `serial_number` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标准编号', + `duty_territory` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '责任领域', + `deliverable` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '交付物', + `buss_document_library_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文档库id', + `auth_dummy_inventory_base_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '认证虚拟清单基础表id', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '认证虚拟清单详情表' ROW_FORMAT = Dynamic; + +-- 项目库-认证清单表 2023-03-03 未同步生产环境 +CREATE TABLE `project_certification_inventory` ( + `id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建日期', + `update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新日期', + `sys_org_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所属部门', + `category` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '类别', + `inspection_item` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '检验项目', + `config_item` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '配置项', + `wvta_id` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'WVTA ID', + `serial_number` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标准编号', + `duty_territory` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '责任领域', + `deliverable` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '交付物', + `buss_document_library_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文档库id', + `sdt` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '工程接口人', + `duty_person` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '责任人', + `deliverable_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '交付物类型', + `deliverable_template` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '交付物模板', + `delivery_result` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '交付结果', + `end_time` datetime NULL DEFAULT NULL COMMENT '截止日期', + `flow_status` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程状态', + `report_number` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '报告编号', + `product_model` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品型号', + `production_enterprise_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '生产企业名称', + `certification_progress` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '认证进度', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '项目库-认证清单表' ROW_FORMAT = Dynamic; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java new file mode 100644 index 000000000..36454500a --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java @@ -0,0 +1,186 @@ +package com.jero.modules.project.controller; + +import java.util.Arrays; +import java.util.List; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.alibaba.fastjson.JSONObject; +import com.jero.common.api.vo.Result; +import com.jero.common.system.query.QueryGenerator; +import com.jero.modules.authDummy.entity.AuthDummyInventoryInfoEO; +import com.jero.modules.project.entity.ProjectCertificationInventoryEO; +import com.jero.modules.project.service.IProjectCertificationInventoryEOService; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; +import com.jero.common.system.base.controller.JeroController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import com.jero.common.aspect.annotation.AutoLog; + + + /** + * @Description: 项目库-认证清单表 + * @Author: jero-boot + * @Date: 2023-03-03 + * @Version: V1.0 + */ +@Api(tags="项目库-认证清单表") +@RestController +@RequestMapping("/project/projectCertificationInventoryEO") +@Slf4j +public class ProjectCertificationInventoryEOController extends JeroController { + @Autowired + private IProjectCertificationInventoryEOService projectCertificationInventoryEOService; + + /** + * 分页列表查询 + * + * @param projectCertificationInventoryEO + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "项目库-认证清单表-分页列表查询") + @ApiOperation(value="项目库-认证清单表-分页列表查询", notes="项目库-认证清单表-分页列表查询") + @GetMapping(value = "/page") + public Result queryPageList(ProjectCertificationInventoryEO projectCertificationInventoryEO, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(projectCertificationInventoryEO, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = projectCertificationInventoryEOService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "项目库-认证清单表-列表查询") + @ApiOperation(value="项目库-认证清单表-列表查询", notes="项目库-认证清单表-列表查询") + @GetMapping(value = "/list") + public Result> queryList() { + List list = projectCertificationInventoryEOService.queryList(); + return Result.OK(list); + } + + /** + * 添加 + * + * @param projectCertificationInventoryEO + * @return + */ + @AutoLog(value = "项目库-认证清单表-添加") + @ApiOperation(value="项目库-认证清单表-添加", notes="项目库-认证清单表-添加") + @PostMapping(value = "/add") + public Result add(@Validated @RequestBody ProjectCertificationInventoryEO projectCertificationInventoryEO) { + projectCertificationInventoryEOService.add(projectCertificationInventoryEO); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param projectCertificationInventoryEO + * @return + */ + @AutoLog(value = "项目库-认证清单表-编辑") + @ApiOperation(value="项目库-认证清单表-编辑", notes="项目库-认证清单表-编辑") + @PutMapping(value = "/edit") + public Result edit(@Validated @RequestBody ProjectCertificationInventoryEO projectCertificationInventoryEO) { + projectCertificationInventoryEOService.editById(projectCertificationInventoryEO); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "项目库-认证清单表-通过id删除") + @ApiOperation(value="项目库-认证清单表-通过id删除", notes="项目库-认证清单表-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + projectCertificationInventoryEOService.deleteById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "项目库-认证清单表-批量删除") + @ApiOperation(value="项目库-认证清单表-批量删除", notes="项目库-认证清单表-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.projectCertificationInventoryEOService.deleteByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @AutoLog(value = "项目库-认证清单表-通过id查询") + @ApiOperation(value="项目库-认证清单表-通过id查询", notes="项目库-认证清单表-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + ProjectCertificationInventoryEO projectCertificationInventoryEO = projectCertificationInventoryEOService.queryById(id); + if(projectCertificationInventoryEO==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(projectCertificationInventoryEO); + } + + /** + * 导出excel + * + * @param request + * @param projectCertificationInventoryEO + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ProjectCertificationInventoryEO projectCertificationInventoryEO) { + return super.exportXls(request, projectCertificationInventoryEO, ProjectCertificationInventoryEO.class, "项目库-认证清单表"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, ProjectCertificationInventoryEO.class); + } + + @AutoLog(value = "项目库-认证清单表-批量添加") + @ApiOperation(value="项目库-认证清单表-批量添加", notes="项目库-认证清单表-批量添加") + @PostMapping(value = "/batchAdd") + public Result batchAdd(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.batchAdd(json); + } + + @AutoLog(value = "认证虚拟清单详情表-批量设置") + @ApiOperation(value="认证虚拟清单详情表-批量设置", notes="认证虚拟清单详情表-批量设置") + @PostMapping(value = "/setBatch") + public Result setBatch(@RequestBody ProjectCertificationInventoryEO projectCertificationInventoryEO) { + return this.projectCertificationInventoryEOService.setBatch(projectCertificationInventoryEO); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java new file mode 100644 index 000000000..22e7fdd3c --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java @@ -0,0 +1,168 @@ +package com.jero.modules.project.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import com.jero.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + + +/** + * @Description: 项目库-认证清单表 + * @Author: jero-boot + * @Date: 2023-03-03 + * @Version: V1.0 + */ +@Data +@TableName("project_certification_inventory") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="project_certification_inventory对象", description="项目库-认证清单表") +public class ProjectCertificationInventoryEO implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + + /**类别*/ + @Excel(name = "类别", width = 15) + @ApiModelProperty(value = "类别") + private java.lang.String category; + + /**检验项目*/ + @Excel(name = "检验项目", width = 15) + @ApiModelProperty(value = "检验项目") + private java.lang.String inspectionItem; + + /**配置项*/ + @Excel(name = "配置项", width = 15) + @ApiModelProperty(value = "配置项") + private java.lang.String configItem; + + /**WVTA ID*/ + @Excel(name = "WVTA ID", width = 15) + @ApiModelProperty(value = "WVTA ID") + private java.lang.String wvtaId; + + /**标准编号*/ + @Excel(name = "标准编号", width = 15) + @ApiModelProperty(value = "标准编号") + private java.lang.String serialNumber; + + /**责任领域*/ + @Excel(name = "责任领域", width = 15) + @ApiModelProperty(value = "责任领域") + private java.lang.String dutyTerritory; + + /**交付物*/ + @Excel(name = "交付物", width = 15) + @ApiModelProperty(value = "交付物") + private java.lang.String deliverable; + + /**文档库id*/ + @Excel(name = "文档库id", width = 15) + @ApiModelProperty(value = "文档库id") + private java.lang.String bussDocumentLibraryId; + + /**工程接口人*/ + @Excel(name = "工程接口人", width = 15) + @ApiModelProperty(value = "工程接口人") + private java.lang.String sdt; + + /**责任人*/ + @Excel(name = "责任人", width = 15) + @ApiModelProperty(value = "责任人") + private java.lang.String dutyPerson; + + /**交付物类型*/ + @Excel(name = "交付物类型", width = 15) + @ApiModelProperty(value = "交付物类型") + private java.lang.String deliverableType; + + /**交付物模板*/ + @Excel(name = "交付物模板", width = 15) + @ApiModelProperty(value = "交付物模板") + private java.lang.String deliverableTemplate; + + /**交付结果*/ + @Excel(name = "交付结果", width = 15) + @ApiModelProperty(value = "交付结果") + private java.lang.String deliveryResult; + + /**截止日期*/ + @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 endTime; + + /**流程状态*/ + @Excel(name = "流程状态", width = 15) + @ApiModelProperty(value = "流程状态") + private java.lang.String flowStatus; + + /**报告编号*/ + @Excel(name = "报告编号", width = 15) + @ApiModelProperty(value = "报告编号") + private java.lang.String reportNumber; + + /**产品型号*/ + @Excel(name = "产品型号", width = 15) + @ApiModelProperty(value = "产品型号") + private java.lang.String productModel; + + /**生产企业名称*/ + @Excel(name = "生产企业名称", width = 15) + @ApiModelProperty(value = "生产企业名称") + private java.lang.String productionEnterpriseName; + + /**认证进度*/ + @Excel(name = "认证进度", width = 15) + @ApiModelProperty(value = "认证进度") + private java.lang.String certificationProgress; + + + @TableField(exist = false) + private String cut; + + @TableField(exist = false) + private String ids; +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/ProjectCertificationInventoryEOMapper.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/ProjectCertificationInventoryEOMapper.java new file mode 100644 index 000000000..397f82044 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/ProjectCertificationInventoryEOMapper.java @@ -0,0 +1,17 @@ +package com.jero.modules.project.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import com.jero.modules.project.entity.ProjectCertificationInventoryEO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 项目库-认证清单表 + * @Author: jero-boot + * @Date: 2023-03-03 + * @Version: V1.0 + */ +public interface ProjectCertificationInventoryEOMapper extends BaseMapper { + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/ProjectCertificationInventoryEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/ProjectCertificationInventoryEOMapper.xml new file mode 100644 index 000000000..0264bfa45 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/ProjectCertificationInventoryEOMapper.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java new file mode 100644 index 000000000..e1f02c85a --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java @@ -0,0 +1,77 @@ +package com.jero.modules.project.service; + +import com.alibaba.fastjson.JSONObject; +import com.jero.common.api.vo.Result; +import com.jero.modules.project.entity.ProjectCertificationInventoryEO; +import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + +/** + * @Description: 项目库-认证清单表 + * @Author: jero-boot + * @Date: 2023-03-03 + * @Version: V1.0 + */ +public interface IProjectCertificationInventoryEOService extends IService { + + /** + * 保存 + * + * @param projectCertificationInventoryEO + * @return + */ + void add(ProjectCertificationInventoryEO projectCertificationInventoryEO); + + /** + * 更新 + * + * @param projectCertificationInventoryEO + * @return + */ + void editById(ProjectCertificationInventoryEO projectCertificationInventoryEO); + + /** + * 通过id删除 + * + * @param id + * @return + */ + void deleteById(String id); + + /** + * 批量删除 + * + * @param ids + * @return + */ + void deleteByIds(List ids); + + /** + * 通过id查询 + * + * @param id + * @return + */ + ProjectCertificationInventoryEO queryById(String id); + + /** + * 列表查询 + * + * @return + */ + List queryList(); + + /** + * 批量添加 + * @param json + * @return + */ + Result batchAdd(JSONObject json); + + /** + * 批量设置 + * @param projectCertificationInventoryEO + * @return + */ + Result setBatch(ProjectCertificationInventoryEO projectCertificationInventoryEO); +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java new file mode 100644 index 000000000..175ef6882 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -0,0 +1,155 @@ +package com.jero.modules.project.service.impl; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.jero.common.api.vo.Result; +import com.jero.common.exception.JeroBootException; +import com.jero.modules.project.entity.ProjectCertificationInventoryEO; +import com.jero.modules.project.mapper.ProjectCertificationInventoryEOMapper; +import com.jero.modules.project.service.IProjectCertificationInventoryEOService; +import org.springframework.beans.BeanUtils; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Date; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +/** + * @Description: 项目库-认证清单表 + * @Author: jero-boot + * @Date: 2023-03-03 + * @Version: V1.0 + */ +@Service +@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) +public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl implements IProjectCertificationInventoryEOService { + + /** + * 保存 + * + * @param projectCertificationInventoryEO + * @return + */ + @Override + public void add(ProjectCertificationInventoryEO projectCertificationInventoryEO) { + Date now = new Date(); + projectCertificationInventoryEO.setCreateTime(now); + projectCertificationInventoryEO.setUpdateTime(now); + save(projectCertificationInventoryEO); + } + + /** + * 更新 + * + * @param projectCertificationInventoryEO + * @return + */ + @Override + public void editById(ProjectCertificationInventoryEO projectCertificationInventoryEO) { + Date now = new Date(); + projectCertificationInventoryEO.setUpdateTime(now); + saveOrUpdate(projectCertificationInventoryEO); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @Override + public void deleteById(String id) { + removeById(id); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @Override + public void deleteByIds(List ids) { + removeByIds(ids); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + @Override + public ProjectCertificationInventoryEO queryById(String id) { + return getById(id); + } + + /** + * 列表查询 + * + * @return + */ + @Override + public List queryList() { + return list(); + } + + @Override + public Result batchAdd(JSONObject json) { + try { + String serialNumber = json.getString("serialNumber"); + String wvtaId = json.getString("wvtaId"); + String bussDocumentLibraryId = json.getString("bussDocumentLibraryId"); + + JSONArray dataList = json.getJSONArray("dataList"); + List projectCertificationInventoryEOList = new ArrayList<>(); + ProjectCertificationInventoryEO projectCertificationInventoryEO = null; + for (Object data : dataList) { + projectCertificationInventoryEO = JSONObject.parseObject(JSONObject.toJSONString(data),ProjectCertificationInventoryEO.class); + projectCertificationInventoryEO.setSerialNumber(serialNumber); + projectCertificationInventoryEO.setWvtaId(wvtaId); + projectCertificationInventoryEO.setBussDocumentLibraryId(bussDocumentLibraryId); + projectCertificationInventoryEOList.add(projectCertificationInventoryEO); + } + + if(CollectionUtils.isNotEmpty(projectCertificationInventoryEOList)){ + this.saveBatch(projectCertificationInventoryEOList); + } + }catch (Exception ex){ + throw new JeroBootException("添加失败!"); + } + return Result.OK("添加成功!"); + } + + @Override + public Result setBatch(ProjectCertificationInventoryEO projectCertificationInventoryEO) { + String ids = projectCertificationInventoryEO.getIds(); + if(StringUtils.isEmpty(ids)){ + throw new JeroBootException("至少选择一条数据进行批量设置!"); + } + try { + List idList = Arrays.asList(ids.split(",")); + + List updateList = new ArrayList<>(); + for (String id : idList) { + ProjectCertificationInventoryEO updateProjectCertificationInventoryEO = new ProjectCertificationInventoryEO(); + BeanUtils.copyProperties(projectCertificationInventoryEO,updateProjectCertificationInventoryEO); + updateProjectCertificationInventoryEO.setId(id); + updateList.add(updateProjectCertificationInventoryEO); + } + + if(CollectionUtils.isNotEmpty(updateList)){ + this.updateBatchById(updateList); + } + }catch (Exception ex){ + throw new JeroBootException("批量设置失败!"); + } + return Result.OK("批量设置成功!"); + } +}