diff --git a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql index 30be0d5d6..81f7c30aa 100644 --- a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql +++ b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql @@ -126,3 +126,19 @@ ADD COLUMN `brand` varchar(255) NULL COMMENT '品牌' AFTER `prc_num`; -- 法规意见收集表添加字段 ALTER TABLE `laws_opinion_gather` ADD COLUMN `brand` varchar(255) NULL COMMENT '品牌' AFTER `evaluator_ids`; + +-- 参数收集清单-操作记录(历史日志) 2022-12-26 未同步生产环境 +CREATE TABLE `laws_weilai`.`params_collect_manifest_log` ( + `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 '所属部门', + `log_cn_content` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '中文内容', + `log_en_content` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '英文内容', + `remarks` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + `params_manifest_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '参数清单id', + `params_collect_manifest_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; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestLogEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestLogEOController.java new file mode 100644 index 000000000..a1bb27b43 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestLogEOController.java @@ -0,0 +1,175 @@ +package com.jero.modules.cert.collect.controller; + +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.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; +import com.jero.common.system.base.controller.JeroController; +import com.jero.common.system.query.QueryGenerator; +import com.jero.modules.cert.collect.entity.ParamsCollectManifestLogEO; +import com.jero.modules.cert.collect.service.IParamsCollectManifestLogEOService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; + + +/** +* @Description: 参数收集清单-操作记录(历史日志) +* @Author: jero-boot +* @Date: 2022-12-26 +* @Version: V1.0 +*/ +@Api(tags="参数收集清单-操作记录(历史日志)") +@RestController +@RequestMapping("/paramsCollectManifestLog/paramsCollectManifestLogEO") +@Slf4j +public class ParamsCollectManifestLogEOController extends JeroController { + @Autowired + private IParamsCollectManifestLogEOService paramsCollectManifestLogEOService; + + /** + * 分页列表查询 + * + * @param paramsCollectManifestLogEO + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "参数收集清单-操作记录(历史日志)-分页列表查询") + @ApiOperation(value="参数收集清单-操作记录(历史日志)-分页列表查询", notes="参数收集清单-操作记录(历史日志)-分页列表查询") + @GetMapping(value = "/page") + public Result queryPageList(ParamsCollectManifestLogEO paramsCollectManifestLogEO, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + @RequestParam(name="cut", defaultValue="cn") String cut, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(paramsCollectManifestLogEO, req.getParameterMap()); + queryWrapper.orderByDesc("create_time"); + Page page = new Page(pageNo, pageSize); + IPage pageList = paramsCollectManifestLogEOService.page(page, queryWrapper); + List records = pageList.getRecords(); + this.paramsCollectManifestLogEOService.disposeData(cut,records); + return Result.OK(pageList); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "参数收集清单-操作记录(历史日志)-列表查询") + @ApiOperation(value="参数收集清单-操作记录(历史日志)-列表查询", notes="参数收集清单-操作记录(历史日志)-列表查询") + @GetMapping(value = "/list") + public Result> queryList() { + List list = paramsCollectManifestLogEOService.queryList(); + return Result.OK(list); + } + + /** + * 添加 + * + * @param paramsCollectManifestLogEO + * @return + */ + @AutoLog(value = "参数收集清单-操作记录(历史日志)-添加") + @ApiOperation(value="参数收集清单-操作记录(历史日志)-添加", notes="参数收集清单-操作记录(历史日志)-添加") + @PostMapping(value = "/add") + public Result add(@Validated @RequestBody ParamsCollectManifestLogEO paramsCollectManifestLogEO) { + paramsCollectManifestLogEOService.add(paramsCollectManifestLogEO); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param paramsCollectManifestLogEO + * @return + */ + @AutoLog(value = "参数收集清单-操作记录(历史日志)-编辑") + @ApiOperation(value="参数收集清单-操作记录(历史日志)-编辑", notes="参数收集清单-操作记录(历史日志)-编辑") + @PutMapping(value = "/edit") + public Result edit(@Validated @RequestBody ParamsCollectManifestLogEO paramsCollectManifestLogEO) { + paramsCollectManifestLogEOService.editById(paramsCollectManifestLogEO); + 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) { + paramsCollectManifestLogEOService.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.paramsCollectManifestLogEOService.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) { + ParamsCollectManifestLogEO paramsCollectManifestLogEO = paramsCollectManifestLogEOService.queryById(id); + if(paramsCollectManifestLogEO==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(paramsCollectManifestLogEO); + } + + /** + * 导出excel + * + * @param request + * @param paramsCollectManifestLogEO + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ParamsCollectManifestLogEO paramsCollectManifestLogEO) { + return super.exportXls(request, paramsCollectManifestLogEO, ParamsCollectManifestLogEO.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, ParamsCollectManifestLogEO.class); + } + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsCollectManifestLogEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsCollectManifestLogEO.java new file mode 100644 index 000000000..1051da74c --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsCollectManifestLogEO.java @@ -0,0 +1,90 @@ +package com.jero.modules.cert.collect.entity; + +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 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-12-26 + * @Version: V1.0 + */ +@Data +@TableName("params_collect_manifest_log") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="params_collect_manifest_log对象", description="参数收集清单-操作记录(历史日志)") +public class ParamsCollectManifestLogEO implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private String id; + + /**创建人*/ + @ApiModelProperty(value = "创建人") + private 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 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 String sysOrgCode; + + /**中文内容*/ + @Excel(name = "中文内容", width = 15) + @ApiModelProperty(value = "中文内容") + private String logCnContent; + + /**英文内容*/ + @Excel(name = "英文内容", width = 15) + @ApiModelProperty(value = "英文内容") + private String logEnContent; + + /**备注*/ + @Excel(name = "备注", width = 15) + @ApiModelProperty(value = "备注") + private String remarks; + + /**参数清单id*/ + @Excel(name = "参数清单id", width = 15) + @ApiModelProperty(value = "参数清单id") + private String paramsManifestId; + + /**参数收集清单id*/ + @Excel(name = "参数收集清单id", width = 15) + @ApiModelProperty(value = "参数收集清单id") + private String paramsCollectManifestId; + + @TableField(exist = false) + private String logContent; + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestLogEOMapper.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestLogEOMapper.java new file mode 100644 index 000000000..d20f5b313 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestLogEOMapper.java @@ -0,0 +1,14 @@ +package com.jero.modules.cert.collect.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.jero.modules.cert.collect.entity.ParamsCollectManifestLogEO; + +/** + * @Description: 参数收集清单-操作记录(历史日志) + * @Author: jero-boot + * @Date: 2022-12-26 + * @Version: V1.0 + */ +public interface ParamsCollectManifestLogEOMapper extends BaseMapper { + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestLogEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestLogEOMapper.xml new file mode 100644 index 000000000..1c666b271 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestLogEOMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestLogEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestLogEOService.java new file mode 100644 index 000000000..77850a972 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestLogEOService.java @@ -0,0 +1,69 @@ +package com.jero.modules.cert.collect.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.jero.modules.cert.collect.entity.ParamsCollectManifestLogEO; + +import java.util.List; + +/** + * @Description: 参数收集清单-操作记录(历史日志) + * @Author: jero-boot + * @Date: 2022-12-26 + * @Version: V1.0 + */ +public interface IParamsCollectManifestLogEOService extends IService { + + /** + * 保存 + * + * @param paramsCollectManifestLogEO + * @return + */ + void add(ParamsCollectManifestLogEO paramsCollectManifestLogEO); + + /** + * 更新 + * + * @param paramsCollectManifestLogEO + * @return + */ + void editById(ParamsCollectManifestLogEO paramsCollectManifestLogEO); + + /** + * 通过id删除 + * + * @param id + * @return + */ + void deleteById(String id); + + /** + * 批量删除 + * + * @param ids + * @return + */ + void deleteByIds(List ids); + + /** + * 通过id查询 + * + * @param id + * @return + */ + ParamsCollectManifestLogEO queryById(String id); + + /** + * 列表查询 + * + * @return + */ + List queryList(); + + /** + * 处理数据 + * @param cut + * @param datas + */ + void disposeData(String cut, List datas); +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index a1f6d9276..7a7b52f5c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -22,10 +22,7 @@ import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServi import com.jero.modules.cert.collect.entity.*; import com.jero.modules.cert.collect.enums.*; import com.jero.modules.cert.collect.mapper.ParamsCollectManifestEOMapper; -import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService; -import com.jero.modules.cert.collect.service.IParamsConfigDataEOService; -import com.jero.modules.cert.collect.service.IParamsConfigEOService; -import com.jero.modules.cert.collect.service.IParamsManifestEOService; +import com.jero.modules.cert.collect.service.*; import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO; import com.jero.modules.cert.collect.vo.ParamsConfigDataVO; import com.jero.modules.cert.collect.vo.ParamsManifestVO; @@ -63,6 +60,7 @@ import com.jero.modules.system.service.ISysAnnouncementService; import com.jero.modules.system.service.ISysDictItemService; import com.jero.modules.system.service.ISysUserRoleService; import com.jero.modules.system.service.ISysUserService; +import com.jero.modules.system.service.impl.SysDictItemServiceImpl; import org.apache.commons.collections4.CollectionUtils; import com.jero.modules.system.service.*; import org.apache.commons.io.FileUtils; @@ -154,6 +152,10 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl operatorMap = new HashMap<>(); + if(CutEnum.CN.getValue().equals(cut)){ + operatorMap.put("db_field_txt","操作"); + }else{ + operatorMap.put("db_field_txt","Operator"); + } + operatorMap.put("click6", true); + list.add(operatorMap); + list.addAll(indexOfDescription+1, listConfig); return list; } @@ -1177,10 +1188,13 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl newConfigDataEOList = new ArrayList<>(); List updateCollectManifestEOList = new ArrayList<>(); + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List paramsCollectManifestLogEOList = new ArrayList<>(); // 处理数据 for (Map map : configDataList) { String paramsCollectManifestId = (String) map.get("id"); + ParamsCollectManifestEO paramsCollectManifestEO = this.paramsCollectManifestEOMapper.selectById(paramsCollectManifestId); // 修改参数项状态 ParamsCollectManifestEO updateCollectManifestEO = new ParamsCollectManifestEO(); @@ -1188,6 +1202,11 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl entry : map.entrySet()) { ParamsConfigDataEO paramsConfigDataEO = new ParamsConfigDataEO(); @@ -1209,17 +1228,39 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsConfigDataVO : paramsConfigDataVOList) { + String dataValue = (String) paramsConfigDataVO.get("dataValue"); + // 只要其中有一个值就可以进行拼接 + if(StringUtils.isNotEmpty(dataValue)){ + appendFlag = true; + break; + } + } + if(appendFlag){ + logCnContentSb.append(paramsConfigEO.getConfigName()).append("为"); + logEnContentSb.append(" configuration ").append(paramsConfigEO.getConfigName()).append(" as "); + } for (Map paramsConfigDataVO : paramsConfigDataVOList) { String type = (String) paramsConfigDataVO.get("type"); String dataValue = (String) paramsConfigDataVO.get("dataValue"); if (type.equals(ConfigDataTypeEnum.TEXT.getValue())) { paramsConfigDataEO.setTextData(dataValue); + if (StringUtils.isNotEmpty(dataValue)) { + logCnContentSb.append("\"").append(dataValue).append("\""); + logEnContentSb.append("\"").append(dataValue).append("\""); + } } else if (type.equals(ConfigDataTypeEnum.PULL.getValue()) || type.equals(ConfigDataTypeEnum.PULL_MORE.getValue())) { paramsConfigDataEO.setPullData(dataValue); + if (StringUtils.isNotEmpty(dataValue)) { + logCnContentSb.append("\"").append(dataValue).append("\""); + logEnContentSb.append("\"").append(dataValue).append("\""); + } } else if (type.equals(ConfigDataTypeEnum.FILE.getValue())) { if (StringUtils.isNotEmpty(dataValue) && dataValue.contains(",")) { // 新加多个文件 @@ -1253,15 +1294,37 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl fileInfos = ossFileService.getFileInfos(dataValue); + String fileNames = fileInfos.stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(fileNames)) { + logCnContentSb.append("\"").append(fileNames).append("\""); + logEnContentSb.append("\"").append(fileNames).append("\""); + } } } + + if(appendFlag){ + logCnContentSb.append(","); + logEnContentSb.append(" and "); + } } newConfigDataEOList.add(paramsConfigDataEO); } + + ParamsCollectManifestLogEO paramsCollectManifestLogEO = new ParamsCollectManifestLogEO(); + paramsCollectManifestLogEO.setLogCnContent(logCnContentSb.toString().substring(0,logCnContentSb.toString().length()-1)); + paramsCollectManifestLogEO.setLogEnContent(logEnContentSb.toString().substring(0,logEnContentSb.toString().length()-5)); + paramsCollectManifestLogEO.setParamsManifestId(paramsCollectManifestEO.getParamsManifestId()); + paramsCollectManifestLogEO.setParamsCollectManifestId(paramsCollectManifestEO.getId()); + paramsCollectManifestLogEOList.add(paramsCollectManifestLogEO); } // 批量更新 paramsConfigDataEOService.saveOrUpdateBatch(newConfigDataEOList); + + if(CollectionUtils.isNotEmpty(paramsCollectManifestLogEOList)){ + this.paramsCollectManifestLogEOService.saveBatch(paramsCollectManifestLogEOList); + } return updateBatchById(updateCollectManifestEOList); } @@ -1661,10 +1724,16 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsConfigEOList = this.paramsConfigEOService.queryList(paramsManifestId); + List updateEOList = new ArrayList<>(); + List paramsCollectManifestLogEOList = new ArrayList<>(); for (int i=0; i fileInfos = ossFileService.getFileInfos(configDataEO.getFileConnectId()); + String fileNames = fileInfos.stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(fileNames)) { + logCnContentSb.append("\"" +fileNames+ "\""); + logEnContentSb.append("\"" +fileNames+ "\""); + } + } + + logEnContentSb.append(" of configuration " +configEO.getConfigName()+ ""); + + // 如果配置有两条或两条以上,并且不是最后一次循环 + if(paramsConfigEOList.size() > 1 && paramsConfigLenth != paramsConfigEOList.size()){ + logCnContentSb.append(","); + logEnContentSb.append(" and "); + } + } + + paramsConfigLenth ++; + } + + if(StringUtils.equals(currentPersonRole,CollectManifestUserTypeEnum.HOMO.getValue())){ + logCnContentSb.append("退回给填写人").append("\"").append(paramsCollectManifestEO.getDre()).append("\""); + logEnContentSb.append(" to the person ").append("\"").append(paramsCollectManifestEO.getDre()).append("\"."); + }else if(StringUtils.equals(currentPersonRole,CollectManifestUserTypeEnum.SDT.getValue())){ + logCnContentSb.append("退回给认证工程师"); + logEnContentSb.append(" to the Homo Engineer."); + } + } else if(StringUtils.equals(currentPersonRole,CollectManifestUserTypeEnum.DRE.getValue())){ + logCnContentSb.append("填写人").append("\"").append(currentUser.getUsername()).append("\"").append("退回给工程接口人").append("\"").append(paramsCollectManifestEO.getSdt()).append("\""); + logEnContentSb.append("DRE ").append("\"").append(currentUser.getUsername()).append("\"").append(" return to project Eng. Interface ").append("\"").append(paramsCollectManifestEO.getSdt()).append("\""); + } + + ParamsCollectManifestLogEO paramsCollectManifestLogEO = new ParamsCollectManifestLogEO(); + paramsCollectManifestLogEO.setLogCnContent(logCnContentSb.toString()); + paramsCollectManifestLogEO.setLogEnContent(logEnContentSb.toString()); + paramsCollectManifestLogEO.setParamsManifestId(paramsManifestId); + paramsCollectManifestLogEO.setParamsCollectManifestId(paramsCollectManifestEO.getId()); + paramsCollectManifestLogEOList.add(paramsCollectManifestLogEO); } boolean update = updateBatchById(updateEOList); + if(CollectionUtils.isNotEmpty(paramsCollectManifestLogEOList)){ + this.paramsCollectManifestLogEOService.saveBatch(paramsCollectManifestLogEOList); + } if (update) { - LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录人 //飞书 for (ParamsCollectManifestEO paramsCollectManifestEO : updateEOList) { paramsCollectManifestEO = getById(paramsCollectManifestEO.getId()); @@ -1788,6 +1929,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsCollectManifestLogEOList = new ArrayList<>(); List updateEOList = new ArrayList<>(); for (int i=0; i paramsCollectManifestEOList = list(queryWrapper); Date deadline = paramsCollectManifestEOList.get(0).getDeadline(); int i = 0; + + List paramsCollectManifestLogEOList = new ArrayList<>(); for (ParamsCollectManifestEO paramsCollectManifestEO : paramsCollectManifestEOList) { if (i < 3) { connectBuilder.append(paramsCollectManifestEO.getNioNumber()).append("-").append(paramsCollectManifestEO.getParamsName()).append(","); } i++; + String logCnContent = "工程接口人\"" +currentUser.getUsername()+ "\"将参数填写人由\"空\"修改为\"" + dre + "\""; + String logEnContent = "Eng. Interface \"" +currentUser.getUsername()+ "\" Change the parameter person from \"null\" to \"" +dre+ "\"."; + if (StringUtils.isNotEmpty(paramsCollectManifestEO.getDre())) { + logCnContent = "工程接口人\"" +currentUser.getUsername()+ "\"将参数填写人由\""+ paramsCollectManifestEO.getDre() +"\"修改为\"" + dre + "\""; + logEnContent = "Eng. Interface \"" +currentUser.getUsername()+ "\" Change the parameter person from \""+ paramsCollectManifestEO.getDre() +"\" to \"" + dre + "\"."; + } + + ParamsCollectManifestLogEO paramsCollectManifestLogEO = new ParamsCollectManifestLogEO(); + paramsCollectManifestLogEO.setLogCnContent(logCnContent); + paramsCollectManifestLogEO.setLogEnContent(logEnContent); + paramsCollectManifestLogEO.setParamsManifestId(paramsManifestId); + paramsCollectManifestLogEO.setParamsCollectManifestId(paramsCollectManifestEO.getId()); + paramsCollectManifestLogEOList.add(paramsCollectManifestLogEO); + ParamsCollectManifestEO updateEO = new ParamsCollectManifestEO(); updateEO.setId(paramsCollectManifestEO.getId()); updateEO.setDre(dre); // 设置填写人 @@ -1927,6 +2096,11 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl> msgMapList = new ArrayList<>(); List updateEOIdList = new ArrayList<>(); List delSdtPermission = new ArrayList<>(); + List paramsCollectManifestLogEOList = new ArrayList<>(); + List paramsCollectManifestEOList = listByIds(Arrays.asList(paramsCollectManifestIdStr)); paramsCollectManifestEOList = paramsCollectManifestEOList.stream().sorted(Comparator.comparing(ParamsCollectManifestBaseEO::getNioNumber)).collect(Collectors.toList()); // 按NIO编号升序 for (ParamsCollectManifestEO paramsCollectManifestEO : paramsCollectManifestEOList) { @@ -2061,6 +2237,13 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl msgMap = new HashMap<>(); msgMap.put("nioNumber", paramsCollectManifestEO.getNioNumber()); @@ -2169,6 +2352,10 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl> msgMapList = new ArrayList<>(); List updateEOIdList = new ArrayList<>(); List delSdtPermission = new ArrayList<>(); + List paramsCollectManifestLogEOList = new ArrayList<>(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(ParamsCollectManifestEO::getParamsManifestId, paramsManifestId) .notIn(ParamsCollectManifestEO::getControlType, ControlTypeEnum.Title.getValue()) @@ -2221,6 +2410,13 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl msgMap = new HashMap<>(); msgMap.put("nioNumber", paramsCollectManifestEO.getNioNumber()); @@ -2331,6 +2527,10 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsCollectManifestEOList = paramsCollectManifestEOMapper.selectBatchIds(paramsCollectManifestIdList); List addReportDetailEOList = new ArrayList<>(); List addReportConfigDataEOList = new ArrayList<>(); // 需要添加的配置数据 + List paramsCollectManifestLogEOList = new ArrayList<>(); Date syncTime = new Date(); for (ParamsCollectManifestEO collectManifestEO : paramsCollectManifestEOList) { ParamsReportDetailEO addReportDetailEO = new ParamsReportDetailEO(); @@ -2593,7 +2795,13 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl fileInfos = ossFileService.getFileInfos(configDataEO.getFileConnectId()); + String fileNames = fileInfos.stream().map(OSSFile::getFileName).distinct().collect(Collectors.joining(",")); + if (StringUtils.isNotEmpty(fileNames)) { + logCnContentSb.append("\"" +fileNames+ "\""); + logEnContentSb.append("\"" +fileNames+ "\""); + } + } + + logEnContentSb.append("of configuration " +configEO.getConfigName()+ ""); + + // 如果配置有两条或两条以上,并且不是最后一次循环 + if(paramsConfigEOList.size() > 1 && paramsConfigLenth != paramsConfigEOList.size()){ + logCnContentSb.append(","); + logEnContentSb.append(" and "); + } + } + + paramsConfigLenth ++; } + + logCnContentSb.append(" 同步至上报库"); + logEnContentSb.append(" to the report database"); + + ParamsCollectManifestLogEO paramsCollectManifestLogEO = new ParamsCollectManifestLogEO(); + paramsCollectManifestLogEO.setLogCnContent(logCnContentSb.toString()); + paramsCollectManifestLogEO.setLogEnContent(logEnContentSb.toString()); + paramsCollectManifestLogEO.setParamsManifestId(paramsManifestId); + paramsCollectManifestLogEO.setParamsCollectManifestId(collectManifestEO.getId()); + paramsCollectManifestLogEOList.add(paramsCollectManifestLogEO); } List nioNumberList = paramsCollectManifestEOList.stream().map(ParamsCollectManifestEO::getNioNumber).collect(Collectors.toList()); @@ -2686,6 +2935,10 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl map = isCollectFinished(paramsManifestId); Boolean finish = (Boolean) map.get("finish"); @@ -2701,7 +2954,6 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsCollectManifestEOList = paramsCollectManifestEOMapper.selectList(queryWrapper); + // 查询所有的责任领域 + List dutyTerritoryList = this.sysDictItemServiceImpl.selectItemsByDictCode("duty_territory"); + + List paramsCollectManifestLogEOList = new ArrayList<>(); List updateEOList = new ArrayList<>(); List> msgMapList = new ArrayList<>(); paramsCollectManifestEOList.forEach(paramsCollectManifestEO -> { @@ -3372,6 +3629,18 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl msgMap = new HashMap<>(); msgMap.put("nioNumber", paramsCollectManifestEO.getNioNumber()); @@ -3384,10 +3653,45 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl dutyTerritoryList,String dutyTerritoryCode,String cut){ + String result = null; + if (CollectionUtils.isNotEmpty(dutyTerritoryList) && StringUtils.isNotEmpty(dutyTerritoryCode)) { + if (StringUtils.equals(cut, CutEnum.CN.getValue())) { + result = dutyTerritoryList.stream().filter(dutyTerritory -> { + boolean flag = false; + if(StringUtils.equals(dutyTerritory.getItemValue(),dutyTerritoryCode)){ + flag = true; + } + return flag; + }).map(SysDictItem::getItemText).collect(Collectors.joining(",")); + } else if (StringUtils.equals(cut, CutEnum.EN.getValue())) { + result = dutyTerritoryList.stream().filter(dutyTerritory -> { + boolean flag = false; + if(StringUtils.equals(dutyTerritory.getItemValue(),dutyTerritoryCode)){ + flag = true; + } + return flag; + }).map(SysDictItem::getEnName).collect(Collectors.joining(",")); + } + } + return result; + } + private String[] getWorkbookTitleForExport(ParamsCollectManifestVO paramsCollectManifestVO) { String cut = paramsCollectManifestVO.getCut(); String paramsManifestId = paramsCollectManifestVO.getParamsManifestId(); @@ -5259,6 +5563,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl configDataQueryWrap = new QueryWrapper<>(); configDataQueryWrap.lambda().in(ParamsConfigDataEO::getParamsCollectManifestId,paramsCollectManifestIdArr); List paramsConfigDataList = this.paramsConfigDataEOService.list(configDataQueryWrap); + List paramsCollectManifestLogEOList = new ArrayList<>(); + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); for (int i=0; i updateWrap = new LambdaUpdateWrapper<>(); updateWrap.set(ParamsCollectManifestEO::getSdt,null); updateWrap.set(ParamsCollectManifestEO::getDre,null); @@ -5313,6 +5626,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl implements IParamsCollectManifestLogEOService { + + /** + * 保存 + * + * @param paramsCollectManifestLogEO + * @return + */ + @Override + public void add(ParamsCollectManifestLogEO paramsCollectManifestLogEO) { + Date now = new Date(); + paramsCollectManifestLogEO.setCreateTime(now); + paramsCollectManifestLogEO.setUpdateTime(now); + save(paramsCollectManifestLogEO); + } + + /** + * 更新 + * + * @param paramsCollectManifestLogEO + * @return + */ + @Override + public void editById(ParamsCollectManifestLogEO paramsCollectManifestLogEO) { + Date now = new Date(); + paramsCollectManifestLogEO.setUpdateTime(now); + saveOrUpdate(paramsCollectManifestLogEO); + } + + /** + * 通过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 ParamsCollectManifestLogEO queryById(String id) { + return getById(id); + } + + /** + * 列表查询 + * + * @return + */ + @Override + public List queryList() { + return list(); + } + + @Override + public void disposeData(String cut, List datas) { + if(CollectionUtils.isNotEmpty(datas)){ + for (ParamsCollectManifestLogEO data : datas) { + String logContent = ""; + if(StringUtils.equals(cut, CutEnum.CN.getValue())){ + logContent = data.getLogCnContent(); + }else if(StringUtils.equals(cut,CutEnum.EN.getValue())){ + logContent = data.getLogEnContent(); + } + data.setLogContent(logContent); + } + } + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/vo/ParamsCollectManifestVO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/vo/ParamsCollectManifestVO.java index 1bbf558fa..485e4e503 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/vo/ParamsCollectManifestVO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/vo/ParamsCollectManifestVO.java @@ -92,5 +92,7 @@ public class ParamsCollectManifestVO { @ApiModelProperty(value = "") private String allNumber; + // 退回操作人角色 + private String currentPersonRole; } diff --git a/jero-web/src/components/tableCollection/index.vue b/jero-web/src/components/tableCollection/index.vue index e1878636e..1e4a4b3a7 100644 --- a/jero-web/src/components/tableCollection/index.vue +++ b/jero-web/src/components/tableCollection/index.vue @@ -33,7 +33,10 @@ {{$t('See')}} - + + {{ text && text.length > 8 ? text.slice(0, 7) + '...' : text }} @@ -166,6 +169,51 @@ + + + + + + + + + + + + {{text && text.length > 10?text.slice(0,9)+'...':text}} + + + +
+ +
+
@@ -311,6 +359,8 @@ dataSource: [], pageNo: 1, pageSize: 100, + pageNohistory: 1, + pageSizehistory: 10, pageSizeOptions: ['100', '200'], total: 0, searchParmes: {}, @@ -354,7 +404,25 @@ getquerySdtId: '', // 当前工程接口人的id areaVisibleView: false, // 查看配置得弹框 seeVisibleView: false, - configDetail: {} // 查看配置得详细信息 + visible: false, + configDetail: {}, // 查看配置得详细信息 + dataSourcehistory:[], + columnshistory: [ + { + title: this.$t('OperationDetails'), + dataIndex: 'logContent', + align: 'center', + ellipsis: true, + scopedSlots: { customRender: 'content' } + }, + { + title: this.$t('OperationTime'), + dataIndex: 'createTime', + align: 'center', + ellipsis: true, + width: 180 + } + ] } }, mounted() { @@ -599,6 +667,45 @@ } }) }, + UpdateLog(val) { + this.visible = true + this.paramsReportDetailId = val.id + this.bussLogList(val) + }, + onChangehistory(page, pageSize) { + console.log(1) + this.pageNohistory = page + this.bussLogList() + }, + SizeChangehistory(page, pageSize) { + this.pageNo = 1 + this.pageSizehistory = pageSize + this.bussLogList() + }, + bussLogList(val) { + let query = { + pageNo: this.pageNohistory, + pageSize: this.pageSizehistory, + paramsManifestId: this.$route.query.id, + paramsCollectManifestId: this.paramsReportDetailId + } + this.loading = true + getAction('paramsCollectManifestLog/paramsCollectManifestLogEO/page', query).then((res) => { + if (res.success) { + this.dataSourcehistory = res.result.records + this.total = res.result.total + this.loading = false + } else { + this.loading = false + } + }) + }, + handleOk() { + this.visible = false + }, + handleCancel() { + this.visible = false + }, getAndUserId(result) { let query = { paramsManifestId: this.$route.query.id, @@ -699,6 +806,11 @@ customRender: 'paramsNameDescription' } } + if (res.click6) { + this.columns[index].scopedSlots = { + customRender: 'Operation' + } + } if (res.click) { // 工程接口人列表修改 this.columns[index].scopedSlots = { diff --git a/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue b/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue index b783e1bb4..048f3b500 100644 --- a/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue +++ b/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue @@ -1654,7 +1654,10 @@ _array.push(item.id) }) let _this = this - let param = { ids: _array.join(',') } + let param = { ids: _array.join(','), + currentPersonRole: this.currentPersonRole, + paramsManifestId: this.$route.query.id + } this.textLoading = true axios({ url: '/jero-boot/params/collectManifest/back',