认证-参数项发布版本
This commit is contained in:
+37
-15
@@ -1,7 +1,6 @@
|
||||
package com.jero.modules.cert.template.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -10,6 +9,7 @@ import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.cert.template.entity.ParamsInfoEO;
|
||||
import com.jero.modules.cert.template.service.IParamsInfoEOService;
|
||||
import com.jero.modules.cert.template.service.IParamsInfoPublishEOService;
|
||||
import com.jero.modules.cert.template.vo.ParamsInfoVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -24,6 +24,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@@ -39,6 +40,9 @@ import java.util.List;
|
||||
public class ParamsInfoEOController extends JeroController<ParamsInfoEO, IParamsInfoEOService> {
|
||||
@Autowired
|
||||
private IParamsInfoEOService paramsInfoEOService;
|
||||
|
||||
@Autowired
|
||||
private IParamsInfoPublishEOService paramsInfoPublishEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
@@ -115,8 +119,12 @@ public class ParamsInfoEOController extends JeroController<ParamsInfoEO, IParams
|
||||
@ApiOperation(value="参数项基本信息表-添加", notes="参数项基本信息表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody ParamsInfoEO paramsInfoEO) {
|
||||
paramsInfoEOService.add(paramsInfoEO);
|
||||
return Result.OK("添加成功!");
|
||||
boolean isSuccess = paramsInfoEOService.add(paramsInfoEO);
|
||||
if (isSuccess) {
|
||||
return Result.OK("添加成功!");
|
||||
} else {
|
||||
return Result.error("添加失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,8 +137,12 @@ public class ParamsInfoEOController extends JeroController<ParamsInfoEO, IParams
|
||||
@ApiOperation(value="参数项基本信息表-编辑", notes="参数项基本信息表-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody ParamsInfoEO paramsInfoEO) {
|
||||
paramsInfoEOService.editById(paramsInfoEO);
|
||||
return Result.OK("编辑成功!");
|
||||
boolean isSuccess = paramsInfoEOService.editById(paramsInfoEO);
|
||||
if (isSuccess) {
|
||||
return Result.OK("编辑成功!");
|
||||
} else {
|
||||
return Result.error("编辑失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,6 +196,20 @@ public class ParamsInfoEOController extends JeroController<ParamsInfoEO, IParams
|
||||
return Result.OK(paramsInfoEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布版本
|
||||
*
|
||||
* @param paramsTemplateId
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "参数项基本信息表-发布版本")
|
||||
@ApiOperation(value="参数项基本信息表-发布版本", notes="参数项基本信息表-发布版本")
|
||||
@GetMapping(value = "/publish")
|
||||
public Result<?> publish(@RequestParam(name="paramsTemplateId") String paramsTemplateId) {
|
||||
int publishVersion = paramsInfoPublishEOService.publishTemplate(paramsTemplateId);
|
||||
return Result.OK("发布版本:" + publishVersion + "成功!");
|
||||
}
|
||||
|
||||
@AutoLog(value = "参数项基本信息表-模板下载")
|
||||
@ApiOperation(value = "参数项基本信息表-模板下载", notes="参数项基本信息表-模板下载")
|
||||
@GetMapping(value = "/exportTemplate")
|
||||
@@ -198,20 +224,16 @@ public class ParamsInfoEOController extends JeroController<ParamsInfoEO, IParams
|
||||
* 导出zip
|
||||
*
|
||||
* @param request
|
||||
* @param parameter
|
||||
*/
|
||||
@AutoLog(value = "参数项基本信息表-导出")
|
||||
@ApiOperation(value = "参数项基本信息表-导出", notes="参数项基本信息表-导出")
|
||||
@PostMapping(value = "/exportParamsInfoZip")
|
||||
public void exportParamsInfoZip(@RequestParam(value = "cut") String cut,
|
||||
@RequestParam(value = "exportName", required = false) String exportName,
|
||||
@RequestParam(value = "paramsInfoVO", required = true) String parameter,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
ParamsInfoVO paramsInfoVO = new ParamsInfoVO();
|
||||
if (StringUtils.isNotBlank(parameter)) {
|
||||
paramsInfoVO = JSONObject.parseObject(parameter, ParamsInfoVO.class);
|
||||
}
|
||||
public void exportParamsInfoZip(@RequestParam Map<String, Object> map,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
String cut = (String) map.get("cut");
|
||||
String exportName = (String) map.get("exportName");
|
||||
ParamsInfoVO paramsInfoVO = (ParamsInfoVO) map.get("paramsInfoVO");
|
||||
paramsInfoEOService.exportParamsInfo(cut, paramsInfoVO, exportName, response, request);
|
||||
}
|
||||
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.jero.modules.cert.template.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 认证类别参数信息表发布版
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("cert_category_params_info_publish")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="cert_category_params_info_publish对象", description="认证类别参数信息表发布版")
|
||||
public class CertCategoryParamsInfoPublishEO extends CertCategoryParamsInfoEO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**发布时版本*/
|
||||
@ApiModelProperty(value = "发布时版本")
|
||||
private Integer version;
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.jero.modules.cert.template.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 参数项基本信息表发布版
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("params_info_publish")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="params_info_publish对象", description="参数项基本信息表发布版")
|
||||
public class ParamsInfoPublishEO extends ParamsInfoEO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**发布时版本*/
|
||||
@ApiModelProperty(value = "发布时版本")
|
||||
private Integer version;
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.cert.template.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.cert.template.entity.CertCategoryParamsInfoPublishEO;
|
||||
|
||||
/**
|
||||
* @Description: 认证类别参数信息表发布版
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface CertCategoryParamsInfoPublishEOMapper extends BaseMapper<CertCategoryParamsInfoPublishEO> {
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.cert.template.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.cert.template.entity.ParamsInfoPublishEO;
|
||||
|
||||
/**
|
||||
* @Description: 参数项基本信息表发布版
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ParamsInfoPublishEOMapper extends BaseMapper<ParamsInfoPublishEO> {
|
||||
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.cert.template.mapper.CertCategoryParamsInfoPublishEOMapper">
|
||||
<resultMap id="CertCategoryParamsInfoPublishEOResultMap" type="com.jero.modules.cert.template.entity.CertCategoryParamsInfoPublishEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="params_number" property="paramsNumber" />
|
||||
<result column="params_name" property="paramsName" />
|
||||
<result column="description" property="description" />
|
||||
<result column="nio_number" property="nioNumber" />
|
||||
<result column="cert_category" property="certCategory" />
|
||||
<result column="params_template_id" property="paramsTemplateId" />
|
||||
<result column="version" property="version" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.cert.template.mapper.ParamsInfoPublishEOMapper">
|
||||
<resultMap id="ParamsInfoPublishEOResultMap" type="com.jero.modules.cert.template.entity.ParamsInfoPublishEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="nio_number" property="nioNumber" />
|
||||
<result column="is_must" property="isMust" />
|
||||
<result column="params_name" property="paramsName" />
|
||||
<result column="technology_territory" property="technologyTerritory" />
|
||||
<result column="params_batch" property="paramsBatch" />
|
||||
<result column="duty_territory" property="dutyTerritory" />
|
||||
<result column="description" property="description" />
|
||||
<result column="cert_category" property="certCategory" />
|
||||
<result column="control_type" property="controlType" />
|
||||
<result column="control_values" property="controlValues" />
|
||||
<result column="control_verify" property="controlVerify" />
|
||||
<result column="file_template_connect_id" property="fileTemplateConnectId" />
|
||||
<result column="params_template_id" property="paramsTemplateId" />
|
||||
<result column="version" property="version" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.jero.modules.cert.template.service;
|
||||
|
||||
import com.jero.modules.cert.template.entity.CertCategoryParamsInfoPublishEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 认证类别参数信息表发布版
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ICertCategoryParamsInfoPublishEOService extends IService<CertCategoryParamsInfoPublishEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param certCategoryParamsInfoPublishEO
|
||||
* @return
|
||||
*/
|
||||
void add(CertCategoryParamsInfoPublishEO certCategoryParamsInfoPublishEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param certCategoryParamsInfoPublishEO
|
||||
* @return
|
||||
*/
|
||||
void editById(CertCategoryParamsInfoPublishEO certCategoryParamsInfoPublishEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
CertCategoryParamsInfoPublishEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<CertCategoryParamsInfoPublishEO> queryList();
|
||||
}
|
||||
+2
-3
@@ -6,7 +6,6 @@ import com.jero.modules.cert.template.entity.ParamsInfoEO;
|
||||
import com.jero.modules.cert.template.vo.CertCategoryParamsInfoCnImport;
|
||||
import com.jero.modules.cert.template.vo.ParamsInfoCnImport;
|
||||
import com.jero.modules.cert.template.vo.ParamsInfoVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -29,7 +28,7 @@ public interface IParamsInfoEOService extends IService<ParamsInfoEO> {
|
||||
* @param paramsInfoEO
|
||||
* @return
|
||||
*/
|
||||
void add(ParamsInfoEO paramsInfoEO);
|
||||
boolean add(ParamsInfoEO paramsInfoEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
@@ -37,7 +36,7 @@ public interface IParamsInfoEOService extends IService<ParamsInfoEO> {
|
||||
* @param paramsInfoEO
|
||||
* @return
|
||||
*/
|
||||
void editById(ParamsInfoEO paramsInfoEO);
|
||||
boolean editById(ParamsInfoEO paramsInfoEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package com.jero.modules.cert.template.service;
|
||||
|
||||
import com.jero.modules.cert.template.entity.ParamsInfoPublishEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 参数项基本信息表发布版
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IParamsInfoPublishEOService extends IService<ParamsInfoPublishEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param paramsInfoPublishEO
|
||||
* @return
|
||||
*/
|
||||
void add(ParamsInfoPublishEO paramsInfoPublishEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param paramsInfoPublishEO
|
||||
* @return
|
||||
*/
|
||||
void editById(ParamsInfoPublishEO paramsInfoPublishEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
ParamsInfoPublishEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ParamsInfoPublishEO> queryList();
|
||||
|
||||
int publishTemplate(String paramsTemplateId);
|
||||
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
package com.jero.modules.cert.template.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.cert.template.entity.CertCategoryParamsInfoPublishEO;
|
||||
import com.jero.modules.cert.template.mapper.CertCategoryParamsInfoPublishEOMapper;
|
||||
import com.jero.modules.cert.template.service.ICertCategoryParamsInfoPublishEOService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 认证类别参数信息表发布版
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class CertCategoryParamsInfoPublishEOServiceImpl extends ServiceImpl<CertCategoryParamsInfoPublishEOMapper, CertCategoryParamsInfoPublishEO> implements ICertCategoryParamsInfoPublishEOService {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param certCategoryParamsInfoPublishEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(CertCategoryParamsInfoPublishEO certCategoryParamsInfoPublishEO) {
|
||||
Date now = new Date();
|
||||
certCategoryParamsInfoPublishEO.setCreateTime(now);
|
||||
certCategoryParamsInfoPublishEO.setUpdateTime(now);
|
||||
save(certCategoryParamsInfoPublishEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param certCategoryParamsInfoPublishEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(CertCategoryParamsInfoPublishEO certCategoryParamsInfoPublishEO) {
|
||||
Date now = new Date();
|
||||
certCategoryParamsInfoPublishEO.setUpdateTime(now);
|
||||
saveOrUpdate(certCategoryParamsInfoPublishEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CertCategoryParamsInfoPublishEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<CertCategoryParamsInfoPublishEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
}
|
||||
+8
-6
@@ -1,7 +1,7 @@
|
||||
package com.jero.modules.cert.template.service.impl;
|
||||
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -36,8 +36,8 @@ import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -68,6 +68,7 @@ import static com.jero.modules.split.util.ExcelUtil.checkObjAllFieldsIsNull;
|
||||
@Service
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, ParamsInfoEO> implements IParamsInfoEOService {
|
||||
|
||||
@Autowired
|
||||
private ICertCategoryParamsInfoEOService certCategoryParamsInfoEOService;
|
||||
|
||||
@@ -81,6 +82,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|
||||
@Value(value = "${jero.path.upload}")
|
||||
private String uploadpath;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -88,7 +90,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(ParamsInfoEO paramsInfoEO) {
|
||||
public boolean add(ParamsInfoEO paramsInfoEO) {
|
||||
String nioNumber = paramsInfoEO.getNioNumber();
|
||||
String paramsTemplateId = paramsInfoEO.getParamsTemplateId();
|
||||
// 校验nio编号 格式:字母数字横杠(-)
|
||||
@@ -134,7 +136,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
Date now = new Date();
|
||||
paramsInfoEO.setCreateTime(now);
|
||||
paramsInfoEO.setUpdateTime(now);
|
||||
save(paramsInfoEO);
|
||||
return save(paramsInfoEO);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,7 +146,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(ParamsInfoEO paramsInfoEO) {
|
||||
public boolean editById(ParamsInfoEO paramsInfoEO) {
|
||||
String nioNumber = paramsInfoEO.getNioNumber();
|
||||
String paramsInfoId = paramsInfoEO.getId();
|
||||
String paramsTemplateId = paramsInfoEO.getParamsTemplateId();
|
||||
@@ -179,7 +181,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
}
|
||||
Date now = new Date();
|
||||
paramsInfoEO.setUpdateTime(now);
|
||||
updateById(paramsInfoEO);
|
||||
return updateById(paramsInfoEO);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
package com.jero.modules.cert.template.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.cert.template.entity.*;
|
||||
import com.jero.modules.cert.template.mapper.ParamsInfoPublishEOMapper;
|
||||
import com.jero.modules.cert.template.service.*;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @Description: 参数项基本信息表发布版
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-29
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ParamsInfoPublishEOServiceImpl extends ServiceImpl<ParamsInfoPublishEOMapper, ParamsInfoPublishEO> implements IParamsInfoPublishEOService {
|
||||
|
||||
@Autowired
|
||||
private IParamsTemplateEOService paramsTemplateEOService;
|
||||
@Autowired
|
||||
private IParamsInfoEOService paramsInfoEOService;
|
||||
@Autowired
|
||||
private ICertCategoryParamsInfoEOService certCategoryParamsInfoEOService;
|
||||
@Autowired
|
||||
private ICertCategoryParamsInfoPublishEOService certCategoryParamsInfoPublishEOService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param paramsInfoPublishEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(ParamsInfoPublishEO paramsInfoPublishEO) {
|
||||
Date now = new Date();
|
||||
paramsInfoPublishEO.setCreateTime(now);
|
||||
paramsInfoPublishEO.setUpdateTime(now);
|
||||
save(paramsInfoPublishEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param paramsInfoPublishEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(ParamsInfoPublishEO paramsInfoPublishEO) {
|
||||
Date now = new Date();
|
||||
paramsInfoPublishEO.setUpdateTime(now);
|
||||
saveOrUpdate(paramsInfoPublishEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ParamsInfoPublishEO queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ParamsInfoPublishEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int publishTemplate(String paramsTemplateId) {
|
||||
ParamsTemplateEO source = paramsTemplateEOService.queryById(paramsTemplateId);
|
||||
List<ParamsInfoEO> sourceParamsInfoEOList = paramsInfoEOService.selectListByParamsTemplateIds(paramsTemplateId);
|
||||
List<CertCategoryParamsInfoEO> sourceCertCategoryParamsInfoEOList = certCategoryParamsInfoEOService.selectListByParamsTemplateIds(paramsTemplateId);
|
||||
|
||||
List<ParamsInfoPublishEO> targetParamsInfoPublishEOList = new ArrayList<>();
|
||||
List<CertCategoryParamsInfoPublishEO> targetCertCategoryParamsInfoPublishEOList = new ArrayList<>();
|
||||
|
||||
int newVersion = source.getVersion() + 1;
|
||||
ParamsTemplateEO updateSource = new ParamsTemplateEO();
|
||||
updateSource.setId(paramsTemplateId);
|
||||
updateSource.setVersion(newVersion);
|
||||
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
for (ParamsInfoEO sourceParamsInfoEO : sourceParamsInfoEOList) {
|
||||
ParamsInfoPublishEO targetParamsInfoEO = new ParamsInfoPublishEO();
|
||||
BeanUtils.copyProperties(sourceParamsInfoEO, targetParamsInfoEO);
|
||||
targetParamsInfoEO.setParamsTemplateId(paramsTemplateId);
|
||||
targetParamsInfoEO.setId(UUID.randomUUID().toString().replace("-",""));
|
||||
targetParamsInfoEO.setVersion(newVersion); // 设置发布版本
|
||||
targetParamsInfoEO.setCreateTime(new Date());
|
||||
targetParamsInfoEO.setCreateBy(sysUser.getUsername());
|
||||
targetParamsInfoEO.setUpdateTime(new Date());
|
||||
targetParamsInfoEO.setUpdateBy(sysUser.getUsername());
|
||||
targetParamsInfoPublishEOList.add(targetParamsInfoEO);
|
||||
}
|
||||
|
||||
for (CertCategoryParamsInfoEO sourceCertCategoryParamsInfoEO : sourceCertCategoryParamsInfoEOList) {
|
||||
CertCategoryParamsInfoPublishEO targetCertCategoryParamsInfoEO = new CertCategoryParamsInfoPublishEO();
|
||||
BeanUtils.copyProperties(sourceCertCategoryParamsInfoEO, targetCertCategoryParamsInfoEO);
|
||||
targetCertCategoryParamsInfoEO.setParamsTemplateId(paramsTemplateId);
|
||||
targetCertCategoryParamsInfoEO.setVersion(newVersion); // 设置发布版本
|
||||
targetCertCategoryParamsInfoEO.setId(null);
|
||||
targetCertCategoryParamsInfoEO.setCreateTime(new Date());
|
||||
targetCertCategoryParamsInfoEO.setCreateBy(sysUser.getUsername());
|
||||
targetCertCategoryParamsInfoEO.setUpdateTime(new Date());
|
||||
targetCertCategoryParamsInfoEO.setUpdateBy(sysUser.getUsername());
|
||||
targetCertCategoryParamsInfoPublishEOList.add(targetCertCategoryParamsInfoEO);
|
||||
}
|
||||
|
||||
this.saveBatch(targetParamsInfoPublishEOList);
|
||||
certCategoryParamsInfoPublishEOService.saveBatch(targetCertCategoryParamsInfoPublishEOList);
|
||||
paramsTemplateEOService.updateById(updateSource);
|
||||
|
||||
return newVersion;
|
||||
}
|
||||
}
|
||||
+1
@@ -127,6 +127,7 @@ public class ParamsTemplateEOServiceImpl extends ServiceImpl<ParamsTemplateEOMap
|
||||
|
||||
target.setId(paramsTemplateId);
|
||||
target.setParamsTemplateName(paramsTemplateName);
|
||||
target.setVersion(0);
|
||||
target.setCreateTime(new Date());
|
||||
target.setCreateBy(sysUser.getUsername());
|
||||
target.setUpdateTime(new Date());
|
||||
|
||||
Reference in New Issue
Block a user